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

Documentation

Index

Constants

View Source
const (
	// task group Admin id
	AdminID = 1
)

const for default groupid

Variables

This section is empty.

Functions

func FormatCSV

func FormatCSV(records [][]string) (data []byte, err error)

FormatCSV format to csv data

Types

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) ActivityAward

func (s *Service) ActivityAward(c context.Context, activityID int64, activityName string, date, statisticsEnd xtime.Time, creator string) (err error)

ActivityAward activity award

func (*Service) AddActivity

func (s *Service) AddActivity(c context.Context, ac *model.CActivity, creator string) (err error)

AddActivity add creative activity

func (*Service) AddAuthorityTaskGroup

func (s *Service) AddAuthorityTaskGroup(name, desc string) (err error)

AddAuthorityTaskGroup add new task group to authority-manage and add privilege 48

func (*Service) AddAuthorityTaskGroupUser

func (s *Service) AddAuthorityTaskGroupUser(username, groupID string) (err error)

AddAuthorityTaskGroupUser add user to task group

func (*Service) AddAuthorityTaskRole

func (s *Service) AddAuthorityTaskRole(groupID int64, name, desc string) (err error)

AddAuthorityTaskRole add task role to authority-manage

func (*Service) AddAuthorityTaskRoleUser

func (s *Service) AddAuthorityTaskRoleUser(username, roleID string) (err error)

AddAuthorityTaskRoleUser add user to task group

func (*Service) AddAuthorityUser

func (s *Service) AddAuthorityUser(username, nickname string) (err error)

AddAuthorityUser add user to authority-manage

func (*Service) AddAward

func (s *Service) AddAward(c context.Context, arg *model.AddAwardArg, username string) (awardID int64, err error)

AddAward .

func (*Service) AddBanner

func (s *Service) AddBanner(c context.Context, image, link string, startAt, endAt int64) (dup int64, err error)

AddBanner Add Banner

func (*Service) AddOfflineActivity

func (s *Service) AddOfflineActivity(ctx context.Context, arg *offlineactivity.AddActivityArg) (res *offlineactivity.AddActivityResult, err error)

AddOfflineActivity add offline activity

func (*Service) AddPrivilege

func (s *Service) AddPrivilege(name string, level, fatherID int64, isRouter uint8) (err error)

AddPrivilege all privilege

func (*Service) AddTagInfo

func (s *Service) AddTagInfo(c context.Context, t *model.TagInfo, creator string) (err error)

AddTagInfo add tag info service

func (*Service) AddTagUps

func (s *Service) AddTagUps(c context.Context, tagID int, mids []int64, isCommon int) (err error)

AddTagUps add tag ups service

func (*Service) AddUp

func (s *Service) AddUp(c context.Context, mid int64, accType int) (err error)

AddUp add user to creative pgc不区分业务,所有的都加入pgc

func (*Service) AutoDismiss

func (s *Service) AutoDismiss(c context.Context, operator string, typ int, mid int64, reason string) (err error)

AutoDismiss update account state to 6

func (*Service) AutoForbid

func (s *Service) AutoForbid(c context.Context, operator string, typ int, mid int64, reason string, days, second int) (err error)

AutoForbid update account state to 7 and add a n days CD

func (*Service) AwardResult

func (s *Service) AwardResult(c context.Context, awardID int64) (res *model.AwardResult, err error)

AwardResult .

func (*Service) Banners

func (s *Service) Banners(c context.Context, from, limit int64) (total int64, bs []*model.Banner, err error)

Banners Get Banners

func (*Service) Block

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

Block add to blacklist

func (*Service) BudgetDayGraph

func (s *Service) BudgetDayGraph(c context.Context, ctype int) (ratioInfo *model.BudgetRatio, err error)

BudgetDayGraph get day graph.

func (*Service) BudgetDayStatistics

func (s *Service) BudgetDayStatistics(c context.Context, ctype, from, limit int) (total int, infos []*model.BudgetDayStatistics, err error)

BudgetDayStatistics budget day statistics.

func (*Service) BudgetMonthStatistics

func (s *Service) BudgetMonthStatistics(c context.Context, ctype, from, limit int) (total int, infos []*model.BudgetMonthStatistics, err error)

BudgetMonthStatistics budget month statistics

