新增猜你喜欢列表接口

This commit is contained in:
2024-09-19 15:44:27 +08:00
parent 715a585147
commit e77d7b18b8
2 changed files with 20 additions and 0 deletions
+17
View File
@@ -344,3 +344,20 @@ func (r *Question) PutQuestionSubmitCount(c *gin.Context) {
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)
}