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: 22 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 info of Dao.

func New

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

New new a Dao and return.

func (*Dao) AllQS

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

AllQS .

func (*Dao) BaseQS

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

BaseQS .

func (*Dao) Board

func (d *Dao) Board(h int) (r *image.Gray)

Board init draw board.

func (*Dao) ByIDs

func (d *Dao) ByIDs(c context.Context, IDs []int64) (res []*model.QuestionDB, err error)

ByIDs by id.

func (*Dao) Close

func (d *Dao) Close()

Close close connections of mc, redis, db.

func (*Dao) Context

func (d *Dao) Context(r *image.Gray, fileStr string) (c *freetype.Context)

Context freetype init context.

func (*Dao) DrawAns

func (d *Dao) DrawAns(c *freetype.Context, conf *TextImgConf, anss [4]string, pt *fixed.Point26_6)

DrawAns draw ans

func (*Dao) DrawQue

func (d *Dao) DrawQue(c *freetype.Context, s string, conf *TextImgConf, pt *fixed.Point26_6)

DrawQue draw question title.

func (*Dao) Height

func (d *Dao) Height(c *TextImgConf, que string, anslen int) (h int)

Height get img height

func (*Dao) HistoryCount

func (d *Dao) HistoryCount(c context.Context, arg *model.ArgHistory) (res int64, err error)

HistoryCount .

func (*Dao) HistoryES

func (d *Dao) HistoryES(c context.Context, arg *model.ArgHistory) (reply []*model.AnswerHistoryDB, err error)

HistoryES search archives by es.

func (*Dao) IDsByState

func (d *Dao) IDsByState(c context.Context) (res []int64, err error)

IDsByState by id.

func (*Dao) InsBaseQs

func (d *Dao) InsBaseQs(c context.Context, qs *model.QuestionDB) (lastID int64, err error)

InsBaseQs .

func (*Dao) QueByID

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

QueByID by id.

func (*Dao) QueConf

func (d *Dao) QueConf(mobile bool) (c *TextImgConf)

QueConf question img conf.

func (*Dao) QueHistory

func (d *Dao) QueHistory(c context.Context, arg *model.ArgHistory) (res []*model.AnswerHistoryDB, err error)

QueHistory .

func (*Dao) QuestionAdd

func (d *Dao) QuestionAdd(c context.Context, q *model.QuestionDB) (aff int64, err error)

QuestionAdd add register question.

func (*Dao) QuestionCount

func (d *Dao) QuestionCount(c context.Context, arg *model.ArgQue) (res int64, err error)

QuestionCount question page total count.

func (*Dao) QuestionEdit

func (d *Dao) QuestionEdit(c context.Context, arg *model.QuestionDB) (aff int64, err error)

QuestionEdit edit register question.

func (*Dao) QuestionList

func (d *Dao) QuestionList(c context.Context, arg *model.ArgQue) (res []*model.QuestionDB, err error)

QuestionList .

func (*Dao) SetQidCache

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

SetQidCache set question id into question set

func (*Dao) TypeSave

func (d *Dao) TypeSave(c context.Context, t *model.TypeInfo) (aff int64, err error)

TypeSave add register question type.

func (*Dao) Types

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

Types get all types.

func (*Dao) UpdateStatus

func (d *Dao) UpdateStatus(c context.Context, state int8, qid int64, operator string) (aff int64, err error)

UpdateStatus update question state.

type Page

type Page struct {
	Num   int64 `json:"num"`
	Size  int64 `json:"size"`
	Total int64 `json:"total"`
}

Page search page info

type SearchSubjectLog

type SearchSubjectLog struct {
	Page   *Page
	Result []*struct {
		MID       int64  `json:"mid"`
		Business  string `json:"business"`
		Action    string `json:"action"`
		ExtraData string `json:"extra_data"`
		Ctime     string `json:"ctime"`
	}
}

SearchSubjectLog get subject logs

type TextImgConf

type TextImgConf struct {
	Fontsize    int
	Length      int
	Ansfontsize int
	Spacing     float64
	Ansspacing  float64
}

TextImgConf text img conf.

Jump to

Keyboard shortcuts

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