Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Comment ¶
type Comment struct { ID uint64 `gorm:"column:id" redis:"id"` //评论ID CreatedAt time.Time `gorm:"column:created_at" redis:"-"` //创建时间 UpdatedAt time.Time `gorm:"column:updated_at" redis:"-"` //更新时间 DeletedAt gorm.DeletedAt `gorm:"column:deleted_at" redis:"-"` //删除时间 Content string `gorm:"column:content" redis:"content"` //评论内容 UserID uint64 `gorm:"column:user_id" redis:"user_id"` //评论所属视频ID VideoID uint64 `gorm:"column:video_id" redis:"video_id"` //评论所属用户ID }
Comment 评论:数据库表comments对应的model
type Favorite ¶
type Favorite struct { ID uint64 `gorm:"column:id"` //点赞表ID CreatedAt time.Time `gorm:"column:created_at"` //创建时间 UpdatedAt time.Time `gorm:"column:updated_at"` //更新时间 DeletedAt gorm.DeletedAt `gorm:"column:deleted_at"` //删除时间 UserID uint64 `gorm:"column:user_id"` //点赞用户ID VideoID uint64 `gorm:"column:video_id"` //被点赞视频ID IsFavorite *bool `gorm:"column:is_favorite"` //是否点赞,false-未点赞,true-点赞 }
Favorite 点赞:数据库表favorites对应的model
type Relation ¶
type Relation struct { ID uint64 `gorm:"column:id"` //关系表ID CreatedAt time.Time `gorm:"column:created_at"` //创建时间 UpdatedAt time.Time `gorm:"column:updated_at"` //更新时间 DeletedAt gorm.DeletedAt `gorm:"column:deleted_at"` //删除时间 FromUserID uint64 `gorm:"column:from_user_id"` //关注者ID ToUserID uint64 `gorm:"column:to_user_id"` //被关注者ID IsFollow *bool `gorm:"column:is_follow"` //是否关注,false-未关注,true-关注 }
Relation 关注:数据库表relations对应的model
type User ¶
type User struct { ID uint64 `gorm:"column:id" redis:"id"` //用户ID CreatedAt time.Time `gorm:"column:created_at" redis:"-"` //创建时间 UpdatedAt time.Time `gorm:"column:updated_at" redis:"-"` //更新时间 DeletedAt gorm.DeletedAt `gorm:"column:deleted_at" redis:"-"` //删除时间 Name string `gorm:"column:name" redis:"name"` //用户名 PassWord string `gorm:"column:password" redis:"password"` //用户密码 FollowCount int64 `gorm:"-" redis:"follow_count"` //关注数量 FollowerCount int64 `gorm:"-" redis:"follower_count"` //粉丝数量 }
User 用户:数据库表users对应的model
type Video ¶
type Video struct { ID uint64 `gorm:"column:id" redis:"id"` //视频ID CreatedAt time.Time `gorm:"column:created_at" redis:"-"` //视频发布创建时间 UpdatedAt time.Time `gorm:"column:updated_at" redis:"-"` //更新时间 DeletedAt gorm.DeletedAt `gorm:"column:deleted_at" redis:"-"` //删除时间 Title string `gorm:"column:title" redis:"title"` //视频标题 AuthorID uint64 `gorm:"column:author_id" redis:"author_id"` //视频发布者ID PlayUrl string `gorm:"column:play_url" redis:"play_url"` //视频源地址 CoverUrl string `gorm:"column:cover_url" redis:"cover_url"` //视频封面地址 FavoriteCount int64 `gorm:"-" redis:"favorite_count"` //视频点赞数 CommentCount int64 `gorm:"-" redis:"comment_count" ` //视频评论数 }
Video 视频:数据库表videos对应的model
Source Files ¶
Click to show internal directories.
Click to hide internal directories.