Initial commit

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
谢宇宁
2026-10-22 14:47:17 +07:00
co-authored by Claude Opus 5.5
commit 3639d2184a
574 changed files with 61690 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
package playletser
import (
"fmt"
"videoweb/app/service/upstream"
"github.com/gin-gonic/gin"
)
const hotLikePath = "/api/app/playlet/hot-like"
// PlayletHotSearchItem 对应 swagger proto.PlayletHotSearchItem。
type PlayletHotSearchItem struct {
Keyword string `json:"keyword"`
Count int64 `json:"count"`
}
// PlayletHotLikeResp 对应 swagger proto.PlayletHotLikeResp。
type PlayletHotLikeResp struct {
HotSearch []PlayletHotSearchItem `json:"hotSearch"`
GuessLike []CommonData `json:"guessLike"`
}
// FetchHotLike 获取前 10 个热搜词及按收藏量排序的 15 部猜你喜欢短剧。
func FetchHotLike(c *gin.Context) (*PlayletHotLikeResp, error) {
var env APIEnvelope[PlayletHotLikeResp]
if err := upstream.GetPublicJSON(c, hotLikePath, &env); err != nil {
return nil, err
}
if env.Code != 200 {
return nil, fmt.Errorf("playlet hot-like code=%d msg=%s tip=%s", env.Code, env.Msg, env.Tip)
}
return &env.Data, nil
}