feat:自动标签添加获取配置文件的接口

This commit is contained in:
cjy 2026-01-08 11:01:40 +08:00
parent e8289367bb
commit 7f583f1a21
4 changed files with 8518 additions and 4425 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -104,6 +104,7 @@ type CastClient interface {
CalculateMediaMetricsByWorks(ctx context.Context, in *CalculateMediaMetricsByWorksReq, opts ...grpc_go.CallOption) (*CalculateMediaMetricsByWorksResp, common.ErrorWithAttachment)
// 艺人AyrShare信息相关接口
GetArtistAyrShareInfo(ctx context.Context, in *GetArtistAyrShareInfoReq, opts ...grpc_go.CallOption) (*GetArtistAyrShareInfoResp, common.ErrorWithAttachment)
GetArtistAyrShareInfoByPlatformIDs(ctx context.Context, in *GetArtistAyrShareInfoByPlatformIDsReq, opts ...grpc_go.CallOption) (*GetArtistAyrShareInfoByPlatformIDsResp, common.ErrorWithAttachment)
// 作品平台信息相关接口
ListWorkPlatformInfo(ctx context.Context, in *ListWorkPlatformInfoReq, opts ...grpc_go.CallOption) (*ListWorkPlatformInfoResp, common.ErrorWithAttachment)
// 任务列表相关接口
@ -188,6 +189,7 @@ type CastClientImpl struct {
ListWorkMetricsDaily func(ctx context.Context, in *ListWorkMetricsDailyReq) (*ListWorkMetricsDailyResp, error)
CalculateMediaMetricsByWorks func(ctx context.Context, in *CalculateMediaMetricsByWorksReq) (*CalculateMediaMetricsByWorksResp, error)
GetArtistAyrShareInfo func(ctx context.Context, in *GetArtistAyrShareInfoReq) (*GetArtistAyrShareInfoResp, error)
GetArtistAyrShareInfoByPlatformIDs func(ctx context.Context, in *GetArtistAyrShareInfoByPlatformIDsReq) (*GetArtistAyrShareInfoByPlatformIDsResp, error)
ListWorkPlatformInfo func(ctx context.Context, in *ListWorkPlatformInfoReq) (*ListWorkPlatformInfoResp, error)
UpsertTaskList func(ctx context.Context, in *UpsertTaskListReq) (*UpsertTaskListResp, error)
GetTaskList func(ctx context.Context, in *GetTaskListReq) (*GetTaskListResp, error)
@ -596,6 +598,12 @@ func (c *castClient) GetArtistAyrShareInfo(ctx context.Context, in *GetArtistAyr
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetArtistAyrShareInfo", in, out)
}
func (c *castClient) GetArtistAyrShareInfoByPlatformIDs(ctx context.Context, in *GetArtistAyrShareInfoByPlatformIDsReq, opts ...grpc_go.CallOption) (*GetArtistAyrShareInfoByPlatformIDsResp, common.ErrorWithAttachment) {
out := new(GetArtistAyrShareInfoByPlatformIDsResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetArtistAyrShareInfoByPlatformIDs", in, out)
}
func (c *castClient) ListWorkPlatformInfo(ctx context.Context, in *ListWorkPlatformInfoReq, opts ...grpc_go.CallOption) (*ListWorkPlatformInfoResp, common.ErrorWithAttachment) {
out := new(ListWorkPlatformInfoResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
@ -735,6 +743,7 @@ type CastServer interface {
CalculateMediaMetricsByWorks(context.Context, *CalculateMediaMetricsByWorksReq) (*CalculateMediaMetricsByWorksResp, error)
// 艺人AyrShare信息相关接口
GetArtistAyrShareInfo(context.Context, *GetArtistAyrShareInfoReq) (*GetArtistAyrShareInfoResp, error)
GetArtistAyrShareInfoByPlatformIDs(context.Context, *GetArtistAyrShareInfoByPlatformIDsReq) (*GetArtistAyrShareInfoByPlatformIDsResp, error)
// 作品平台信息相关接口
ListWorkPlatformInfo(context.Context, *ListWorkPlatformInfoReq) (*ListWorkPlatformInfoResp, error)
// 任务列表相关接口
@ -948,6 +957,9 @@ func (UnimplementedCastServer) CalculateMediaMetricsByWorks(context.Context, *Ca
func (UnimplementedCastServer) GetArtistAyrShareInfo(context.Context, *GetArtistAyrShareInfoReq) (*GetArtistAyrShareInfoResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetArtistAyrShareInfo not implemented")
}
func (UnimplementedCastServer) GetArtistAyrShareInfoByPlatformIDs(context.Context, *GetArtistAyrShareInfoByPlatformIDsReq) (*GetArtistAyrShareInfoByPlatformIDsResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetArtistAyrShareInfoByPlatformIDs not implemented")
}
func (UnimplementedCastServer) ListWorkPlatformInfo(context.Context, *ListWorkPlatformInfoReq) (*ListWorkPlatformInfoResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListWorkPlatformInfo not implemented")
}
@ -2862,6 +2874,35 @@ func _Cast_GetArtistAyrShareInfo_Handler(srv interface{}, ctx context.Context, d
return interceptor(ctx, in, info, handler)
}
func _Cast_GetArtistAyrShareInfoByPlatformIDs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(GetArtistAyrShareInfoByPlatformIDsReq)
if err := dec(in); err != nil {
return nil, err
}
base := srv.(dubbo3.Dubbo3GrpcService)
args := []interface{}{}
args = append(args, in)
md, _ := metadata.FromIncomingContext(ctx)
invAttachment := make(map[string]interface{}, len(md))
for k, v := range md {
invAttachment[k] = v
}
invo := invocation.NewRPCInvocation("GetArtistAyrShareInfoByPlatformIDs", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _Cast_ListWorkPlatformInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(ListWorkPlatformInfoReq)
if err := dec(in); err != nil {
@ -3415,6 +3456,10 @@ var Cast_ServiceDesc = grpc_go.ServiceDesc{
MethodName: "GetArtistAyrShareInfo",
Handler: _Cast_GetArtistAyrShareInfo_Handler,
},
{
MethodName: "GetArtistAyrShareInfoByPlatformIDs",
Handler: _Cast_GetArtistAyrShareInfoByPlatformIDs_Handler,
},
{
MethodName: "ListWorkPlatformInfo",
Handler: _Cast_ListWorkPlatformInfo_Handler,

View File

@ -276,6 +276,22 @@ func AutoHashtags(ctx *gin.Context) {
// 未设置语种,默认使用中文
req.Language = "zh"
}
profileKeys, err := service.CastProvider.GetArtistAyrShareInfoByPlatformIDs(context.Background(), &cast.GetArtistAyrShareInfoByPlatformIDsReq{
PlatformIDs: []uint32{1, 2, 3, 5},
Page: 1,
PageSize: 20,
})
if err != nil {
zap.L().Error("GetArtistAyrShareInfoByPlatformIDs failed", zap.Error(err))
err = errors.New("获取有效profileKey失败")
service.Error(ctx, err)
return
}
if len(profileKeys.Data) == 0 {
err = errors.New("当前没有有效的profileKey")
service.Error(ctx, err)
return
}
// 调用 Ayrshare 的 AutoHashtags 接口
resp, err := service.AyrshareProvider.AutoHashtags(context.Background(), req)
if err != nil {