Documentation ¶
Index ¶
- func CreateComment(ctx context.Context, comment *Comment) error
- func CreateFavorite(ctx context.Context, uid, vid uint64) error
- func CreateVideo(ctx context.Context, videos []*Video) error
- func DeleteComment(ctx context.Context, uid, cid uint64) error
- func DeleteFavorite(ctx context.Context, uid, vid uint64) error
- func GetSetInt64List(ctx context.Context, key string) ([]uint64, error)
- func Init()
- func InitMysql()
- func InitRDB()
- func MGetFavoriteVideoIDs(ctx context.Context, uid uint64) (ids []uint64, err error)
- func QueryCommentCount(ctx context.Context, vid int64) (uint64, error)
- func QueryFavoriteCount(ctx context.Context, vid uint64) uint64
- func QueryIsFavorite(ctx context.Context, uid, vid uint64) bool
- type Comment
- type Video
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MGetFavoriteVideoIDs ¶
Types ¶
type Comment ¶
type Video ¶
type Video struct { gorm.Model Title string `gorm:"column:title"` AuthorID uint64 `gorm:"column:uid"` PlayUrl string `gorm:"column:play_url"` CoverUrl string `gorm:"column:cover_url"` FavoriteCount uint64 `gorm:"-"` CommentCount uint64 `gorm:"-"` IsFavorite bool `gorm:"-"` }
Video 影音视频字段
func MGetVideos ¶
MGetVideos multiple get list of video info
Click to show internal directories.
Click to hide internal directories.