feat: 植物识别
This commit is contained in:
@@ -70,6 +70,37 @@ func (a *PostApi) PostPage(c *gin.Context) {
|
||||
}, c)
|
||||
}
|
||||
|
||||
// MyPost 我的发布
|
||||
// @Tags 帖子
|
||||
// @Summary 我的发布
|
||||
// @Security BearerAuth
|
||||
// @accept json
|
||||
// @Produce application/json
|
||||
// @Param data body plantReq.PostPage true "分页获取帖子列表"
|
||||
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
|
||||
// @Router /post/myPost [post]
|
||||
func (a *PostApi) MyPost(c *gin.Context) {
|
||||
var req plantReq.PostPage
|
||||
err := c.ShouldBindJSON(&req)
|
||||
if err != nil {
|
||||
response.FailWithMsg("请求参数错误", c)
|
||||
return
|
||||
}
|
||||
userId := auth.GetUserId(c)
|
||||
posts, total, err := postService.MyPost(req, userId)
|
||||
if err != nil {
|
||||
global.Logger.Error("获取帖子列表失败", zap.Error(err))
|
||||
response.FailWithMsg("获取帖子列表失败", c)
|
||||
return
|
||||
}
|
||||
response.OkWithData(response.PageResult{
|
||||
List: posts,
|
||||
Total: total,
|
||||
Page: req.Current,
|
||||
PageSize: req.PageSize,
|
||||
}, c)
|
||||
}
|
||||
|
||||
// LikePost 点赞帖子
|
||||
// @Tags 帖子
|
||||
// @Summary 点赞帖子
|
||||
|
||||
Reference in New Issue
Block a user