代码拉取完成,页面将自动刷新
package models
type Community struct {
BaseModel
CommunityId int `json:"community_id" gorm:"index:idx_community_id;type:int(10);not null"`
CommunityName string `json:"community_name" gorm:"index:idx_community_name;type:varchar(128);not null"`
Introduction string `json:"introduction" gorm:"type:varchar(256);not null"`
}
type CommunityList struct {
CommunityId int `json:"community_name" gorm:"index:idx_community_name;type:varchar(128);not null"`
Introduction string `json:"introduction" gorm:"type:varchar(256);not null"`
}
type CommunityDetail struct {
BaseModel
CommunityId int `json:"community_id" gorm:"index:idx_community_id;type:int(10);not null"`
CommunityName string `json:"community_name" gorm:"index:idx_community_name;type:varchar(128);not null"`
Introduction string `json:"introduction" gorm:"type:varchar(256);not null"`
}
type Post struct {
BaseModel
PostId int `json:"post_id" gorm:"index:idx_post_id;bigint(20);not null;commit '帖子id'"`
Title string `json:"title" gorm:"varchar(128);not null;commit '标题'" binding:"required"`
Content string `json:"content" gorm:"varchar(8192);not null;commit '内容'" binding:"required"`
AuthorId int `json:"author_id" gorm:"index:idx_author_id;bigint(20);not null;commit '作者的用户id'"`
CommunityId int `json:"community_id" gorm:"index:idx_community_id;bigint(20);not null;commit '所属社区'" binding:"required"`
Status int `json:"status" gorm:"default:1;tinyint(4);not null;commit '帖子状态'"`
}
type PostDetail struct {
Post Post
UserName string `json:"user_name"`
CommunityName string `json:"community_name"`
Introduction string `json:"introduction"`
}
type PostDetail2 struct {
Post Post
UserName string `json:"user_name"`
CommunityName string `json:"community_name"`
Introduction string `json:"introduction"`
VoteNum int64 `json:"vote_num"`
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。