models

package
v0.0.0-...-6390a39 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Manager = ClientManager{

	Register: make(chan *Clientmodel),
	// contains filtered or unexported fields
}

Manager export to controller

Functions

func AddGananciaClient

func AddGananciaClient(seudonimo string, montoganado int64, formapago string, serial uint) map[string]interface{}

AddGananciaClient Client db

func CloseRacing

func CloseRacing(idRacing uint) map[string]interface{}

CloseRacing .

func CreateAmount

func CreateAmount(clientIdentificationcard string) map[string]interface{}

CreateAmount Client db

func CreateHorses

func CreateHorses(Arrayhorse []Horse) map[string]interface{}

CreateHorses add new race horses

func CreateRaces

func CreateRaces(racesList []Racing, idEvent uint) map[string]interface{}

CreateRaces .

func CreateRemates

func CreateRemates(idracing uint, idhorse int, numberhorse int, seudonimo string, amount int64, horsename string) map[string]interface{}

CreateRemates .

func CreateTablas

func CreateTablas(idracing uint, montoTotal int64) map[string]interface{}

CreateTablas .

func DeleteAllHorses

func DeleteAllHorses(idRacing uint) bool

DeleteAllHorses delete all horses of race.

func DeleteAllRacesByEventID

func DeleteAllRacesByEventID(eventID uint) bool

DeleteAllRacesByEventID .

func DeleteClient

func DeleteClient(idClient *string) bool

DeleteClient from DB Delete client then delete All client deposits and client coin.

func DeleteCoinsClient

func DeleteCoinsClient(Clientidentificationcard string) bool

DeleteCoinsClient client deposit in database

func DeleteDepositsClient

func DeleteDepositsClient(Clientidentificationcard string) bool

DeleteDepositsClient delete all client deposits in database

func DeleteEvent

func DeleteEvent(idEvent uint) bool

DeleteEvent from DB

func DeleteHorse

func DeleteHorse(idRacing uint, idHorse uint) bool

DeleteHorse from DB

func DeleteRacing

func DeleteRacing(idEvent, idRacing uint) bool

DeleteRacing from DB

func FindRaceByEventID

func FindRaceByEventID(idEvent, idRacing uint) map[string]interface{}

FindRaceByEventID find

func GetAllDepositsClient

func GetAllDepositsClient(idClient *string) map[string]interface{}

GetAllDepositsClient Client db

func GetAllWithdrawal

func GetAllWithdrawal(clientIDCard *string) map[string]interface{}

GetAllWithdrawal Client

func GetCoinsClient

func GetCoinsClient(Clientidentificationcard string) map[string]interface{}

GetCoinsClient client

func GetDB

func GetDB() *gorm.DB

GetDB .

func GetEvents

func GetEvents() map[string]interface{}

GetEvents all events of table events

func GetHorses

func GetHorses(idRacing string) map[string]interface{}

GetHorses all Horses

func GetOneEvent

func GetOneEvent(idEvent uint) map[string]interface{}

GetOneEvent event

func GetRace

func GetRace(idRacing uint) map[string]interface{}

GetRace .

func GetRacings

func GetRacings(idEvent uint) map[string]interface{}

GetRacings all Racings by eventID

func GetRemates

func GetRemates(idracing uint) map[string]interface{}

GetRemates .

func GetTablas

func GetTablas(idracing uint) map[string]interface{}

GetTablas .

func Login

func Login(email, password string) map[string]interface{}

Login function user

func LoginClient

func LoginClient(password string, seudonimo string) map[string]interface{}

LoginClient function user

func RepartirGanancias

func RepartirGanancias(idRace uint, idHorse int) map[string]interface{}

RepartirGanancias find

func TimeisEqualStartTime

func TimeisEqualStartTime(idRacing uint) bool

TimeisEqualStartTime in DB

func UpdateIdentificationClientDeposit

func UpdateIdentificationClientDeposit(Clientidentificationcard, newIdentification string) map[string]interface{}

UpdateIdentificationClientDeposit update client ID in all deposits

func UpdateIdentificationClientRetiro

func UpdateIdentificationClientRetiro(clientIDCard, newIdentification string) map[string]interface{}

UpdateIdentificationClientRetiro all record in table retiros

func UpdateIdentificationCoinClient

func UpdateIdentificationCoinClient(Clientidentificationcard, newIdentification string) map[string]interface{}

UpdateIdentificationCoinClient client identification in coins table of DB

func UpdateMontos

func UpdateMontos(idRacing uint, amount int64) map[string]interface{}

UpdateMontos .

func UpdateRaces

func UpdateRaces(Arrayracing []Racing, idEvent uint) map[string]interface{}

