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

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

This section is empty.

Types

type Comment

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

func NewComment

func NewComment(db *gorm.DB) *Comment

NewComment create an interaction comment dao.

func (*Comment) CommentCountByVideoId

func (c *Comment) CommentCountByVideoId(videoId int64) (int64, error)

CommentCountByVideoId gets the number of comments by videoId.

func (*Comment) CreateComment

func (c *Comment) CreateComment(comment *model.Comment) error

CreateComment creates a comment.

func (*Comment) DeleteComment

func (c *Comment) DeleteComment(id int64) error

DeleteComment to delete a comment.

func (*Comment) GetCommentIdListByVideoId

func (c *Comment) GetCommentIdListByVideoId(videoId int64) ([]string, error)

GetCommentIdListByVideoId gets commentId list by videoId

func (*Comment) GetCommentListByVideoId

func (c *Comment) GetCommentListByVideoId(videoId int64) ([]*model.Comment, error)

GetCommentListByVideoId gets comment list by videoId.

type Favorite

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

func NewFavorite

func NewFavorite(db *gorm.DB) *Favorite

NewFavorite create a interaction favorite dao.

func (*Favorite) CreateFavorite

func (f *Favorite) CreateFavorite(fav *model.Favorite) error

CreateFavorite creates a favorite record.

func (*Favorite) GetFavoriteCountByVideoId

func (f *Favorite) GetFavoriteCountByVideoId(videoId int64) (int64, error)

GetFavoriteCountByVideoId gets the number of favorite by videoId.

func (*Favorite) GetFavoriteInfo

func (f *Favorite) GetFavoriteInfo(userId, videoId int64) (*model.Favorite, error)

GetFavoriteInfo get favorite info.

func (*Favorite) GetFavoriteUserList

func (f *Favorite) GetFavoriteUserList(videoId int64) ([]int64, error)

GetFavoriteUserList gets favorite user list by videoId.

func (*Favorite) GetFavoriteVideoCountByUserId

func (f *Favorite) GetFavoriteVideoCountByUserId(userId int64) (int64, error)

GetFavoriteVideoCountByUserId gets a user's favorite video count.

func (*Favorite) GetFavoriteVideoIdListByUserId

func (f *Favorite) GetFavoriteVideoIdListByUserId(userId int64) ([]int64, error)

GetFavoriteVideoIdListByUserId gets a user's favorite video list

func (*Favorite) UpdateFavorite

func (f *Favorite) UpdateFavorite(userId, videoId int64, actionType int8) error

UpdateFavorite updates favorite status.

Jump to

Keyboard shortcuts

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