新增猜你喜欢列表接口
This commit is contained in:
parent
715a585147
commit
e77d7b18b8
@ -344,3 +344,20 @@ func (r *Question) PutQuestionSubmitCount(c *gin.Context) {
|
|||||||
|
|
||||||
responses.Ok(c)
|
responses.Ok(c)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetGuessUserLikeList 获取问题列表-猜你喜欢
|
||||||
|
func (b *Question) GetGuessUserLikeList(c *gin.Context) {
|
||||||
|
userId := c.GetInt64("UserId")
|
||||||
|
|
||||||
|
// 获取数据
|
||||||
|
questionService := service.QuestionService{}
|
||||||
|
questions, err := questionService.GetGuessUserLIkeList(userId)
|
||||||
|
if err != nil {
|
||||||
|
responses.OkWithData(nil, c)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理返回值
|
||||||
|
g := dto.GetHotQuestionListDto(questions)
|
||||||
|
|
||||||
|
responses.OkWithData(g, c)
|
||||||
|
}
|
||||||
|
|||||||
@ -212,6 +212,9 @@ func privateRouter(r *gin.Engine, api controller.Api) {
|
|||||||
// 增加问题提交次数(提交个人信息进行了算算的人次)
|
// 增加问题提交次数(提交个人信息进行了算算的人次)
|
||||||
clickGroup.PUT("/submit/:question_id", api.Question.PutQuestionSubmitCount)
|
clickGroup.PUT("/submit/:question_id", api.Question.PutQuestionSubmitCount)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取问题列表-猜你喜欢
|
||||||
|
questionGroup.GET("/like", api.Question.GetGuessUserLikeList)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 用户
|
// 用户
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user