models

package
v0.0.0-...-9b663ca Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2021 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HistoryNull = iota
	HistoryVideo
)

history category

Variables

This section is empty.

Functions

This section is empty.

Types

type History

type History struct {
	base.Model
	UID           uint  `gorm:"primary_key;auto_increment:false"`
	SourceType    uint8 `gorm:"primary_key;auto_increment:false"` //1:video
	SourceID      uint  `gorm:"primary_key;auto_increment:false"`
	SubSourceID   uint
	Platform      string
	CurrentTime   float64
	RemainingTime float64
	UpdatedAt     time.Time
}

History 历史记录

func NewHistory

func NewHistory() *History

NewHistory ..

func (*History) TableName

func (m *History) TableName() string

TableName ..

type Histroyer

type Histroyer interface {
	GetSourceID(subSourceID *int64) uint
	JoinSource(r base.Repository, tableName string, sourceID uint) error
	GetStatistic(ctx context.Context, uid uint) [][]float64
}

Histroyer ...

func CreateHistory

func CreateHistory(sourceType *int64) Histroyer

CreateHistory retrun history depends on sourcetype

type NullHistory

type NullHistory struct {
}

NullHistory ...

func (NullHistory) GetSourceID

func (h NullHistory) GetSourceID(subSourceID *int64) uint

GetSourceID ..

func (NullHistory) GetStatistic

func (h NullHistory) GetStatistic(ctx context.Context, uid uint) [][]float64

GetStatistic ..

func (NullHistory) JoinSource

func (h NullHistory) JoinSource(r base.Repository, tableName string, sourceID uint) error

JoinSource ..

type VideoHistory

type VideoHistory struct {
}

VideoHistory ...

func (VideoHistory) GetSourceID

func (h VideoHistory) GetSourceID(subSourceID *int64) uint

GetSourceID ..

func (VideoHistory) GetStatistic

func (h VideoHistory) GetStatistic(ctx context.Context, uid uint) [][]float64

GetStatistic 获取统计数据

func (VideoHistory) JoinSource

func (h VideoHistory) JoinSource(r base.Repository, tableName string, sourceID uint) error

JoinSource ..

Jump to

Keyboard shortcuts

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