Documentation ¶
Overview ¶
*
- 抽奖系统数据处理(包括数据库,也包括缓存等其他形式数据)
*
- 抽奖系统数据处理(包括数据库,也包括缓存等其他形式数据)
*
- 抽奖系统数据处理(包括数据库,也包括缓存等其他形式数据)
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlackipService ¶
type BlackipService interface { GetAll(page, size int) []models.LtBlackip CountAll() int64 Search(ip string) []models.LtBlackip Get(id int) *models.LtBlackip //Delete(id int) error Update(user *models.LtBlackip, columns []string) error Create(user *models.LtBlackip) error GetByIp(ip string) *models.LtBlackip }
func NewBlackipService ¶
func NewBlackipService() BlackipService
type GiftService ¶
type GiftService interface { GetAll(useCache bool) []models.LtGift CountAll() int64 //Search(country string) []models.LtGift Get(id int, useCache bool) *models.LtGift Delete(id int) error // 指明要强制更新的数据表字段 Update(data *models.LtGift, columns []string) error Create(data *models.LtGift) error GetAllUse(useCache bool) []models.ObjGiftPrize IncrLeftNum(id, num int) (int64, error) DecrLeftNum(id, num int) (int64, error) }
接口,多种实现,service 更加灵活 首字母大写对外公开
func NewGiftService ¶
func NewGiftService() GiftService
返回 GiftService 接口 而不是 私有的giftService 否则外界无法使用
type ResultService ¶
type ResultService interface { GetAll(page, size int) []models.LtResult CountAll() int64 GetNewPrize(size int, giftIds []int) []models.LtResult SearchByGift(giftId, page, size int) []models.LtResult SearchByUser(uid, page, size int) []models.LtResult CountByGift(giftId int) int64 CountByUser(uid int) int64 Get(id int) *models.LtResult Delete(id int) error Update(result *models.LtResult, columns []string) error Create(result *models.LtResult) error }
func NewResultService ¶
func NewResultService() ResultService
type UserService ¶
type UserService interface { GetAll(page, size int) []models.LtUser CountAll() int //Search(country string) []models.LtUser Get(id int) *models.LtUser //Delete(id int) error Update(user *models.LtUser, columns []string) error Create(user *models.LtUser) error }
func NewUserService ¶
func NewUserService() UserService
type UserdayService ¶
type UserdayService interface { GetAll(page, size int) []models.LtUserday CountAll() int64 Search(uid, day int) []models.LtUserday Count(uid, day int) int Get(id int) *models.LtUserday //Delete(id int) error Update(user *models.LtUserday, columns []string) error Create(user *models.LtUserday) error GetUserToday(uid int) *models.LtUserday }
func NewUserdayService ¶
func NewUserdayService() UserdayService
Click to show internal directories.
Click to hide internal directories.