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 ReplyAdminLog

type ReplyAdminLog struct {
	model.AdminLog
	AdminName string `json:"admin_name"`
}

ReplyAdminLog ReplyAdminLog

type Service

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

Service is a service.

func New

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

New new a service and return.

func (*Service) ActionCount

func (s *Service) ActionCount(c context.Context, rpID, oid, adminID int64, typ int32) (like, hate int32, err error)

ActionCount return action exact count.

func (*Service) AddBusiness

func (s *Service) AddBusiness(c context.Context, tp int32, name, appkey, remark, alias string) (id int64, err error)

AddBusiness add a business

func (*Service) AddReplyConfig

func (s *Service) AddReplyConfig(c context.Context, m *model.Config) (id int64, err error)

AddReplyConfig create a new administrator configuration for reply business

func (*Service) AddTop

func (s *Service) AddTop(c context.Context, adid int64, adName string, oid, rpID int64, typ int32, act uint32) (err error)

AddTop add a top reply.

func (*Service) AdminDeleteReply

func (s *Service) AdminDeleteReply(c context.Context, adminID int64, oids, rpIDs []int64, ftime int64, typ int32, moral int32, notify bool, adminName, remark string, reason, freason int32) (err error)

AdminDeleteReply delete reply by admin.

func (*Service) AdminEditReply

func (s *Service) AdminEditReply(c context.Context, adminID int64, adName string, oid, rpID int64, tp int32, msg, remark string) (err error)

AdminEditReply edit reply content by admin.

func (*Service) AdminPassReply

func (s *Service) AdminPassReply(c context.Context, adid int64, adName string, oids, rpIDs []int64, typ int32, remark string) (err error)

AdminPassReply recover reply by admin.

func (*Service) AdminRecoverReply

func (s *Service) AdminRecoverReply(c context.Context, adminID int64, adName string, oid, rpID int64, typ int32, remark string) (err error)

AdminRecoverReply recover reply by admin.

func (*Service) CallbackDeleteReply

func (s *Service) CallbackDeleteReply(ctx context.Context, adminID int64, oid, rpID int64, ftime int64, typ int32, moral int32, adminName, remark string, reason, freason int32) (err error)

CallbackDeleteReply delete reply by admin.

func (*Service) CreateEmoji

func (s *Service) CreateEmoji(c context.Context, pid int64, name string, url string, sort int32, state int32, remark string) (id int64, err error)

CreateEmoji CreateEmoji

func (*Service) CreateEmojiPackage

func (s *Service) CreateEmojiPackage(c context.Context, name string, url string, sort int32, remark string, state int32) (id int64, err error)

CreateEmojiPackage CreateEmojiPackage

func (*Service) CreateNotice

func (s *Service) CreateNotice(c context.Context, nt *model.Notice) (lastID int64, err error)

CreateNotice CreateNotice

func (*Service) DeleteNotice

func (s *Service) DeleteNotice(c context.Context, id uint32) (err error)

DeleteNotice DeleteNotice

func (*Service) EmojiByName

func (s *Service) EmojiByName(c context.Context, name string) (err error)

EmojiByName EmojiByName

func (*Service) EmojiList

func (s *Service) EmojiList(c context.Context, pid int64) (emojis []*model.Emoji, err error)

EmojiList EmojiList

func (*Service) EmojiPackageList

func (s *Service) EmojiPackageList(c context.Context) (resp []*model.EmojiPackage, err error)

EmojiPackageList return all emojipackages and emojis

func (*Service) ExportReply

func (s *Service) ExportReply(c context.Context, oid, mid int64, tp int8, state string, startTime, endTime time.Time) (data [][]string, err error)

ExportReply get exported replies by query

func (*Service) FoldReplies

func (s *Service) FoldReplies(ctx context.Context, oids, tps, rpIDs []int64) (err error)

FoldReplies ...

func (*Service) FreezeSub

func (s *Service) FreezeSub(c context.Context, adid int64, adName string, oids []int64, typ int32, freeze int32, remark string) (fails map[int64]string, err error)

