feat: 获取推荐标签和热门标签自动获取有效配置

This commit is contained in:
cjy 2026-01-08 14:17:57 +08:00
parent c17028fbcf
commit d8b972be26

View File

@ -288,7 +288,6 @@ func GenerateAutoHashtags(ctx context.Context, post string, max int32, position,
max = int32(5 - len(beforeTags))
}
// 获取有效的 profileKey从 TikTok、YouTube、Instagram、Bluesky 平台获取)
profileKey, err := GetValidProfileKey(ctx, []uint32{1, 2, 3, 5})
if err != nil {
return nil, nil, false, err
@ -372,6 +371,12 @@ func RecommendHashtags(ctx *gin.Context) {
service.Error(ctx, err)
return
}
profileKey, err := GetValidProfileKey(context.Background(), []uint32{1})
if err != nil {
service.Error(ctx, err)
return
}
req.ProfileKey = profileKey
resp, err := service.AyrshareProvider.RecommendHashtags(context.Background(), req)
if err != nil {
zap.L().Error("RecommendHashtags failed", zap.Error(err))
@ -391,6 +396,12 @@ func SearchHashtags(ctx *gin.Context) {
service.Error(ctx, err)
return
}
profileKey, err := GetValidProfileKey(context.Background(), []uint32{3})
if err != nil {
service.Error(ctx, err)
return
}
req.ProfileKey = profileKey
resp, err := service.AyrshareProvider.SearchHashtags(context.Background(), req)
if err != nil {
zap.L().Error("SearchHashtags failed", zap.Error(err))