Documentation ¶
Index ¶
- Variables
- func InitApi()
- type Dao
- func (d *Dao) AddBag(ctx context.Context, uid, giftID, giftNum, expireAt int64) (affected int64, err error)
- func (d *Dao) AddDayBag(ctx context.Context, uid int64, date string, dayInfo *model.BagGiftStatus) (affected int64, err error)
- func (d *Dao) AddWeekBag(ctx context.Context, uid int64, week int, level int64, ...) (affected int64, err error)
- func (d *Dao) ClearBagListCache(ctx context.Context, uid int64) (err error)
- func (d *Dao) ClearVipStatusCache(ctx context.Context, uid int64) (err error)
- func (d *Dao) Close()
- func (d *Dao) ForceUnLock(ctx context.Context, key string) (err error)
- func (d *Dao) GetAllGift(ctx context.Context) (gifts []*model.GiftOnline, err error)
- func (d *Dao) GetBag(ctx context.Context, uid, giftID, expireAt int64) (res *model.BagInfo, err error)
- func (d *Dao) GetBagByID(ctx context.Context, uid, id int64) (res *model.BagInfo, err error)
- func (d *Dao) GetBagIDCache(ctx context.Context, uid, giftID, expireAt int64) (bagID int64, err error)
- func (d *Dao) GetBagList(ctx context.Context, uid int64) (list []*model.BagGiftList, err error)
- func (d *Dao) GetBagListCache(ctx context.Context, uid int64) (res []*model.BagGiftList, err error)
- func (d *Dao) GetBagStatusCache(ctx context.Context, uid int64) (status int64, err error)
- func (d *Dao) GetByDiscountIds(ctx context.Context, ids []int64) (res []*model.DiscountGift, err error)
- func (d *Dao) GetDailyBagCache(ctx context.Context, uid int64) (res []*v1pb.DailyBagResp_BagList, err error)
- func (d *Dao) GetDayBagStatus(ctx context.Context, uid int64, date string) (res *model.DayGiftInfo, err error)
- func (d *Dao) GetDiscountPlan(ctx context.Context, now time.Time) (plans []*model.DiscountPlan, err error)
- func (d *Dao) GetMedalDailyBagCache(ctx context.Context, uid int64) (res *model.BagGiftStatus, err error)
- func (d *Dao) GetOnlinePlan(ctx context.Context) (plans []*model.GiftPlan, err error)
- func (d *Dao) GetVipStatusCache(ctx context.Context, uid int64) (status int64, err error)
- func (d *Dao) GetWeekBagStatus(ctx context.Context, uid int64, week int, level int64) (res *model.WeekGiftInfo, err error)
- func (d *Dao) GetWeekLevelBagCache(ctx context.Context, uid, level int64) (res *model.BagGiftStatus, err error)
- func (d *Dao) Lock(ctx context.Context, key string, ttl int, retry int, retryDelay int) (gotLock bool, lockValue string, err error)
- func (d *Dao) Ping(ctx context.Context) error
- func (d *Dao) SetBagIDCache(ctx context.Context, uid, giftID, expireAt, bagID, expire int64) (err error)
- func (d *Dao) SetBagListCache(ctx context.Context, uid int64, data []*model.BagGiftList, expire int64) (err error)
- func (d *Dao) SetBagNumCache(ctx context.Context, uid, giftID, expireAt, giftNum, expire int64) (err error)
- func (d *Dao) SetBagStatusCache(ctx context.Context, uid, status int64, expire int64) (err error)
- func (d *Dao) SetDailyBagCache(ctx context.Context, uid int64, data []*v1pb.DailyBagResp_BagList, ...) (err error)
- func (d *Dao) SetMedalDailyBagCache(ctx context.Context, uid int64, data *model.BagGiftStatus, expire int64) (err error)
- func (d *Dao) SetWeekLevelBagCache(ctx context.Context, uid, level int64, data *model.BagGiftStatus, expire int64) (err error)
- func (d *Dao) UnLock(ctx context.Context, key string, lockValue string) (err error)
- func (d *Dao) UpdateBagNum(ctx context.Context, uid, id, num int64) (affected int64, err error)
Constants ¶
This section is empty.
Variables ¶
var ( // RoomApi RoomApi RoomApi *room.Client // LiveUserApi LiveUserApi LiveUserApi *live_user.Client // UserApi UserApi UserApi *user.Client // FansMedalApi FansMedalApi FansMedalApi *fans_medal.Client // ActivityApi ActivityApi ActivityApi *activity.Client // XuserClient XuserClient XuserClient *xuser.Client )
Functions ¶
Types ¶
type Dao ¶
type Dao struct {
// contains filtered or unexported fields
}
Dao dao
func (*Dao) AddBag ¶
func (d *Dao) AddBag(ctx context.Context, uid, giftID, giftNum, expireAt int64) (affected int64, err error)
AddBag AddBag
func (*Dao) AddDayBag ¶
func (d *Dao) AddDayBag(ctx context.Context, uid int64, date string, dayInfo *model.BagGiftStatus) (affected int64, err error)
AddDayBag AddDayBag
func (*Dao) AddWeekBag ¶
func (d *Dao) AddWeekBag(ctx context.Context, uid int64, week int, level int64, weekInfo *model.BagGiftStatus) (affected int64, err error)
AddWeekBag AddWeekBag
func (*Dao) ClearBagListCache ¶
ClearBagListCache ClearBagListCache
func (*Dao) ClearVipStatusCache ¶
ClearVipStatusCache ClearVipStatusCache
func (*Dao) ForceUnLock ¶
ForceUnLock UnLock without lockValue
func (*Dao) GetAllGift ¶
GetAllGift GetAllGift
func (*Dao) GetBag ¶
func (d *Dao) GetBag(ctx context.Context, uid, giftID, expireAt int64) (res *model.BagInfo, err error)
GetBag GetBag
func (*Dao) GetBagByID ¶
GetBagByID GetBagByID
func (*Dao) GetBagIDCache ¶
func (d *Dao) GetBagIDCache(ctx context.Context, uid, giftID, expireAt int64) (bagID int64, err error)
GetBagIDCache GetBagIDCache
func (*Dao) GetBagList ¶
GetBagList GetBagList
func (*Dao) GetBagListCache ¶
GetBagListCache GetBagListCache
func (*Dao) GetBagStatusCache ¶
GetBagStatusCache GetBagStatusCache
func (*Dao) GetByDiscountIds ¶
func (d *Dao) GetByDiscountIds(ctx context.Context, ids []int64) (res []*model.DiscountGift, err error)
GetByDiscountIds GetByDiscountIds
func (*Dao) GetDailyBagCache ¶
func (d *Dao) GetDailyBagCache(ctx context.Context, uid int64) (res []*v1pb.DailyBagResp_BagList, err error)
GetDailyBagCache GetDailyBagCache
func (*Dao) GetDayBagStatus ¶
func (d *Dao) GetDayBagStatus(ctx context.Context, uid int64, date string) (res *model.DayGiftInfo, err error)
GetDayBagStatus GetDayBagStatus
func (*Dao) GetDiscountPlan ¶
func (d *Dao) GetDiscountPlan(ctx context.Context, now time.Time) (plans []*model.DiscountPlan, err error)
GetDiscountPlan GetDiscountPlan
func (*Dao) GetMedalDailyBagCache ¶
func (d *Dao) GetMedalDailyBagCache(ctx context.Context, uid int64) (res *model.BagGiftStatus, err error)
GetMedalDailyBagCache GetMedalDailyBagCache
func (*Dao) GetOnlinePlan ¶
GetOnlinePlan GetOnlinePlan
func (*Dao) GetVipStatusCache ¶
GetVipStatusCache GetVipStatusCache
func (*Dao) GetWeekBagStatus ¶
func (d *Dao) GetWeekBagStatus(ctx context.Context, uid int64, week int, level int64) (res *model.WeekGiftInfo, err error)
GetWeekBagStatus GetWeekBagStatus
func (*Dao) GetWeekLevelBagCache ¶
func (d *Dao) GetWeekLevelBagCache(ctx context.Context, uid, level int64) (res *model.BagGiftStatus, err error)
GetWeekLevelBagCache GetWeekLevelBagCache
func (*Dao) Lock ¶
func (d *Dao) Lock(ctx context.Context, key string, ttl int, retry int, retryDelay int) (gotLock bool, lockValue string, err error)
Lock Lock
func (*Dao) SetBagIDCache ¶
func (d *Dao) SetBagIDCache(ctx context.Context, uid, giftID, expireAt, bagID, expire int64) (err error)
SetBagIDCache SetBagIDCache
func (*Dao) SetBagListCache ¶
func (d *Dao) SetBagListCache(ctx context.Context, uid int64, data []*model.BagGiftList, expire int64) (err error)
SetBagListCache SetBagListCache
func (*Dao) SetBagNumCache ¶
func (d *Dao) SetBagNumCache(ctx context.Context, uid, giftID, expireAt, giftNum, expire int64) (err error)
SetBagNumCache SetBagNumCache
func (*Dao) SetBagStatusCache ¶
SetBagStatusCache SetBagStatusCache
func (*Dao) SetDailyBagCache ¶
func (d *Dao) SetDailyBagCache(ctx context.Context, uid int64, data []*v1pb.DailyBagResp_BagList, expire int64) (err error)
SetDailyBagCache SetDailyBagCache
func (*Dao) SetMedalDailyBagCache ¶
func (d *Dao) SetMedalDailyBagCache(ctx context.Context, uid int64, data *model.BagGiftStatus, expire int64) (err error)
SetMedalDailyBagCache SetMedalDailyBagCache
func (*Dao) SetWeekLevelBagCache ¶
func (d *Dao) SetWeekLevelBagCache(ctx context.Context, uid, level int64, data *model.BagGiftStatus, expire int64) (err error)
SetWeekLevelBagCache SetWeekLevelBagCache