1 Star 0 Fork 0

mq-go/bluebell

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
community.go 1.89 KB
一键复制 编辑 原始数据 按行查看 历史
柒染 提交于 2023-10-04 12:37 +08:00 . 接口优化
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"`
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/mq-go/bluebell.git
git@gitee.com:mq-go/bluebell.git
mq-go
bluebell
bluebell
d993e0e507c7

搜索帮助