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

Documentation

Index

Constants

View Source
const (
	// TaskAvCharge .
	TaskAvCharge = iota + 1
	// TaskCmCharge .
	TaskCmCharge
	// TaskTagRatio .
	TaskTagRatio
	// TaskBubbleMeta .
	TaskBubbleMeta
	// TaskBlacklist .
	TaskBlacklist
	// TaskCreativeIncome .
	TaskCreativeIncome
	// TaskCreativeStatis .
	TaskCreativeStatis
	// TaskBgmSync .
	TaskBgmSync
	// TaskTagIncome .
	TaskTagIncome
	// TaskCreativeCharge .
	TaskCreativeCharge
	// TaskBudget .
	TaskBudget
	// TaskSnapshotBubbleIncome .
	TaskSnapshotBubbleIncome
)

Variables

This section is empty.

Functions

func Div

func Div(x, y float64) float64

Div div

func DivWithRound

func DivWithRound(x, y float64, places int) float64

DivWithRound div with round

func FormatCSV

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

FormatCSV format to csv data

func GetTaskService

func GetTaskService() *taskService

GetTaskService get task service

func Mul

func Mul(x, y float64) float64

Mul mul

func MulWithRound

func MulWithRound(x, y float64, places int) float64

MulWithRound mul with round

func NextDay

func NextDay(hour, min, second int) time.Duration

NextDay next day x hours

func Round

func Round(val float64, places int) float64

Round round

func Tax

func Tax(income float64) (tax float64)

Tax tax

func WriteCSV

func WriteCSV(records [][]string, filename string) (err error)

WriteCSV write data to csv

Types

type Service

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

Service struct

func New

func New(c *conf.Config, executor ctrl.Executor) (s *Service)

New fn

func (*Service) AutoBreach

func (s *Service) AutoBreach(c context.Context, date string) (msg string, err error)

AutoBreach auto breach

func (*Service) AutoExamination

func (s *Service) AutoExamination(c context.Context) (msg string, err error)

AutoExamination auto examination

func (*Service) AutoPunish

func (s *Service) AutoPunish(c context.Context) (msg string, err error)

AutoPunish auto punish

func (*Service) AvIncomes

func (s *Service) AvIncomes(c context.Context, mid int64, date string) (result map[int64]*model.Patch, err error)

AvIncomes av_income

func (*Service) CheatStatistics

func (s *Service) CheatStatistics(c context.Context, date time.Time) (err error)

CheatStatistics task update cheat

func (*Service) Close

func (s *Service) Close()

Close close the service

func (*Service) CombineMails

func (s *Service) CombineMails() (err error)

CombineMails combine mails.

func (*Service) CombineMailsByHTTP

func (s *Service) CombineMailsByHTTP(c context.Context, year int, month int, day int) (err error)

CombineMailsByHTTP send income mail by http.

func (*Service) CreativeActivity

func (s *Service) CreativeActivity(c context.Context, date time.Time) (err error)

CreativeActivity creative activity job

func (*Service) CreativeBudget

func (s *Service) CreativeBudget(c context.Context, date time.Time) (err error)

CreativeBudget creative budget

func (*Service) CreativeUpBill

func (s *Service) CreativeUpBill(c context.Context, startDate, endDate time.Time) (err error)

CreativeUpBill creative up bill

func (*Service) DelActivity

func (s *Service) DelActivity(c context.Context, limit int64) (rows int64, err error)

DelActivity clean activity_info table.

func (*Service) DelDataLimit

func (s *Service) DelDataLimit(c context.Context, table string, count int64) (err error)

DelDataLimit del up_bill

func (*Service) DeleteAvRatio

func (s *Service) DeleteAvRatio(c context.Context, limit int64) (rows int64, err error)

DeleteAvRatio clean the av_charge_ratio

func (*Service) DeleteUpIncome

func (s *Service) DeleteUpIncome(c context.Context, limit int64) (rows int64, err error)

DeleteUpIncome clean the up_tag_income

func (*Service) ExecIncomeForHTTP

func (s *Service) ExecIncomeForHTTP(c context.Context, year int, month int, day int) (err error)

ExecIncomeForHTTP income

func (*Service) ExecRatioForHTTP

func (s *Service) ExecRatioForHTTP(c context.Context, year int, month int, day int) (err error)

ExecRatioForHTTP exec http

func (*Service) FixAvBreach

func (s *Service) FixAvBreach(c context.Context, mid int64, date string, count int) (err error)

FixAvBreach fix av_breach_record data

func (*Service) FixBaseIncome

func (s *Service) FixBaseIncome(c context.Context, base int64, mid int64, date string) (err error)

FixBaseIncome fix income

func (*Service) FixBgmBaseIncome

func (s *Service) FixBgmBaseIncome(c context.Context, mid int64, date string) (err error)

FixBgmBaseIncome fix bgm base income

func (*Service) FixBgmIncomeStatis

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

FixBgmIncomeStatis fix bgm income statis

func (*Service) FixIncome

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

FixIncome fix income

func (*Service) FixUpAvStatis

func (s *Service) FixUpAvStatis(c context.Context, count int) (err error)

FixUpAvStatis fix up_av_statis

func (*Service) FixUpIncome

func (s *Service) FixUpIncome(c context.Context, date string, tagID int64, addCount, needAddIncome int) (err error)

FixUpIncome fix up_income

func (*Service) FixUpTotalIncome

