重构一下数据库
This commit is contained in:
28
Backend/internal/model/do/forum_boards.go
Normal file
28
Backend/internal/model/do/forum_boards.go
Normal file
@@ -0,0 +1,28 @@
|
||||
// =================================================================================
|
||||
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
|
||||
// =================================================================================
|
||||
|
||||
package do
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
)
|
||||
|
||||
// ForumBoards is the golang structure of table forum_boards for DAO operations like Where/Data.
|
||||
type ForumBoards struct {
|
||||
g.Meta `orm:"table:forum_boards, do:true"`
|
||||
Id any // 版块ID(主键)
|
||||
SectionId any // 所属频道ID(关联 forum_sections.id,无外键;可为空=不分区)
|
||||
Name any // 版块名称
|
||||
Description any // 版块简介
|
||||
CoverImage any // 版块封面图URL
|
||||
Status any // 状态:normal=正常 hidden=隐藏 deleted=删除
|
||||
DisplayOrder any // 排序值(越大越靠前)
|
||||
PostCount any // 帖子总数(冗余)
|
||||
TodayPostCount any // 今日发帖数(冗余,可选)
|
||||
LastPostId any // 最后一篇帖子ID(冗余,可选)
|
||||
LastPostAt *gtime.Time // 最后发帖时间(冗余,可选)
|
||||
CreatedAt *gtime.Time // 创建时间
|
||||
UpdatedAt *gtime.Time // 更新时间
|
||||
}
|
||||
@@ -11,16 +11,16 @@ import (
|
||||
|
||||
// ForumComments is the golang structure of table forum_comments for DAO operations like Where/Data.
|
||||
type ForumComments struct {
|
||||
g.Meta `orm:"table:forum_comments, do:true"`
|
||||
Id any // 评论ID(主键)
|
||||
UserId any // 评论发布者ID(关联users.id,无外键)
|
||||
PostId any // 所属帖子ID(关联forum_posts.id,无外键)
|
||||
ParentId any // 父评论ID(NULL=根评论,非NULL=回复某条评论)
|
||||
Content any // 评论内容(支持emoji)
|
||||
Status any // 评论状态:normal=正常 deleted=软删除 audit=审核中 reject=审核驳回
|
||||
LikeCount any // 点赞数
|
||||
ReplyCount any // 回复数(冗余字段)
|
||||
CreatedAt *gtime.Time // 评论创建时间
|
||||
UpdatedAt *gtime.Time // 评论更新时间
|
||||
DeletedAt *gtime.Time // 软删除时间
|
||||
g.Meta `orm:"table:forum_comments, do:true"`
|
||||
Id any // 评论ID(主键)
|
||||
PostId any // 所属帖子ID(关联 forum_posts.id,无外键)
|
||||
UserId any // 评论发布者ID(关联 users.id,无外键)
|
||||
ParentId any // 父评论ID:NULL=一级评论;非NULL=二级评论(指向一级评论ID,无外键)
|
||||
ReplyToUserId any // 回复的用户ID(可选,用于展示“回复@xxx”,无外键)
|
||||
Content any // 评论内容(支持emoji)
|
||||
Status any // 状态:normal=正常 deleted=软删 audit=审核中 reject=驳回
|
||||
LikeCount any // 点赞数(冗余)
|
||||
CreatedAt *gtime.Time // 创建时间
|
||||
UpdatedAt *gtime.Time // 更新时间
|
||||
DeletedAt *gtime.Time // 软删除时间
|
||||
}
|
||||
|
||||
@@ -11,17 +11,23 @@ import (
|
||||
|
||||
// ForumPosts is the golang structure of table forum_posts for DAO operations like Where/Data.
|
||||
type ForumPosts struct {
|
||||
g.Meta `orm:"table:forum_posts, do:true"`
|
||||
Id any // 帖子ID(主键)
|
||||
UserId any // 发帖用户ID(关联users.id,无外键)
|
||||
Title any // 帖子标题
|
||||
Content any // 帖子正文(支持富文本/emoji)
|
||||
CoverImage any // 帖子封面图URL
|
||||
Status any // 帖子状态:normal=正常 deleted=软删除 audit=审核中 reject=审核驳回
|
||||
ViewCount any // 浏览量(冗余字段)
|
||||
LikeCount any // 点赞数(冗余字段)
|
||||
CommentCount any // 评论数(冗余字段)
|
||||
CreatedAt *gtime.Time // 发帖时间
|
||||
UpdatedAt *gtime.Time // 更新时间
|
||||
DeletedAt *gtime.Time // 软删除时间
|
||||
g.Meta `orm:"table:forum_posts, do:true"`
|
||||
Id any // 帖子ID(主键)
|
||||
BoardId any // 所属版块ID(关联 forum_boards.id,无外键)
|
||||
UserId any // 发帖用户ID(关联 users.id,无外键)
|
||||
Title any // 帖子标题
|
||||
Content any // 帖子正文(支持富文本/emoji)
|
||||
CoverImage any // 帖子封面图URL
|
||||
Status any // 状态:normal=正常 deleted=软删 audit=审核中 reject=驳回
|
||||
IsPinned any // 是否置顶:0否 1是
|
||||
IsEssence any // 是否精华:0否 1是
|
||||
ViewCount any // 浏览量(冗余)
|
||||
LikeCount any // 点赞数(冗余)
|
||||
CommentCount any // 评论数(冗余)
|
||||
CollectCount any // 收藏数(冗余,可选)
|
||||
LastCommentId any // 最后一条评论ID(冗余,可选)
|
||||
LastCommentAt *gtime.Time // 最后评论时间(冗余,可选)
|
||||
CreatedAt *gtime.Time // 发帖时间
|
||||
UpdatedAt *gtime.Time // 更新时间
|
||||
DeletedAt *gtime.Time // 软删除时间
|
||||
}
|
||||
|
||||
23
Backend/internal/model/do/forum_sections.go
Normal file
23
Backend/internal/model/do/forum_sections.go
Normal file
@@ -0,0 +1,23 @@
|
||||
// =================================================================================
|
||||
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
|
||||
// =================================================================================
|
||||
|
||||
package do
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
)
|
||||
|
||||
// ForumSections is the golang structure of table forum_sections for DAO operations like Where/Data.
|
||||
type ForumSections struct {
|
||||
g.Meta `orm:"table:forum_sections, do:true"`
|
||||
Id any // 频道/分区ID(主键)
|
||||
Name any // 频道名称
|
||||
Description any // 频道简介
|
||||
Icon any // 频道图标URL
|
||||
Status any // 状态:normal=正常 hidden=隐藏 deleted=删除
|
||||
DisplayOrder any // 排序值(越大越靠前)
|
||||
CreatedAt *gtime.Time // 创建时间
|
||||
UpdatedAt *gtime.Time // 更新时间
|
||||
}
|
||||
@@ -18,16 +18,12 @@ type Users struct {
|
||||
Nickname any // 昵称
|
||||
Gender any // 性别:0未知 1男 2女
|
||||
BirthDate *gtime.Time // 生日
|
||||
UserType any // 用户类型:normal普通用户,vip为VIP用户
|
||||
VipStartAt *gtime.Time // VIP开始时间
|
||||
VipEndAt *gtime.Time // VIP结束时间
|
||||
UserType any // 用户类型:1 user 2 admin
|
||||
CreatedAt *gtime.Time // 创建时间
|
||||
UpdatedAt *gtime.Time // 更新时间
|
||||
RealityRole any // 现实身份/角色
|
||||
AbnormalRole any // 异常身份/角色
|
||||
JobTitle any // 职位
|
||||
Commendation any //
|
||||
Admonition any //
|
||||
Email any //
|
||||
RedTrace any // 红轨
|
||||
YellowTrace any // 黄轨
|
||||
|
||||
Reference in New Issue
Block a user