func (*Service) BusPrivilege

func (s *Service) BusPrivilege(c context.Context, username string, ctypes string) (res []*model.BusRes, err error)

BusPrivilege business privilege

func (*Service) CheatArchives

func (s *Service) CheatArchives(c context.Context, mid, avID int64, nickname string, from, limit int) (total int, spies []*model.ArchiveSpy, err error)

CheatArchives get cheat avs

func (*Service) CheatFans

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

CheatFans handle checkfans mid.

func (*Service) CheatUps

func (s *Service) CheatUps(c context.Context, mid int64, nickname string, from, limit int) (total int, spies []*model.UpSpy, err error)

CheatUps get cheat ups

func (*Service) Close

func (s *Service) Close()

Close dao

func (*Service) CreditRecords

func (s *Service) CreditRecords(c context.Context, mid int64) (crs []*model.CreditRecord, err error)

CreditRecords get credit records by mid

func (*Service) DelUpAccount

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

DelUpAccount del mid from up_account

func (*Service) DeleteAuthorityTaskGroup

func (s *Service) DeleteAuthorityTaskGroup(groupID int64) (err error)

DeleteAuthorityTaskGroup delete task group

func (*Service) DeleteAuthorityTaskGroupUser

func (s *Service) DeleteAuthorityTaskGroupUser(id, groupID int64) (err error)

DeleteAuthorityTaskGroupUser delete user from task group

func (*Service) DeleteAuthorityTaskRole

func (s *Service) DeleteAuthorityTaskRole(roleID int64) (err error)

DeleteAuthorityTaskRole delete task role

func (*Service) DeleteAuthorityTaskRoleUser

func (s *Service) DeleteAuthorityTaskRoleUser(id, roleID int64) (err error)

DeleteAuthorityTaskRoleUser delete user from task role

func (*Service) DeleteAuthorityUser

func (s *Service) DeleteAuthorityUser(id int64) (err error)

DeleteAuthorityUser delete user from authority-manage from id

func (*Service) DeleteFromBlocked

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

DeleteFromBlocked del blocked and recover up info of video

func (*Service) DeleteUp

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

DeleteUp delete up from up_info (update is_deleted = 1)

func (*Service) DetailAward

func (s *Service) DetailAward(c context.Context, awardID int64) (data *model.AwardDetail, err error)

DetailAward .

func (*Service) Dismiss

func (s *Service) Dismiss(c context.Context, operator string, typ, oldState int, mid int64, reason string) (err error)

Dismiss update account state to 6

func (*Service) EditBanner

func (s *Service) EditBanner(c context.Context, id, startAt, endAt int64, image, link string) (dup int64, err error)

EditBanner Update Banner

func (*Service) ExportAwardWinner

func (s *Service) ExportAwardWinner(c context.Context, arg *model.QueryAwardWinnerArg) (res []byte, err error)

ExportAwardWinner .

func (*Service) ExportBlacklist

func (s *Service) ExportBlacklist(fromTime, toTime int64, ctype, reason int, mid int64, nickname string, aid int64, from, limit int, sort string) (res []byte, err error)

ExportBlacklist blacklist export csv

func (*Service) ExportCheatAvs

func (s *Service) ExportCheatAvs(c context.Context, mid, avID int64, nickname string, from, limit int) (res []byte, err error)

ExportCheatAvs export cheat avs

func (*Service) ExportCheatUps

func (s *Service) ExportCheatUps(c context.Context, mid int64, nickname string, from, limit int) (res []byte, err error)

ExportCheatUps export up.

func (*Service) ExportUps

func (s *Service) ExportUps(c context.Context, busType, accType int, states []int64, mid int64, category int, signType int, nickname string, lower int, upper int, from int, limit int, sort string) (res []byte, err error)

ExportUps export ups by query

func (*Service) Forbid

func (s *Service) Forbid(c context.Context, operator string, typ, oldState int, mid int64, reason string, days, second int) (err error)

Forbid update account state to 7 and add a n days CD

func (*Service) GetAuthorityUserGroup

func (s *Service) GetAuthorityUserGroup(username string) (data []*model.Group, err error)

GetAuthorityUserGroup get authority user group

func (*Service) GetAuthorityUserPrivileges

func (s *Service) GetAuthorityUserPrivileges(username string) (data interface{}, err error)

