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: 19 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 struct answer history of Dao

func New

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

New new a Dao and return.

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

func (d *Dao) AddPendantHistory(c context.Context, mid, hid int64) (affected int64, err error)

AddPendantHistory .

func (*Dao) ByIds

func (d *Dao) ByIds(c context.Context, ids []int64) (res map[int64]*model.Question, err error)

ByIds get question in idStr

func (*Dao) Captcha

func (d *Dao) Captcha(c context.Context) (string, string, error)

Captcha Captcha.

func (*Dao) CheckBlockCache

func (d *Dao) CheckBlockCache(c context.Context, mid int64) (exist bool, err error)

CheckBlockCache check user's block.

func (*Dao) Close

func (d *Dao) Close()

Close close connections of mc, redis, db.

func (*Dao) DelExpireCache

func (d *Dao) DelExpireCache(c context.Context, mid int64) (err error)

DelExpireCache delete user's answer stime and base answer error times cache.

func (*Dao) DelExtraQidsCache

func (d *Dao) DelExtraQidsCache(c context.Context, ans int8) (err error)

DelExtraQidsCache del extra qids cahce.

func (*Dao) DelHistoryCache

func (d *Dao) DelHistoryCache(c context.Context, mid int64) (err error)

DelHistoryCache delete user's answer history cache

func (*Dao) DelIdsCache

func (d *Dao) DelIdsCache(c context.Context, mid int64, t int8) (err error)

DelIdsCache delete user's base question ids

func (*Dao) DelQidsCache

func (d *Dao) DelQidsCache(c context.Context, typeID int) (err error)

DelQidsCache del qids cahce.

func (*Dao) ExpireCache

func (d *Dao) ExpireCache(c context.Context, mid int64) (at *model.AnswerTime, err error)

ExpireCache get user's answer stime and base answer error times cache.

func (*Dao) ExtraByIds

func (d *Dao) ExtraByIds(c context.Context, ids []int64) (res map[int64]*model.ExtraQst, err error)

ExtraByIds get extra question in idstr

func (*Dao) ExtraQidByType

func (d *Dao) ExtraQidByType(c context.Context, ans int8, num uint8) (ids []int64, err error)

ExtraQidByType extra qis by type.

func (*Dao) HidCache

func (d *Dao) HidCache(c context.Context, hid int64) (ah *model.AnswerHistory, err error)

HidCache get user's answer history cache

func (*Dao) History

func (d *Dao) History(c context.Context, mid int64) (res *model.AnswerHistory, err error)

History get user's answer history by mid.

func (*Dao) HistoryByHid

func (d *Dao) HistoryByHid(c context.Context, hid int64) (res *model.AnswerHistory, err error)

HistoryByHid get user's answer history by mid.

func (*Dao) HistoryCache

func (d *Dao) HistoryCache(c context.Context, mid int64) (ah *model.AnswerHistory, err error)

HistoryCache get user's answer history cache

func (*Dao) IdsCache

func (d *Dao) IdsCache(c context.Context, mid int64, t int8) (ids []int64, err error)

IdsCache get user's base question ids

func (*Dao) OldHistory

func (d *Dao) OldHistory(c context.Context, hid, idx int64) (res *model.AnswerHistory, err error)

OldHistory get user's answer history by hid and sharing index.

func (*Dao) PendantHistory

func (d *Dao) PendantHistory(c context.Context, mid int64) (hid int64, status int8, err error)

PendantHistory .

func (*Dao) PubExtraRet

func (d *Dao) PubExtraRet(c context.Context, mid int64, msg interface{}) (err error)

PubExtraRet pub extra msg into databus.

func (*Dao) QidByType

func (d *Dao) QidByType(c context.Context, tid int, num uint8) (ids []int64, err error)

QidByType get question by type.

func (*Dao) QidsByState

func (d *Dao) QidsByState(c context.Context, state int8) (res []*model.Question, err error)

QidsByState get question ids by check

func (*Dao) QidsExtraByState

func (d *Dao) QidsExtraByState(c context.Context, size int) (res []*model.ExtraQst, err error)

QidsExtraByState get extra question ids by check

func (*Dao) SetBlockCache

func (d *Dao) SetBlockCache(c context.Context, mid int64) (err error)

SetBlockCache set user's block.

func (*Dao) SetExpireCache

func (d *Dao) SetExpireCache(c context.Context, mid int64, at *model.AnswerTime) (err error)

SetExpireCache set user's answer stime and base answer error times cache.

func (*Dao) SetExtraQids

func (d *Dao) SetExtraQids(c context.Context, qs []int64, ans int8) (err error)

SetExtraQids set extra question ids.

func (*Dao) SetHidCache

func (d *Dao) SetHidCache(c context.Context, ah *model.AnswerHistory) (err error)

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

func (d *Dao) SetHistoryCache(c context.Context, mid int64, ah *model.AnswerHistory) (err error)

SetHistoryCache set user's answer history cache

func (*Dao) SetIdsCache

func (d *Dao) SetIdsCache(c context.Context, mid int64, ids []int64, t int8) (err error)

SetIdsCache set user's base question ids

func (*Dao) SetQids

func (d *Dao) SetQids(c context.Context, qs []int64, typeID int) (err error)

SetQids set question ids.

func (*Dao) SharingIndexByHid

func (d *Dao) SharingIndexByHid(c context.Context, hid int64) (res int64, err error)

SharingIndexByHid get old history sharingIndex by hid

func (*Dao) Types

func (d *Dao) Types(c context.Context) (res []*model.TypeInfo, err error)

Types get all types

func (*Dao) UpPendantHistory

func (d *Dao) UpPendantHistory(c context.Context, mid, hid int64) (ret int64, err error)

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.

func (*Dao) UpdateStepTwoTime

func (d *Dao) UpdateStepTwoTime(c context.Context, id int64, mid int64, t time.Time) (ret int64, err error)

UpdateStepTwoTime .

func (*Dao) Verify

func (d *Dao) Verify(c context.Context, token, code, ip string) error

Verify Verify.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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