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
+5 -4
View File
@@ -16,7 +16,7 @@ type TopicApi struct{}
// @Tags 帖子话题
// @Summary 发布话题
// @Security BearerAuth
// @accept json
// @accept application/json
// @Produce application/json
// @Param data body plantReq.CreateTopic true "发布话题"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"发布成功"}"
@@ -40,7 +40,7 @@ func (a *TopicApi) AddTopic(c *gin.Context) {
// @Tags 帖子话题
// @Summary 修改话题
// @Security BearerAuth
// @accept json
// @accept application/json
// @Produce application/json
// @Param data body plantReq.UpdateTopic true "修改话题"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"发布成功"}"
@@ -64,14 +64,15 @@ func (a *TopicApi) UpdateTopic(c *gin.Context) {
// @Tags 帖子话题
// @Summary 话题分页
// @Security BearerAuth
// @accept json
// @accept application/json
// @Produce application/json
// @Param data body request.PageInfo true "分页获取话题列表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /topic/page [post]
func (a *TopicApi) TopicPage(c *gin.Context) {
var req request.PageInfo
if err := c.ShouldBindQuery(&req); err != nil {
err := c.ShouldBindJSON(&req)
if err != nil {
response.FailWithMsg("请求参数错误", c)
return
}