info

package
v0.0.0-...-5f108f6 Latest Latest
Warning

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

Go to latest
Published: May 9, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AwardsInfo

func AwardsInfo(c *gin.Context)

Get prize information for lottery

func DrawTimes

func DrawTimes(c *gin.Context)

Query user's remaining lottery draws

func LoadRouter

func LoadRouter(_ *gin.RouterGroup, infoGroup *gin.RouterGroup)

load routers

func LotteryInfo

func LotteryInfo(c *gin.Context)

Get a list of ongoing lottery

func WinInfo

func WinInfo(c *gin.Context)

Get the user winning information of the lottery

Types

type AwardInfoRes

type AwardInfoRes struct {
	LotteryId          uint64      `json:"lottery_id"`
	LotteryTitle       string      `json:"lottery_title"`
	LotteryDescription string      `json:"lottery_description"`
	Awards             []AwardItem `json:"awards"`
	Page               uint64      `json:"page"`
	Rows               uint64      `json:"rows"`
	Total              int64       `json:"total"`
}

AwardInfoRes: struct for AwardsInfo()

type AwardInfos

type AwardInfos struct {
	ID          uint64    `gorm:"primaryKey;column:id;type:bigint unsigned;not null" json:"-"`
	Lottery     uint64    `gorm:"column:lottery;type:bigint unsigned;not null" json:"lottery"`
	Fkey        Lotteries `gorm:"foreignkey:Lottery;association_foreignkey:ID;constraint:OnUpdate:CASCADE,OnDelete:CASCADE"`
	Name        string    `gorm:"column:name;type:varchar(32)" json:"name"`
	Type        int64     `gorm:"column:type;type:bigint" json:"type"`
	Description string    `gorm:"column:description;type:text" json:"description"`
	Pic         string    `gorm:"column:pic;type:text" json:"pic"`
	Total       uint64    `gorm:"column:total;type:bigint" json:"total"`
	DisplayRate uint64    `gorm:"column:display_rate;type:bigint" json:"display_rate"`
	Rate        uint64    `gorm:"column:rate;type:bigint" json:"rate"`
	Value       uint64    `gorm:"column:value;type:bigint" json:"value"`
}

AwardInfos: struct for award_infos

func (*AwardInfos) TableName

func (m *AwardInfos) TableName() string

type AwardItem

type AwardItem struct {
	ID          uint64 `json:"award_id"`
	Name        string `json:"award_name"`
	Description string `json:"award_description"`
	Pic         string `json:"pic"`
	Total       uint64 `json:"total"`
	DisplayRate uint64 `json:"display_rate"`
	Value       uint64 `json:"value"`
}

type Awards

type Awards struct {
	Award   uint64     `gorm:"primaryKey;column:award;type:bigint unsigned;not null" json:"-"`
	Fkey2   AwardInfos `gorm:"foreignkey:Award;association_foreignkey:ID;constraint:OnUpdate:CASCADE,OnDelete:CASCADE"`
	Lottery uint64     `gorm:"index:idx_awards_lottery;column:lottery;type:bigint unsigned;not null" json:"lottery"`
	Fkey1   Lotteries  `gorm:"foreignkey:Lottery;association_foreignkey:ID;constraint:OnUpdate:CASCADE,OnDelete:CASCADE"`
	Remain  int64      `gorm:"column:remain;type:bigint" json:"remain"`
}

Awards [...]

func (*Awards) TableName

func (m *Awards) TableName() string

TableName get sql table name.

type Lotteries

type Lotteries struct {
	ID          uint64    `gorm:"primaryKey;column:id;type:bigint unsigned;not null" json:"lottery_id"`
	Title       string    `gorm:"column:title;type:varchar(32);not null" json:"lottery_title"`
	Description string    `gorm:"column:description;type:text" json:"lottery_description"`
	Permanent   uint64    `gorm:"column:permanent;type:bigint" json:"permanent"`
	Temporary   uint64    `gorm:"column:temporary;type:bigint" json:"temporary"`
	StartTime   time.Time `gorm:"column:start_time;type:datetime(3)" json:"start_time"`
	EndTime     time.Time `gorm:"column:end_time;type:datetime(3)" json:"end_time"`
}

Lotteries: struct for lotteries

func QueryLotteryById

func QueryLotteryById(lotteryId uint64) (Lotteries, uint64)

func (*Lotteries) TableName

func (m *Lotteries) TableName() string

type LotteryInfoRes

type LotteryInfoRes struct {
	LotteryItems []Lotteries `json:"lottery_items"`
	Page         uint64      `json:"page"`
	Rows         uint64      `json:"rows"`
	Total        int64       `json:"total"`
}

LotteryInfoRes: struct for LotteryInfo()

type Users

type Users struct {
	ID          uint64    `gorm:"primaryKey;column:id;type:bigint unsigned;not null" json:"-"`
	AccessToken string    `gorm:"column:access_token;type:varchar(128)" json:"-"`
	TokenType   uint64    `gorm:"column:token_type;type:bigint" json:"-"`
	Role        uint64    `gorm:"column:role;type:bigint" json:"role"`
	CreatedAt   time.Time `gorm:"column:created_at;type:datetime(3)" json:"created_at"`
}

Users [...]

func (*Users) TableName

func (m *Users) TableName() string

TableName get sql table name.

type WinItem

type WinItem struct {
	Lottery uint64 `json:"lottery_id"`
	Title   string `json:"lottery_title"`
	AwardId uint64 `json:"award_id"`
	Name    string `json:"award_name"`
	Address string `json:"address"`
	Handout bool   `json:"handout"`
}

type WinningInfoRes

type WinningInfoRes struct {
	UserId uint64    `json:"user_id"`
	Awards []WinItem `json:"awards"`
	Page   uint64    `json:"page"`
	Rows   uint64    `json:"rows"`
	Total  int64     `json:"total"`
}

type WinningInfos

type WinningInfos struct {
	ID      uint64     `gorm:"primaryKey;column:id;type:bigint unsigned;not null" json:"-"`
	User    uint64     `gorm:"index:idx_winning_infos_user;column:user;type:bigint unsigned;not null" json:"user"`
	Fkey1   Users      `gorm:"foreignkey:User;association_foreignkey:ID;constraint:OnUpdate:CASCADE,OnDelete:CASCADE"`
	Award   uint64     `gorm:"index:idx_winning_infos_award;column:award;type:bigint unsigned;not null" json:"award"`
	Fkey2   AwardInfos `gorm:"foreignkey:Award;association_foreignkey:ID;constraint:OnUpdate:CASCADE,OnDelete:CASCADE"`
	Lottery uint64     `gorm:"index:idx_winning_infos_lottery;column:lottery;type:bigint unsigned;not null" json:"lottery"`
	Fkey3   Lotteries  `gorm:"foreignkey:Lottery;association_foreignkey:ID;constraint:OnUpdate:CASCADE,OnDelete:CASCADE"`
	Address string     `gorm:"column:address;type:tinytext" json:"address"`
	Handout bool       `gorm:"column:handout;type:tinyint(1);default:0" json:"handout"`
}

WinningInfo: struct for winning_infos

func (*WinningInfos) TableName

func (m *WinningInfos) TableName() string

TableName get sql table name.

Jump to

Keyboard shortcuts

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