Documentation
¶
Index ¶
- type Dao
- func (d *Dao) AddVip(ctx context.Context, uid int64, vipTime, sVipTime xtime.Time) (row int64, err error)
- func (d *Dao) ClearCache(ctx context.Context, uid int64) (err error)
- func (d *Dao) Close()
- func (d *Dao) CreateApVipRecord(ctx context.Context, record *model.VipRecord) (row int64, err error)
- func (d *Dao) CreateVipRecord(ctx context.Context, req *model.VipBuy) (recordID int64, err error)
- func (d *Dao) GetVipFromCache(ctx context.Context, uid int64) (info *model.VipInfo, err error)
- func (d *Dao) GetVipFromDB(ctx context.Context, uid int64) (info *model.VipInfo, err error)
- func (d *Dao) Ping(ctx context.Context) error
- func (d *Dao) SetVipCache(ctx context.Context, uid int64, info *model.VipInfo) (err error)
- func (d *Dao) UpdateVipRecord(ctx context.Context, recordID, uid int64, info *model.VipInfo) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dao ¶
type Dao struct {
// contains filtered or unexported fields
}
Dao vip dao
func (*Dao) AddVip ¶
func (d *Dao) AddVip(ctx context.Context, uid int64, vipTime, sVipTime xtime.Time) (row int64, err error)
AddVip update user_n vip fields, add vip/svip time weather add vip or svip, vipTime should not be empty
func (*Dao) ClearCache ¶
ClearCache clear user's vip and level field cache Todo: remove level attr
func (*Dao) CreateApVipRecord ¶
func (d *Dao) CreateApVipRecord(ctx context.Context, record *model.VipRecord) (row int64, err error)
CreateApVipRecord create ap_vip_record
func (*Dao) CreateVipRecord ¶
CreateVipRecord create user vip record if not exists return error maybe unique key exists err or other db error, upper business should notice unique key is (uid,order_id)
func (*Dao) GetVipFromCache ¶
GetVipFromCache get user vip info from cache
func (*Dao) GetVipFromDB ¶
GetVipFromDB get vip info by uid return error maybe sql no row or just scan error, how to handle decided by upper business
func (*Dao) SetVipCache ¶
SetVipCache set vip to cache
Click to show internal directories.
Click to hide internal directories.