feat(P3): 私信 + #话题标签 + @提及 完成

This commit is contained in:
Sisyphus
2026-04-25 20:10:50 +08:00
parent 41454de49f
commit 18245c06bf
10 changed files with 438 additions and 185 deletions

View File

@@ -174,3 +174,28 @@ func nonNilFeedVideoItems(items []FeedVideoItem) []FeedVideoItem {
}
return items
}
func (h *FeedHandler) ListByTag(c *gin.Context) {
var req struct {
TagName string `json:"tag_name"`
Limit int `json:"limit"`
}
if err := c.ShouldBindJSON(&req); err != nil {
c.JSON(400, gin.H{"error": err.Error()})
return
}
if req.TagName == "" {
c.JSON(400, gin.H{"error": "tag_name is required"})
return
}
if req.Limit <= 0 || req.Limit > 50 {
req.Limit = 10
}
viewerAccountID, _ := jwt.GetAccountID(c)
items, err := h.service.ListByTag(c.Request.Context(), req.TagName, req.Limit, viewerAccountID)
if err != nil {
c.JSON(apierror.ClassifyHTTPStatus(err), gin.H{"error": err.Error()})
return
}
c.JSON(200, gin.H{"video_list": nonNilFeedVideoItems(items)})
}