Documentation ¶
Index ¶
- type Dao
- func (d *Dao) AccountInfo(c context.Context, mid int64) (ai *api.Info, err error)
- func (d *Dao) AddCachePayParam(c context.Context, id string, val *model.PayParam) (err error)
- func (d *Dao) AddCacheUserInfoByMid(c context.Context, id int64, val *model.UserInfo) (err error)
- func (d *Dao) BeginTran(c context.Context) (*xsql.Tx, error)
- func (d *Dao) CachePayParamByToken(c context.Context, id string) (res *model.PayParam, err error)
- func (d *Dao) CachePayParamsByTokens(c context.Context, ids []string) (res map[string]*model.PayParam, err error)
- func (d *Dao) CacheUserInfoByMid(c context.Context, id int64) (res *model.UserInfo, err error)
- func (d *Dao) Close()
- func (d *Dao) CreateYstOrder(c context.Context, req *model.YstCreateOrderReq) (res *model.YstCreateOrderReply, err error)
- func (d *Dao) DelCacheUserInfoByMid(c context.Context, id int64) (err error)
- func (d *Dao) EndTran(tx *xsql.Tx, err error) error
- func (d *Dao) GiveMVipGift(c context.Context, mid int64, batchId int, orderNo string) error
- func (d *Dao) Lock(c context.Context, key string, val string) (err error)
- func (d *Dao) MainVip(c context.Context, mid int64) (mv *model.MainVip, err error)
- func (d *Dao) PayOrderByID(c context.Context, id int) (po *model.PayOrder, err error)
- func (d *Dao) PayOrderByOrderNo(c context.Context, orderNo string) (po *model.PayOrder, err error)
- func (d *Dao) PayOrdersByMid(c context.Context, mid int, pn, ps int) (res []*model.PayOrder, total int, err error)
- func (d *Dao) PayOrdersByMidAndStatus(c context.Context, mid int, status int8, pn, ps int) (res []*model.PayOrder, total int, err error)
- func (d *Dao) PayOrdersByMidAndStatusAndCtime(c context.Context, mid int64, status int8, from, to xtime.Time, pn, ps int) (res []*model.PayOrder, total int, err error)
- func (d *Dao) Ping(ctx context.Context) error
- func (d *Dao) PriceConfigsByStatus(c context.Context, status int8) (res []*model.PriceConfig, total int, err error)
- func (d *Dao) RawUserInfoByMid(c context.Context, mid int64) (ui *model.UserInfo, err error)
- func (d *Dao) RenewYstOrder(c context.Context, req *model.YstRenewOrderReq) (res *model.YstRenewOrderReply, err error)
- func (d *Dao) SaledPriceConfigsByStatus(c context.Context, status int8) (res []*model.PriceConfig, total int, err error)
- func (d *Dao) Signer() *pkg.Signer
- func (d *Dao) TxDeleteUserContract(ctx context.Context, tx *xsql.Tx, id int32) (err error)
- func (d *Dao) TxInsertPayOrder(ctx context.Context, tx *xsql.Tx, po *model.PayOrder) (id int64, err error)
- func (d *Dao) TxInsertUserChangeHistory(ctx context.Context, tx *xsql.Tx, uch *model.UserChangeHistory) (id int64, err error)
- func (d *Dao) TxInsertUserContract(ctx context.Context, tx *xsql.Tx, uc *model.UserContract) (id int64, err error)
- func (d *Dao) TxInsertUserInfo(ctx context.Context, tx *xsql.Tx, ui *model.UserInfo) (id int64, err error)
- func (d *Dao) TxUpdatePayOrder(ctx context.Context, tx *xsql.Tx, po *model.PayOrder) error
- func (d *Dao) TxUpdateUserInfo(ctx context.Context, tx *xsql.Tx, ui *model.UserInfo) (err error)
- func (d *Dao) TxUpdateUserPayType(ctx context.Context, tx *xsql.Tx, ui *model.UserInfo) (err error)
- func (d *Dao) TxUpdateUserStatus(ctx context.Context, tx *xsql.Tx, ui *model.UserInfo) (err error)
- func (d *Dao) Unlock(c context.Context, key string, val string) (err error)
- func (d *Dao) UnpaidNotCallbackOrder(c context.Context, stime, etime xtime.Time, pn, ps int) (res []*model.PayOrder, err error)
- func (d *Dao) UpdateCachePayParam(c context.Context, id string, val *model.PayParam) (err error)
- func (d *Dao) UserChangeHistoryByID(c context.Context, id int32) (uch *model.UserChangeHistory, err error)
- func (d *Dao) UserChangeHistorysByMid(c context.Context, mid int64, pn, ps int32) (res []*model.UserChangeHistory, total int, err error)
- func (d *Dao) UserChangeHistorysByMidAndCtime(c context.Context, mid int64, from, to xtime.Time, pn, ps int32) (res []*model.UserChangeHistory, total int, err error)
- func (d *Dao) UserContractByContractId(c context.Context, contractId string) (uc *model.UserContract, err error)
- func (d *Dao) UserContractByMid(c context.Context, mid int64) (uc *model.UserContract, err error)
- func (d *Dao) UserInfoByMid(c context.Context, id int64) (res *model.UserInfo, err error)
- func (d *Dao) YstOrderState(c context.Context, req *model.YstOrderStateReq) (res *model.YstOrderStateReply, err error)
- type YstClient
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 dao
func (*Dao) AccountInfo ¶
AccountInfo queries account info by user id.
func (*Dao) AddCachePayParam ¶
AddCachePayParam Set data to mc
func (*Dao) AddCacheUserInfoByMid ¶
AddCacheUserInfoByMid Set data to mc
func (*Dao) CachePayParamByToken ¶
CachePayParamByToken get data from mc
func (*Dao) CachePayParamsByTokens ¶
func (d *Dao) CachePayParamsByTokens(c context.Context, ids []string) (res map[string]*model.PayParam, err error)
CachePayParamsByTokens get data from mc
func (*Dao) CacheUserInfoByMid ¶
CacheUserInfoByMid get data from mc
func (*Dao) CreateYstOrder ¶
func (d *Dao) CreateYstOrder(c context.Context, req *model.YstCreateOrderReq) (res *model.YstCreateOrderReply, err error)
CreateYstOrder creates one yst order.
func (*Dao) DelCacheUserInfoByMid ¶
DelCacheUserInfoByMid delete data from mc
func (*Dao) GiveMVipGift ¶
GiveMVipGift gives bilibili vip to user.
func (*Dao) PayOrderByID ¶
PayOrderByID quires one row from tv_pay_order.
func (*Dao) PayOrderByOrderNo ¶
PayOrderByOrderNo quires one row from tv_pay_order.
func (*Dao) PayOrdersByMid ¶
func (d *Dao) PayOrdersByMid(c context.Context, mid int, pn, ps int) (res []*model.PayOrder, total int, err error)
PayOrdersByMid quires rows from tv_pay_order.
func (*Dao) PayOrdersByMidAndStatus ¶
func (d *Dao) PayOrdersByMidAndStatus(c context.Context, mid int, status int8, pn, ps int) (res []*model.PayOrder, total int, err error)
PayOrdersByMidAndStatus quires rows from tv_pay_order.
func (*Dao) PayOrdersByMidAndStatusAndCtime ¶
func (d *Dao) PayOrdersByMidAndStatusAndCtime(c context.Context, mid int64, status int8, from, to xtime.Time, pn, ps int) (res []*model.PayOrder, total int, err error)
PayOrdersByMidAndStatusAndCtime quires rows from tv_pay_order.
func (*Dao) PriceConfigsByStatus ¶
func (d *Dao) PriceConfigsByStatus(c context.Context, status int8) (res []*model.PriceConfig, total int, err error)
PriceConfigsByStatus quires rows from tv_price_config.
func (*Dao) RawUserInfoByMid ¶
UserInfoByMid quires one row from tv_user_info.
func (*Dao) RenewYstOrder ¶
func (d *Dao) RenewYstOrder(c context.Context, req *model.YstRenewOrderReq) (res *model.YstRenewOrderReply, err error)
RenewYstOrder creates one renew order.
func (*Dao) SaledPriceConfigsByStatus ¶
func (d *Dao) SaledPriceConfigsByStatus(c context.Context, status int8) (res []*model.PriceConfig, total int, err error)
SaledPriceConfigsByStatus quires rows from tv_price_config.
func (*Dao) TxDeleteUserContract ¶
TxDeleteUserContract deletes one user contract record.
func (*Dao) TxInsertPayOrder ¶
func (d *Dao) TxInsertPayOrder(ctx context.Context, tx *xsql.Tx, po *model.PayOrder) (id int64, err error)
TxInsertPayOrder insert one row into tv_pay_order.
func (*Dao) TxInsertUserChangeHistory ¶
func (d *Dao) TxInsertUserChangeHistory(ctx context.Context, tx *xsql.Tx, uch *model.UserChangeHistory) (id int64, err error)
TxInsertUserChangeHistory insert one row into tv_user_change_history.
func (*Dao) TxInsertUserContract ¶
func (d *Dao) TxInsertUserContract(ctx context.Context, tx *xsql.Tx, uc *model.UserContract) (id int64, err error)
TxInsertUserContract insert one row into tv_user_contract.
func (*Dao) TxInsertUserInfo ¶
func (d *Dao) TxInsertUserInfo(ctx context.Context, tx *xsql.Tx, ui *model.UserInfo) (id int64, err error)
TxInsertUserInfo insert one row into tv_user_info.
func (*Dao) TxUpdatePayOrder ¶
TxUpdatePayOrder updates status, third party no and payment time.
func (*Dao) TxUpdateUserInfo ¶
TxUpdateUserInfo updates user info.
func (*Dao) TxUpdateUserPayType ¶
TxUpdateUserPayType updates pay type of user.
func (*Dao) TxUpdateUserStatus ¶
TxUpdateUserInfo updates vip status of user.
func (*Dao) Unlock ¶
no thread-safe, but it's works. bad case of unlocking: 1, process-a gets lock 2, lock expires 3, process-b gets lock 4, process-a releases lock
func (*Dao) UnpaidNotCallbackOrder ¶
func (d *Dao) UnpaidNotCallbackOrder(c context.Context, stime, etime xtime.Time, pn, ps int) (res []*model.PayOrder, err error)
UnpaidNotCallbackOrder get orders not paid where stime < ctime < etime
func (*Dao) UpdateCachePayParam ¶
UpdateCachePayParam Replace data to mc
func (*Dao) UserChangeHistoryByID ¶
func (d *Dao) UserChangeHistoryByID(c context.Context, id int32) (uch *model.UserChangeHistory, err error)
UserChangeHistoryByID quires one row from tv_user_change_history.
func (*Dao) UserChangeHistorysByMid ¶
func (d *Dao) UserChangeHistorysByMid(c context.Context, mid int64, pn, ps int32) (res []*model.UserChangeHistory, total int, err error)
UserChangeHistorysByMid quires rows from tv_user_change_history.
func (*Dao) UserChangeHistorysByMidAndCtime ¶
func (d *Dao) UserChangeHistorysByMidAndCtime(c context.Context, mid int64, from, to xtime.Time, pn, ps int32) (res []*model.UserChangeHistory, total int, err error)
UserChangeHistorysByMidAndCtime quires rows from tv_user_change_history.
func (*Dao) UserContractByContractId ¶
func (d *Dao) UserContractByContractId(c context.Context, contractId string) (uc *model.UserContract, err error)
UserContractByContractId quires one row from tv_user_contract.
func (*Dao) UserContractByMid ¶
UserContractByMid quires one row from tv_user_contract.
func (*Dao) UserInfoByMid ¶
UserInfoByMid get data from cache if miss will call source method, then add to cache.
func (*Dao) YstOrderState ¶
func (d *Dao) YstOrderState(c context.Context, req *model.YstOrderStateReq) (res *model.YstOrderStateReply, err error)
YstOrderState queries order details from yst.
type YstClient ¶
type YstClient struct {
// contains filtered or unexported fields
}
YstClient represents http client for sending requests to yst.
func (*YstClient) NewRequest ¶
NewRequest news a post request.