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: 20 Imported by: 0

Documentation

Index

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 New

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

New new a Dao and return.

func (*Dao) AddBankBind

func (d *Dao) AddBankBind(c context.Context, update []model.ArgQuestionBankBind, insert []model.ArgQuestionBankBind) (err error)

AddBankBind add

func (*Dao) AddPayData

func (d *Dao) AddPayData(data *model.ShieldData)

AddPayData .

func (*Dao) AddUserAnwser

func (d *Dao) AddUserAnwser(c context.Context, answer *model.ArgCheckAnswer, isCorrect int8) (affect int64, err error)

AddUserAnwser add

func (*Dao) BankSearch

func (d *Dao) BankSearch(c context.Context, name string) (res []*model.QuestionBank, err error)

BankSearch search

func (*Dao) BeginTran

func (d *Dao) BeginTran(c context.Context) (*sql.Tx, error)

BeginTran begin mysql transaction

func (*Dao) CheckAnswer

func (d *Dao) CheckAnswer(c context.Context, qsid int64, ids []int64) (total int, err error)

CheckAnswer check

func (*Dao) CheckBlack

func (d *Dao) CheckBlack(c context.Context, customerId, mid int64, clientIP string) (err error)

CheckBlack 检测黑名单

func (*Dao) CheckGeetestCount

func (d *Dao) CheckGeetestCount(c context.Context) (err error)

CheckGeetestCount 检查极验总数是否达到上限

func (*Dao) CheckIPChange

func (d *Dao) CheckIPChange(c context.Context, mid int64, ip string, changeTime int64) (err error)

CheckIPChange 检查用户ip变更

func (*Dao) CheckLimitNum

func (d *Dao) CheckLimitNum(c context.Context, key string, num int64, pastTime int64) (err error)

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

func (d *Dao) Close()

Close close connections.

func (*Dao) CorrectAnswerIds

func (d *Dao) CorrectAnswerIds(c context.Context, qid int64) (ids []int64, err error)

CorrectAnswerIds id

func (*Dao) CountBindItem

func (d *Dao) CountBindItem(c context.Context, bankID int64) (count int64, err error)

CountBindItem cnt

func (*Dao) CoverStr

func (d *Dao) CoverStr(strs map[int64]int64) string

CoverStr str

func (*Dao) DelAnswerCache

func (d *Dao) DelAnswerCache(c context.Context, id int64) (err error)

DelAnswerCache del cache

func (*Dao) DelAnwser

func (d *Dao) DelAnwser(c context.Context, qusID int64) (affect int64, err error)

DelAnwser del

func (*Dao) DelQus

func (d *Dao) DelQus(c context.Context, qid int64) (affect int64, err error)

DelQus del

func (*Dao) DelQusBank

func (d *Dao) DelQusBank(c context.Context, qbID int64, status int8) (affect int64, err error)

DelQusBank del

func (*Dao) DelQusBankCache

func (d *Dao) DelQusBankCache(c context.Context, id int64) (err error)

DelQusBankCache del cache

func (*Dao) DelQusCache

func (d *Dao) DelQusCache(c context.Context, id int64) (err error)

DelQusCache del cache

func (*Dao) DelTargetItemBindCache

func (d *Dao) DelTargetItemBindCache(c context.Context, skuID string) (err error)

DelTargetItemBindCache del cache

func (*Dao) GetAllPicIds

func (d *Dao) GetAllPicIds(c context.Context, offset int, limitnum int) (ids []int, err error)

GetAllPicIds ids

func (*Dao) GetAnswerList

func (d *Dao) GetAnswerList(c context.Context, qusID int64) (res []*model.Answer, err error)

GetAnswerList list

func (*Dao) GetAnsweredID

func (d *Dao) GetAnsweredID(c context.Context, args *model.ArgGetQuestion) (ids []int64)

GetAnsweredID 获取已回答问题

func (*Dao) GetAnswersByCache

func (d *Dao) GetAnswersByCache(c context.Context, id int64) (oi []*model.Answer, err error)

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

func (d *Dao) GetBankQuestionsCache(c context.Context, bankID int64) (ids []int64)

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

func (d *Dao) GetCacheQus(c context.Context, id int64) (oi *model.Question, err error)

GetCacheQus get

func (*Dao) GetComponentID

func (d *Dao) GetComponentID(c context.Context, args *model.ArgGetQuestion) (cID int, err error)

GetComponentID 获取组件id

func (*Dao) GetComponentTimes

func (d *Dao) GetComponentTimes(c context.Context, args *model.ArgGetQuestion) (cID int64, err error)

GetComponentTimes 获取组件答题次数

func (*Dao) GetObj

func (d *Dao) GetObj(c context.Context, key string, obj interface{}) (err error)

GetObj get

func (*Dao) GetPic

func (d *Dao) GetPic(c context.Context, id int) (oi *model.QuestBkPic, err error)

GetPic 获取背景图

func (*Dao) GetPicCount

func (d *Dao) GetPicCount(c context.Context) (total int, err error)

GetPicCount cnt

func (*Dao) GetQBId

func (d *Dao) GetQBId(c context.Context, id int64) (qbID int64, err error)

GetQBId id

func (*Dao) GetQusBankCount

func (d *Dao) GetQusBankCount(c context.Context, name string) (total int64, err error)

GetQusBankCount cnt

