Merge branch 'feature-userinfo-daiyb' into dev

This commit is contained in:
戴育兵 2025-12-18 20:02:59 +08:00
commit 8e68bbe543
4 changed files with 651 additions and 494 deletions

File diff suppressed because it is too large Load Diff

View File

@ -7143,6 +7143,107 @@ var _ interface {
ErrorName() string
} = PublishMediaInfoRespValidationError{}
// Validate checks the field values on ToolsReq with the rules defined in the
// proto definition for this message. If any rules are violated, the first
// error encountered is returned, or nil if there are no violations.
func (m *ToolsReq) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on ToolsReq with the rules defined in
// the proto definition for this message. If any rules are violated, the
// result is a list of violation errors wrapped in ToolsReqMultiError, or nil
// if none found.
func (m *ToolsReq) ValidateAll() error {
return m.validate(true)
}
func (m *ToolsReq) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
// no validation rules for Action
if len(errors) > 0 {
return ToolsReqMultiError(errors)
}
return nil
}
// ToolsReqMultiError is an error wrapping multiple validation errors returned
// by ToolsReq.ValidateAll() if the designated constraints aren't met.
type ToolsReqMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m ToolsReqMultiError) Error() string {
msgs := make([]string, 0, len(m))
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m ToolsReqMultiError) AllErrors() []error { return m }
// ToolsReqValidationError is the validation error returned by
// ToolsReq.Validate if the designated constraints aren't met.
type ToolsReqValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e ToolsReqValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e ToolsReqValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e ToolsReqValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e ToolsReqValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e ToolsReqValidationError) ErrorName() string { return "ToolsReqValidationError" }
// Error satisfies the builtin error interface
func (e ToolsReqValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sToolsReq.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = ToolsReqValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = ToolsReqValidationError{}
// Validate checks the field values on UpdateVideoScriptReq with the rules
// defined in the proto definition for this message. If any rules are
// violated, the first error encountered is returned, or nil if there are no violations.

View File

@ -57,7 +57,7 @@ type CastClient interface {
UpdateOAuth(ctx context.Context, in *UpdateOAuthReq, opts ...grpc_go.CallOption) (*emptypb.Empty, common.ErrorWithAttachment)
RefreshToken(ctx context.Context, in *RefreshTokenReq, opts ...grpc_go.CallOption) (*RefreshTokenResp, common.ErrorWithAttachment)
PublishMediaInfo(ctx context.Context, in *PublishMediaInfoReq, opts ...grpc_go.CallOption) (*PublishMediaInfoResp, common.ErrorWithAttachment)
Test(ctx context.Context, in *emptypb.Empty, opts ...grpc_go.CallOption) (*emptypb.Empty, common.ErrorWithAttachment)
Tools(ctx context.Context, in *ToolsReq, opts ...grpc_go.CallOption) (*emptypb.Empty, common.ErrorWithAttachment)
// 视频脚本相关接口
UpdateVideoScript(ctx context.Context, in *UpdateVideoScriptReq, opts ...grpc_go.CallOption) (*UpdateVideoScriptResp, common.ErrorWithAttachment)
GetVideoScript(ctx context.Context, in *GetVideoScriptReq, opts ...grpc_go.CallOption) (*GetVideoScriptResp, common.ErrorWithAttachment)
@ -136,7 +136,7 @@ type CastClientImpl struct {
UpdateOAuth func(ctx context.Context, in *UpdateOAuthReq) (*emptypb.Empty, error)
RefreshToken func(ctx context.Context, in *RefreshTokenReq) (*RefreshTokenResp, error)
PublishMediaInfo func(ctx context.Context, in *PublishMediaInfoReq) (*PublishMediaInfoResp, error)
Test func(ctx context.Context, in *emptypb.Empty) (*emptypb.Empty, error)
Tools func(ctx context.Context, in *ToolsReq) (*emptypb.Empty, error)
UpdateVideoScript func(ctx context.Context, in *UpdateVideoScriptReq) (*UpdateVideoScriptResp, error)
GetVideoScript func(ctx context.Context, in *GetVideoScriptReq) (*GetVideoScriptResp, error)
ListVideoScripts func(ctx context.Context, in *ListVideoScriptsReq) (*ListVideoScriptsResp, error)
@ -352,10 +352,10 @@ func (c *castClient) PublishMediaInfo(ctx context.Context, in *PublishMediaInfoR
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/PublishMediaInfo", in, out)
}
func (c *castClient) Test(ctx context.Context, in *emptypb.Empty, opts ...grpc_go.CallOption) (*emptypb.Empty, common.ErrorWithAttachment) {
func (c *castClient) Tools(ctx context.Context, in *ToolsReq, opts ...grpc_go.CallOption) (*emptypb.Empty, common.ErrorWithAttachment) {
out := new(emptypb.Empty)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/Test", in, out)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/Tools", in, out)
}
func (c *castClient) UpdateVideoScript(ctx context.Context, in *UpdateVideoScriptReq, opts ...grpc_go.CallOption) (*UpdateVideoScriptResp, common.ErrorWithAttachment) {
@ -588,7 +588,7 @@ type CastServer interface {
UpdateOAuth(context.Context, *UpdateOAuthReq) (*emptypb.Empty, error)
RefreshToken(context.Context, *RefreshTokenReq) (*RefreshTokenResp, error)
PublishMediaInfo(context.Context, *PublishMediaInfoReq) (*PublishMediaInfoResp, error)
Test(context.Context, *emptypb.Empty) (*emptypb.Empty, error)
Tools(context.Context, *ToolsReq) (*emptypb.Empty, error)
// 视频脚本相关接口
UpdateVideoScript(context.Context, *UpdateVideoScriptReq) (*UpdateVideoScriptResp, error)
GetVideoScript(context.Context, *GetVideoScriptReq) (*GetVideoScriptResp, error)
@ -724,8 +724,8 @@ func (UnimplementedCastServer) RefreshToken(context.Context, *RefreshTokenReq) (
func (UnimplementedCastServer) PublishMediaInfo(context.Context, *PublishMediaInfoReq) (*PublishMediaInfoResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method PublishMediaInfo not implemented")
}
func (UnimplementedCastServer) Test(context.Context, *emptypb.Empty) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method Test not implemented")
func (UnimplementedCastServer) Tools(context.Context, *ToolsReq) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method Tools not implemented")
}
func (UnimplementedCastServer) UpdateVideoScript(context.Context, *UpdateVideoScriptReq) (*UpdateVideoScriptResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateVideoScript not implemented")
@ -1666,8 +1666,8 @@ func _Cast_PublishMediaInfo_Handler(srv interface{}, ctx context.Context, dec fu
return interceptor(ctx, in, info, handler)
}
func _Cast_Test_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(emptypb.Empty)
func _Cast_Tools_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(ToolsReq)
if err := dec(in); err != nil {
return nil, err
}
@ -1679,7 +1679,7 @@ func _Cast_Test_Handler(srv interface{}, ctx context.Context, dec func(interface
for k, v := range md {
invAttachment[k] = v
}
invo := invocation.NewRPCInvocation("Test", args, invAttachment)
invo := invocation.NewRPCInvocation("Tools", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
@ -2772,8 +2772,8 @@ var Cast_ServiceDesc = grpc_go.ServiceDesc{
Handler: _Cast_PublishMediaInfo_Handler,
},
{
MethodName: "Test",
Handler: _Cast_Test_Handler,
MethodName: "Tools",
Handler: _Cast_Tools_Handler,
},
{
MethodName: "UpdateVideoScript",

View File

@ -119,6 +119,15 @@ func Test(ctx *gin.Context) {
service.Success(ctx, uploadResp)
return
}
if action == "syncArtist" {
service.CastProvider.Tools(context.Background(), &cast.ToolsReq{Action: action})
return
}
if action == "artistOrderInfo" {
service.CastProvider.Tools(context.Background(), &cast.ToolsReq{Action: action})
return
}
service.Success(ctx, "unknow")
return
}