Documentation ¶
Index ¶
Constants ¶
View Source
const TableNameCollection = "collection"
View Source
const TableNameCollectionVideo = "collection_video"
View Source
const TableNameComment = "comment"
View Source
const TableNameFavorite = "favorite"
View Source
const TableNameFollow = "follow"
View Source
const TableNameUser = "user"
View Source
const TableNameVideo = "video"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Collection ¶
type Collection struct { ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` UserID int64 `gorm:"column:user_id;type:bigint;not null;index:user_id_idx,priority:1" json:"user_id"` Title string `gorm:"column:title;type:varchar(255);not null" json:"title"` Description string `gorm:"column:description;type:text;not null" json:"description"` IsDeleted bool `gorm:"column:is_deleted;type:tinyint(1);not null;index:user_id_idx,priority:2" json:"is_deleted"` CreateTime time.Time `` /* 127-byte string literal not displayed */ UpdateTime time.Time `` /* 127-byte string literal not displayed */ }
Collection mapped from table <collection>
func (*Collection) TableName ¶
func (*Collection) TableName() string
TableName Collection's table name
type CollectionVideo ¶
type CollectionVideo struct { ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` CollectionID int64 `gorm:"column:collection_id;type:bigint;not null;index:collection_id_idx,priority:1" json:"collection_id"` UserID int64 `gorm:"column:user_id;type:bigint;not null" json:"user_id"` VideoID int64 `gorm:"column:video_id;type:bigint;not null" json:"video_id"` IsDeleted bool `gorm:"column:is_deleted;type:tinyint(1);not null;index:collection_id_idx,priority:2" json:"is_deleted"` CreateTime time.Time `gorm:"column:create_time;type:timestamp;not null;default:CURRENT_TIMESTAMP" json:"create_time"` UpdateTime time.Time `gorm:"column:update_time;type:timestamp;not null;default:CURRENT_TIMESTAMP" json:"update_time"` }
CollectionVideo mapped from table <collection_video>
func (*CollectionVideo) TableName ¶
func (*CollectionVideo) TableName() string
TableName CollectionVideo's table name
type Comment ¶
type Comment struct { ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` VideoID int64 `gorm:"column:video_id;type:bigint;not null;index:video_id_idx,priority:1" json:"video_id"` UserID int64 `gorm:"column:user_id;type:bigint;not null;index:user_id_idx,priority:1;comment:发表评论的用户id" json:"user_id"` // 发表评论的用户id ParentID *int64 `gorm:"column:parent_id;type:bigint;comment:父评论id" json:"parent_id"` // 父评论id ToUserID *int64 `gorm:"column:to_user_id;type:bigint;comment:评论所回复的用户id" json:"to_user_id"` // 评论所回复的用户id Content string `gorm:"column:content;type:varchar(512);not null;comment:评论内容" json:"content"` // 评论内容 FirstComments string `gorm:"column:first_comments;type:json;not null;comment:最开始的x条子评论" json:"first_comments"` // 最开始的x条子评论 IsDeleted bool `` /* 126-byte string literal not displayed */ CreateTime time.Time `` /* 127-byte string literal not displayed */ UpdateTime time.Time `` /* 127-byte string literal not displayed */ }
Comment mapped from table <comment>
type Favorite ¶
type Favorite struct { ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` UserID int64 `gorm:"column:user_id;type:bigint;not null;index:user_id_idx,priority:1" json:"user_id"` TargetType int32 `` // 点赞对象类型 1-视频 2-评论 /* 136-byte string literal not displayed */ TargetID int64 `gorm:"column:target_id;type:bigint;not null;index:user_id_idx,priority:2;comment:点赞对象id" json:"target_id"` // 点赞对象id FavoriteType int32 `` // 点赞类型 1-点赞 2-踩 /* 131-byte string literal not displayed */ IsDeleted bool `gorm:"column:is_deleted;type:tinyint(1);not null;index:user_id_idx,priority:5" json:"is_deleted"` CreateTime time.Time `` /* 127-byte string literal not displayed */ UpdateTime time.Time `` /* 127-byte string literal not displayed */ }
Favorite mapped from table <favorite>
type Follow ¶
type Follow struct { ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` UserID int64 `gorm:"column:user_id;type:bigint;not null;index:user_id_idx,priority:1" json:"user_id"` TargetUserID int64 `` // 被关注的用户id /* 129-byte string literal not displayed */ IsDeleted bool `gorm:"column:is_deleted;type:tinyint(1);not null;index:user_id_idx,priority:3" json:"is_deleted"` CreateTime time.Time `gorm:"column:create_time;type:timestamp;not null;default:CURRENT_TIMESTAMP" json:"create_time"` UpdateTime time.Time `gorm:"column:update_time;type:timestamp;not null;default:CURRENT_TIMESTAMP" json:"update_time"` }
Follow mapped from table <follow>
type User ¶
type User struct { ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` AccountID int64 `gorm:"column:account_id;type:bigint;not null;uniqueIndex:idx_users_account_id,priority:1" json:"account_id"` Mobile string `gorm:"column:mobile;type:varchar(20);not null" json:"mobile"` Email string `gorm:"column:email;type:varchar(50);not null" json:"email"` Name string `gorm:"column:name;type:varchar(50);not null" json:"name"` Avatar string `gorm:"column:avatar;type:varchar(255);not null" json:"avatar"` BackgroundImage string `gorm:"column:background_image;type:varchar(255);not null" json:"background_image"` Signature string `gorm:"column:signature;type:varchar(255);not null" json:"signature"` CreatedAt time.Time `gorm:"column:created_at;type:timestamp;not null;default:CURRENT_TIMESTAMP" json:"created_at"` UpdatedAt time.Time `gorm:"column:updated_at;type:timestamp;not null;default:CURRENT_TIMESTAMP" json:"updated_at"` }
User mapped from table <user>
type Video ¶
type Video struct { ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` UserID int64 `gorm:"column:user_id;type:bigint;not null" json:"user_id"` Title string `gorm:"column:title;type:varchar(50);not null" json:"title"` Description string `gorm:"column:description;type:varchar(255);not null" json:"description"` VideoURL string `gorm:"column:video_url;type:varchar(255);not null" json:"video_url"` CoverURL string `gorm:"column:cover_url;type:varchar(255);not null" json:"cover_url"` LikeCount int64 `gorm:"column:like_count;type:bigint;not null" json:"like_count"` CommentCount int64 `gorm:"column:comment_count;type:bigint;not null" json:"comment_count"` CreatedAt time.Time `gorm:"column:created_at;type:timestamp;not null;default:CURRENT_TIMESTAMP" json:"created_at"` UpdatedAt time.Time `gorm:"column:updated_at;type:timestamp;not null;default:CURRENT_TIMESTAMP" json:"updated_at"` }
Video mapped from table <video>
Click to show internal directories.
Click to hide internal directories.