Versions in this module Expand all Collapse all v1 v1.1.0 Jul 18, 2022 Changes in this version + var DB *gorm.DB + func Create(ctx context.Context, currentId int64, toUserId int64) error + func CreateComment(ctx context.Context, comment *CommentRaw) error + func CreateFavorite(ctx context.Context, favorite *FavoriteRaw, videoId int64) error + func Delete(ctx context.Context, currentId int64, toUserId int64) error + func DeleteFavorite(ctx context.Context, currentId int64, videoId int64) error + func Init() + func PublishVideoData(ctx context.Context, videoData *VideoRaw) error + func QueryFavoriteById(ctx context.Context, userId int64) ([]int64, error) + func QueryFavoriteByIds(ctx context.Context, currentId int64, videoIds []int64) (map[int64]*FavoriteRaw, error) + func QueryRelationByIds(ctx context.Context, currentId int64, userIds []int64) (map[int64]*RelationRaw, error) + func UploadUserData(ctx context.Context, username string, password string) (int64, error) + type CommentRaw struct + Contents string + UserId int64 + VideoId int64 + func DeleteComment(ctx context.Context, commentId int64) (*CommentRaw, error) + func QueryCommentByCommentIds(ctx context.Context, commentIds []int64) ([]*CommentRaw, error) + func QueryCommentByVideoId(ctx context.Context, videoId int64) ([]*CommentRaw, error) + func (CommentRaw) TableName() string + type FavoriteRaw struct + UserId int64 + VideoId int64 + func (FavoriteRaw) TableName() string + type RelationRaw struct + ToUserId int64 + UserId int64 + func QueryFollowById(ctx context.Context, userId int64) ([]*RelationRaw, error) + func QueryFollowerById(ctx context.Context, userId int64) ([]*RelationRaw, error) + func (RelationRaw) TableName() string + type UserRaw struct + FollowCount int64 + FollowerCount int64 + Name string + Password string + func QueryUserByIds(ctx context.Context, userIds []int64) ([]*UserRaw, error) + func QueryUserByName(ctx context.Context, userName string) ([]*UserRaw, error) + func (UserRaw) TableName() string + type VideoRaw struct + CommentCount int64 + CoverUrl string + FavoriteCount int64 + PlayUrl string + Title string + UpdatedAt time.Time + UserId int64 + func QueryVideoByLatestTime(ctx context.Context, latestTime int64) ([]*VideoRaw, error) + func QueryVideoByUserId(ctx context.Context, userId int64) ([]*VideoRaw, error) + func QueryVideoByVideoIds(ctx context.Context, videoIds []int64) ([]*VideoRaw, error) + func (v *VideoRaw) TableName() string