feat: 徽章处理

This commit is contained in:
Blizzard
2026-02-14 15:35:12 +08:00
parent 4ffc41ea84
commit 3f50901ac6
10 changed files with 157 additions and 8 deletions
+20
View File
@@ -82,3 +82,23 @@ func (a *UserProfileApi) MyStars(c *gin.Context) {
PageSize: req.PageSize,
}, c)
}
// MyBadges 我的徽章
// @Tags 个人中心
// @Summary 我的徽章
// @Security BearerAuth
// @Produce application/json
// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}"
// @Router /profile/badge [get]
func (a *UserProfileApi) MyBadges(c *gin.Context) {
userId := auth.GetUserId(c)
list, err := userProfileService.MyBadges(userId)
if err != nil {
global.Logger.Error("获取用户徽章失败", zap.Error(err))
response.FailWithMsg("获取用户徽章失败", c)
return
}
response.OkWithData(response.ListResult{
List: list,
}, c)
}