dao

package
v0.0.0-...-55e1567 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2023 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoSuchRecord       = errors.New("no such video record")
	ErrRecordAlreadyExist = errors.New("video record already exist")
)

Functions

This section is empty.

Types

type Video

type Video struct {
	// contains filtered or unexported fields
}

func NewVideo

func NewVideo(db *gorm.DB) *Video

NewVideo create a video dao.

func (*Video) BatchGetVideoByVideoId

func (v *Video) BatchGetVideoByVideoId(vidList []int64) ([]*model.Video, error)

BatchGetVideoByVideoId gets video list by videoId list.

func (*Video) CreateVideo

func (v *Video) CreateVideo(video *model.Video) error

CreateVideo creates a new video record.

func (*Video) DeleteVideoById

func (v *Video) DeleteVideoById(videoId int64) error

DeleteVideoById delete video by id.

func (*Video) GetVideoByVideoId

func (v *Video) GetVideoByVideoId(vid int64) (*model.Video, error)

GetVideoByVideoId gets video by videoId

func (*Video) GetVideoIdListByAuthorId

func (v *Video) GetVideoIdListByAuthorId(AuthorId int64) ([]int64, error)

GetVideoIdListByAuthorId gets videos by userId of author.

func (*Video) GetVideoListByAuthorId

func (v *Video) GetVideoListByAuthorId(AuthorId int64) ([]*model.Video, error)

GetVideoListByAuthorId gets videos by userId of author.

func (*Video) GetVideoListByLatestTime

func (v *Video) GetVideoListByLatestTime(latestTime int64) ([]*model.Video, error)

GetVideoListByLatestTime gets videos for feed.

Jump to

Keyboard shortcuts

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