This commit is contained in:
sjk
2025-11-28 15:18:10 +08:00
parent ad4a600af9
commit 5683f35942
188 changed files with 53680 additions and 1062 deletions

View File

@@ -137,6 +137,22 @@ func (h *CommentHandler) GetCommentStats(c *gin.Context) {
response.Success(c, stats)
}
// GetHighRatingComments 获取高分评论(用于首页展示)
func (h *CommentHandler) GetHighRatingComments(c *gin.Context) {
limit, _ := strconv.Atoi(c.DefaultQuery("limit", "6"))
comments, err := h.commentService.GetHighRatingComments(limit)
if err != nil {
response.ErrorWithMessage(c, response.ERROR, err.Error())
return
}
// 转换为响应格式
result := h.convertToResponseList(comments)
response.Success(c, result)
}
// GetCommentDetail 获取评论详情
func (h *CommentHandler) GetCommentDetail(c *gin.Context) {
idStr := c.Param("id")