Documentation ¶
Index ¶
- Constants
- type Dao
- func (d *Dao) AddCacheRewardConf(c context.Context, id int64, val *model.AnchorRewardConf) (err error)
- func (d *Dao) AddExpireCountCache(c context.Context, k string, times int64) (err error)
- func (d *Dao) AddReward(c context.Context, iRewardID int64, uid int64, iSource int64, iRoomid int64, ...) (err error)
- func (d *Dao) CacheRewardConf(c context.Context, id int64) (res *model.AnchorRewardConf, err error)
- func (d *Dao) CheckOrderID(c context.Context, id string) (exist int64, err error)
- func (d *Dao) ClearExpireCountCache(c context.Context, k string) (err error)
- func (d *Dao) CountExpire(interval int64, now time.Time) (err error)
- func (d *Dao) DelLockCache(c context.Context, k string) (err error)
- func (d *Dao) GetById(id int64) (reward *model.AnchorReward, err error)
- func (d *Dao) GetByUidPage(c context.Context, uid int64, page int64, pageSize int64, status []int64) (pager *model.AnchorRewardPager, list []*model.AnchorRewardObject, err error)
- func (d *Dao) GetExpireCountCache(c context.Context, k string) (count int64, err error)
- func (d *Dao) GetHasReward(c context.Context, uid int64) (r int64, err error)
- func (d *Dao) GetNewReward(c context.Context, uid int64) (r int64, err error)
- func (d *Dao) GetOrder(c context.Context, id string) (exists int64, err error)
- func (d *Dao) HasNewReward(c context.Context, uid int64) (rst int64, err error)
- func (d *Dao) HasReward(c context.Context, uid int64) (r int64, err error)
- func (d *Dao) Ping(c context.Context) (err error)
- func (d *Dao) RawRewardConf(c context.Context, id int64) (res *model.AnchorRewardConf, err error)
- func (d *Dao) RewardConf(c context.Context, id int64) (res *model.AnchorRewardConf, err error)
- func (d *Dao) SaveOrder(c context.Context, id string) (err error)
- func (d *Dao) SaveOrderID(c context.Context, id string) error
- func (d *Dao) SendBroadcast(uid int64, roomid int64, rewardId int64) (err error)
- func (d *Dao) SendBroadcastV2(c context.Context, uid int64, roomid int64, rewardId int64) (err error)
- func (d *Dao) SetExpire(now time.Time) (err error)
- func (d *Dao) SetHasReward(c context.Context, uid int64, isHave int64) (err error)
- func (d *Dao) SetNewReward(c context.Context, uid int64, hasNew int64) (err error)
- func (d *Dao) SetNxLock(c context.Context, k string, times int64) (res bool, err error)
- func (d *Dao) UseReward(id int64, usePlat string) (rst bool, err error)
- type HasNewReward
Constants ¶
const ( //NewRewardCache have new reward. NewRewardCache = "new_reward:v1:%d" //HasRewardCache have a reward HasRewardCache = "has_reward:v1:%d" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dao ¶
type Dao struct {
// contains filtered or unexported fields
}
Dao dao
func (*Dao) AddCacheRewardConf ¶
func (d *Dao) AddCacheRewardConf(c context.Context, id int64, val *model.AnchorRewardConf) (err error)
AddCacheRewardConf 保存奖励配置
func (*Dao) AddExpireCountCache ¶
AddExpireCountCache .
func (*Dao) AddReward ¶
func (d *Dao) AddReward(c context.Context, iRewardID int64, uid int64, iSource int64, iRoomid int64, iLifespan int64) (err error)
AddReward add Reward to a user.
func (*Dao) CacheRewardConf ¶
CacheRewardConf 获取奖励配置
func (*Dao) CheckOrderID ¶
CheckOrderID check orderid is valid.
func (*Dao) ClearExpireCountCache ¶
ClearExpireCountCache .
func (*Dao) CountExpire ¶
CountExpire .
func (*Dao) DelLockCache ¶
DelLockCache del lock cache.
func (*Dao) GetById ¶
func (d *Dao) GetById(id int64) (reward *model.AnchorReward, err error)
GetById get reward by id.
func (*Dao) GetByUidPage ¶
func (d *Dao) GetByUidPage(c context.Context, uid int64, page int64, pageSize int64, status []int64) (pager *model.AnchorRewardPager, list []*model.AnchorRewardObject, err error)
GetByUidPage get reward by uid and page.
func (*Dao) GetExpireCountCache ¶
GetExpireCountCache .
func (*Dao) GetHasReward ¶
GetHasReward .
func (*Dao) GetNewReward ¶
GetNewReward set MRRecord to mc
func (*Dao) HasNewReward ¶
HasNewReward .
func (*Dao) RawRewardConf ¶
RawRewardConf return reward config from db.
func (*Dao) RewardConf ¶
RewardConf get data from cache if miss will call source method, then add to cache.
func (*Dao) SaveOrderID ¶
SaveOrderID save order id.
func (*Dao) SendBroadcast ¶
SendBroadcast .
func (*Dao) SendBroadcastV2 ¶
func (d *Dao) SendBroadcastV2(c context.Context, uid int64, roomid int64, rewardId int64) (err error)
SendBroadcastV2 .
func (*Dao) SetHasReward ¶
SetHasReward save whether one user have reward.
func (*Dao) SetNewReward ¶
SetNewReward get MRRecord from mc
type HasNewReward ¶
type HasNewReward struct {
HasNewReward int64 `json:"has_new_reward"`
}
HasNewReward .