model

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

Documentation

Index

Constants

View Source
const (
	// CacheNotFound .
	CacheNotFound = -1
	// SyncInsert binlog action.
	SyncInsert = "insert"
	// SyncUpdate binlog action.
	SyncUpdate = "update"
	// SyncDelete binlog action.
	SyncDelete = "delete"
)
View Source
const (
	// type
	FieldFav      = "folder"
	FieldArc      = "video"
	FieldResource = "resource"
	// action
	ActionAdd                 = "add"
	ActionDel                 = "del"
	ActionMove                = "move"
	ActionCopy                = "copy"
	ActionMdel                = "mdel"
	ActionIndef               = "indef"
	ActionIncol               = "incol"
	ActionClean               = "clean"
	ActionInitRelationFids    = "initRelationFids"
	ActionInitFolderRelations = "initFolderRelations"
)
View Source
const (

	// StateDefaultPublic default public folder.
	StateDefaultPublic = int8(0) // binary 00 / int 0
	// StateDefaultNoPublic default private folder.
	StateDefaultNoPublic = int8(0) | bit1 // binary 01 / int 1
	// StateNormalPublic nomal public folder.
	StateNormalPublic = bit2 | int8(0) // binary 10 / int 2
	// StateNormalNoPublic nomal private folder.
	StateNormalNoPublic = bit2 | bit1 // binary 11 / int 3

	// DefaultFolderName name of favorite folder.
	DefaultFolderName = "默认收藏夹"
)

Variables

View Source
var (
	// ErrFavResourceExist error this has been favoured.
	ErrFavResourceExist = errors.New("error this has been favoured")
	// ErrFavResourceAlreadyDel error this has been unfavoured.
	ErrFavResourceAlreadyDel = errors.New("error this has been unfavoured")
)
View Source
var (
	// ErrFavVideoExist error video has been favoured.
	ErrFavVideoExist = errors.New("error video has been favoured")
	// ErrFavVideoAlreadyDel error video has been unfavoured.
	ErrFavVideoAlreadyDel = errors.New("error video has been unfavoured")
)

Functions

func CheckPublic

func CheckPublic(state int8) bool

CheckPublic check user update public value in [0, 1].

func IsDefault

func IsDefault(state int8) bool

IsDefault return true if state is default state.

Types

type Archive

type Archive struct {
	ID    int64     `json:"id"`
	Mid   int64     `json:"mid"`
	Fid   int64     `json:"fid"`
	Aid   int64     `json:"aid"`
	CTime time.Time `json:"-"`
	MTime time.Time `json:"-"`
}

Archive .

type CanelMessage

type CanelMessage struct {
	Action string          `json:"action"`
	Table  string          `json:"table"`
	New    json.RawMessage `json:"new"`
	Old    json.RawMessage `json:"old"`
}

CanelMessage binlog message.

type Cover

type Cover struct {
	Aid int64  `json:"aid"`
	Pic string `json:"pic"`
}

Cover image

type Favorite

type Favorite struct {
	Fid        int64     `json:"fid"`
	Mid        int64     `json:"mid"`
	Name       string    `json:"name"`
	MaxCount   int       `json:"max_count"`
	CurCount   int       `json:"cur_count"`
	AttenCount int       `json:"atten_count"`
	State      int8      `json:"state"`
	CTime      time.Time `json:"ctime"`
	MTime      time.Time `json:"-"`
	Cover      []*Cover  `json:"cover,omitempty"`
}

Favorite .

func (*Favorite) IsDefault

func (f *Favorite) IsDefault() bool

IsDefault return true if folder is default.

func (*Favorite) IsPublic

func (f *Favorite) IsPublic() bool

IsPublic return true if folder is public.

func (*Favorite) StateDef

func (f *Favorite) StateDef() int8

StateDef return folder's default state.

func (*Favorite) StatePub

func (f *Favorite) StatePub() int8

StatePub return folder's public state.

type Favorites

type Favorites []*Favorite

Favorites .

func (Favorites) Len

func (f Favorites) Len() int

func (Favorites) Less

func (f Favorites) Less(i, j int) bool

func (Favorites) Swap

func (f Favorites) Swap(i, j int)

type Music

type Music struct {
	ID    int64  `json:"song_id"`
	Cover string `json:"cover_url"`
	Title string `json:"title"`
}

type MusicResult

