refactor: 1.修正api auth 2.帖子话题业务

This commit is contained in:
Blizzard
2026-02-07 15:52:54 +08:00
parent e4de80eecc
commit 9adad90490
17 changed files with 314 additions and 35 deletions
+10 -10
View File
@@ -16,7 +16,7 @@ type MyPlantApi struct{}
// AddPlant 添加植物
// @Tags 我的植物
// @Summary 添加植物
// @Security ApiKeyAuth
// @Security BearerAuth
// @accept json
// @Produce application/json
// @Param data body plantReq.CreateMyPlant true "创建植物"
@@ -42,7 +42,7 @@ func (a *MyPlantApi) AddPlant(c *gin.Context) {
// PlantPage 植物列表
// @Tags 我的植物
// @Summary 植物列表
// @Security ApiKeyAuth
// @Security BearerAuth
// @accept json
// @Produce application/json
// @Param data body request.PageInfo true "分页获取植物列表"
@@ -72,7 +72,7 @@ func (a *MyPlantApi) PlantPage(c *gin.Context) {
// PlantDetail 植物详情
// @Tags 我的植物
// @Summary ById植物详情
// @Security ApiKeyAuth
// @Security BearerAuth
// @Produce application/json
// @Param id query string true "id"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取ById成功"}"
@@ -91,7 +91,7 @@ func (a *MyPlantApi) PlantDetail(c *gin.Context) {
// UpdatePlant 修改植物
// @Tags 我的植物
// @Summary 修改ById植物
// @Security ApiKeyAuth
// @Security BearerAuth
// @accept json
// @Produce application/json
// @Param data body plantReq.UpdateMyPlant true "修改ById植物"
@@ -116,7 +116,7 @@ func (a *MyPlantApi) UpdatePlant(c *gin.Context) {
// TodayTask 今日任务
// @Tags 我的植物
// @Summary 今日任务
// @Security ApiKeyAuth
// @Security BearerAuth
// @accept json
// @Produce application/json
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
@@ -137,7 +137,7 @@ func (a *MyPlantApi) TodayTask(c *gin.Context) {
// CompleteTask plantReq.CompleteMyPlant
// @Tags 我的植物
// @Summary 完成任务
// @Security ApiKeyAuth
// @Security BearerAuth
// @accept json
// @Produce application/json
// @Param data body plantReq.CompleteTask true "完成任务"
@@ -162,12 +162,12 @@ func (a *MyPlantApi) CompleteTask(c *gin.Context) {
// DeletePlants
// @Tags 我的植物
// @Summary 删除植物
// @Security ApiKeyAuth
// @Security BearerAuth
// @accept json
// @Produce application/json
// @Param data body request.IdsReq true "删除植物"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
// @Router /plant/delete/ [post]
// @Router /plant/deletePlant [post]
func (a *MyPlantApi) DeletePlants(c *gin.Context) {
var req request.IdsReq
err := c.ShouldBindJSON(&req)
@@ -186,12 +186,12 @@ func (a *MyPlantApi) DeletePlants(c *gin.Context) {
// DeletePlans DeletePlants
// @Tags 我的植物
// @Summary 删除任务
// @Security ApiKeyAuth
// @Security BearerAuth
// @accept json
// @Produce application/json
// @Param data body request.IdsReq true "删除植物"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
// @Router /plant/deletePlant [post]
// @Router /plant/deletePlan [post]
func (a *MyPlantApi) DeletePlans(c *gin.Context) {
var req request.IdsReq
err := c.ShouldBindJSON(&req)