func (*Dao) GetQusBankInfo

func (d *Dao) GetQusBankInfo(c context.Context, qbid int64) (oi *model.QuestionBank, err error)

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

func (d *Dao) GetQusCount(c context.Context, bid int64) (total int64, err error)

GetQusCount cnt

func (*Dao) GetQusIds

func (d *Dao) GetQusIds(c context.Context, bankID int64) (ids []int64, err error)

GetQusIds ids

func (*Dao) GetQusInfo

func (d *Dao) GetQusInfo(c context.Context, qid int64) (oi *model.Question, err error)

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

func (d *Dao) GetRandomPic(c context.Context, id int) (oi *model.QuestBkPic, err error)

GetRandomPic get

func (*Dao) GetUserQuestionCache

func (d *Dao) GetUserQuestionCache(c context.Context, args *model.ArgGetQuestion, bankID int64)

GetUserQuestionCache get

func (*Dao) IncrComponentTimes

func (d *Dao) IncrComponentTimes(c context.Context, args *model.ArgGetQuestion) (err error)

IncrComponentTimes 组件计数

func (*Dao) IncrGeetestCount

func (d *Dao) IncrGeetestCount(c context.Context)

IncrGeetestCount 统计一小时内极验的请求数

func (*Dao) InserAnwser

func (d *Dao) InserAnwser(c context.Context, answer *model.AnswerAdd) (affect int64, err error)

InserAnwser add

func (*Dao) InsertQus

func (d *Dao) InsertQus(c context.Context, oi *model.Question) (lastID int64, err error)

InsertQus add

func (*Dao) InsertQusBank

func (d *Dao) InsertQusBank(c context.Context, oi *model.QuestionBank) (lastID int64, err error)

InsertQusBank add

func (*Dao) MultiAddAnwser

func (d *Dao) MultiAddAnwser(c context.Context, answers []*model.AnswerAdd) (err error)

MultiAddAnwser add

func (*Dao) PayShield

func (d *Dao) PayShield(c context.Context, data *model.ShieldData)

PayShield 支付风控

func (*Dao) Ping

func (d *Dao) Ping(c context.Context) (err error)

Ping ping health.

func (*Dao) PingRedis

func (d *Dao) PingRedis(c context.Context) (err error)

PingRedis check redis connection

func (*Dao) PopAnswer

func (d *Dao) PopAnswer(c context.Context)

PopAnswer pop

func (*Dao) PushAllPic

func (d *Dao) PushAllPic(c context.Context) (err error)

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

func (d *Dao) QusFetchTime(c context.Context, args *model.ArgGetQuestion) (ts int64)

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

func (d *Dao) RmAnsweredID(c context.Context, args *model.ArgGetQuestion) (err error)

RmAnsweredID 删除已回答问题

func (*Dao) SetAnsweredID

func (d *Dao) SetAnsweredID(c context.Context, args *model.ArgGetQuestion, questionID int64) (err error)

SetAnsweredID 设置已回答问题

func (*Dao) SetBankQuestionsCache

func (d *Dao) SetBankQuestionsCache(c context.Context, bankID int64, ids []int64) (err error)

SetBankQuestionsCache 将题库下的全部问题存入缓存

func (*Dao) SetComponentID

func (d *Dao) SetComponentID(c context.Context, args *model.ArgGetQuestion) (err error)

SetComponentID 设置组件id

func (*Dao) SetComponentTimes

func (d *Dao) SetComponentTimes(c context.Context, args *model.ArgGetQuestion) (err error)

SetComponentTimes 设置组件答题次数

func (*Dao) SetObj

func (d *Dao) SetObj(c context.Context, key string, obj interface{}, exp time.Duration) error

SetObj set

func (*Dao) SetQusFetchTime

func (d *Dao) SetQusFetchTime(c context.Context, args *model.ArgGetQuestion, ts int64) (err error)

SetQusFetchTime 设置上次题目拉取时间

func (*Dao) Setex

func (d *Dao) Setex(c context.Context, key string, data interface{}, exp time.Duration) error

Setex set

func (*Dao) SetexRedisKey

func (d *Dao) SetexRedisKey(c context.Context, key string, timeout int64)

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

func (d *Dao) ShieldIPList(c context.Context, mtime string) (res []*model.IPListDetail, err error)

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

func (d *Dao) SyncPayShield(c context.Context)

SyncPayShield .

func (*Dao) UpdateAnwser

func (d *Dao) UpdateAnwser(c context.Context, answer *model.AnswerAdd) (affect int64, err error)

UpdateAnwser upd

func (*Dao) UpdateQsBankCnt

func (d *Dao) UpdateQsBankCnt(c context.Context, qid int64) (effid int64, err error)

UpdateQsBankCnt 更新数量

func (*Dao) UpdateQus

func (d *Dao) UpdateQus(c context.Context, update *model.ArgUpdateQus, answers []model.Answer) (affect int64, err error)

UpdateQus update

func (*Dao) UpdateQusBank

func (d *Dao) UpdateQusBank(c context.Context, qbID int64, name string, trytime int64, cdtime int64) (affect int64, err error)

UpdateQusBank update

func (*Dao) Voucher

func (d *Dao) Voucher(c context.Context, mid int64, ip string, itemID, customer, voucherType int64) (voucher string)

Voucher 凭证

Jump to

Keyboard shortcuts

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