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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	DB        *gorm.DB
	DBArchive *gorm.DB
	// contains filtered or unexported fields
}

Service str

func New

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

New fn

func (*Service) AddGiftReward

func (s *Service) AddGiftReward(v *task.GiftReward, rewardsIDs []int64) (rows int64, err error)

AddGiftReward for add gift rewards.

func (*Service) AddReward

func (s *Service) AddReward(v *task.Reward) (id int64, err error)

AddReward for add one reward.

func (*Service) AddSubtask

func (s *Service) AddSubtask(v *task.Task, rewardsIDs []int64) (id int64, err error)

AddSubtask for add sub task.

func (*Service) AddTaskGroup

func (s *Service) AddTaskGroup(v *task.TaskGroup, rewardsIDs []int64) (id int64, err error)

AddTaskGroup for add task group.

func (*Service) Archive

func (s *Service) Archive(c context.Context, aid int64) (res *api.Arc, err error)

Archive get one archive by rpc

func (*Service) Archives

func (s *Service) Archives(c context.Context, aids []int64) (res map[int64]*api.Arc, err error)

Archives get archives by rpc

func (*Service) ArchivesWithES

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

ArchivesWithES for es search

func (*Service) Articles

func (s *Service) Articles(c context.Context, aids []int64) (res map[int64]*model.Meta, err error)

Articles get articles by rpc

func (*Service) BatchOnline

func (s *Service) BatchOnline(tgs []*task.TaskGroup) (err error)

BatchOnline for subtask & grouptask with state,rank and so on.

func (*Service) BindWithCategory

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

BindWithCategory .

func (*Service) Cards

func (s *Service) Cards(c context.Context, wls []*whitelist.Whitelist) (wlsWithAcc []*whitelist.Whitelist, err error)

Cards fn

func (*Service) CategoryByID

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

CategoryByID .

func (*Service) Close

func (s *Service) Close()

Close dao

func (*Service) EditGiftReward

func (s *Service) EditGiftReward(v *task.GiftReward, rewardsIDs []int64) (rows int64, err error)

EditGiftReward for edit gift rewards.

func (*Service) EditReward

func (s *Service) EditReward(v *task.Reward) (id int64, err error)

EditReward for edit one reward.

func (*Service) EditSubtask

func (s *Service) EditSubtask(v *task.Task, rewardsIDs []int64) (id int64, err error)

EditSubtask for edit sub task.

func (*Service) EditTaskGroup

func (s *Service) EditTaskGroup(v *task.TaskGroup, rewardsIDs []int64) (id int64, err error)

EditTaskGroup for edit task group.

func (*Service) ListGiftReward

func (s *Service) ListGiftReward() (res []*task.GiftReward, err error)

ListGiftReward for get gift list.

func (*Service) OrderSubTask

func (s *Service) OrderSubTask(v *task.OrderTask) (err error)

OrderSubTask for order sub task.

func (*Service) OrderTaskGroup

func (s *Service) OrderTaskGroup(v *task.OrderTask) (err error)

OrderTaskGroup for order task group.

func (*Service) ParseFile

func (s *Service) ParseFile(c context.Context, content []byte) (file *bfs.FileInfo, err error)

ParseFile analyses file info

func (*Service) Ping

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

Ping fn

func (*Service) ProfileStat

func (s *Service) ProfileStat(c context.Context, mid int64) (pfl *accapi.ProfileStatReply, err error)

ProfileStat fn

func (*Service) RewardTree

func (s *Service) RewardTree() (res []*task.Reward)

RewardTree for reward tree.

func (*Service) SearchKeywords

func (s *Service) SearchKeywords() (res []interface{}, err error)

SearchKeywords for list search keywords.

func (*Service) SendAcademyLog

func (s *Service) SendAcademyLog(c *bm.Context, lp *academy.LogParam) (err error)

SendAcademyLog academy log to manager.

func (*Service) SendMusicLog

func (s *Service) SendMusicLog(c *bm.Context, clientType int, ap *music.LogParam) (err error)

SendMusicLog send to log archive music

func (*Service) SendNotify

func (s *Service) SendNotify(c *bm.Context, sendIds []int64, data map[int64]*music.SidNotify) (err error)

SendNotify .

func (*Service) SendTaskLog

func (s *Service) SendTaskLog(c *bm.Context, lp *task.LogParam) (err error)

SendTaskLog task log to manager.

func (*Service) Stats

func (s *Service) Stats(c context.Context, aids []int64, ip string) (res map[int64]*api.Stat, err error)

Stats get archives stat.

func (*Service) SubSearchKeywords

func (s *Service) SubSearchKeywords(vs []*academy.SearchKeywords) (err error)

SubSearchKeywords for add search keywords.

func (*Service) Task

func (s *Service) Task(id int64) (res *task.Task, err error)

Task for task.

func (*Service) TaskGroup

func (s *Service) TaskGroup(id int64) (res *task.TaskGroup, err error)

TaskGroup for task group.

func (*Service) TaskGroupRewards

func (s *Service) TaskGroupRewards(ids []int64) (res map[int64][]*task.TaskGroupReward, err error)

TaskGroupRewards for task group & rewards.

func (*Service) TaskList

func (s *Service) TaskList(ty int8) (res []*task.TaskGroup, err error)

TaskList for task list

func (*Service) TaskRewards

func (s *Service) TaskRewards(ids []int64) (res map[int64][]*task.TaskReward, err error)

TaskRewards for task & rewards.

func (*Service) TasksByGroupIDsMap

func (s *Service) TasksByGroupIDsMap(gids []int64) (res map[int64][]*task.Task, err error)

TasksByGroupIDsMap for task map

func (*Service) TransferSubtask

func (s *Service) TransferSubtask(id, gid int64) (err error)

TransferSubtask for transfer one sub task from some one group to another one.

func (*Service) UpGiftReward

func (s *Service) UpGiftReward(v *task.GiftReward) (rows int64, err error)

UpGiftReward for update gift reward.

func (*Service) UpStateGroup

func (s *Service) UpStateGroup(id int64, state int8) (err error)

UpStateGroup for update task group.

func (*Service) UpStateReward

func (s *Service) UpStateReward(id int64, state int8) (err error)

UpStateReward for update reward state.

func (*Service) UpStateSubTask

func (s *Service) UpStateSubTask(id int64, state int8) (err error)

UpStateSubTask for update sub task state.

func (*Service) Upload

func (s *Service) Upload(c context.Context, fileName string, fileType string, timing int64, body []byte) (location string, err error)

Upload to bfs

func (*Service) ViewGiftReward

func (s *Service) ViewGiftReward(v *task.GiftReward) (res *task.GiftReward, err error)

ViewGiftReward for view gift.

func (*Service) ViewReward

func (s *Service) ViewReward(id int64) (res *task.Reward, err error)

ViewReward for view one reward.

Jump to

Keyboard shortcuts

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