Documentation ¶
Index ¶
Constants ¶
View Source
const TableNameComment = "comment"
View Source
const TableNameFavorite = "favorite"
View Source
const TableNameMessage = "message"
View Source
const TableNameRelation = "relation"
View Source
const TableNameUser = "user"
View Source
const TableNameVideo = "video"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Comment ¶
type Comment struct { ID int32 `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"` VideoID int32 `gorm:"column:video_id;not null" json:"video_id"` UserID int32 `gorm:"column:user_id;not null" json:"user_id"` Content string `gorm:"column:content" json:"content"` CreateAt time.Time `gorm:"column:create_at;default:CURRENT_TIMESTAMP" json:"create_at"` Author User `gorm:"foreignKey:UserID" json:"author"` }
Comment mapped from table <comment>
type Favorite ¶
type Favorite struct { ID int32 `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"` UserID int32 `gorm:"column:user_id;not null" json:"user_id"` VideoID int32 `gorm:"column:video_id;not null" json:"video_id"` }
Favorite mapped from table <favorite>
type Message ¶
type Message struct { ID int32 `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"` UserID int32 `gorm:"column:user_id;not null" json:"user_id"` // 发送方 ToUserID int32 `gorm:"column:to_user_id" json:"to_user_id"` // 接收方 Content string `gorm:"column:content" json:"content"` CreateAt time.Time `gorm:"column:create_at;default:CURRENT_TIMESTAMP" json:"create_at"` }
Message mapped from table <message>
type Relation ¶
type Relation struct { ID int32 `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"` UserID int32 `gorm:"column:user_id;not null" json:"user_id"` // 关注者id ToUserID int32 `gorm:"column:to_user_id;not null" json:"to_user_id"` // 被关注者id CreateAt time.Time `gorm:"column:create_at;default:CURRENT_TIMESTAMP" json:"create_at"` User User `gorm:"foreignKey:UserID" json:"user"` FollowUser User `gorm:"foreignKey:ToUserID" json:"follow_user"` }
Relation mapped from table <relation>
type User ¶
type User struct { ID int32 `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"` Username string `gorm:"column:username;not null" json:"username"` Password string `gorm:"column:password;not null" json:"password"` FollowCount int32 `gorm:"column:follow_count" json:"follow_count"` // 关注数 FollowerCount int32 `gorm:"column:follower_count" json:"follower_count"` // 粉丝数 Avatar string `gorm:"column:avatar;not null" json:"avatar"` CreateAt time.Time `gorm:"column:create_at;not null;default:CURRENT_TIMESTAMP" json:"create_at"` UpdateAt time.Time `gorm:"column:update_at;not null;default:CURRENT_TIMESTAMP" json:"update_at"` BackgroundImage string `gorm:"column:background_image" json:"background_image"` Signature string `gorm:"column:signature" json:"signature"` TotalFavorited int32 `gorm:"column:total_favorited" json:"total_favorited"` // 获赞数量 WorkCount int32 `gorm:"column:work_count" json:"work_count"` // 作品数量 FavoriteCount int32 `gorm:"column:favorite_count" json:"favorite_count"` // 点赞数量 }
User mapped from table <user>
type Video ¶
type Video struct { ID int32 `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"` UserID int32 `gorm:"column:user_id;not null" json:"user_id"` PlayURL string `gorm:"column:play_url;not null" json:"play_url"` // 视频播放地址 CoverURL string `gorm:"column:cover_url;not null" json:"cover_url"` // 视频封面地址 FavoriteCount int32 `gorm:"column:favorite_count;not null" json:"favorite_count"` // 视频点赞数 CommentCount int32 `gorm:"column:comment_count;not null" json:"comment_count"` // 视频评论数 Title string `gorm:"column:title;not null" json:"title"` CreateAt time.Time `gorm:"column:create_at;default:CURRENT_TIMESTAMP" json:"create_at"` UpdateAt time.Time `gorm:"column:update_at;default:CURRENT_TIMESTAMP" json:"update_at"` Author User `gorm:"foreignKey:UserID" json:"author"` }
Video mapped from table <video>
Click to show internal directories.
Click to hide internal directories.