UpdateRaces .

func UpdateStateClient

func UpdateStateClient(idClient *string) map[string]interface{}

UpdateStateClient client in DB

func WithdrawHorse

func WithdrawHorse(idHorse uint, idRacing uint) map[string]interface{}

WithdrawHorse .

Types

type Admin

type Admin struct {
	gorm.Model
	Email    string `json:"email"`
	Password string `json:"password"`
	Token    string `json:"token";sql:"-"`
}

Admin struct

func GetAdmins

func GetAdmins() []*Admin

GetAdmins all db

func GetUser

func GetUser(id uint) *Admin

GetUser from DB

func (*Admin) Create

func (admin *Admin) Create() map[string]interface{}

Create accoutn db

func (*Admin) Validate

func (admin *Admin) Validate() (map[string]interface{}, bool)

Validate admin struct

type Client

type Client struct {
	gorm.Model
	Name               string `json:"name"`
	Identificationcard string `json:"identificationcard"`
	Seudonimo          string `json:"seudonimo"`
	Password           string `json:"password"`
	Email              string `json:"email"`
	Phone              string `json:"phone"`
	Banknumber         string `json:"banknumber"`
	Bankname           string `json:"bankname"`
	State              string `json:"state"`
	Token              string `json:"token";sql:"-"`
}

Client struct

func ExistClientDB

func ExistClientDB(idClient *string) (*Client, error)

ExistClientDB .

func ExistClientIdentificationDB

func ExistClientIdentificationDB(clientIdentification string) (*Client, error)

ExistClientIdentificationDB .

func ExistClientSeudonimonDB

func ExistClientSeudonimonDB(seudonimo string) (*Client, error)

ExistClientSeudonimonDB .

func GetClient

func GetClient(idClient *string) []*Client

GetClient client that request for him identification

func GetClients

func GetClients() []*Client

GetClients all client of table clients

func (*Client) CreateClient

func (client *Client) CreateClient() map[string]interface{}

CreateClient .

func (*Client) UpdateClient

func (client *Client) UpdateClient(idClient *string) map[string]interface{}

UpdateClient client in DB

func (*Client) ValidateClient

func (client *Client) ValidateClient() (map[string]interface{}, bool)

ValidateClient struct that Front-End to Back-End

func (*Client) ValidateClientParams

func (client *Client) ValidateClientParams(idClient *string) (map[string]interface{}, bool)

ValidateClientParams struct Params for Update Client

type ClientManager

type ClientManager struct {
	Register chan *Clientmodel
	// contains filtered or unexported fields
}

ClientManager model ClientManager

func (*ClientManager) Send

func (manager *ClientManager) Send(message []byte, ignore *Clientmodel)

Send send message to websocket

func (*ClientManager) Start

func (manager *ClientManager) Start()

Start export func

type Clientmodel

type Clientmodel struct {
	Id     string
	Socket *websocket.Conn
	Send   chan []byte
}

Clientmodel model Clientmodel

func (*Clientmodel) Read

func (c *Clientmodel) Read()

func (*Clientmodel) Write

func (c *Clientmodel) Write()

type Coins

type Coins struct {
	gorm.Model
	Clientidentificationcard string  `json:"clientidentificationcard"`
	Amount                   float64 `json:"amount"`
}

Coins struct

func ExistClientinCoinsDB

func ExistClientinCoinsDB(clientIDCard string) (*Coins, error)

ExistClientinCoinsDB .

func (*Coins) DecreaseCoins

func (coins *Coins) DecreaseCoins(rematesAmount float64) map[string]interface{}

DecreaseCoins of client in DB

func (*Coins) UpdateCoins

func (coins *Coins) UpdateCoins(amountDeposit float64) map[string]interface{}

UpdateCoins of client

func (*Coins) ValidateCoins

func (coins *Coins) ValidateCoins() (map[string]interface{}, bool)

ValidateCoins struct

type Deposit

type Deposit struct {
	gorm.Model
	Amount                   float64 `json:"amount"`
	Clientidentificationcard string  `json:"clientidentificationcard"`
	FormaPago                string  `json:"formapago"`
	Serial                   uint    `json:"serial"`
}

Deposit struct

func (*Deposit) AddDepositClient

func (deposit *Deposit) AddDepositClient() map[string]interface{}

AddDepositClient Client db

func (*Deposit) ValidateDeposit

func (deposit *Deposit) ValidateDeposit() (map[string]interface{}, bool)

ValidateDeposit struct that Front-End to Back-End

type Event

