feat: 长文本语音合成
This commit is contained in:
@@ -154,6 +154,61 @@ func (a *InteractionApi) ToggleLike(c *gin.Context) {
|
||||
response.OkWithData(isLiked, c)
|
||||
}
|
||||
|
||||
// GetLikeList 获取点赞列表
|
||||
// @Tags 用户互动
|
||||
// @Summary 获取收藏列表
|
||||
// @Produce application/json
|
||||
// @Param data body request.GetLikeList true "分页查询"
|
||||
// @Success 200 {object} response.Response
|
||||
// @Router /like/list [post]
|
||||
func (a *InteractionApi) GetLikeList(c *gin.Context) {
|
||||
userId := auth.GetUserId(c)
|
||||
if userId == "" || userId == "0" {
|
||||
response.FailWithMsg("用户未登录", c)
|
||||
return
|
||||
}
|
||||
var req request.GetLikeList
|
||||
err := c.ShouldBindJSON(&req)
|
||||
if err != nil {
|
||||
response.FailWithMsg("参数错误: "+err.Error(), c)
|
||||
return
|
||||
}
|
||||
|
||||
list, total, err := interactionService.GetLikeList(userId, req)
|
||||
if err != nil {
|
||||
global.Logger.Error("获取收藏列表失败!", zap.Error(err))
|
||||
response.FailWithMsg(err.Error(), c)
|
||||
return
|
||||
}
|
||||
|
||||
response.OkWithData(response.PageResult{
|
||||
List: list,
|
||||
Total: total,
|
||||
Page: req.Current,
|
||||
}, c)
|
||||
}
|
||||
|
||||
// RemoveAllLike 清空所有赞
|
||||
// @Tags 用户互动
|
||||
// @Summary 清空所有赞
|
||||
// @Produce application/json
|
||||
// @Success 200 {object} response.Response
|
||||
// @Router /like/removeAll [get]
|
||||
func (a *InteractionApi) RemoveAllLike(c *gin.Context) {
|
||||
userId := auth.GetUserId(c)
|
||||
if userId == "" || userId == "0" {
|
||||
response.FailWithMsg("用户未登录", c)
|
||||
return
|
||||
}
|
||||
err := interactionService.RemoveAllLike(userId)
|
||||
if err != nil {
|
||||
global.Logger.Error("清空所有赞失败!", zap.Error(err))
|
||||
response.FailWithMsg(err.Error(), c)
|
||||
return
|
||||
}
|
||||
response.OkWithMsg("清空所有赞成功", c)
|
||||
}
|
||||
|
||||
// GetFavoriteList 获取收藏列表
|
||||
// @Tags 用户互动
|
||||
// @Summary 获取收藏列表
|
||||
|
||||
Reference in New Issue
Block a user