FreezeSub freeze or unfreeze subject

func (*Service) GetBusiness

func (s *Service) GetBusiness(c context.Context, tp int32) (business *model.Business, err error)

GetBusiness return a business by type

func (*Service) GetNotice

func (s *Service) GetNotice(c context.Context, id uint32) (nt *model.Notice, err error)

GetNotice GetNotice

func (*Service) ListBusiness

func (s *Service) ListBusiness(c context.Context, state int32) (business []*model.Business, err error)

ListBusiness return all business

func (*Service) ListNotice

func (s *Service) ListNotice(c context.Context, page, pageSize int64) (nts []*model.Notice, total int64, err error)

ListNotice ListNotice

func (*Service) LoadReplyConfig

func (s *Service) LoadReplyConfig(c context.Context, typ, category int32, oid int64) (m *model.Config, err error)

LoadReplyConfig load a configuration record of reply business.

func (*Service) LogsByRpID

func (s *Service) LogsByRpID(c context.Context, rpID int64) (res []ReplyAdminLog, err error)

LogsByRpID get log by reply id.

func (*Service) MarkAsSpam

func (s *Service) MarkAsSpam(c context.Context, oids, rpIDs []int64, adminID int64, adminName, remark string) (err error)

MarkAsSpam mark a reply(normal state) as spam.

func (*Service) ModifySubState

func (s *Service) ModifySubState(c context.Context, adid int64, adName string, oids []int64, typ int32, state int32, remark string) (fails map[int64]string, err error)

ModifySubState modify subject state

func (*Service) MointorLog

func (s *Service) MointorLog(c context.Context, sp model.LogSearchParam) (result *model.MonitorLogResult, err error)

MointorLog MointorLog

func (*Service) MonitorSearch

func (s *Service) MonitorSearch(c context.Context, sp *model.SearchMonitorParams, page, pageSize int64) (res *model.SearchMonitorResult, err error)

MonitorSearch return monitor result from search.

func (*Service) MonitorStats

func (s *Service) MonitorStats(c context.Context, mode, page, pageSize int64, adminIDs, sort, order, startTime, endTime string) (res *model.StatsMonitorResult, err error)

MonitorStats return monitor stats.

func (*Service) NotifyTroll

func (s *Service) NotifyTroll(c context.Context, mid int64) (err error)

专门给喷子,带狗发送的消息通知, 20181206 针对大忽悠事件

func (*Service) PaginateReplyConfig

func (s *Service) PaginateReplyConfig(c context.Context, typ, category int32, oid int64, operator string, offset, count int) (configs []*model.Config, totalCount, pages int64, err error)

PaginateReplyConfig paginate configuration list of records indexing from start to end, and a total count of records

func (*Service) Ping

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

Ping check service is ok.

func (*Service) RenewReplyConfig

func (s *Service) RenewReplyConfig(c context.Context, id int64) (result bool, err error)

RenewReplyConfig reset reply configuration by default, with deleting the detail configurations from db

func (*Service) ReplyList

func (s *Service) ReplyList(c context.Context, oids, rpids []int64) (res map[int64]*model.ReplyEx, err error)

ReplyList ReplyList

func (*Service) ReplySearch

func (s *Service) ReplySearch(c context.Context, sp *model.SearchParams, page, pageSize int64) (res *model.SearchResult, err error)

ReplySearch return reply result from search.

func (*Service) ReplyTopLog

func (s *Service) ReplyTopLog(c context.Context, sp model.LogSearchParam) (result *model.ReplyTopLogResult, err error)

ReplyTopLog ReplyTopLog

func (*Service) ReportDel

func (s *Service) ReportDel(c context.Context, oids, rpIDs []int64, adminID, ftime int64, typ, audit, moral, reason, freason int32, notify bool, adminName, remark, content string) (err error)

ReportDel delete reply by report.

func (*Service) ReportIgnore

