新增了后台

This commit is contained in:
2024-09-03 16:05:14 +08:00
parent c233e5d9b4
commit 383817a543
40 changed files with 2485 additions and 129 deletions
-1
View File
@@ -15,7 +15,6 @@ type Article struct {
ArticleContent string `gorm:"column:article_content;type:text;comment:文章内容" json:"article_content"`
Model
ArticleAuthor []*ArticleAuthor `gorm:"foreignKey:ArticleId;references:article_id" json:"article_author"`
Rank *int `gorm:"column:rank;type:tinyint(1) unsigned;comment:排名" json:"rank"`
}
func (m *Article) TableName() string {
+2
View File
@@ -13,6 +13,8 @@ type ArticleVoteDay struct {
UserId int64 `gorm:"column:user_id;type:bigint(19);comment:用户id;NOT NULL" json:"user_id"`
VotedAt *LocalTime `gorm:"column:voted_at;type:date;comment:投票时间(日)" json:"voted_at"`
Model
Article *Article `gorm:"foreignKey:ArticleId;references:article_id" json:"article"`
User *User `gorm:"foreignKey:UserId;references:user_id" json:"user"`
}
func (m *ArticleVoteDay) TableName() string {
+1
View File
@@ -9,6 +9,7 @@ import (
// BaseAgreement 基础-协议
type BaseAgreement struct {
AgreementId int64 `gorm:"column:agreement_id;type:bigint(19);primary_key;comment:主键id" json:"agreement_id"`
AgreementTitle string `gorm:"column:agreement_title;type:varchar(255);comment:协议标题" json:"agreement_title"`
AgreementType int `gorm:"column:agreement_type;type:tinyint(1);comment:协议类型(1:大赛介绍 2:投票规则);NOT NULL" json:"agreement_type"`
AgreementContent string `gorm:"column:agreement_content;type:text;comment:协议内容" json:"agreement_content"`
Model
+6 -5
View File
@@ -8,11 +8,12 @@ import (
// Video 视频表
type Video struct {
VideoId int64 `gorm:"column:video_id;type:bigint(19);primary_key;comment:主键id" json:"video_id"`
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"`
VideoUrl string `gorm:"column:video_url;type:varchar(255);comment:视频地址" json:"video_url"`
VideoId int64 `gorm:"column:video_id;type:bigint(19);primary_key;comment:主键id" json:"video_id"`
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"`
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
VideoAuthor []*VideoAuthor `gorm:"foreignKey:VideoId;references:video_id" json:"video_author"`
}
+2
View File
@@ -13,6 +13,8 @@ type VideoVoteDay struct {
UserId int64 `gorm:"column:user_id;type:bigint(19);comment:用户id;NOT NULL" json:"user_id"`
VotedAt *LocalTime `gorm:"column:voted_at;type:date;comment:投票时间(日)" json:"voted_at"`
Model
Video *Video `gorm:"foreignKey:VideoId;references:video_id" json:"video"`
User *User `gorm:"foreignKey:UserId;references:user_id" json:"user"`
}
func (m *VideoVoteDay) TableName() string {