dao

package
v0.0.0-...-83adff0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2020 License: GPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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

func InitApi

func InitApi()

InitApi InitApi

Types

type Dao

type Dao struct {
	// contains filtered or unexported fields
}

Dao dao

func New

func New(c *conf.Config) (dao *Dao)

New init mysql db

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

func (d *Dao) ClearBagListCache(ctx context.Context, uid int64) (err error)

ClearBagListCache ClearBagListCache

func (*Dao) ClearVipStatusCache

func (d *Dao) ClearVipStatusCache(ctx context.Context, uid int64) (err error)

ClearVipStatusCache ClearVipStatusCache

func (*Dao) Close

func (d *Dao) Close()

Close close the resource.

func (*Dao) ForceUnLock

func (d *Dao) ForceUnLock(ctx context.Context, key string) (err error)

ForceUnLock UnLock without lockValue

func (*Dao) GetAllGift

func (d *Dao) GetAllGift(ctx context.Context) (gifts []*model.GiftOnline, err error)

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

func (d *Dao) GetBagByID(ctx context.Context, uid, id int64) (res *model.BagInfo, err error)

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

func (d *Dao) GetBagList(ctx context.Context, uid int64) (list []*model.BagGiftList, err error)

GetBagList GetBagList

func (*Dao) GetBagListCache

func (d *Dao) GetBagListCache(ctx context.Context, uid int64) (res []*model.BagGiftList, err error)

GetBagListCache GetBagListCache

func (*Dao) GetBagStatusCache

func (d *Dao) GetBagStatusCache(ctx context.Context, uid int64) (status int64, err error)

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

func (d *Dao) GetOnlinePlan(ctx context.Context) (plans []*model.GiftPlan, err error)

GetOnlinePlan GetOnlinePlan

func (*Dao) GetVipStatusCache

func (d *Dao) GetVipStatusCache(ctx context.Context, uid int64) (status int64, err error)

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) Ping

func (d *Dao) Ping(ctx context.Context) error

Ping dao ping

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

func (d *Dao) SetBagStatusCache(ctx context.Context, uid, status int64, expire int64) (err error)

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

func (*Dao) UnLock

func (d *Dao) UnLock(ctx context.Context, key string, lockValue string) (err error)

UnLock UnLock

func (*Dao) UpdateBagNum

func (d *Dao) UpdateBagNum(ctx context.Context, uid, id, num int64) (affected int64, err error)

UpdateBagNum UpdateBagNum

Jump to

Keyboard shortcuts

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