feat: 添加了列出点赞视频的功能

This commit is contained in:
Leon
2025-12-26 18:23:55 +08:00
parent ce0aec6110
commit a21a79a2be
4 changed files with 40 additions and 0 deletions

View File

@@ -89,3 +89,18 @@ func (lh *LikeHandler) IsLiked(c *gin.Context) {
}
c.JSON(200, gin.H{"is_liked": isLiked})
}
func (lh *LikeHandler) ListMyLikedVideos(c *gin.Context) {
accountID, err := middleware.GetAccountID(c)
if err != nil {
c.JSON(400, gin.H{"error": err.Error()})
return
}
videos, err := lh.service.ListLikedVideos(c.Request.Context(), accountID)
if err != nil {
c.JSON(500, gin.H{"error": err.Error()})
return
}
c.JSON(200, videos)
}