Documentation ¶
Index ¶
- type Gift
- type GiftDB
- func (db *GiftDB) DeleteGift(giftID int) error
- func (db *GiftDB) GetByID(giftID int) (*Gift, error)
- func (db *GiftDB) InsertGift(label, icon, description string, money, hour int) (int, error)
- func (db *GiftDB) List() ([]Gift, error)
- func (db *GiftDB) ListAll(userID, isCompleted, giftID int, startTime, endTime time.Time, ...) ([]UserGift, int, error)
- func (db *GiftDB) ListByIDArr(giftIDs ...int) ([]Gift, error)
- func (db *GiftDB) ListUserByID(userID int) ([]UserGift, error)
- func (db *GiftDB) Search(searchKey string) ([]Gift, error)
- func (db *GiftDB) UpdateGift(label, icon, description string, hour, money, giftID int) error
- func (db *GiftDB) UserGiftByID(userGiftID int) (*UserGift, error)
- type GiftTx
- type UserGift
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Gift ¶
type Gift struct { GiftID int `json:"giftID" db:"gift_id"` // 礼物ID Active bool `json:"active" db:"active"` // Money int `json:"money" db:"money"` // Label string `json:"label" db:"label"` // 礼物名称 Icon string `json:"icon" db:"icon"` // 礼物图标 Hour int `json:"hour" db:"hour"` // 有效时间 Description string `json:"description" db:"description"` // 有效时间 CreateTime time.Time `json:"createTime" db:"create_time"` // UpdateTime time.Time `json:"updateTime" db:"update_time"` // }
Gift 礼物结构体
type GiftDB ¶
func (*GiftDB) InsertGift ¶
InsertGift 添加礼物
func (*GiftDB) ListAll ¶
func (db *GiftDB) ListAll(userID, isCompleted, giftID int, startTime, endTime time.Time, offset, limit int) ([]UserGift, int, error)
ListAll 列出所有礼物商品
func (*GiftDB) ListByIDArr ¶
ListByIDArr 列出指定礼物
func (*GiftDB) ListUserByID ¶
ListUserByID 获取用户指定礼品
func (*GiftDB) UpdateGift ¶
UpdateGift 修改指定礼物
type GiftTx ¶
type UserGift ¶
type UserGift struct { UserGiftID int `json:"userGiftID" db:"user_gift_id"` // 礼物券ID UserID int `json:"userID" db:"user_id"` // 用户ID GiftID int `json:"giftID" db:"gift_id"` // 礼物ID Active bool `json:"active" db:"active"` // Money int `json:"money" db:"money"` // IsCompleted bool `json:"isCompleted" db:"is_completed"` // 是否核销 Label string `json:"label" db:"label"` // 礼物名称 Icon string `json:"icon" db:"icon"` // 礼物图标 Description string `json:"description" db:"description"` // 描述 EndTime time.Time `json:"endTime" db:"end_time"` // 有效期结束时间 CompletedTime time.Time `json:"completedTime" db:"completed_time"` // 核销时间 CreateTime time.Time `json:"createTime" db:"create_time"` // 创建时间 UpdateTime time.Time `json:"updateTime" db:"update_time"` // 修改时间 }
UserGift 礼物结构体
Click to show internal directories.
Click to hide internal directories.