type Event struct {
	gorm.Model
	Dateevent           time.Time `json:"dateevent"`
	Hipodromo           string    `json:"hipodromo"`
	Racingnumbers       uint      `json:"racingnumbers"`
	Minimumamount       uint      `json:"minimumamount"`
	Profitpercentage    uint      `json:"profitpercentage"`
	Auctionnumber       uint      `json:"auctionnumber"`
	TimebetweenAuctions uint      `json:"timebetweenAuctions"`
	Horsenotauction     string    `json:"horsenotauction"`
}

Event struct

func ExistEventID

func ExistEventID(idEvent uint) (*Event, error)

ExistEventID .

func (*Event) CreateEvent

func (event *Event) CreateEvent() map[string]interface{}

CreateEvent Event db

func (*Event) UpdateEvent

func (event *Event) UpdateEvent(idEvent uint) map[string]interface{}

UpdateEvent .

func (*Event) ValidateEvent

func (event *Event) ValidateEvent() (map[string]interface{}, bool)

ValidateEvent struct that Front-End to Back-End

func (*Event) ValidateEventParams

func (event *Event) ValidateEventParams(idEvent uint) (map[string]interface{}, bool)

ValidateEventParams struct Params for Update Event

type Horse

type Horse struct {
	gorm.Model
	Racingid  uint   `json:"racingid"`
	Horsename string `json:"horsename"`
	Numero    uint   `json:"numero"`
	State     string `json:"state"`
}

Horse struct

func (*Horse) UpdateHorse

func (horse *Horse) UpdateHorse(idRacing uint, idHorse string) map[string]interface{}

UpdateHorse in DB

func (*Horse) ValidateHorseParams

func (horse *Horse) ValidateHorseParams(idRacing uint) (map[string]interface{}, bool)

ValidateHorseParams .

type MatrixRemates

type MatrixRemates struct {
	Monto         int64
	MatrixRow     int
	NumeroCaballo int
	Seudonimo     string

	Horsename string
	// contains filtered or unexported fields
}

MatrixRemates model MatrixRemates

type Message

type Message struct {
	Sender         string `json:"sender,omitempty"`
	Recipient      string `json:"recipient,omitempty"`
	Content        string `json:"content,omitempty"`
	Timerestante   int64
	Matrix         []MatrixRemates
	Actualposition MatrixRemates
}

Message model message

type Racing

type Racing struct {
	gorm.Model
	Eventid              uint      `json:"eventid"`
	Starttime            time.Time `json:"starttime"`
	Horsenumbers         uint      `json:"horsenumbers"`
	Auctiontime          time.Time `json:"auctiontime"`
	Alerttime            time.Time `json:"alerttime"`
	Stateracing          string    `json:"stateracing"`
	Idcaballoganador     int       `json:"idcaballoganador"`
	Nombrecaballoganador string    `json:"nombrecaballoganador"`
}

Racing struct

func ExistRaceID

func ExistRaceID(raceID uint) (*Racing, error)

ExistRaceID .

type Remates

type Remates struct {
	gorm.Model
	Idracing    uint   `json:"idracing"`
	Idhorse     int    `json:"idhorse"`
	Numberhorse int    `json:"numberhorse"`
	Seudonimo   string `json:"seudonimo"`
	Amount      int64  `json:"amount"`
	Horsename   string `json:"horsename"`
}

Remates struct

func SearchRemateByRaceIDAndHorseID

func SearchRemateByRaceIDAndHorseID(idRacing uint, idHorse int) (*Remates, error)

SearchRemateByRaceIDAndHorseID .

type Retiro

type Retiro struct {
	gorm.Model
	Amount                   float64 `json:"amount"`
	Clientidentificationcard string  `json:"clientidentificationcard"`
}

Retiro struct

func (*Retiro) Dowithdrawal

func (retiro *Retiro) Dowithdrawal(clientIDCard string) map[string]interface{}

Dowithdrawal Client db

type Tablas

type Tablas struct {
	gorm.Model
	Idracing         uint   `json:"idracing"`
	Montototal       int64  `json:"montototal"`
	Montocasa        int64  `json:"montocasa"`
	Montoganador     int64  `json:"montoganador"`
	Posiciontabla    uint   `json:"posiciontabla"`
	Porcentajeevento uint   `json:"posicionevento"`
	Estado           string `json:"estado"`
}

Tablas struct

func SearchTablaByRaceID

func SearchTablaByRaceID(idRace uint) (*Tablas, error)

SearchTablaByRaceID .

func (*Tablas) UpdateStateTabla

func (tabla *Tablas) UpdateStateTabla() map[string]interface{}

UpdateStateTabla tablas

type Token

type Token struct {
	UserID uint
	jwt.StandardClaims
}

Token JWT claims struct

Jump to

Keyboard shortcuts

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