service

package
v0.7.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 26, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Enable  = "Enable"
	Disable = "Disable"
	Delete  = "Delete"
)
View Source
const (
	Pending = "Pending"
	Failure = "Failure"
	Success = "Success"
)

Variables

Functions

This section is empty.

Types

type DalInfo

type DalInfo struct {
	Model
	DalID           string `gorm:"not null"`
	Secret          string `gorm:"not null"`
	AccessToken     string
	RefreshToken    string
	ExpiresIn       int32
	TokenType       string
	LastRequestTime int64
	Scope           string
}

func (*DalInfo) TableName

func (model *DalInfo) TableName() string

type DalInfoService

type DalInfoService interface {
	FindById(ctx context.Context, id int64) (dalInfo *DalInfo)
	FindByDalId(ctx context.Context, dalId string) (dalInfo *DalInfo)
	FindAll(ctx context.Context) (all []*DalInfo)
	Create(ctx context.Context, dalInfo *DalInfo) (err error)
	Update(ctx context.Context, dalInfo *DalInfo) (err error)
}

func NewDalInfoService

func NewDalInfoService(cfg config.Config, db *gorm.DB) DalInfoService

type Model

type Model struct {
	ID        int64     `gorm:"type:bigint;primarykey"`
	CreatedAt time.Time `gorm:"column:created_time;not null"`
	UpdatedAt time.Time `gorm:"column:updated_time;not null"`
	DataState string    `gorm:"type:varchar(20);not null"`
}

func (*Model) BeforeCreate

func (model *Model) BeforeCreate(tx *gorm.DB) error

type ReportHistory

type ReportHistory struct {
	Model
	ReportId     string `gorm:"not null"`
	Content      string `gorm:"not null"`
	Url          string `gorm:"not null"`
	ProductKey   string `gorm:"not null"`
	Sn           string `gorm:"not null"`
	RetryTimes   int32  `gorm:"not null"`
	Status       string `gorm:"not null"`
	LastSendTime *time.Time
	DalInfoId    int64 `gorm:"not null"`
	Reason       string
}

func (*ReportHistory) TableName

func (rh *ReportHistory) TableName() string

type ReportService

type ReportService interface {
	FindHistory(ctx context.Context, id int64) *ReportHistory
	FindHistoryByReportId(ctx context.Context, reportId string) *ReportHistory
	CreateHistory(ctx context.Context, history *ReportHistory) error
	UpdateHistory(ctx context.Context, history *ReportHistory) error
	DeleteHistory(ctx context.Context, id int64) error
	FindRetryPage(ctx context.Context, page, size int) (total int64, records []*RetryRecord)
	CreateRetry(ctx context.Context, record *RetryRecord) error
	UpdateRetry(ctx context.Context, record *RetryRecord) error
	DeleteRetryByReportId(ctx context.Context, reportId int64) error
}

func NewReportService

func NewReportService(cfg config.Config, db *gorm.DB) ReportService

type RetryRecord

type RetryRecord struct {
	Model
	ReportHistory *ReportHistory `gorm:"ForeignKey:ReportID;AssociationForeignKey:ID;constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"`
	ReportID      int64          `gorm:"uniqueIndex:idx_client_retry_record_report_id_next;not null"`
	Prev          *time.Time
	Next          *time.Time `gorm:"uniqueIndex:idx_client_retry_record_report_id_next,sort:asc"`
	RetryTimes    int32      `gorm:"not null"`
}

func (*RetryRecord) TableName

func (rr *RetryRecord) TableName() string

type TransactionKey

type TransactionKey struct{}

Jump to

Keyboard shortcuts

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