dtos

package
v0.0.0-...-d26b62e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 12, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromDTO

func FromDTO(dto *CurrencyDto) *money.Money

FromMoney converts between the dto to the used currency and precision library used.

Types

type AccountHistoryEvent

type AccountHistoryEvent struct {
	Amount  *CurrencyDto `json:"amount"`
	Type    string       `json:"type"`
	Time    time.Time    `json:"time"`
	Game    string       `json:"gameId"`
	LobbyID string       `json:"roundId"`
}

AccountHistoryEvent is a transaction event

type ClassInfoResponse

type ClassInfoResponse struct {
	Classes []models.Class `json:"classes"`
}

ClassInfoResponse contains the registered poker lobby classes that are available

type CryptoInfoDto

type CryptoInfoDto struct {
	PublicKey string `json:"publicKey"`
}

type CurrencyDto

type CurrencyDto struct {
	Value    int64  `json:"value"`    //Value of the monetary value
	Currency string `json:"currency"` //Currency Code of the monetary value
}

CurrencyDto is the data transfer object for a monetary value

func FromMoney

func FromMoney(money *money.Money) *CurrencyDto

FromMoney converts between the used currency and precision library used to the currency dto

type LobbyInfoResponse

type LobbyInfoResponse struct {
	Lobbies [][]models.LobbyBase `json:"lobbies"`
}

LobbyInfoResponse returns the current active lobbies sorted by lobby classes

type LoginDto

type LoginDto struct {
	Username   string `json:"username" schema:"username"`
	Password   string `json:"password" schema:"password"`
	RememberMe bool   `json:"rememberme" schema:"rememberme"`
}

LoginDto defines the object for the api login request

type PokerInfoResponse

type PokerInfoResponse struct {
	Classes []models.Class       `json:"classes"`
	Lobbies [][]models.LobbyBase `json:"lobbies"`
}

PokerInfoResponse is the combination of the ClassInfoResponse and the LobbyInfoResponse

type RegisterDto

type RegisterDto struct {
	Username   string `json:"username"`
	Email      string `json:"email"`
	Password   string `json:"password"`
	FullName   string `json:"fullName"`
	Birthdate  int64  `json:"birthdate"`
	RememberMe bool   `json:"rememberme"`
}

RegisterDto defines the dto for the user account registration

type SessionInfo

type SessionInfo struct {
	Authenticated bool `json:"authenticated"`
}

type SessionResponse

type SessionResponse struct {
	User *SessionUser `json:"user"`
}

SessionResponse is the response of a session request

type SessionUser

type SessionUser struct {
	Username string `json:"username" schema:"username"`
	Name     string `json:"name" schema:"name"`
	Id       string `json:"id" schema:"id"`
}

LoginDto

type SpinDTO

type SpinDTO struct {
	Number    uint32 `json:"number"`
	Prove     []byte `json:"prove"`
	WinAmount int    `json:"winAmount"`
}

The DTO of a spin request

type UpdateUserDto

type UpdateUserDto struct {
	Email    string `json:"email"`
	FullName string `json:"fullName"`
}

type User

type User struct {
	// The user id
	// required: true
	ID string `json:"id"`
	// The registration time of the user
	CreatedAt time.Time `json:"created_at"`
	// The time when the user was updated last
	UpdatedAt time.Time `json:"updated_at"`
	// The username of the user
	// required: true
	// min length: 4
	// max length: 100
	Username string `json:"username"`
	// The email of the user
	// required: true
	// min length: 4
	// max length: 100
	// swagger:strfmt email
	Email string `json:"email"`
	// The full name of the user
	// required: true
	// min length: 1
	// max length: 100
	FullName string `json:"fullName"`

	// The unix birthdate of the user
	// required: true
	Birthdate int64 `json:"birthdate"`
}

User is the data transfer object of the internal user object swagger:model

func NewUser

func NewUser(user *models.User) *User

NewUserDTO creates a new user dto form the given user

type VerifyAmount

type VerifyAmount struct {
	VerificationResult bool `json:"result"`
}

VeriyAmount is a result of a verification

func NewVerifyAmount

func NewVerifyAmount(res bool) *VerifyAmount

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL