Documentation ¶
Index ¶
- type Dao
- func (d *Dao) AddBankBind(c context.Context, update []model.ArgQuestionBankBind, ...) (err error)
- func (d *Dao) AddPayData(data *model.ShieldData)
- func (d *Dao) AddUserAnwser(c context.Context, answer *model.ArgCheckAnswer, isCorrect int8) (affect int64, err error)
- func (d *Dao) BankSearch(c context.Context, name string) (res []*model.QuestionBank, err error)
- func (d *Dao) BeginTran(c context.Context) (*sql.Tx, error)
- func (d *Dao) CheckAnswer(c context.Context, qsid int64, ids []int64) (total int, err error)
- func (d *Dao) CheckBlack(c context.Context, customerId, mid int64, clientIP string) (err error)
- func (d *Dao) CheckGeetestCount(c context.Context) (err error)
- func (d *Dao) CheckIPChange(c context.Context, mid int64, ip string, changeTime int64) (err error)
- func (d *Dao) CheckLimitNum(c context.Context, key string, num int64, pastTime int64) (err error)
- func (d *Dao) CheckSalesTime(c context.Context, mid, itemID, salesTime, saleTimeOut int64) (err error)
- func (d *Dao) CheckVoucher(c context.Context, mid int64, voucher string, voucherType int64) (err error)
- func (d *Dao) Close()
- func (d *Dao) CorrectAnswerIds(c context.Context, qid int64) (ids []int64, err error)
- func (d *Dao) CountBindItem(c context.Context, bankID int64) (count int64, err error)
- func (d *Dao) CoverStr(strs map[int64]int64) string
- func (d *Dao) DelAnswerCache(c context.Context, id int64) (err error)
- func (d *Dao) DelAnwser(c context.Context, qusID int64) (affect int64, err error)
- func (d *Dao) DelQus(c context.Context, qid int64) (affect int64, err error)
- func (d *Dao) DelQusBank(c context.Context, qbID int64, status int8) (affect int64, err error)
- func (d *Dao) DelQusBankCache(c context.Context, id int64) (err error)
- func (d *Dao) DelQusCache(c context.Context, id int64) (err error)
- func (d *Dao) DelTargetItemBindCache(c context.Context, skuID string) (err error)
- func (d *Dao) GetAllPicIds(c context.Context, offset int, limitnum int) (ids []int, err error)
- func (d *Dao) GetAnswerList(c context.Context, qusID int64) (res []*model.Answer, err error)
- func (d *Dao) GetAnsweredID(c context.Context, args *model.ArgGetQuestion) (ids []int64)
- func (d *Dao) GetAnswersByCache(c context.Context, id int64) (oi []*model.Answer, err error)
- func (d *Dao) GetBankBind(c context.Context, source, targetItemType int8, targetItem []string, ...) (list []*model.QuestionBankBind, err error)
- func (d *Dao) GetBankInfoByQBid(c context.Context, qbID map[int64]int64) (res []*model.QusBankSt, err error)
- func (d *Dao) GetBankQuestionsCache(c context.Context, bankID int64) (ids []int64)
- func (d *Dao) GetBindBank(c context.Context, source, targetItemType int8, targetItem []string) (binds []*model.QuestionBankBind, err error)
- func (d *Dao) GetBindBankInfo(c context.Context, source, targetItemType int8, targetItem string) (bind *model.QuestionBankBind, err error)
- func (d *Dao) GetBindItem(c context.Context, bankID int64, page, pageSize int) (list []*model.QuestionBankBind, total int64, err error)
- func (d *Dao) GetCacheAnswerPic(c context.Context, args *model.ArgGetQuestion) (oi *model.QuestBkPic, err error)
- func (d *Dao) GetCacheQus(c context.Context, id int64) (oi *model.Question, err error)
- func (d *Dao) GetComponentID(c context.Context, args *model.ArgGetQuestion) (cID int, err error)
- func (d *Dao) GetComponentTimes(c context.Context, args *model.ArgGetQuestion) (cID int64, err error)
- func (d *Dao) GetObj(c context.Context, key string, obj interface{}) (err error)
- func (d *Dao) GetPic(c context.Context, id int) (oi *model.QuestBkPic, err error)
- func (d *Dao) GetPicCount(c context.Context) (total int, err error)
- func (d *Dao) GetQBId(c context.Context, id int64) (qbID int64, err error)
- func (d *Dao) GetQusBankCount(c context.Context, name string) (total int64, err error)
- func (d *Dao) GetQusBankInfo(c context.Context, qbid int64) (oi *model.QuestionBank, err error)
- func (d *Dao) GetQusBankInfoCache(c context.Context, qbid int64) (oi *model.QuestionBank, err error)
- func (d *Dao) GetQusBankList(c context.Context, cnt int, ids []int64) (res []*model.QuestionBank, err error)
- func (d *Dao) GetQusBankListByIds(c context.Context, ids []int64) (res []*model.QuestionBank, err error)
- func (d *Dao) GetQusCount(c context.Context, bid int64) (total int64, err error)
- func (d *Dao) GetQusIds(c context.Context, bankID int64) (ids []int64, err error)
- func (d *Dao) GetQusInfo(c context.Context, qid int64) (oi *model.Question, err error)
- func (d *Dao) GetQusKey(format string, args *model.ArgGetQuestion) (s string)
- func (d *Dao) GetQusList(c context.Context, offset int, limitnum int, qBid int64) (res []*model.Question, err error)
- func (d *Dao) GetRandPic(c context.Context, args *model.ArgGetQuestion) (oi *model.QuestBkPic, err error)
- func (d *Dao) GetRandomPic(c context.Context, id int) (oi *model.QuestBkPic, err error)
- func (d *Dao) GetUserQuestionCache(c context.Context, args *model.ArgGetQuestion, bankID int64)
- func (d *Dao) IncrComponentTimes(c context.Context, args *model.ArgGetQuestion) (err error)
- func (d *Dao) IncrGeetestCount(c context.Context)
- func (d *Dao) InserAnwser(c context.Context, answer *model.AnswerAdd) (affect int64, err error)
- func (d *Dao) InsertQus(c context.Context, oi *model.Question) (lastID int64, err error)
- func (d *Dao) InsertQusBank(c context.Context, oi *model.QuestionBank) (lastID int64, err error)
- func (d *Dao) MultiAddAnwser(c context.Context, answers []*model.AnswerAdd) (err error)
- func (d *Dao) PayShield(c context.Context, data *model.ShieldData)
- func (d *Dao) Ping(c context.Context) (err error)
- func (d *Dao) PingRedis(c context.Context) (err error)
- func (d *Dao) PopAnswer(c context.Context)
- func (d *Dao) PushAllPic(c context.Context) (err error)
- func (d *Dao) PushAnswer(c context.Context, answer *model.ArgCheckAnswer, isCorrect int8) (affect int64, err error)
- func (d *Dao) QuestionBankUnbind(c context.Context, delIds []int64, targetType int8, source int8) (err error)
- func (d *Dao) QusFetchTime(c context.Context, args *model.ArgGetQuestion) (ts int64)
- func (d *Dao) RedisDo(c context.Context, cmd string, args ...interface{}) (reply interface{}, err error)
- func (d *Dao) RmAnsweredID(c context.Context, args *model.ArgGetQuestion) (err error)
- func (d *Dao) SetAnsweredID(c context.Context, args *model.ArgGetQuestion, questionID int64) (err error)
- func (d *Dao) SetBankQuestionsCache(c context.Context, bankID int64, ids []int64) (err error)
- func (d *Dao) SetComponentID(c context.Context, args *model.ArgGetQuestion) (err error)
- func (d *Dao) SetComponentTimes(c context.Context, args *model.ArgGetQuestion) (err error)
- func (d *Dao) SetObj(c context.Context, key string, obj interface{}, exp time.Duration) error
- func (d *Dao) SetQusFetchTime(c context.Context, args *model.ArgGetQuestion, ts int64) (err error)
- func (d *Dao) Setex(c context.Context, key string, data interface{}, exp time.Duration) error
- func (d *Dao) SetexRedisKey(c context.Context, key string, timeout int64)
- func (d *Dao) ShieldIPDetail(c context.Context, ip, stime, etime string) (res []*model.ListDetail, err error)
- func (d *Dao) ShieldIPList(c context.Context, mtime string) (res []*model.IPListDetail, err error)
- func (d *Dao) ShieldUIDDetail(c context.Context, uid, stime, etime string) (res []*model.ListDetail, err error)
- func (d *Dao) ShieldUIDList(c context.Context, mtime string) (res []*model.UIDListDetail, err error)
- func (d *Dao) StatisticsQusBank(c context.Context, offset int, limitnum int, name string) (res []*model.QusBankSt, err error)
- func (d *Dao) SyncPayShield(c context.Context)
- func (d *Dao) UpdateAnwser(c context.Context, answer *model.AnswerAdd) (affect int64, err error)
- func (d *Dao) UpdateQsBankCnt(c context.Context, qid int64) (effid int64, err error)
- func (d *Dao) UpdateQus(c context.Context, update *model.ArgUpdateQus, answers []model.Answer) (affect int64, err error)
- func (d *Dao) UpdateQusBank(c context.Context, qbID int64, name string, trytime int64, cdtime int64) (affect int64, err error)
- func (d *Dao) Voucher(c context.Context, mid int64, ip string, itemID, customer, voucherType int64) (voucher string)
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 init dao
func (*Dao) AddBankBind ¶
func (d *Dao) AddBankBind(c context.Context, update []model.ArgQuestionBankBind, insert []model.ArgQuestionBankBind) (err error)
AddBankBind add
func (*Dao) AddUserAnwser ¶
func (d *Dao) AddUserAnwser(c context.Context, answer *model.ArgCheckAnswer, isCorrect int8) (affect int64, err error)
AddUserAnwser add
func (*Dao) BankSearch ¶
BankSearch search
func (*Dao) CheckAnswer ¶
CheckAnswer check
func (*Dao) CheckBlack ¶
CheckBlack 检测黑名单
func (*Dao) CheckGeetestCount ¶
CheckGeetestCount 检查极验总数是否达到上限
func (*Dao) CheckIPChange ¶
CheckIPChange 检查用户ip变更
func (*Dao) CheckLimitNum ¶
CheckLimitNum 检查限制次数
func (*Dao) CheckSalesTime ¶
func (d *Dao) CheckSalesTime(c context.Context, mid, itemID, salesTime, saleTimeOut int64) (err error)
CheckSalesTime 检查售卖时间
func (*Dao) CheckVoucher ¶
func (d *Dao) CheckVoucher(c context.Context, mid int64, voucher string, voucherType int64) (err error)
CheckVoucher 验证用户凭证,一次性
func (*Dao) CorrectAnswerIds ¶
CorrectAnswerIds id
func (*Dao) CountBindItem ¶
CountBindItem cnt
func (*Dao) DelAnswerCache ¶
DelAnswerCache del cache
func (*Dao) DelQusBank ¶
DelQusBank del
func (*Dao) DelQusBankCache ¶
DelQusBankCache del cache
func (*Dao) DelQusCache ¶
DelQusCache del cache
func (*Dao) DelTargetItemBindCache ¶
DelTargetItemBindCache del cache
func (*Dao) GetAllPicIds ¶
GetAllPicIds ids
func (*Dao) GetAnswerList ¶
GetAnswerList list
func (*Dao) GetAnsweredID ¶
GetAnsweredID 获取已回答问题
func (*Dao) GetAnswersByCache ¶
GetAnswersByCache cache
func (*Dao) GetBankBind ¶
func (d *Dao) GetBankBind(c context.Context, source, targetItemType int8, targetItem []string, withDeleted bool) (list []*model.QuestionBankBind, err error)
GetBankBind 查询绑定关系
func (*Dao) GetBankInfoByQBid ¶
func (d *Dao) GetBankInfoByQBid(c context.Context, qbID map[int64]int64) (res []*model.QusBankSt, err error)
GetBankInfoByQBid byids
func (*Dao) GetBankQuestionsCache ¶
GetBankQuestionsCache 从缓存获取题库下的全部问题
func (*Dao) GetBindBank ¶
func (d *Dao) GetBindBank(c context.Context, source, targetItemType int8, targetItem []string) (binds []*model.QuestionBankBind, err error)
GetBindBank 获取已绑定的题库信息
func (*Dao) GetBindBankInfo ¶
func (d *Dao) GetBindBankInfo(c context.Context, source, targetItemType int8, targetItem string) (bind *model.QuestionBankBind, err error)
GetBindBankInfo get
func (*Dao) GetBindItem ¶
func (d *Dao) GetBindItem(c context.Context, bankID int64, page, pageSize int) (list []*model.QuestionBankBind, total int64, err error)
GetBindItem itm
func (*Dao) GetCacheAnswerPic ¶
func (d *Dao) GetCacheAnswerPic(c context.Context, args *model.ArgGetQuestion) (oi *model.QuestBkPic, err error)
GetCacheAnswerPic get
func (*Dao) GetCacheQus ¶
GetCacheQus get
func (*Dao) GetComponentID ¶
GetComponentID 获取组件id
func (*Dao) GetComponentTimes ¶
func (d *Dao) GetComponentTimes(c context.Context, args *model.ArgGetQuestion) (cID int64, err error)
GetComponentTimes 获取组件答题次数
func (*Dao) GetPicCount ¶
GetPicCount cnt
func (*Dao) GetQusBankCount ¶
GetQusBankCount cnt
func (*Dao) GetQusBankInfo ¶
GetQusBankInfo info
func (*Dao) GetQusBankInfoCache ¶
func (d *Dao) GetQusBankInfoCache(c context.Context, qbid int64) (oi *model.QuestionBank, err error)
GetQusBankInfoCache get
func (*Dao) GetQusBankList ¶
func (d *Dao) GetQusBankList(c context.Context, cnt int, ids []int64) (res []*model.QuestionBank, err error)
GetQusBankList list
func (*Dao) GetQusBankListByIds ¶
func (d *Dao) GetQusBankListByIds(c context.Context, ids []int64) (res []*model.QuestionBank, err error)
GetQusBankListByIds ids
func (*Dao) GetQusCount ¶
GetQusCount cnt
func (*Dao) GetQusInfo ¶
GetQusInfo info
func (*Dao) GetQusKey ¶
func (d *Dao) GetQusKey(format string, args *model.ArgGetQuestion) (s string)
GetQusKey getkey
func (*Dao) GetQusList ¶
func (d *Dao) GetQusList(c context.Context, offset int, limitnum int, qBid int64) (res []*model.Question, err error)
GetQusList list
func (*Dao) GetRandPic ¶
func (d *Dao) GetRandPic(c context.Context, args *model.ArgGetQuestion) (oi *model.QuestBkPic, err error)
GetRandPic 背景图
func (*Dao) GetRandomPic ¶
GetRandomPic get
func (*Dao) GetUserQuestionCache ¶
GetUserQuestionCache get
func (*Dao) IncrComponentTimes ¶
IncrComponentTimes 组件计数
func (*Dao) IncrGeetestCount ¶
IncrGeetestCount 统计一小时内极验的请求数
func (*Dao) InserAnwser ¶
InserAnwser add
func (*Dao) InsertQusBank ¶
InsertQusBank add
func (*Dao) MultiAddAnwser ¶
MultiAddAnwser add
func (*Dao) PayShield ¶
func (d *Dao) PayShield(c context.Context, data *model.ShieldData)
PayShield 支付风控
func (*Dao) PushAllPic ¶
PushAllPic 事先放入redis list中
func (*Dao) PushAnswer ¶
func (d *Dao) PushAnswer(c context.Context, answer *model.ArgCheckAnswer, isCorrect int8) (affect int64, err error)
PushAnswer push
func (*Dao) QuestionBankUnbind ¶
func (d *Dao) QuestionBankUnbind(c context.Context, delIds []int64, targetType int8, source int8) (err error)
QuestionBankUnbind 解绑
func (*Dao) QusFetchTime ¶
QusFetchTime 上次题目拉取时间
func (*Dao) RedisDo ¶
func (d *Dao) RedisDo(c context.Context, cmd string, args ...interface{}) (reply interface{}, err error)
RedisDo redis cmd
func (*Dao) RmAnsweredID ¶
RmAnsweredID 删除已回答问题
func (*Dao) SetAnsweredID ¶
func (d *Dao) SetAnsweredID(c context.Context, args *model.ArgGetQuestion, questionID int64) (err error)
SetAnsweredID 设置已回答问题
func (*Dao) SetBankQuestionsCache ¶
SetBankQuestionsCache 将题库下的全部问题存入缓存
func (*Dao) SetComponentID ¶
SetComponentID 设置组件id
func (*Dao) SetComponentTimes ¶
SetComponentTimes 设置组件答题次数
func (*Dao) SetQusFetchTime ¶
SetQusFetchTime 设置上次题目拉取时间
func (*Dao) SetexRedisKey ¶
SetexRedisKey 设置redis key
func (*Dao) ShieldIPDetail ¶
func (d *Dao) ShieldIPDetail(c context.Context, ip, stime, etime string) (res []*model.ListDetail, err error)
ShieldIPDetail .
func (*Dao) ShieldIPList ¶
ShieldIPList .
func (*Dao) ShieldUIDDetail ¶
func (d *Dao) ShieldUIDDetail(c context.Context, uid, stime, etime string) (res []*model.ListDetail, err error)
ShieldUIDDetail .
func (*Dao) ShieldUIDList ¶
func (d *Dao) ShieldUIDList(c context.Context, mtime string) (res []*model.UIDListDetail, err error)
ShieldUIDList .
func (*Dao) StatisticsQusBank ¶
func (d *Dao) StatisticsQusBank(c context.Context, offset int, limitnum int, name string) (res []*model.QusBankSt, err error)
StatisticsQusBank 统计bank
func (*Dao) UpdateAnwser ¶
UpdateAnwser upd
func (*Dao) UpdateQsBankCnt ¶
UpdateQsBankCnt 更新数量
func (*Dao) UpdateQus ¶
func (d *Dao) UpdateQus(c context.Context, update *model.ArgUpdateQus, answers []model.Answer) (affect int64, err error)
UpdateQus update