model

package
v0.0.0-...-905bf1f Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init()

Types

type Search struct {
	Year   int64  `sql:"year >= ?"`
	Liked  int64  `sql:"liked >= ?"`
	Shared int64  `sql:"shared >= ?"`
	Title  string `sql:"title LIKE ?"`
}

func (*Search) SearchVideos

func (s *Search) SearchVideos(dst *[]Video) error

type Status

type Status struct {
	ID      int64 `gorm:"primaryKey;not null;unique"`
	VideoID int64 `gorm:"not null;unique"`
	Passed  bool  `gorm:"not null"`
	Reason  string
}

type Video

type Video struct {
	ID          int64   `gorm:"primaryKey;not null;unique"`
	UserID      int64   `gorm:"not null"`
	Title       string  `gorm:"unique;not null"`
	Description string  `gorm:"not null"`
	Liked       int64   `gorm:"not null"`
	Shared      int64   `gorm:"not null"`
	VideoUrl    string  `gorm:"not null"`
	Year        int64   `gorm:"not null"`
	Status      *Status `gorm:"foreignKey:VideoID;references:ID"`
}

func (*Video) Create

func (v *Video) Create() error

func (*Video) JudgeThenGet

func (v *Video) JudgeThenGet() error

func (*Video) Like

func (v *Video) Like() error

func (*Video) Share

func (v *Video) Share() error

func (*Video) View

func (v *Video) View() error

Jump to

Keyboard shortcuts

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