Documentation
¶
Overview ¶
文章模块
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Article ¶
type Article struct { Id uint `gorm:"column:id;primaryKey;type:INT UNSIGNED;not null;autoIncrement" json:"id" form:"id"` // 文章ID Title string `gorm:"column:title;type:varchar(200)" json:"title" form:"title"` // 文章标题 UserId uint `gorm:"column:user_id;type:INT UNSIGNED;not null" json:"user_id" form:"user_id"` // 创建人id GiveLikeNum uint `gorm:"column:give_like_num;type:INT UNSIGNED;not null" json:"give_like_num" form:"give_like_num"` // 点赞次数 BrowseNum uint `gorm:"column:browse_num;type:INT UNSIGNED;not null" json:"browse_num" form:"browse_num"` // 浏览次数 CollectNum uint `gorm:"column:collect_num;type:INT UNSIGNED;not null" json:"collect_num" form:"collect_num"` // 收藏次数 CommentNum int `gorm:"column:comment_num;type:INT UNSIGNED;not null" json:"comment_num" form:"comment_num"` // 评论数量 DonotComment uint8 `gorm:"do_not_comment;type:TINYINT UNSIGNED;not null" json:"do_not_comment" form:"do_not_comment"` // 是否禁止评论 IsDelete int8 `gorm:"column:is_delete;type:TINYINT UNSIGNED" json:"is_delete" form:"is_delete"` // 是否删除 1-删除 0-未删除 CreatedAt string `gorm:"column:created_at;type:datetime" json:"created_at" form:"created_at"` // 创建时间 UpdatedAt string `gorm:"column:updated_at;type:datetime" json:"updated_at" form:"updated_at"` // 更新时间 }
文章主表,用于展示文章的主要信息
type ArticleComment ¶
type ArticleComment struct { Id uint `gorm:"column:id;primaryKey;type:INT UNSIGNED;not null;autoIncrement" json:"id" form:"id"` // 评论ID ArticleId uint `gorm:"column:article_id;type:INT UNSIGNED;not null" json:"article_id" form:"article_id"` // 文章ID CommentId uint `gorm:"column:comment_id;type:INT UNSIGNED;not null" json:"comment_id" form:"comment_id"` // 回复评论ID UserId uint `gorm:"column:user_id;type:INT UNSIGNED;not null" json:"user_id" form:"user_id"` // 创建人id Content string `gorm:"column:content;type:varchar(200)" json:"content" form:"content"` // 文章评论 200字内 IsDelete int8 `gorm:"column:is_delete;type:TINYINT UNSIGNED" json:"is_delete" form:"is_delete"` // 是否删除 1-删除 0-未删除 CreatedAt string `gorm:"column:created_at;type:datetime" json:"created_at" form:"created_at"` // 创建时间 }
文章评论表
type ArticleConfig ¶
type ArticleContent ¶
type ArticleContent struct { ArticleId uint `gorm:"column:id;primaryKey;type:INT UNSIGNED;not null" json:"id" form:"id"` // 文章ID Content string `gorm:"column:content;type:longtext" json:"content" form:"content"` // 文章内容 }
文章详情表,用于存储文章的详情内容
type ArticleEdits ¶
type ArticleEdits struct { Id uint `gorm:"column:id;primaryKey;type:INT UNSIGNED;not null;autoIncrement" json:"id" form:"id"` // 文章ID Title string `gorm:"column:title;type:varchar(200)" json:"title" form:"title"` // 文章标题 UserId uint `gorm:"column:user_id;type:INT UNSIGNED;not null" json:"user_id" form:"user_id"` // 创建人id AuditStatus uint8 `gorm:"column:audit_status;type:TINYINT UNSIGNED;not null" json:"audit_status" form:"audit_status"` // 审核状态 0-未审核 98-审核拒绝 99-审核通过 AuditUserId uint `gorm:"column:audit_user_id;type:INT UNSIGNED;not null" json:"audit_user_id" form:"audit_user_id"` // 审核人id CreatedAt string `gorm:"column:created_at;type:datetime" json:"created_at" form:"created_at"` // 创建时间 UpdatedAt string `gorm:"column:updated_at;type:datetime" json:"updated_at" form:"updated_at"` // 审核时间 }
文章编辑表,该表每次编辑都会重新生成一条记录
type ArticleEditsContent ¶
type ArticleEditsContent struct { ArticleEditsId uint `gorm:"column:id;primaryKey;type:INT UNSIGNED;not null" json:"id" form:"id"` // 文章编辑条目ID Content string `gorm:"column:content;type:longtext" json:"content" form:"content"` // 文章内容 }
文章编辑表对应的内容,审核通过后会将该内容替换到文章表中
Click to show internal directories.
Click to hide internal directories.