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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BmGetInt64OrDefault

func BmGetInt64OrDefault(c *bm.Context, key string, defaul int64) (value int64, exist bool)

BmGetInt64OrDefault get int64

func BmGetStringOrDefault

func BmGetStringOrDefault(c *bm.Context, key string, defaul string) (value string, exist bool)

BmGetStringOrDefault get string

func BmHTTPErrorWithMsg

func BmHTTPErrorWithMsg(c *bm.Context, err error, msg string)

BmHTTPErrorWithMsg custom error msg

Types

type BaseJobInterface

type BaseJobInterface interface {
	Run() (err error)
	Description() string
}

BaseJobInterface job interface

type CalcJob

type CalcJob struct {
	ID int
	// 数据日
	Date time.Time
	// 对应的数据
	TableNum int
	Overall  *calculator.OverAllStatistic
	IsDone   bool
	Svc      *CalcService
}

CalcJob calculate job

func (*CalcJob) Description

func (job *CalcJob) Description() (dest string)

Description descrpit job

func (*CalcJob) Run

func (job *CalcJob) Run() (err error)

Run run job

type CalcService

type CalcService struct {
	JobChannel chan BaseJobInterface
	OutputChan chan *upcrmmodel.UpScoreHistory
	// contains filtered or unexported fields
}

CalcService calc service

func NewCalc

func NewCalc(c *conf.Config, outChan chan *upcrmmodel.UpScoreHistory, crmdao *upcrmdao.Dao) *CalcService

NewCalc create calc service

func (*CalcService) AddCalcJob

func (c *CalcService) AddCalcJob(date time.Time)

AddCalcJob add job

func (*CalcService) CalcScoreSectionData

func (c *CalcService) CalcScoreSectionData() (err error)

CalcScoreSectionData calc score section

func (*CalcService) Close

func (c *CalcService) Close()

Close close service

func (*CalcService) Run

func (c *CalcService) Run()

Run fun service

func (*CalcService) ScheduleJob

func (c *CalcService) ScheduleJob()

ScheduleJob schedule job

type CalcStatisticJob

type CalcStatisticJob struct {
	ID int
	// 数据日
	Date time.Time
	Svc  *CalcService
}

CalcStatisticJob statis job

func (*CalcStatisticJob) Description

func (j *CalcStatisticJob) Description() (dest string)

Description desc

func (*CalcStatisticJob) Run

func (j *CalcStatisticJob) Run() (err error)

Run run

type Service

type Service struct {
	CreditScoreInputChan chan *upcrmmodel.UpScoreHistory
	CalcSvc              *CalcService
	// contains filtered or unexported fields
}

Service is service.

func New

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

New is go-common/app/service/videoup service implementation.

func (*Service) Close

func (s *Service) Close()

Close service close

func (*Service) GetCreditLog

func (c *Service) GetCreditLog(con context.Context, arg *upcrmmodel.ArgGetLogHistory) (results []*upcrmmodel.SimpleCreditLogWithContent, err error)

GetCreditLog get log

func (*Service) GetCreditScore

func (c *Service) GetCreditScore(con context.Context, arg *upcrmmodel.GetScoreParam) (results []*upcrmmodel.UpScoreHistory, err error)

GetCreditScore get credit score

func (*Service) LogCredit

func (s *Service) LogCredit(c context.Context, arg *upcrmmodel.ArgCreditLogAdd) (err error)

LogCredit log credit log

func (*Service) Test

func (s *Service) Test()

Test test func

func (*Service) WriteStatData

func (s *Service) WriteStatData()

WriteStatData write log to db

Jump to

Keyboard shortcuts

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