service

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: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache struct {
	// contains filtered or unexported fields
}

Cache simple cache

func NewCache

func NewCache(d int64) *Cache

NewCache new cache

func (*Cache) Get

func (c *Cache) Get(key string) (val interface{})

Get ...

func (*Cache) Set

func (c *Cache) Set(key string, val interface{})

Set ...

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service struct

func New

func New(c *conf.Config) (s *Service)

New fn

func (*Service) AddAuthority

func (s *Service) AddAuthority(c context.Context, mids []int64) (int64, error)

AddAuthority .

func (*Service) Close

func (s *Service) Close()

Close dao

func (*Service) ExportScores

func (s *Service) ExportScores(ctx context.Context, arg *model.RatingListArg, date time.Time) (res []byte, err error)

ExportScores exports scores

func (*Service) GetLastRatingStatis

func (s *Service) GetLastRatingStatis(c context.Context, ctype int64, tagID string) (statis []*model.RatingStatis, date time.Time, err error)

GetLastRatingStatis get last rating statis

func (*Service) GetRatingStatis

func (s *Service) GetRatingStatis(c context.Context, ctype int64, tagID string, date time.Time) (statis []*model.RatingStatis, err error)

GetRatingStatis get rating statis

func (*Service) GetTrendAsc

func (s *Service) GetTrendAsc(c context.Context, ctype string, tags []int64, date time.Time, frl, fru int, mid int64, offset, limit int) (total int, ts []*model.Trend, err error)

GetTrendAsc get trend asc

func (*Service) GetTrendDesc

func (s *Service) GetTrendDesc(c context.Context, ctype string, tags []int64, date time.Time, frl, fru int, mid int64, offset, limit int) (total int, ts []*model.Trend, err error)

GetTrendDesc get trend desc

func (*Service) InsertParameter

func (s *Service) InsertParameter(c context.Context, name, remark string, value int) (err error)

InsertParameter insert parameter

func (*Service) Ping

func (s *Service) Ping(c context.Context) (err error)

Ping fn

func (*Service) RatingList

func (s *Service) RatingList(c context.Context, arg *model.RatingListArg, date time.Time) (res []*model.RatingInfo, total int64, err error)

RatingList returns rating info list

func (*Service) RemoveAuthority

func (s *Service) RemoveAuthority(c context.Context, mids []int64) (int64, error)

RemoveAuthority .

func (*Service) ScoreCurrent

func (s *Service) ScoreCurrent(c context.Context, mid int64) (res *model.ScoreCurrentResp, err error)

ScoreCurrent returns current rating info

func (*Service) ScoreHistory

func (s *Service) ScoreHistory(c context.Context, types []model.ScoreType, mid int64, queryAll bool, limit int) (res []*model.UpScoreHistory, err error)

ScoreHistory returns score history

func (*Service) StatisExport

func (s *Service) StatisExport(c context.Context, ctype int64, tagID string, Compare int) (res []byte, err error)

StatisExport export statis

func (*Service) StatisGraph

func (s *Service) StatisGraph(c context.Context, ctype int64, tagID string, Compare int) (data interface{}, err error)

StatisGraph get statistics graph data

func (*Service) StatisList

func (s *Service) StatisList(c context.Context, ctype int64, tagID string, Compare int) (list []*model.RatingStatis, err error)

StatisList get statistics list

Jump to

Keyboard shortcuts

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