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: 27 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 event dao def.

func New

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

New create instance of dao and return.

func (*Dao) AddQs

func (d *Dao) AddQs(c context.Context, qs *model.LabourQs) (err error)

AddQs add labour question log.

func (*Dao) BeFormal

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

BeFormal become a full member

func (*Dao) Board

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

Board init draw board.

func (*Dao) ByID

func (d *Dao) ByID(c context.Context, id int64) (que *model.LabourQs, err error)

ByID get question by id.

func (*Dao) Close

func (d *Dao) Close()

Close close all db connections.

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 [2]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) Ping

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

Ping check db health.

func (*Dao) QidsExtraByState

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

QidsExtraByState get extra question ids by check

func (*Dao) QueConf

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

QueConf question img conf.

func (*Dao) UpdateQs

func (d *Dao) UpdateQs(c context.Context, que *model.LabourQs) (err error)

UpdateQs update question.

func (*Dao) UpdateState

func (d *Dao) UpdateState(c context.Context, que *model.LabourQs) (err error)

UpdateState update state.

func (*Dao) Upload

func (d *Dao) Upload(c context.Context, fileType string, filename string, body io.Reader) (location string, err error)

Upload upload bfs.

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