type MusicResult struct {
	Code int              `json:"code"`
	Data map[int64]*Music `json:"data"`
}

type NewCount

type NewCount struct {
	ID    int64 `json:"id"`
	Type  int8  `json:"type"`
	Oid   int64 `json:"oid"`
	Count int64 `json:"count"`
	CTime Stime `json:"ctime"`
	MTime Stime `json:"mtime"`
}

NewCount .

type NewFolder

type NewFolder struct {
	ID    int64  `json:"id"`
	Type  int8   `json:"type"`
	Mid   int64  `json:"mid"`
	Name  string `json:"name"`
	Count int    `json:"count"`
	Attr  int8   `json:"attr"`
	State int8   `json:"state"`
	CTime Stime  `json:"ctime"`
	MTime Stime  `json:"mtime"`
}

NewFolder .

type NewFolderSort

type NewFolderSort struct {
	ID    int64  `json:"id"`
	Type  int8   `json:"type"`
	Mid   int64  `json:"mid"`
	Sort  []byte `json:"sort"`
	CTime Stime  `json:"ctime"`
	MTime Stime  `json:"mtime"`
}

NewFolderSort .

type NewRelation

type NewRelation struct {
	ID    int64 `json:"id"`
	Type  int8  `json:"type"`
	Mid   int64 `json:"mid"`
	Fid   int64 `json:"fid"`
	Oid   int64 `json:"oid"`
	State int8  `json:"state"`
	CTime Stime `json:"ctime"`
	MTime Stime `json:"mtime"`
}

NewRelation .

type OldCount

type OldCount struct {
	ID    int64 `json:"id"`
	Aid   int64 `json:"aid"`
	Count int64 `json:"count"`
	CTime Stime `json:"ctime"`
	MTime Stime `json:"mtime"`
}

OldCount .

type OldFolder

type OldFolder struct {
	ID       int64  `json:"id"`
	Mid      int64  `json:"mid"`
	Name     string `json:"name"`
	CurCount int    `json:"cur_count"`
	State    int8   `json:"state"`
	CTime    Stime  `json:"ctime"`
	MTime    Stime  `json:"mtime"`
}

OldFolder .

type OldFolderSort

type OldFolderSort struct {
	ID    int64  `json:"id"`
	Mid   int64  `json:"mid"`
	Sort  string `json:"sort"`
	CTime Stime  `json:"ctime"`
	MTime Stime  `json:"mtime"`
}

OldFolderSort .

type OldVideo

type OldVideo struct {
	ID    int64 `json:"id"`
	Mid   int64 `json:"mid"`
	Fid   int64 `json:"fid"`
	Aid   int64 `json:"aid"`
	CTime Stime `json:"ctime"`
	MTime Stime `json:"mtime"`
}

OldVideo .

type PlayReport

type PlayReport struct {
	ID       int64  `json:"id"`
	Mid      int64  `json:"mid"`
	LV       string `json:"lv"`
	IP       string `json:"ip"`
	Buvid    string `json:"buvid"`
	DeviceID string `json:"device_id"`
	UA       string `json:"ua"`
	Refer    string `json:"refer"`
	TS       int64  `json:"ts"`
}

PlayReport .

type StatCount

type StatCount struct {
	Type      string `json:"type"`
	ID        int64  `json:"id"`
	Count     int64  `json:"count"`
	DisLike   int64  `json:"dislike_count"`
	TimeStamp int64  `json:"timestamp"`
}

StatCount .

type StatMsg

type StatMsg struct {
	Play  *int64 `json:"play"`
	Fav   *int64 `json:"fav"`
	Share *int64 `json:"share"`
	Oid   int64  `json:"oid"`
}

StatMsg .

type Stime

type Stime int64

Stime .

func (*Stime) Scan

func (st *Stime) Scan(src interface{}) (err error)

Scan scan time.

func (*Stime) UnmarshalJSON

func (st *Stime) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface.

func (Stime) Value

func (st Stime) Value() (driver.Value, error)

Value get time value.

type VideoFolder

type VideoFolder struct {
	ID       int64 `json:"id"`
	Mid      int64 `json:"mid"`
	Fid      int64 `json:"fid"`
	VideoFid int64 `json:"video_fid"`
	CTime    Stime `json:"ctime"`
	MTime    Stime `json:"mtime"`
}

VideoFolder .

Jump to

Keyboard shortcuts

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