GetAuthorityUserPrivileges get user all privileges

func (*Service) GetUserPri

func (s *Service) GetUserPri(username string) (priMap map[int64]bool, err error)

GetUserPri get user privilege

func (*Service) GoodsList

func (s *Service) GoodsList(c context.Context, from, limit int) (total int64, res []*model.GoodsInfo, err error)

GoodsList .

func (*Service) InsertNotice

func (s *Service) InsertNotice(c context.Context, title string, typ int, platform int, link string, status int) (err error)

InsertNotice insert notice

func (*Service) InsertTagUpInfos

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

InsertTagUpInfos insert tag_info

func (*Service) InsertWhite

func (s *Service) InsertWhite(c context.Context, mid int64, typ int) (err error)

InsertWhite insert white

func (*Service) ListActivity

func (s *Service) ListActivity(c context.Context, name string, from, limit int, sort string) (acs []*model.CActivity, total int, err error)

ListActivity list activity by query

func (*Service) ListActivitySignUp

func (s *Service) ListActivitySignUp(c context.Context, activityID int64, from, limit int) (ups []*model.UpActivity, total int, err error)

ListActivitySignUp list activity who sign up

func (*Service) ListActivityWinners

func (s *Service) ListActivityWinners(c context.Context, activityID, mid int64, from, limit int) (ups []*model.UpActivity, total int, err error)

ListActivityWinners list activity winners

func (*Service) ListAuthorityGroupPrivilege

func (s *Service) ListAuthorityGroupPrivilege(groupID int64, fatherID int64) (ret *model.SPrivilege, err error)

ListAuthorityGroupPrivilege list task group's privileges

func (*Service) ListAuthorityRolePrivilege

func (s *Service) ListAuthorityRolePrivilege(groupID, roleID int64, fatherID int64) (data *model.SPrivilege, err error)

ListAuthorityRolePrivilege list task role's privileges

func (*Service) ListAuthorityTaskGroups

func (s *Service) ListAuthorityTaskGroups(from, limit int, sort string) (groups []*model.TaskGroup, total int, err error)

ListAuthorityTaskGroups list all task groups in authority-manage

func (*Service) ListAuthorityTaskRoles

func (s *Service) ListAuthorityTaskRoles(username string, from, limit int, sort string) (roles []*model.TaskRole, total int, err error)

ListAuthorityTaskRoles list user's task roles

func (*Service) ListAuthorityUsers

func (s *Service) ListAuthorityUsers(username string, from, limit int, sort string) (users []*model.User, total int, err error)

ListAuthorityUsers list all users in authority-manage

func (*Service) ListAvs

func (s *Service) ListAvs(c context.Context, tagID, from, limit int, avID int64) (total int, data []*model.AvIncomeInfo, err error)

ListAvs list avs

func (*Service) ListAward

func (s *Service) ListAward(c context.Context, from, limit int) (total int64, data []*model.AwardListModel, err error)

ListAward .

func (*Service) ListAwardWinner

func (s *Service) ListAwardWinner(c context.Context, arg *model.QueryAwardWinnerArg) (total int64, res []*model.AwardWinner, err error)

ListAwardWinner .

func (*Service) ListGroupAndRole

func (s *Service) ListGroupAndRole() (groups []*model.Group, roles []*model.Role, err error)

ListGroupAndRole list all task groups and task roles to admin

func (*Service) ListPrivilege

func (s *Service) ListPrivilege() (data []*model.SPrivilege, err error)

ListPrivilege list privilege by level

func (*Service) ListUps

func (s *Service) ListUps(c context.Context, tagID int, mid int64, from int, limit int) (total int, data []*model.UpIncomeInfo, err error)

ListUps list ups

func (*Service) ModeTagState

func (s *Service) ModeTagState(c context.Context, tagID int, isDeleted int) (err error)

ModeTagState mode tag state

func (*Service) Notices

func (s *Service) Notices(c context.Context, typ int, status int, platform int, from int, limit int) (total int, notices []*model.Notice, err error)

Notices notices

func (*Service) Off

func (s *Service) Off(c context.Context, endAt, id int64) (err error)

Off set end time to now

func (*Service) OfflineActivityQueryActivity

