model

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Channel added in v0.0.20

type Channel struct {
	Id          int64          `gorm:"primaryKey;autoIncrement;comment:主键id"`
	ChannelName string         `gorm:"comment:频道名"`
	ChannelUrl  string         `gorm:"comment:频道url字段"`
	ChannelId   string         `gorm:"comment:频道id"` // 自动去除 -100前缀 ,默认文件名第一个下划线之前
	CreatedAt   time.Time      `gorm:"autoCreateTime"`
	UpdatedAt   time.Time      `gorm:"autoUpdateTime"`
	DeletedAt   gorm.DeletedAt `gorm:"index"`
}

func (*Channel) GetByChannelId added in v0.1.0

func (c *Channel) GetByChannelId(channelId string) error

func (*Channel) GetByChannelName added in v0.1.0

func (c *Channel) GetByChannelName(channelName string) error

func (*Channel) GetByChannelURL added in v0.1.0

func (c *Channel) GetByChannelURL(channelURL string) error

func (*Channel) SetChannel added in v0.0.24

func (c *Channel) SetChannel() (int64, error)

type File

type File struct {
	Id        int64          `gorm:"primaryKey;autoIncrement;comment:主键id"`
	Origin    string         `gorm:"comment:原始url"`
	Channel   string         `gorm:"comment:频道id"`
	FileId    int            `gorm:"comment:文件id"` // 文件id
	Tag       string         `gorm:"comment:主文件夹名 #后面的文件名"`
	Subtag    string         `gorm:"comment:子(二级)文件夹名 &后面的文件名"`
	Filename  string         `gorm:"comment:手动设置的文件名 @后面的文件名"`
	Offset    int            `gorm:"comment:偏移量 如下载当前媒体之后第n个文件 +后面的数字"`
	Capacity  int            `gorm:"comment:下载当前文件和之后的n个文件 %后面的数字"`
	From      string         `gorm:"comment:用来下载的设备"`
	CreatedAt time.Time      `gorm:"autoCreateTime"`
	UpdatedAt time.Time      `gorm:"autoUpdateTime"`
	DeletedAt gorm.DeletedAt `gorm:"index"`
}

func (*File) FindByFileId added in v0.1.0

func (f *File) FindByFileId() (bool, error)

根据fileid判断是否下载过

func (*File) FindByFileIdAndChannel added in v0.1.0

func (f *File) FindByFileIdAndChannel() (bool, error)

根据fileid和channel判断是否下载过,如果有同一条记录同时这两个值相等,则认为是同一个文件

func (*File) FindByFilename added in v0.0.20

func (f *File) FindByFilename() (bool, error)

根据自定义文件名判断是否下载过

func (*File) FindByOriginURL

func (f *File) FindByOriginURL() (bool, error)

根据分割后的原始url判断是否下载过

func (*File) InsertOne

func (f *File) InsertOne() (int64, error)

type Save added in v0.1.0

type Save struct {
	Id       int64          `gorm:"primaryKey;autoIncrement;comment:主键"`
	FileName string         `gorm:"comment:文件名"`
	Before   string         `gorm:"comment:转换前大小(MB)"`
	After    string         `gorm:"comment:转换后大小(MB)"`
	SaveSize float64        `gorm:"comment:节省(为正数的时候)的空间(MB)"`
	CreateAt time.Time      `gorm:"autoCreateTime;comment:创建时间"`
	UpdateAt time.Time      `gorm:"autoUpdateTime;comment:更新时间"`
	DeleteAt gorm.DeletedAt `gorm:"index;comment:删除时间"`
}

func (*Save) Delete added in v0.1.0

func (s *Save) Delete() error

func (*Save) GetAll added in v0.1.0

func (s *Save) GetAll() ([]Save, error)

func (*Save) GetById added in v0.1.0

func (s *Save) GetById(id int64) error

func (*Save) Insert added in v0.1.0

func (s *Save) Insert() error

func (*Save) Sync added in v0.1.0

func (s *Save) Sync()

func (*Save) Update added in v0.1.0

func (s *Save) Update() error

Jump to

Keyboard shortcuts

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