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: 34 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 {
	ItemSalesMax   map[string]int
	ItemSalesMin   map[string]int
	ItemWishMax    map[string]int
	ItemWishMin    map[string]int
	ItemCommentMax map[string]int
	ItemCommentMin map[string]int
	// contains filtered or unexported fields
}

Dao dao

func New

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

New init mysql db

func (*Dao) Close

func (d *Dao) Close()

Close close the resource.

func (*Dao) CommentCount

func (d *Dao) CommentCount(c context.Context, item *model.Item) (commentCount int, err error)

CommentCount ...

func (*Dao) Context

func (d *Dao) Context(r *image.NRGBA64) (c *freetype.Context)

Context make object for write letters

func (*Dao) CreateIndex

func (d *Dao) CreateIndex(ctx context.Context, name string, mapping string) bool

CreateIndex ...

func (*Dao) CreateItemPNG

func (d *Dao) CreateItemPNG(item model.Item) (location string, err error)

CreateItemPNG make a pic

func (*Dao) DelSug

func (d *Dao) DelSug(c context.Context, seasonID string) (b bool, err error)

DelSug ...

func (*Dao) DelSugItem

func (d *Dao) DelSugItem(c context.Context, seasonID, itemsID int64) (b bool, err error)

DelSugItem ...

func (*Dao) FetchItem

func (d *Dao) FetchItem(c context.Context) (itemList []*model.Item, err error)

FetchItem query project list from mysql

func (*Dao) GetBind

func (d *Dao) GetBind(c context.Context) (sugList []*model.Sug, err error)

GetBind select sug from db

func (*Dao) GetItem

func (d *Dao) GetItem(c context.Context, sug *model.Sug) (err error)

GetItem get item info

func (*Dao) Index

func (d *Dao) Index(ctx context.Context, index, typ string, id string, data interface{})

Index ...

func (*Dao) IndexExists

func (d *Dao) IndexExists(ctx context.Context, index string) bool

IndexExists ...

func (*Dao) InsertMatch

func (d *Dao) InsertMatch(c context.Context, item *model.Item, season model.Score) (affect int64, err error)

InsertMatch ...

func (*Dao) Ping

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

Ping dao ping

func (*Dao) SalesCount

func (d *Dao) SalesCount(c context.Context, item *model.Item) (salesCount int, err error)

SalesCount ...

func (*Dao) SeasonData

func (d *Dao) SeasonData(c context.Context, item *model.Item) (scoreSlice []model.Score, err error)

SeasonData

func (*Dao) SetItem

func (d *Dao) SetItem(c context.Context, item *model.Item) (b bool, err error)

SetItem set item info to redis

func (*Dao) SetSug

func (d *Dao) SetSug(c context.Context, seasonID string, ItemID int64, score float64) (b bool, err error)

SetSug ...

func (*Dao) Text

func (d *Dao) Text(c *freetype.Context, s string, pt *fixed.Point26_6, size int, color image.Image, length fixed.Int26_6) (err error)

Text write letters

func (*Dao) UpdatePic

func (d *Dao) UpdatePic(c context.Context, sug *model.Sug) (affect int64, err error)

UpdatePic ...

func (*Dao) Upload

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

Upload upload bfs.

func (*Dao) WishCount

func (d *Dao) WishCount(c context.Context, item *model.Item) (wishCount int, err error)

WishCount ...

Jump to

Keyboard shortcuts

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