func (s *Service) FixUpTotalIncome(c context.Context, table, date string, count int) (err error)

FixUpTotalIncome fix up_income total income

func (*Service) GetAvIncome

func (s *Service) GetAvIncome(c context.Context) (avs []*model.AvIncome, err error)

GetAvIncome get av_income

func (*Service) GetAvIncomeStatis

func (s *Service) GetAvIncomeStatis(c context.Context, date string) error

GetAvIncomeStatis get av monthly income

func (*Service) GetAvsMID

func (s *Service) GetAvsMID(c context.Context, avs []int64) (avsMap map[int64]int64, err error)

GetAvsMID get avs mid from api

func (*Service) GetTrueAvsIncome

func (s *Service) GetTrueAvsIncome(c context.Context, mids []int64, date string) (avs map[int64]*model.Patch, err error)

GetTrueAvsIncome get true av_income

func (*Service) GetUpAccount

func (s *Service) GetUpAccount(c context.Context, date, ctime string) (ups []*model.UpAccount, err error)

GetUpAccount get up_account

func (*Service) GetUpIncome

func (s *Service) GetUpIncome(c context.Context, table, date string) (ups []*model.UpIncome, err error)

GetUpIncome get up_income

func (*Service) GetUpIncomeStatis

func (s *Service) GetUpIncomeStatis(c context.Context, date string, hasWithdraw int) (err error)

GetUpIncomeStatis get up statis

func (*Service) GetUpNickname

func (s *Service) GetUpNickname(c context.Context, mids []int64) (upNick map[int64]string, err error)

GetUpNickname get up nickname

func (*Service) GetUpWithdraw

func (s *Service) GetUpWithdraw(c context.Context, date string) (ups map[int64]int64, err error)

GetUpWithdraw get up_income_withdraw

func (*Service) HTTPClient

func (s *Service) HTTPClient(method, url string, params map[string]string, nowTime int64) (body []byte, err error)

HTTPClient http client handle

func (*Service) InitBlacklistMID

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

InitBlacklistMID init av_black_list mid

func (*Service) InsertTagIncome

func (s *Service) InsertTagIncome(c context.Context, date time.Time) (err error)

InsertTagIncome insert up_tag_income.

func (*Service) Ping

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

Ping check server ok.

func (*Service) SendTagIncomeByHTTP

func (s *Service) SendTagIncomeByHTTP(c context.Context, year int, month int, day int) (err error)

SendTagIncomeByHTTP exec http

func (*Service) SnapshotBubbleIncomeTask

func (s *Service) SnapshotBubbleIncomeTask(c context.Context, date time.Time) (err error)

SnapshotBubbleIncomeTask get income lottery

func (*Service) SyncAvBaseIncome

func (s *Service) SyncAvBaseIncome(c context.Context, table string) (err error)

SyncAvBaseIncome sync base_income to av_base_income by mid_date

func (*Service) SyncCreditScore

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

SyncCreditScore sync credit score

func (*Service) SyncIncomeBubbleMeta

func (s *Service) SyncIncomeBubbleMeta(c context.Context, start, end time.Time, tp int) (rows int64, err error)

SyncIncomeBubbleMeta .

func (*Service) SyncIncomeBubbleMetaTask

func (s *Service) SyncIncomeBubbleMetaTask(c context.Context, date time.Time) (err error)

SyncIncomeBubbleMetaTask sync meta data for income bubble to growup

func (*Service) SyncUpAccount

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

SyncUpAccount sync up_account to up_tag_year

func (*Service) SyncUpPGC

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

SyncUpPGC sync pgc up from up_info_video to up_info_column

func (*Service) TxUpdateIncome

func (s *Service) TxUpdateIncome(tx *sql.Tx, avID, mid, categoryID int64, incIncome int64) (err error)

TxUpdateIncome update creative income

func (*Service) UpdateAccountType

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

UpdateAccountType update account type

func (*Service) UpdateAvRatio

func (s *Service) UpdateAvRatio() (err error)

UpdateAvRatio update av ratio everyday

func (*Service) UpdateBlacklist

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

UpdateBlacklist update blacklist

func (*Service) UpdateCheatHTTP

func (s *Service) UpdateCheatHTTP(c context.Context, date time.Time) (err error)

UpdateCheatHTTP update cheat by http

func (*Service) UpdateColumnTag

func (s *Service) UpdateColumnTag(c context.Context, table string, oldTag string, newTag int, count int64) (err error)

UpdateColumnTag update column tag

func (*Service) UpdateTagAdjust

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

UpdateTagAdjust update tag adjust_type

func (*Service) UpdateTagIncome

func (s *Service) UpdateTagIncome(c context.Context, date string) (err error)

UpdateTagIncome update tag_Info income

func (*Service) UpdateTaskStatus

func (s *Service) UpdateTaskStatus(c context.Context, date string, typ int, status int) (err error)

UpdateTaskStatus update task status

func (*Service) UpdateUpAccountMoney

func (s *Service) UpdateUpAccountMoney(c context.Context, mid int64, total, unwithdraw int64) (err error)

UpdateUpAccountMoney update up_account

func (*Service) UpdateUpInfo

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

UpdateUpInfo update up_info_video

func (*Service) UpdateWithdraw

func (s *Service) UpdateWithdraw(c context.Context, oldDate, newDate string, count int64) (err error)

UpdateWithdraw update up_account withdraw

type TaxRate

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

TaxRate tax rate

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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