func (s *Service) OfflineActivityQueryActivity(ctx context.Context, arg *offlineactivity.QueryActivityByIDArg) (res *offlineactivity.QueryActivityResult, err error)

OfflineActivityQueryActivity query activity

func (*Service) OfflineActivityQueryActivityByMonth

func (s *Service) OfflineActivityQueryActivityByMonth(ctx context.Context, arg *offlineactivity.QueryActvityMonthArg) (res *offlineactivity.QueryActivityMonthResult, err error)

OfflineActivityQueryActivityByMonth activity by month

func (*Service) OfflineActivityQueryUpBonusByActivity

func (s *Service) OfflineActivityQueryUpBonusByActivity(ctx context.Context, arg *offlineactivity.QueryUpBonusByMidArg) (res *offlineactivity.QueryUpBonusByActivityResult, err error)

OfflineActivityQueryUpBonusByActivity get bonus info group by activity

func (*Service) OfflineActivityQueryUpBonusSummary

func (s *Service) OfflineActivityQueryUpBonusSummary(ctx context.Context, arg *offlineactivity.QueryUpBonusByMidArg) (res *offlineactivity.QueryUpBonusByMidResult, err error)

OfflineActivityQueryUpBonusSummary query up bonus info

func (*Service) OrderExport

func (s *Service) OrderExport(c context.Context, arg *model.OrderQueryArg, from, limit int) (res []byte, err error)

OrderExport .

func (*Service) OrderList

func (s *Service) OrderList(c context.Context, arg *model.OrderQueryArg, from, limit int) (total int64, list []*model.OrderInfo, err error)

OrderList .

func (*Service) OrderStatistics

func (s *Service) OrderStatistics(c context.Context, arg *model.OrderQueryArg) (data interface{}, err error)

OrderStatistics .

func (*Service) Pass

func (s *Service) Pass(c context.Context, mids []int64, typ int) (err error)

Pass update account state to 3(signed) type 0.video 1.audio 2.column 3.bgm,

func (*Service) Ping

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

Ping fn

func (*Service) PreAddOfflineActivity

func (s *Service) PreAddOfflineActivity(ctx context.Context, arg *offlineactivity.AddActivityArg) (res *offlineactivity.PreAddActivityResult, err error)

PreAddOfflineActivity just test add resutl

func (*Service) QueryBlacklist

func (s *Service) QueryBlacklist(fromTime, toTime int64, ctype, reason int, mid int64, nickname string, aid int64, from, limit int, sort string) (total int, blacklist []*model.Blacklist, err error)

QueryBlacklist query blacklist

func (*Service) QueryCheatFans

func (s *Service) QueryCheatFans(c context.Context, from, limit int64) (total int64, fans []*model.CheatFans, err error)

QueryCheatFans query cheat fans.

func (*Service) QueryFromBlocked

func (s *Service) QueryFromBlocked(c context.Context, mid int64, category int, nickname string, lower, upper, from, limit int, sort string) (ups []*model.Blocked, total int, err error)

QueryFromBlocked query up-info in black list of growup plan

func (*Service) QueryFromUpInfo

func (s *Service) QueryFromUpInfo(c context.Context, busType int, accType int, states []int64, mid int64, category int, signType int, nickname string, lower int, upper int, from int, limit int, sort string) (ups []*model.UpInfo, total int, err error)

QueryFromUpInfo query up-info in growup plan

func (*Service) QueryTagInfo

func (s *Service) QueryTagInfo(c context.Context, start int64, end int64, categories []int64, business []int64, tag string, effect, from int, limit int, sort string) (total int, tagInfos []*model.TagInfo, err error)

QueryTagInfo query tag info service

func (*Service) RecoverBlacklist

func (s *Service) RecoverBlacklist(aID int64, ctype int) (err error)

RecoverBlacklist recover av from blacklist

func (*Service) RecoverCreditScore

func (s *Service) RecoverCreditScore(c context.Context, typ int, id, mid int64) (err error)

RecoverCreditScore recover credit score

func (*Service) Recovery

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

Recovery update (video/column) account state to 3(signed)

func (*Service) Reject

func (s *Service) Reject(c context.Context, typ int, mids []int64, reason string, days int) (err error)

Reject update account state to 4(reject)

func (*Service) ReleaseUp

func (s *Service) ReleaseUp(c context.Context, tagID int, mid int64) (err error)

