新增文章编号
This commit is contained in:
parent
c85fdd129f
commit
d3e5526ffc
@ -10,6 +10,7 @@ type ArticleDto struct {
|
||||
ArticleId string `json:"article_id"` // 主键id
|
||||
ArticleTitle string `json:"article_title"` // 文章标题
|
||||
ArticleStatus int `json:"article_status"` // 文章状态(1:正常 2:禁用)
|
||||
ArticleNumber string `json:"article_number"` // 文章编号
|
||||
VoteNum uint `json:"vote_num"` // 总票数
|
||||
ArticleContent string `json:"article_content"` // 文章内容
|
||||
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
|
||||
@ -30,6 +31,7 @@ func GetArticleListDto(m []*model.Article) []*ArticleDto {
|
||||
ArticleId: fmt.Sprintf("%d", v.ArticleId),
|
||||
ArticleTitle: v.ArticleTitle,
|
||||
ArticleStatus: v.ArticleStatus,
|
||||
ArticleNumber: v.ArticleNumber,
|
||||
VoteNum: v.VoteNum,
|
||||
CreatedAt: v.CreatedAt,
|
||||
UpdatedAt: v.UpdatedAt,
|
||||
@ -54,6 +56,7 @@ func GetArticleDto(m *model.Article) *ArticleDto {
|
||||
ArticleId: fmt.Sprintf("%d", m.ArticleId),
|
||||
ArticleTitle: m.ArticleTitle,
|
||||
ArticleStatus: m.ArticleStatus,
|
||||
ArticleNumber: m.ArticleNumber,
|
||||
VoteNum: m.VoteNum,
|
||||
ArticleContent: m.ArticleContent,
|
||||
CreatedAt: m.CreatedAt,
|
||||
|
||||
@ -10,6 +10,7 @@ type VideoDto struct {
|
||||
VideoId string `json:"video_id"` // 主键id
|
||||
VideoTitle string `json:"video_title"` // 视频标题
|
||||
VideoStatus int `json:"video_status"` // 视频状态(1:正常 2:禁用)
|
||||
VideoNumber string `json:"video_number"` // 视频编号
|
||||
VoteNum uint `json:"vote_num"` // 总票数
|
||||
VideoNo string `json:"video_no"` // 视频编号(保利)
|
||||
VideoContent string `json:"video_content"` // 视频内容
|
||||
@ -31,6 +32,7 @@ func GetVideoListDto(m []*model.Video) []*VideoDto {
|
||||
VideoId: fmt.Sprintf("%d", v.VideoId),
|
||||
VideoTitle: v.VideoTitle,
|
||||
VideoStatus: v.VideoStatus,
|
||||
VideoNumber: v.VideoNumber,
|
||||
VoteNum: v.VoteNum,
|
||||
VideoNo: v.VideoNo,
|
||||
CreatedAt: v.CreatedAt,
|
||||
@ -56,6 +58,7 @@ func GetVideoDto(m *model.Video) *VideoDto {
|
||||
VideoId: fmt.Sprintf("%d", m.VideoId),
|
||||
VideoTitle: m.VideoTitle,
|
||||
VideoStatus: m.VideoStatus,
|
||||
VideoNumber: m.VideoNumber,
|
||||
VoteNum: m.VoteNum,
|
||||
VideoNo: m.VideoNo,
|
||||
VideoContent: m.VideoContent,
|
||||
|
||||
@ -11,6 +11,7 @@ type Article struct {
|
||||
ArticleId int64 `gorm:"column:article_id;type:bigint(19);primary_key;comment:主键id" json:"article_id"`
|
||||
ArticleTitle string `gorm:"column:article_title;type:varchar(200);comment:文章标题" json:"article_title"`
|
||||
ArticleStatus int `gorm:"column:article_status;type:tinyint(1);default:1;comment:文章状态(1:正常 2:禁用)" json:"article_status"`
|
||||
ArticleNumber string `gorm:"column:article_number;type:varchar(10);comment:文章编号;NOT NULL" json:"article_number"`
|
||||
VoteNum uint `gorm:"column:vote_num;type:int(10) unsigned;default:0;comment:总票数" json:"vote_num"`
|
||||
ArticleContent string `gorm:"column:article_content;type:text;comment:文章内容" json:"article_content"`
|
||||
Model
|
||||
|
||||
@ -12,6 +12,7 @@ type Video struct {
|
||||
VideoTitle string `gorm:"column:video_title;type:varchar(200);comment:视频标题" json:"video_title"`
|
||||
VideoStatus int `gorm:"column:video_status;type:tinyint(1);default:1;comment:视频状态(1:正常 2:禁用)" json:"video_status"`
|
||||
VoteNum uint `gorm:"column:vote_num;type:int(10) unsigned;default:0;comment:总票数" json:"vote_num"`
|
||||
VideoNumber string `gorm:"column:video_number;type:varchar(10);comment:视频编号;NOT NULL" json:"video_number"`
|
||||
VideoNo string `gorm:"column:video_no;type:varchar(255);comment:视频编号(保利)" json:"video_no"`
|
||||
VideoContent string `gorm:"column:video_content;type:text;comment:视频内容" json:"video_content"`
|
||||
Model
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user