func (s *Service) ReportIgnore(c context.Context, oids, rpIDs []int64, adminID int64, adName string, typ, audit int32, remark string, delReport bool) (err error)

ReportIgnore ignore a report.

func (*Service) ReportRecover

func (s *Service) ReportRecover(c context.Context, oids, rpIDs []int64, adminID int64, typ, audit int32, remark string) (err error)

ReportRecover recover a report reply.

func (*Service) ReportSearch

func (s *Service) ReportSearch(c context.Context, sp *model.SearchReportParams, page, pageSize int64) (res *model.SearchReportResult, err error)

ReportSearch return report result from search.

func (*Service) ReportStateSet

func (s *Service) ReportStateSet(c context.Context, oids, rpIDs []int64, adminID int64, adname string, typ, state int32, remark string, delReport bool) (err error)

ReportStateSet transfer a report.

func (*Service) ReportTransfer

func (s *Service) ReportTransfer(c context.Context, oids, rpIDs []int64, adminID int64, adName string, typ, audit int32, remark string) (err error)

ReportTransfer transfer a report.

func (*Service) Subject

func (s *Service) Subject(c context.Context, oid int64, typ int32) (sub *model.Subject, err error)

Subject get subject info.

func (*Service) SubjectLog

func (s *Service) SubjectLog(c context.Context, sp model.LogSearchParam) (res *model.SubjectLogRes, err error)

SubjectLog returns operation logs by query parameters

func (s *Service) TitleLink(c context.Context, oid int64, typ int32) (title, link string, err error)

TitleLink TitleLink

func (*Service) TopChildReply

func (s *Service) TopChildReply(c context.Context, rootID, childID, oid int64) (err error)

TopChildReply ...

func (*Service) UpActionHate

func (s *Service) UpActionHate(c context.Context, rpID, oid, adminID int64, typ, count int32, remark string) (err error)

UpActionHate update action hate.

func (*Service) UpActionLike

func (s *Service) UpActionLike(c context.Context, rpID, oid, adminID int64, typ, count int32, remark string) (err error)

UpActionLike update action like.

func (*Service) UpBusiness

func (s *Service) UpBusiness(c context.Context, name, appkey, remark, alias string, tp int32) (id int64, err error)

UpBusiness update a business's name appkey and remark

func (*Service) UpBusinessState

func (s *Service) UpBusinessState(c context.Context, state, tp int32) (id int64, err error)

UpBusinessState update a business's state

func (*Service) UpEmoji

func (s *Service) UpEmoji(c context.Context, name string, remark string, url string, id int64) (idx int64, err error)

UpEmoji UpEmoji

func (*Service) UpEmojiPackage

func (s *Service) UpEmojiPackage(c context.Context, name string, url string, remark string, state int32, id int64) (idx int64, err error)

UpEmojiPackage UpEmojiPackage

func (*Service) UpEmojiPackageSort

func (s *Service) UpEmojiPackageSort(c context.Context, ids string) (err error)

UpEmojiPackageSort UpEmojiPackageSort

func (*Service) UpEmojiSort

func (s *Service) UpEmojiSort(c context.Context, ids string) (err error)

UpEmojiSort UpEmojiSort

func (*Service) UpEmojiState

func (s *Service) UpEmojiState(c context.Context, state int32, id int64) (idx int64, err error)

UpEmojiState UpEmojiState

func (*Service) UpMonitorState

func (s *Service) UpMonitorState(c context.Context, adminID int64, adName string, oid int64, typ, state int32, remark string) (err error)

UpMonitorState set monitor state into subject attr.

func (*Service) UpdateNotice

func (s *Service) UpdateNotice(c context.Context, nt *model.Notice) (err error)

UpdateNotice UpdateNotice

func (*Service) UpdateNoticeStatus

func (s *Service) UpdateNoticeStatus(c context.Context, status model.NoticeStatus, id uint32) (err error)

UpdateNoticeStatus UpdateNoticeStatus

Jump to

Keyboard shortcuts

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