ReleaseUp release tag ups service

func (*Service) ReplaceAwardWinner

func (s *Service) ReplaceAwardWinner(c context.Context, awardID, prevMID, mid int64) (err error)

ReplaceAwardWinner .

func (*Service) SaveAwardResult

func (s *Service) SaveAwardResult(c context.Context, arg *model.AwardResult) (err error)

SaveAwardResult .

func (*Service) ShellCallback

func (s *Service) ShellCallback(ctx context.Context, arg *shell.OrderCallbackParam) (err error)

ShellCallback shell callback

func (*Service) SyncGoods

func (s *Service) SyncGoods(c context.Context, gt int) (eff int64, err error)

SyncGoods . secret portal...

func (*Service) TagDetails

func (s *Service) TagDetails(c context.Context, tagID, from, limit int) (total int, data []*model.Details, err error)

TagDetails query tag details.

func (*Service) UpState

func (s *Service) UpState(c context.Context, mid int64, typ int) (data interface{}, err error)

UpState get up state

func (*Service) UpdateActivity

func (s *Service) UpdateActivity(c context.Context, newAc *model.CActivity) (err error)

UpdateActivity update creative activity

func (*Service) UpdateAuthorityGroupPrivilege

func (s *Service) UpdateAuthorityGroupPrivilege(groupID int64, add, minus string, authType int) (err error)

UpdateAuthorityGroupPrivilege update group task privileges

func (*Service) UpdateAuthorityRolePrivilege

func (s *Service) UpdateAuthorityRolePrivilege(roleID int64, add, minus string) (err error)

UpdateAuthorityRolePrivilege update role task privileges

func (*Service) UpdateAuthorityTaskGroupInfo

func (s *Service) UpdateAuthorityTaskGroupInfo(groupID int64, name, desc string) (err error)

UpdateAuthorityTaskGroupInfo update task group info

func (*Service) UpdateAuthorityTaskRoleInfo

func (s *Service) UpdateAuthorityTaskRoleInfo(roleID int64, name, desc string) (err error)

UpdateAuthorityTaskRoleInfo update task role info

func (*Service) UpdateAuthorityUserAuth

func (s *Service) UpdateAuthorityUserAuth(id int64, groupID, roleID string) (err error)

UpdateAuthorityUserAuth update user's task group and task role

func (*Service) UpdateAuthorityUserInfo

func (s *Service) UpdateAuthorityUserInfo(id int64, nickname string) (err error)

UpdateAuthorityUserInfo update user's nickname

func (*Service) UpdateAward

func (s *Service) UpdateAward(c context.Context, arg *model.SaveAwardArg) (err error)

UpdateAward .

func (*Service) UpdateGoodsDisplay

func (s *Service) UpdateGoodsDisplay(c context.Context, status model.DisplayStatus, IDs []int64) (eff int64, err error)

UpdateGoodsDisplay by IDs

func (*Service) UpdateGoodsInfo

func (s *Service) UpdateGoodsInfo(c context.Context, discount int, ID int64) (int64, error)

UpdateGoodsInfo by ID

func (*Service) UpdateNotice

func (s *Service) UpdateNotice(c context.Context, typ int, platform int, title string, link string, id int64, status int) (err error)

UpdateNotice update notice

func (*Service) UpdatePrivilege

func (s *Service) UpdatePrivilege(id int64, name string, level, fatherID int64, isRouter uint8) (err error)

UpdatePrivilege update privilege info

func (*Service) UpdateTagActivity

func (s *Service) UpdateTagActivity(c context.Context, tagID, activityID int64) (err error)

UpdateTagActivity update tag activity_id

func (*Service) UpdateTagInfo

func (s *Service) UpdateTagInfo(c context.Context, t *model.TagInfo, creator string) (err error)

UpdateTagInfo update tag

func (*Service) UpdateUpAccount

func (s *Service) UpdateUpAccount(c context.Context, mid int64, isDeleted int, withdrawDate string) (err error)

UpdateUpAccount update up_account

func (*Service) UpdateUpAccountState

func (s *Service) UpdateUpAccountState(c context.Context, table string, mid int64, state int) (err error)

UpdateUpAccountState update video up account state

func (*Service) Upload

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

Upload upload.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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