Documentation ¶
Index ¶
- Variables
- func Init()
- 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)
- type FavoriteRaw
- type RelationRaw
- type UserRaw
- type VideoRaw
Constants ¶
This section is empty.
Variables ¶
View Source
var DB *gorm.DB
Functions ¶
func QueryFavoriteByIds ¶
func QueryRelationByIds ¶
Types ¶
type FavoriteRaw ¶
type FavoriteRaw struct { gorm.Model UserId int64 `gorm:"column:user_id;not null;index:idx_userid"` VideoId int64 `gorm:"column:video_id;not null;index:idx_videoid"` }
func (FavoriteRaw) TableName ¶
func (FavoriteRaw) TableName() string
type RelationRaw ¶
type RelationRaw struct { gorm.Model UserId int64 `gorm:"column:user_id;not null;index:idx_userid"` ToUserId int64 `gorm:"column:to_user_id;not null;index:idx_touserid"` }
func (RelationRaw) TableName ¶
func (RelationRaw) TableName() string
type UserRaw ¶
type UserRaw struct { gorm.Model Name string `gorm:"column:name;index:idx_username,unique;type:varchar(32);not null"` Password string `gorm:"column:password;type:varchar(32);not null"` FollowCount int64 `gorm:"column:follow_count;default:0"` FollowerCount int64 `gorm:"column:follower_count;default:0"` Avatar string `gorm:"column:avatar,type:varchar(100);not null"` // 用户头像 BackgroundImage string `gorm:"column:background_image,type:varchar(100);not null"` // 用户个人页顶部大图 Signature string `gorm:"column:signature,type:varchar(1000);not null"` // 个人简介 TotalFavorited string `gorm:"column:total_favorited;type:varchar(1000);not null"` // 获赞数量 WorkCount int64 `gorm:"column:work_count;default:0"` // 作品数量 FavoriteCount int64 `gorm:"column:favorite_count;default:0"` // 点赞数量 }
type VideoRaw ¶
type VideoRaw struct { gorm.Model UserId int64 `gorm:"column:user_id;not null;index:idx_userid"` PlayUrl string `gorm:"column:play_url;varchar(128);not null"` CoverUrl string `gorm:"column:cover_url;varchar(128);not null"` FavoriteCount int64 `gorm:"column:favorite_count;default:0"` CommentCount int64 `gorm:"column:comment_count;default:0"` Title string `gorm:"column:title;type:varchar(128);not null"` UpdatedAt time.Time `gorm:"column:update_time;not null;index:idx_update"` }
func QueryVideoByLatestTime ¶
QueryVideoByLatestTime query video info by latest create Time
func QueryVideoByVideoIds ¶
QueryVideoByVideoIds query video info by video ids
Click to show internal directories.
Click to hide internal directories.