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: 29 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 {
	DB        *gorm.DB
	DBArchive *gorm.DB
	// contains filtered or unexported fields
}

Dao dao.

func New

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

New new a dao and return.

func (*Dao) Archive

func (d *Dao) Archive(c context.Context, aid int64) (a *api.Arc, err error)

Archive get archive.

func (*Dao) Archives

func (d *Dao) Archives(c context.Context, aids []int64) (a map[int64]*api.Arc, err error)

Archives get archive list.

func (*Dao) ArchivesWithES

func (d *Dao) ArchivesWithES(c context.Context, aca *academy.EsParam) (res *academy.SearchResult, err error)

ArchivesWithES search archives by es.

func (*Dao) ArticleMetas

func (d *Dao) ArticleMetas(c context.Context, aids []int64) (res map[int64]*model.Meta, err error)

ArticleMetas batch get articles by aids.

func (*Dao) BindWithCategory

func (d *Dao) BindWithCategory(c context.Context, MaterialID, CategoryID, index int64) (id int64, err error)

BindWithCategory .

func (*Dao) CategoryByID

func (d *Dao) CategoryByID(c context.Context, id int64) (cate *material.Category, err error)

CategoryByID .

func (*Dao) Close

func (d *Dao) Close()

Close close connection of db , mc.

func (*Dao) MutliSendSysMsg

func (d *Dao) MutliSendSysMsg(c context.Context, allMids []int64, title string, context string) (err error)

MutliSendSysMsg Mutli send sys msg.

func (*Dao) Ping

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

Ping check connection of db , mc.

func (*Dao) ProfileStat

func (d *Dao) ProfileStat(c context.Context, mid int64) (res *accapi.ProfileStatReply, err error)

ProfileStat get account.

func (*Dao) SendSysMsg

func (d *Dao) SendSysMsg(c context.Context, mids []int64, title string, context string) (err error)

SendSysMsg send sys msg.

func (*Dao) Stats

func (d *Dao) Stats(c context.Context, aids []int64, ip string) (a map[int64]*api.Stat, err error)

Stats get archives stat.

func (*Dao) Upload

func (d *Dao) Upload(c context.Context, fileName string, fileType string, timing int64, data []byte, bfs *conf.Bfs) (location string, err error)

Upload upload picture or log file to bfs

Jump to

Keyboard shortcuts

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