Documentation ¶
Index ¶
- type Dao
- func (d *Dao) AddHistory(c context.Context, mid int64, his *model.AnswerHistory) (affected int64, hid string, err error)
- func (d *Dao) AddPendantHistory(c context.Context, mid, hid int64) (affected int64, err error)
- func (d *Dao) ByIds(c context.Context, ids []int64) (res map[int64]*model.Question, err error)
- func (d *Dao) Captcha(c context.Context) (string, string, error)
- func (d *Dao) CheckBlockCache(c context.Context, mid int64) (exist bool, err error)
- func (d *Dao) Close()
- func (d *Dao) DelExpireCache(c context.Context, mid int64) (err error)
- func (d *Dao) DelExtraQidsCache(c context.Context, ans int8) (err error)
- func (d *Dao) DelHistoryCache(c context.Context, mid int64) (err error)
- func (d *Dao) DelIdsCache(c context.Context, mid int64, t int8) (err error)
- func (d *Dao) DelQidsCache(c context.Context, typeID int) (err error)
- func (d *Dao) ExpireCache(c context.Context, mid int64) (at *model.AnswerTime, err error)
- func (d *Dao) ExtraByIds(c context.Context, ids []int64) (res map[int64]*model.ExtraQst, err error)
- func (d *Dao) ExtraQidByType(c context.Context, ans int8, num uint8) (ids []int64, err error)
- func (d *Dao) HidCache(c context.Context, hid int64) (ah *model.AnswerHistory, err error)
- func (d *Dao) History(c context.Context, mid int64) (res *model.AnswerHistory, err error)
- func (d *Dao) HistoryByHid(c context.Context, hid int64) (res *model.AnswerHistory, err error)
- func (d *Dao) HistoryCache(c context.Context, mid int64) (ah *model.AnswerHistory, err error)
- func (d *Dao) IdsCache(c context.Context, mid int64, t int8) (ids []int64, err error)
- func (d *Dao) OldHistory(c context.Context, hid, idx int64) (res *model.AnswerHistory, err error)
- func (d *Dao) PendantHistory(c context.Context, mid int64) (hid int64, status int8, err error)
- func (d *Dao) PubExtraRet(c context.Context, mid int64, msg interface{}) (err error)
- func (d *Dao) QidByType(c context.Context, tid int, num uint8) (ids []int64, err error)
- func (d *Dao) QidsByState(c context.Context, state int8) (res []*model.Question, err error)
- func (d *Dao) QidsExtraByState(c context.Context, size int) (res []*model.ExtraQst, err error)
- func (d *Dao) SetBlockCache(c context.Context, mid int64) (err error)
- func (d *Dao) SetExpireCache(c context.Context, mid int64, at *model.AnswerTime) (err error)
- func (d *Dao) SetExtraQids(c context.Context, qs []int64, ans int8) (err error)
- func (d *Dao) SetHidCache(c context.Context, ah *model.AnswerHistory) (err error)
- func (d *Dao) SetHistory(c context.Context, mid int64, his *model.AnswerHistory) (affected int64, err error)
- func (d *Dao) SetHistoryCache(c context.Context, mid int64, ah *model.AnswerHistory) (err error)
- func (d *Dao) SetIdsCache(c context.Context, mid int64, ids []int64, t int8) (err error)
- func (d *Dao) SetQids(c context.Context, qs []int64, typeID int) (err error)
- func (d *Dao) SharingIndexByHid(c context.Context, hid int64) (res int64, err error)
- func (d *Dao) Types(c context.Context) (res []*model.TypeInfo, err error)
- func (d *Dao) UpPendantHistory(c context.Context, mid, hid int64) (ret int64, err error)
- func (d *Dao) UpdateCaptcha(c context.Context, id int64, mid int64, isPassCaptcha int8) (ret int64, err error)
- func (d *Dao) UpdateExtraRet(c context.Context, id int64, mid int64, t int64, extraScore int64) (ret int64, err error)
- func (d *Dao) UpdateExtraStartTime(c context.Context, id int64, mid int64, t time.Time) (ret int64, err error)
- func (d *Dao) UpdateLevel(c context.Context, id int64, mid int64, isFirstPass, passedLevel int8) (ret int64, err error)
- func (d *Dao) UpdateStepTwoTime(c context.Context, id int64, mid int64, t time.Time) (ret int64, err error)
- func (d *Dao) Verify(c context.Context, token, code, ip string) 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 struct answer history of Dao
func (*Dao) AddHistory ¶
func (d *Dao) AddHistory(c context.Context, mid int64, his *model.AnswerHistory) (affected int64, hid string, err error)
AddHistory add user's answer history by id.
func (*Dao) AddPendantHistory ¶
AddPendantHistory .
func (*Dao) CheckBlockCache ¶
CheckBlockCache check user's block.
func (*Dao) DelExpireCache ¶
DelExpireCache delete user's answer stime and base answer error times cache.
func (*Dao) DelExtraQidsCache ¶
DelExtraQidsCache del extra qids cahce.
func (*Dao) DelHistoryCache ¶
DelHistoryCache delete user's answer history cache
func (*Dao) DelIdsCache ¶
DelIdsCache delete user's base question ids
func (*Dao) DelQidsCache ¶
DelQidsCache del qids cahce.
func (*Dao) ExpireCache ¶
ExpireCache get user's answer stime and base answer error times cache.
func (*Dao) ExtraByIds ¶
ExtraByIds get extra question in idstr
func (*Dao) ExtraQidByType ¶
ExtraQidByType extra qis by type.
func (*Dao) HistoryByHid ¶
HistoryByHid get user's answer history by mid.
func (*Dao) HistoryCache ¶
HistoryCache get user's answer history cache
func (*Dao) OldHistory ¶
OldHistory get user's answer history by hid and sharing index.
func (*Dao) PendantHistory ¶
PendantHistory .
func (*Dao) PubExtraRet ¶
PubExtraRet pub extra msg into databus.
func (*Dao) QidsByState ¶
QidsByState get question ids by check
func (*Dao) QidsExtraByState ¶
QidsExtraByState get extra question ids by check
func (*Dao) SetBlockCache ¶
SetBlockCache set user's block.
func (*Dao) SetExpireCache ¶
SetExpireCache set user's answer stime and base answer error times cache.
func (*Dao) SetExtraQids ¶
SetExtraQids set extra question ids.
func (*Dao) SetHidCache ¶
SetHidCache set user's answer history cache
func (*Dao) SetHistory ¶
func (d *Dao) SetHistory(c context.Context, mid int64, his *model.AnswerHistory) (affected int64, err error)
SetHistory set user's answer history by id.
func (*Dao) SetHistoryCache ¶
SetHistoryCache set user's answer history cache
func (*Dao) SetIdsCache ¶
SetIdsCache set user's base question ids
func (*Dao) SharingIndexByHid ¶
SharingIndexByHid get old history sharingIndex by hid
func (*Dao) UpPendantHistory ¶
UpPendantHistory update pendant history.
func (*Dao) UpdateCaptcha ¶
func (d *Dao) UpdateCaptcha(c context.Context, id int64, mid int64, isPassCaptcha int8) (ret int64, err error)
UpdateCaptcha update answer history captcha.
func (*Dao) UpdateExtraRet ¶
func (d *Dao) UpdateExtraRet(c context.Context, id int64, mid int64, t int64, extraScore int64) (ret int64, err error)
UpdateExtraRet update extra start time.
func (*Dao) UpdateExtraStartTime ¶
func (d *Dao) UpdateExtraStartTime(c context.Context, id int64, mid int64, t time.Time) (ret int64, err error)
UpdateExtraStartTime update extra start time.
func (*Dao) UpdateLevel ¶
func (d *Dao) UpdateLevel(c context.Context, id int64, mid int64, isFirstPass, passedLevel int8) (ret int64, err error)
UpdateLevel update answer history passedLevel and isFirstPass.