feat: swagger format

This commit is contained in:
Blizzard
2026-02-11 16:22:17 +08:00
parent 112a1f439c
commit 69e59b0e36
14 changed files with 54 additions and 44 deletions
+1 -1
View File
@@ -15,7 +15,7 @@ type Post struct {
CommentCount int `json:"commentCount" form:"commentCount" gorm:"default:0;column:comment_count;comment:评论次数"`
LikeCount int `json:"likeCount" form:"likeCount" gorm:"default:0;column:like_count;comment:点赞次数"`
Location string `json:"location" form:"location" gorm:"column:location;size:100;comment:位置"`
HasReviewed int `json:"hasReviewed" form:"hasReviewed" gorm:"column:has_reviewed;comment:是否审核通过"`
HasReviewed int `json:"hasReviewed" form:"hasReviewed" gorm:"column:has_revieweddefault:0;comment:是否审核通过"`
HasLiked int `json:"hasLiked" form:"hasLiked" gorm:"-"`
//图片
ImgList []*system.Oss `json:"imgList" form:"imgList" gorm:"many2many:post_oss;comment:图片列表"`
+2 -2
View File
@@ -8,7 +8,7 @@ import (
type Topic struct {
global.BaseModel
Title string `json:"title"`
StartTime time.Time `json:"start_time" gorm:"column:start_time;"`
EndTime time.Time `json:"end_time" gorm:"column:end_time;"`
StartTime time.Time `json:"startTime" gorm:"type:date;column:start_time;"`
EndTime time.Time `json:"endTime" gorm:"type:date;column:end_time;"`
Remark string `json:"remark"`
}
+1 -1
View File
@@ -22,7 +22,7 @@ type UpdatePost struct {
type PostPage struct {
common.PageInfo
Title string `json:"title"` // 标题
HasReviewed int `json:"hasReviewed"` //是否审核通过
HasReviewed *int `json:"hasReviewed"` //是否审核通过
}
// CreateComment 创建评论
+4 -4
View File
@@ -2,15 +2,15 @@ package request
type CreateTopic struct {
Title string `json:"title"`
StartTime string `json:"start_time"`
EndTime string `json:"end_time"`
StartTime string `json:"startTime"`
EndTime string `json:"endTime"`
Remark string `json:"remark"`
}
type UpdateTopic struct {
Id int `json:"id" binding:"required"`
Title string `json:"title"`
StartTime string `json:"start_time"`
EndTime string `json:"end_time"`
StartTime string `json:"startTime"`
EndTime string `json:"endTime"`
Remark string `json:"remark"`
}