Updata:解决冲突
This commit is contained in:
commit
efe79ec250
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
17315042007 测试-陆嘉骅2 视频
|
13111111112 测试-陆嘉骅2 视频
|
||||||
|
|
||||||
13196788678 Aa.123456 脚本
|
13196788678 Aa.123456 脚本
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -66,6 +66,8 @@ service AccountFiee {
|
|||||||
rpc SendNationMsg (SendNationMsgRequest) returns (SendMsgStatusResponse) {} //发送境外国际短信验证码 --艺术商城
|
rpc SendNationMsg (SendNationMsgRequest) returns (SendMsgStatusResponse) {} //发送境外国际短信验证码 --艺术商城
|
||||||
rpc VerifySliderStatus(VerifySliderStatusRequest) returns (VerifySliderStatusResponse) {}// 验证滑块验证码状态
|
rpc VerifySliderStatus(VerifySliderStatusRequest) returns (VerifySliderStatusResponse) {}// 验证滑块验证码状态
|
||||||
rpc SendNationTemplateMsg (SendNationMsgRequest) returns (SendMsgStatusResponse) {} //发送境外国际短信验证码 --艺术商城
|
rpc SendNationTemplateMsg (SendNationMsgRequest) returns (SendMsgStatusResponse) {} //发送境外国际短信验证码 --艺术商城
|
||||||
|
rpc GetInviterInfo(InviterInfoRequest) returns(InviterInfoResponse) {} //获取邀请人信息
|
||||||
|
rpc GetInviterList(InviterListRequest) returns(InviterListResponse) {} //获取邀请人信息
|
||||||
|
|
||||||
|
|
||||||
rpc CreateUserAndRealName (CreateUserAndRealNameRequest) returns (CreateUserAndRealNameResponse) {}// 创建用户并实名, 自动导入
|
rpc CreateUserAndRealName (CreateUserAndRealNameRequest) returns (CreateUserAndRealNameResponse) {}// 创建用户并实名, 自动导入
|
||||||
@ -101,7 +103,21 @@ service AccountFiee {
|
|||||||
rpc GetChatAutoReplyRulerDetail ( GetChatAutoReplyRulerByIdRequest )returns( ChatAutoReplyRulerData ){} //查询自动回复规则详情
|
rpc GetChatAutoReplyRulerDetail ( GetChatAutoReplyRulerByIdRequest )returns( ChatAutoReplyRulerData ){} //查询自动回复规则详情
|
||||||
rpc GetChatAutoReplyRulerList ( GetChatAutoReplyRulerListRequest )returns( GetChatAutoReplyRulerListResp ){} //查询自动回复规则列表
|
rpc GetChatAutoReplyRulerList ( GetChatAutoReplyRulerListRequest )returns( GetChatAutoReplyRulerListResp ){} //查询自动回复规则列表
|
||||||
}
|
}
|
||||||
|
message InviterListRequest{
|
||||||
|
repeated uint64 ids =1;
|
||||||
|
}
|
||||||
|
message InviterListResponse{
|
||||||
|
repeated InviterInfoResponse list = 1;
|
||||||
|
}
|
||||||
|
message InviterInfoRequest{
|
||||||
|
string code = 1;
|
||||||
|
}
|
||||||
|
message InviterInfoResponse{
|
||||||
|
uint64 id = 1;
|
||||||
|
string code = 2;
|
||||||
|
string name = 3;
|
||||||
|
string telNum = 4;
|
||||||
|
}
|
||||||
message VerifySliderStatusRequest {
|
message VerifySliderStatusRequest {
|
||||||
string nonceStr = 1;
|
string nonceStr = 1;
|
||||||
}
|
}
|
||||||
@ -183,6 +199,11 @@ message UserListInfo{
|
|||||||
string idNumber = 21;
|
string idNumber = 21;
|
||||||
string dateOfBirth = 22;
|
string dateOfBirth = 22;
|
||||||
string age = 23;
|
string age = 23;
|
||||||
|
string email = 24;
|
||||||
|
string AbroadTelAreaCode = 25;
|
||||||
|
string AbroadTel = 26;
|
||||||
|
string inviterName = 27;
|
||||||
|
string inviterCode = 28;
|
||||||
}
|
}
|
||||||
message UserListRequest{
|
message UserListRequest{
|
||||||
string domain = 1;
|
string domain = 1;
|
||||||
@ -221,6 +242,11 @@ message UserInfoResponse{
|
|||||||
string telAreaCode = 19;
|
string telAreaCode = 19;
|
||||||
string idNumber = 20;
|
string idNumber = 20;
|
||||||
string dateOfBirth = 21;
|
string dateOfBirth = 21;
|
||||||
|
string email = 22;
|
||||||
|
string AbroadTelAreaCode = 23;
|
||||||
|
string AbroadTel = 24;
|
||||||
|
uint64 inviterId = 25;
|
||||||
|
|
||||||
}
|
}
|
||||||
message RealNameResponse{
|
message RealNameResponse{
|
||||||
uint64 id = 1;
|
uint64 id = 1;
|
||||||
@ -541,6 +567,9 @@ message UpdateRequest {
|
|||||||
string Domain = 2 [json_name = "domain"];
|
string Domain = 2 [json_name = "domain"];
|
||||||
string Language = 3 [json_name = "language"];
|
string Language = 3 [json_name = "language"];
|
||||||
string NickName = 4 [json_name = "nickName"];
|
string NickName = 4 [json_name = "nickName"];
|
||||||
|
string Email = 5 [json_name = "email"];
|
||||||
|
string AbroadTel = 6 [json_name = "abroadTel"];
|
||||||
|
string AbroadTelAreaCode = 7 [json_name = "abroadTelAreaCode"];
|
||||||
}
|
}
|
||||||
|
|
||||||
message Operator {
|
message Operator {
|
||||||
@ -632,6 +661,8 @@ message RegistRequest {
|
|||||||
string telAreaCode = 5;
|
string telAreaCode = 5;
|
||||||
string language = 6;
|
string language = 6;
|
||||||
string nickName = 7;
|
string nickName = 7;
|
||||||
|
uint64 inviterID = 8;
|
||||||
|
string inviterCode = 9;
|
||||||
}
|
}
|
||||||
|
|
||||||
message LoginRequest {
|
message LoginRequest {
|
||||||
|
|||||||
@ -17,6 +17,25 @@ var _ = proto.Marshal
|
|||||||
var _ = fmt.Errorf
|
var _ = fmt.Errorf
|
||||||
var _ = math.Inf
|
var _ = math.Inf
|
||||||
|
|
||||||
|
func (this *InviterListRequest) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *InviterListResponse) Validate() error {
|
||||||
|
for _, item := range this.List {
|
||||||
|
if item != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("List", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *InviterInfoRequest) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *InviterInfoResponse) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
func (this *VerifySliderStatusRequest) Validate() error {
|
func (this *VerifySliderStatusRequest) Validate() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
@ -70,6 +70,8 @@ type AccountFieeClient interface {
|
|||||||
SendNationMsg(ctx context.Context, in *SendNationMsgRequest, opts ...grpc_go.CallOption) (*SendMsgStatusResponse, common.ErrorWithAttachment)
|
SendNationMsg(ctx context.Context, in *SendNationMsgRequest, opts ...grpc_go.CallOption) (*SendMsgStatusResponse, common.ErrorWithAttachment)
|
||||||
VerifySliderStatus(ctx context.Context, in *VerifySliderStatusRequest, opts ...grpc_go.CallOption) (*VerifySliderStatusResponse, common.ErrorWithAttachment)
|
VerifySliderStatus(ctx context.Context, in *VerifySliderStatusRequest, opts ...grpc_go.CallOption) (*VerifySliderStatusResponse, common.ErrorWithAttachment)
|
||||||
SendNationTemplateMsg(ctx context.Context, in *SendNationMsgRequest, opts ...grpc_go.CallOption) (*SendMsgStatusResponse, common.ErrorWithAttachment)
|
SendNationTemplateMsg(ctx context.Context, in *SendNationMsgRequest, opts ...grpc_go.CallOption) (*SendMsgStatusResponse, common.ErrorWithAttachment)
|
||||||
|
GetInviterInfo(ctx context.Context, in *InviterInfoRequest, opts ...grpc_go.CallOption) (*InviterInfoResponse, common.ErrorWithAttachment)
|
||||||
|
GetInviterList(ctx context.Context, in *InviterListRequest, opts ...grpc_go.CallOption) (*InviterListResponse, common.ErrorWithAttachment)
|
||||||
CreateUserAndRealName(ctx context.Context, in *CreateUserAndRealNameRequest, opts ...grpc_go.CallOption) (*CreateUserAndRealNameResponse, common.ErrorWithAttachment)
|
CreateUserAndRealName(ctx context.Context, in *CreateUserAndRealNameRequest, opts ...grpc_go.CallOption) (*CreateUserAndRealNameResponse, common.ErrorWithAttachment)
|
||||||
// submit info
|
// submit info
|
||||||
SaveSubmitInfo(ctx context.Context, in *SubmitInfoRequest, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment)
|
SaveSubmitInfo(ctx context.Context, in *SubmitInfoRequest, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment)
|
||||||
@ -148,6 +150,8 @@ type AccountFieeClientImpl struct {
|
|||||||
SendNationMsg func(ctx context.Context, in *SendNationMsgRequest) (*SendMsgStatusResponse, error)
|
SendNationMsg func(ctx context.Context, in *SendNationMsgRequest) (*SendMsgStatusResponse, error)
|
||||||
VerifySliderStatus func(ctx context.Context, in *VerifySliderStatusRequest) (*VerifySliderStatusResponse, error)
|
VerifySliderStatus func(ctx context.Context, in *VerifySliderStatusRequest) (*VerifySliderStatusResponse, error)
|
||||||
SendNationTemplateMsg func(ctx context.Context, in *SendNationMsgRequest) (*SendMsgStatusResponse, error)
|
SendNationTemplateMsg func(ctx context.Context, in *SendNationMsgRequest) (*SendMsgStatusResponse, error)
|
||||||
|
GetInviterInfo func(ctx context.Context, in *InviterInfoRequest) (*InviterInfoResponse, error)
|
||||||
|
GetInviterList func(ctx context.Context, in *InviterListRequest) (*InviterListResponse, error)
|
||||||
CreateUserAndRealName func(ctx context.Context, in *CreateUserAndRealNameRequest) (*CreateUserAndRealNameResponse, error)
|
CreateUserAndRealName func(ctx context.Context, in *CreateUserAndRealNameRequest) (*CreateUserAndRealNameResponse, error)
|
||||||
SaveSubmitInfo func(ctx context.Context, in *SubmitInfoRequest) (*CommonResponse, error)
|
SaveSubmitInfo func(ctx context.Context, in *SubmitInfoRequest) (*CommonResponse, error)
|
||||||
CreateChatUser func(ctx context.Context, in *ChatUserData) (*CreateChatUserResp, error)
|
CreateChatUser func(ctx context.Context, in *ChatUserData) (*CreateChatUserResp, error)
|
||||||
@ -436,6 +440,18 @@ func (c *accountFieeClient) SendNationTemplateMsg(ctx context.Context, in *SendN
|
|||||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/SendNationTemplateMsg", in, out)
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/SendNationTemplateMsg", in, out)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *accountFieeClient) GetInviterInfo(ctx context.Context, in *InviterInfoRequest, opts ...grpc_go.CallOption) (*InviterInfoResponse, common.ErrorWithAttachment) {
|
||||||
|
out := new(InviterInfoResponse)
|
||||||
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetInviterInfo", in, out)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *accountFieeClient) GetInviterList(ctx context.Context, in *InviterListRequest, opts ...grpc_go.CallOption) (*InviterListResponse, common.ErrorWithAttachment) {
|
||||||
|
out := new(InviterListResponse)
|
||||||
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetInviterList", in, out)
|
||||||
|
}
|
||||||
|
|
||||||
func (c *accountFieeClient) CreateUserAndRealName(ctx context.Context, in *CreateUserAndRealNameRequest, opts ...grpc_go.CallOption) (*CreateUserAndRealNameResponse, common.ErrorWithAttachment) {
|
func (c *accountFieeClient) CreateUserAndRealName(ctx context.Context, in *CreateUserAndRealNameRequest, opts ...grpc_go.CallOption) (*CreateUserAndRealNameResponse, common.ErrorWithAttachment) {
|
||||||
out := new(CreateUserAndRealNameResponse)
|
out := new(CreateUserAndRealNameResponse)
|
||||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
@ -650,6 +666,8 @@ type AccountFieeServer interface {
|
|||||||
SendNationMsg(context.Context, *SendNationMsgRequest) (*SendMsgStatusResponse, error)
|
SendNationMsg(context.Context, *SendNationMsgRequest) (*SendMsgStatusResponse, error)
|
||||||
VerifySliderStatus(context.Context, *VerifySliderStatusRequest) (*VerifySliderStatusResponse, error)
|
VerifySliderStatus(context.Context, *VerifySliderStatusRequest) (*VerifySliderStatusResponse, error)
|
||||||
SendNationTemplateMsg(context.Context, *SendNationMsgRequest) (*SendMsgStatusResponse, error)
|
SendNationTemplateMsg(context.Context, *SendNationMsgRequest) (*SendMsgStatusResponse, error)
|
||||||
|
GetInviterInfo(context.Context, *InviterInfoRequest) (*InviterInfoResponse, error)
|
||||||
|
GetInviterList(context.Context, *InviterListRequest) (*InviterListResponse, error)
|
||||||
CreateUserAndRealName(context.Context, *CreateUserAndRealNameRequest) (*CreateUserAndRealNameResponse, error)
|
CreateUserAndRealName(context.Context, *CreateUserAndRealNameRequest) (*CreateUserAndRealNameResponse, error)
|
||||||
// submit info
|
// submit info
|
||||||
SaveSubmitInfo(context.Context, *SubmitInfoRequest) (*CommonResponse, error)
|
SaveSubmitInfo(context.Context, *SubmitInfoRequest) (*CommonResponse, error)
|
||||||
@ -811,6 +829,12 @@ func (UnimplementedAccountFieeServer) VerifySliderStatus(context.Context, *Verif
|
|||||||
func (UnimplementedAccountFieeServer) SendNationTemplateMsg(context.Context, *SendNationMsgRequest) (*SendMsgStatusResponse, error) {
|
func (UnimplementedAccountFieeServer) SendNationTemplateMsg(context.Context, *SendNationMsgRequest) (*SendMsgStatusResponse, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method SendNationTemplateMsg not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method SendNationTemplateMsg not implemented")
|
||||||
}
|
}
|
||||||
|
func (UnimplementedAccountFieeServer) GetInviterInfo(context.Context, *InviterInfoRequest) (*InviterInfoResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method GetInviterInfo not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedAccountFieeServer) GetInviterList(context.Context, *InviterListRequest) (*InviterListResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method GetInviterList not implemented")
|
||||||
|
}
|
||||||
func (UnimplementedAccountFieeServer) CreateUserAndRealName(context.Context, *CreateUserAndRealNameRequest) (*CreateUserAndRealNameResponse, error) {
|
func (UnimplementedAccountFieeServer) CreateUserAndRealName(context.Context, *CreateUserAndRealNameRequest) (*CreateUserAndRealNameResponse, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method CreateUserAndRealName not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method CreateUserAndRealName not implemented")
|
||||||
}
|
}
|
||||||
@ -2112,6 +2136,64 @@ func _AccountFiee_SendNationTemplateMsg_Handler(srv interface{}, ctx context.Con
|
|||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func _AccountFiee_GetInviterInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(InviterInfoRequest)
|
||||||
|
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("GetInviterInfo", 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 _AccountFiee_GetInviterList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(InviterListRequest)
|
||||||
|
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("GetInviterList", 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 _AccountFiee_CreateUserAndRealName_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
func _AccountFiee_CreateUserAndRealName_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
in := new(CreateUserAndRealNameRequest)
|
in := new(CreateUserAndRealNameRequest)
|
||||||
if err := dec(in); err != nil {
|
if err := dec(in); err != nil {
|
||||||
@ -3095,6 +3177,14 @@ var AccountFiee_ServiceDesc = grpc_go.ServiceDesc{
|
|||||||
MethodName: "SendNationTemplateMsg",
|
MethodName: "SendNationTemplateMsg",
|
||||||
Handler: _AccountFiee_SendNationTemplateMsg_Handler,
|
Handler: _AccountFiee_SendNationTemplateMsg_Handler,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
MethodName: "GetInviterInfo",
|
||||||
|
Handler: _AccountFiee_GetInviterInfo_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "GetInviterList",
|
||||||
|
Handler: _AccountFiee_GetInviterList_Handler,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
MethodName: "CreateUserAndRealName",
|
MethodName: "CreateUserAndRealName",
|
||||||
Handler: _AccountFiee_CreateUserAndRealName_Handler,
|
Handler: _AccountFiee_CreateUserAndRealName_Handler,
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -6,11 +6,10 @@ package aryshare
|
|||||||
import (
|
import (
|
||||||
fmt "fmt"
|
fmt "fmt"
|
||||||
math "math"
|
math "math"
|
||||||
|
|
||||||
proto "github.com/golang/protobuf/proto"
|
proto "github.com/golang/protobuf/proto"
|
||||||
|
_ "google.golang.org/protobuf/types/descriptorpb"
|
||||||
_ "github.com/mwitkow/go-proto-validators"
|
_ "github.com/mwitkow/go-proto-validators"
|
||||||
github_com_mwitkow_go_proto_validators "github.com/mwitkow/go-proto-validators"
|
github_com_mwitkow_go_proto_validators "github.com/mwitkow/go-proto-validators"
|
||||||
_ "google.golang.org/protobuf/types/descriptorpb"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Reference imports to suppress errors if they are not otherwise used.
|
// Reference imports to suppress errors if they are not otherwise used.
|
||||||
@ -34,6 +33,12 @@ func (this *InstagramOptions) Validate() error {
|
|||||||
func (this *TikTokOptions) Validate() error {
|
func (this *TikTokOptions) Validate() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
func (this *YouTubeOptions) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *BlueskyOptions) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
func (this *PostRequest) Validate() error {
|
func (this *PostRequest) Validate() error {
|
||||||
if this.Post == "" {
|
if this.Post == "" {
|
||||||
return github_com_mwitkow_go_proto_validators.FieldError("Post", fmt.Errorf(`post内容不能为空`))
|
return github_com_mwitkow_go_proto_validators.FieldError("Post", fmt.Errorf(`post内容不能为空`))
|
||||||
@ -41,6 +46,11 @@ func (this *PostRequest) Validate() error {
|
|||||||
if len(this.Platforms) < 1 {
|
if len(this.Platforms) < 1 {
|
||||||
return github_com_mwitkow_go_proto_validators.FieldError("Platforms", fmt.Errorf(`platforms平台列表不能为空`))
|
return github_com_mwitkow_go_proto_validators.FieldError("Platforms", fmt.Errorf(`platforms平台列表不能为空`))
|
||||||
}
|
}
|
||||||
|
for _, item := range this.Platforms {
|
||||||
|
if item == "" {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Platforms", fmt.Errorf(`platforms平台列表不能为空`))
|
||||||
|
}
|
||||||
|
}
|
||||||
if this.InstagramOptions != nil {
|
if this.InstagramOptions != nil {
|
||||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.InstagramOptions); err != nil {
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.InstagramOptions); err != nil {
|
||||||
return github_com_mwitkow_go_proto_validators.FieldError("InstagramOptions", err)
|
return github_com_mwitkow_go_proto_validators.FieldError("InstagramOptions", err)
|
||||||
@ -51,6 +61,16 @@ func (this *PostRequest) Validate() error {
|
|||||||
return github_com_mwitkow_go_proto_validators.FieldError("TikTokOptions", err)
|
return github_com_mwitkow_go_proto_validators.FieldError("TikTokOptions", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if this.YouTubeOptions != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.YouTubeOptions); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("YouTubeOptions", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if this.BlueskyOptions != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.BlueskyOptions); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("BlueskyOptions", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
func (this *PostId) Validate() error {
|
func (this *PostId) Validate() error {
|
||||||
@ -173,12 +193,6 @@ func (this *Email) Validate() error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
func (this *GenerateJWTRequest) Validate() error {
|
func (this *GenerateJWTRequest) Validate() error {
|
||||||
if this.Domain == "" {
|
|
||||||
return github_com_mwitkow_go_proto_validators.FieldError("Domain", fmt.Errorf(`domain不能为空`))
|
|
||||||
}
|
|
||||||
if this.PrivateKey == "" {
|
|
||||||
return github_com_mwitkow_go_proto_validators.FieldError("PrivateKey", fmt.Errorf(`privateKey不能为空`))
|
|
||||||
}
|
|
||||||
if this.ProfileKey == "" {
|
if this.ProfileKey == "" {
|
||||||
return github_com_mwitkow_go_proto_validators.FieldError("ProfileKey", fmt.Errorf(`profileKey不能为空`))
|
return github_com_mwitkow_go_proto_validators.FieldError("ProfileKey", fmt.Errorf(`profileKey不能为空`))
|
||||||
}
|
}
|
||||||
@ -192,3 +206,711 @@ func (this *GenerateJWTRequest) Validate() error {
|
|||||||
func (this *GenerateJWTResponse) Validate() error {
|
func (this *GenerateJWTResponse) Validate() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
func (this *HistoryPostId) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *HistoryItem) Validate() error {
|
||||||
|
for _, item := range this.PostIds {
|
||||||
|
if item != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("PostIds", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if this.ScheduleDate != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.ScheduleDate); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("ScheduleDate", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *GetHistoryRequest) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *GetHistoryResponse) Validate() error {
|
||||||
|
for _, item := range this.History {
|
||||||
|
if item != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("History", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *GetHistoryByIdRequest) Validate() error {
|
||||||
|
if this.Id == "" {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Id", fmt.Errorf(`帖子ID不能为空`))
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *GetHistoryByIdResponse) Validate() error {
|
||||||
|
for _, item := range this.PostIds {
|
||||||
|
if item != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("PostIds", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if this.ScheduleDate != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.ScheduleDate); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("ScheduleDate", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *PlatformPost) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *GetHistoryByPlatformRequest) Validate() error {
|
||||||
|
if this.Platform == "" {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Platform", fmt.Errorf(`平台名称不能为空`))
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *GetHistoryByPlatformResponse) Validate() error {
|
||||||
|
for _, item := range this.Posts {
|
||||||
|
if item != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Posts", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *SendMessageRequest) Validate() error {
|
||||||
|
if this.Platform == "" {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Platform", fmt.Errorf(`平台不能为空`))
|
||||||
|
}
|
||||||
|
if this.RecipientId == "" {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("RecipientId", fmt.Errorf(`接收者ID不能为空`))
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *MessageItem) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *SendMessageResponse) Validate() error {
|
||||||
|
for _, item := range this.Messages {
|
||||||
|
if item != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Messages", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *GetMessagesRequest) Validate() error {
|
||||||
|
if this.Platform == "" {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Platform", fmt.Errorf(`平台不能为空`))
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *MessageAttachment) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *MessageSenderDetails) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *MessageRecipientDetails) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *MessageReaction) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *GetMessagesItem) Validate() error {
|
||||||
|
if this.SenderDetails != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.SenderDetails); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("SenderDetails", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if this.RecipientDetails != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.RecipientDetails); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("RecipientDetails", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for _, item := range this.Attachments {
|
||||||
|
if item != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Attachments", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for _, item := range this.Reactions {
|
||||||
|
if item != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Reactions", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *ConversationParticipant) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *ConversationDetail) Validate() error {
|
||||||
|
if this.Participant != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Participant); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Participant", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *GetMessagesResponse) Validate() error {
|
||||||
|
for _, item := range this.Messages {
|
||||||
|
if item != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Messages", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for _, item := range this.ConversationsDetails {
|
||||||
|
if item != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("ConversationsDetails", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *PostCommentRequest) Validate() error {
|
||||||
|
if this.Id == "" {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Id", fmt.Errorf(`id不能为空`))
|
||||||
|
}
|
||||||
|
if this.Comment == "" {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Comment", fmt.Errorf(`comment不能为空`))
|
||||||
|
}
|
||||||
|
if len(this.Platforms) < 1 {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Platforms", fmt.Errorf(`platforms平台列表不能为空`))
|
||||||
|
}
|
||||||
|
for _, item := range this.Platforms {
|
||||||
|
if item == "" {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Platforms", fmt.Errorf(`platforms平台列表不能为空`))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *InstagramCommentResponse) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *TikTokCommentResponse) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *BlueskyCommentResponse) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *FacebookCommentResponse) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *LinkedInCommentResponse) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *TwitterCommentResponse) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *YouTubeCommentResponse) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *PlatformError) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *PostCommentResponse) Validate() error {
|
||||||
|
if this.Instagram != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Instagram); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Instagram", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if this.Tiktok != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Tiktok); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Tiktok", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for _, item := range this.Errors {
|
||||||
|
if item != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Errors", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if this.Bluesky != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Bluesky); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Bluesky", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if this.Facebook != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Facebook); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Facebook", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if this.Linkedin != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Linkedin); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Linkedin", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if this.Twitter != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Twitter); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Twitter", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if this.Youtube != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Youtube); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Youtube", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *GetCommentRequest) Validate() error {
|
||||||
|
if this.Id == "" {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Id", fmt.Errorf(`id不能为空`))
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *InstagramUser) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *InstagramUserInfo) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *InstagramComment) Validate() error {
|
||||||
|
if this.From != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.From); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("From", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for _, item := range this.Replies {
|
||||||
|
if item != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Replies", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if this.User != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.User); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("User", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *TikTokComment) Validate() error {
|
||||||
|
for _, item := range this.Replies {
|
||||||
|
if item != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Replies", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *BlueskyComment) Validate() error {
|
||||||
|
for _, item := range this.Replies {
|
||||||
|
if item != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Replies", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *FacebookUser) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *FacebookParent) Validate() error {
|
||||||
|
if this.From != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.From); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("From", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *FacebookComment) Validate() error {
|
||||||
|
if this.From != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.From); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("From", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if this.Parent != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Parent); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Parent", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for _, item := range this.Replies {
|
||||||
|
if item != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Replies", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *LinkedInMedia) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *LinkedInFrom) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *LinkedInComment) Validate() error {
|
||||||
|
if this.From != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.From); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("From", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for _, item := range this.Media {
|
||||||
|
if item != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Media", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *RedditUser) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *RedditComment) Validate() error {
|
||||||
|
if this.From != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.From); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("From", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *ThreadsComment) Validate() error {
|
||||||
|
for _, item := range this.Replies {
|
||||||
|
if item != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Replies", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *TwitterPublicMetrics) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *TwitterReferencedTweet) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *TwitterReplyTo) Validate() error {
|
||||||
|
if this.PublicMetrics != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.PublicMetrics); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("PublicMetrics", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *TwitterComment) Validate() error {
|
||||||
|
if this.PublicMetrics != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.PublicMetrics); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("PublicMetrics", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for _, item := range this.ReferencedTweets {
|
||||||
|
if item != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("ReferencedTweets", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if this.ReplyTo != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.ReplyTo); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("ReplyTo", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *YouTubeReply) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *YouTubeComment) Validate() error {
|
||||||
|
for _, item := range this.Replies {
|
||||||
|
if item != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Replies", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *GetCommentResponse) Validate() error {
|
||||||
|
for _, item := range this.Instagram {
|
||||||
|
if item != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Instagram", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for _, item := range this.Tiktok {
|
||||||
|
if item != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Tiktok", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for _, item := range this.Bluesky {
|
||||||
|
if item != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Bluesky", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for _, item := range this.Facebook {
|
||||||
|
if item != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Facebook", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for _, item := range this.Linkedin {
|
||||||
|
if item != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Linkedin", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for _, item := range this.Reddit {
|
||||||
|
if item != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Reddit", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for _, item := range this.Threads {
|
||||||
|
if item != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Threads", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for _, item := range this.Twitter {
|
||||||
|
if item != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Twitter", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for _, item := range this.Youtube {
|
||||||
|
if item != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Youtube", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *DeleteCommentRequest) Validate() error {
|
||||||
|
if this.Id == "" {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Id", fmt.Errorf(`id不能为空`))
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *InstagramDeleteResponse) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *TikTokDeleteResponse) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *DeleteCommentResponse) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *ReplyCommentRequest) Validate() error {
|
||||||
|
if this.Id == "" {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Id", fmt.Errorf(`id不能为空`))
|
||||||
|
}
|
||||||
|
if this.Comment == "" {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Comment", fmt.Errorf(`comment不能为空`))
|
||||||
|
}
|
||||||
|
if len(this.Platforms) < 1 {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Platforms", fmt.Errorf(`platforms平台列表不能为空`))
|
||||||
|
}
|
||||||
|
for _, item := range this.Platforms {
|
||||||
|
if item == "" {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Platforms", fmt.Errorf(`platforms平台列表不能为空`))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *InstagramReplyResponse) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *TikTokReplyResponse) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *BlueskyReplyResponse) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *FacebookReplyResponse) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *LinkedInReplyResponse) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *TwitterReplyResponse) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *YouTubeReplyResponse) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *ReplyCommentResponse) Validate() error {
|
||||||
|
if this.Instagram != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Instagram); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Instagram", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if this.Tiktok != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Tiktok); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Tiktok", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if this.Bluesky != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Bluesky); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Bluesky", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if this.Facebook != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Facebook); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Facebook", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if this.Linkedin != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Linkedin); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Linkedin", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if this.Twitter != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Twitter); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Twitter", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if this.Youtube != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Youtube); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Youtube", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *GetPostAnalyticsRequest) Validate() error {
|
||||||
|
if this.Id == "" {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Id", fmt.Errorf(`帖子ID不能为空`))
|
||||||
|
}
|
||||||
|
if len(this.Platforms) < 1 {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Platforms", fmt.Errorf(`platforms平台列表不能为空`))
|
||||||
|
}
|
||||||
|
for _, item := range this.Platforms {
|
||||||
|
if item == "" {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Platforms", fmt.Errorf(`platforms平台列表不能为空`))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *GetPostAnalyticsBySocialIDRequest) Validate() error {
|
||||||
|
if this.Id == "" {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Id", fmt.Errorf(`Social Post ID不能为空`))
|
||||||
|
}
|
||||||
|
if len(this.Platforms) < 1 {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Platforms", fmt.Errorf(`platforms平台列表不能为空`))
|
||||||
|
}
|
||||||
|
for _, item := range this.Platforms {
|
||||||
|
if item == "" {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Platforms", fmt.Errorf(`platforms平台列表不能为空`))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *GetPostAnalyticsResponse) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *GetSocialAnalyticsRequest) Validate() error {
|
||||||
|
if len(this.Platforms) < 1 {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Platforms", fmt.Errorf(`platforms平台列表不能为空`))
|
||||||
|
}
|
||||||
|
for _, item := range this.Platforms {
|
||||||
|
if item == "" {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Platforms", fmt.Errorf(`platforms平台列表不能为空`))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *GetSocialAnalyticsResponse) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *AutoHashtagsRequest) Validate() error {
|
||||||
|
if this.Post == "" {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Post", fmt.Errorf(`post内容不能为空`))
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *AutoHashtagsResponse) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *CheckBannedHashtagRequest) Validate() error {
|
||||||
|
if this.Hashtag == "" {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Hashtag", fmt.Errorf(`hashtag不能为空`))
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *CheckBannedHashtagResponse) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *HashtagRecommendation) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *RecommendHashtagsRequest) Validate() error {
|
||||||
|
if this.Keyword == "" {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Keyword", fmt.Errorf(`keyword不能为空`))
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *RecommendHashtagsResponse) Validate() error {
|
||||||
|
for _, item := range this.Recommendations {
|
||||||
|
if item != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Recommendations", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *SearchHashtagsRequest) Validate() error {
|
||||||
|
if this.Keyword == "" {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Keyword", fmt.Errorf(`keyword不能为空`))
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *SearchHashtagInfo) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *SearchHashtagChild) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *SearchHashtagChildren) Validate() error {
|
||||||
|
for _, item := range this.Data {
|
||||||
|
if item != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Data", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *SearchHashtagMedia) Validate() error {
|
||||||
|
if this.Children != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Children); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Children", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *SearchHashtagsResponse) Validate() error {
|
||||||
|
if this.Hashtag != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Hashtag); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Hashtag", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for _, item := range this.SearchResults {
|
||||||
|
if item != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("SearchResults", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|||||||
@ -37,6 +37,27 @@ type AyrshareClient interface {
|
|||||||
CreateProfile(ctx context.Context, in *CreateProfileRequest, opts ...grpc_go.CallOption) (*CreateProfileResponse, common.ErrorWithAttachment)
|
CreateProfile(ctx context.Context, in *CreateProfileRequest, opts ...grpc_go.CallOption) (*CreateProfileResponse, common.ErrorWithAttachment)
|
||||||
GetProfiles(ctx context.Context, in *GetProfilesRequest, opts ...grpc_go.CallOption) (*GetProfilesResponse, common.ErrorWithAttachment)
|
GetProfiles(ctx context.Context, in *GetProfilesRequest, opts ...grpc_go.CallOption) (*GetProfilesResponse, common.ErrorWithAttachment)
|
||||||
GenerateJWT(ctx context.Context, in *GenerateJWTRequest, opts ...grpc_go.CallOption) (*GenerateJWTResponse, common.ErrorWithAttachment)
|
GenerateJWT(ctx context.Context, in *GenerateJWTRequest, opts ...grpc_go.CallOption) (*GenerateJWTResponse, common.ErrorWithAttachment)
|
||||||
|
// 历史记录相关 api
|
||||||
|
GetHistory(ctx context.Context, in *GetHistoryRequest, opts ...grpc_go.CallOption) (*GetHistoryResponse, common.ErrorWithAttachment)
|
||||||
|
GetHistoryById(ctx context.Context, in *GetHistoryByIdRequest, opts ...grpc_go.CallOption) (*GetHistoryByIdResponse, common.ErrorWithAttachment)
|
||||||
|
GetHistoryByPlatform(ctx context.Context, in *GetHistoryByPlatformRequest, opts ...grpc_go.CallOption) (*GetHistoryByPlatformResponse, common.ErrorWithAttachment)
|
||||||
|
// 消息相关 api
|
||||||
|
SendMessage(ctx context.Context, in *SendMessageRequest, opts ...grpc_go.CallOption) (*SendMessageResponse, common.ErrorWithAttachment)
|
||||||
|
GetMessages(ctx context.Context, in *GetMessagesRequest, opts ...grpc_go.CallOption) (*GetMessagesResponse, common.ErrorWithAttachment)
|
||||||
|
// 评论相关 api
|
||||||
|
PostComment(ctx context.Context, in *PostCommentRequest, opts ...grpc_go.CallOption) (*PostCommentResponse, common.ErrorWithAttachment)
|
||||||
|
GetComment(ctx context.Context, in *GetCommentRequest, opts ...grpc_go.CallOption) (*GetCommentResponse, common.ErrorWithAttachment)
|
||||||
|
DeleteComment(ctx context.Context, in *DeleteCommentRequest, opts ...grpc_go.CallOption) (*DeleteCommentResponse, common.ErrorWithAttachment)
|
||||||
|
ReplyComment(ctx context.Context, in *ReplyCommentRequest, opts ...grpc_go.CallOption) (*ReplyCommentResponse, common.ErrorWithAttachment)
|
||||||
|
// 分析相关 api
|
||||||
|
GetPostAnalytics(ctx context.Context, in *GetPostAnalyticsRequest, opts ...grpc_go.CallOption) (*GetPostAnalyticsResponse, common.ErrorWithAttachment)
|
||||||
|
GetPostAnalyticsBySocialID(ctx context.Context, in *GetPostAnalyticsBySocialIDRequest, opts ...grpc_go.CallOption) (*GetPostAnalyticsResponse, common.ErrorWithAttachment)
|
||||||
|
GetSocialAnalytics(ctx context.Context, in *GetSocialAnalyticsRequest, opts ...grpc_go.CallOption) (*GetSocialAnalyticsResponse, common.ErrorWithAttachment)
|
||||||
|
// Hashtags 相关 api
|
||||||
|
AutoHashtags(ctx context.Context, in *AutoHashtagsRequest, opts ...grpc_go.CallOption) (*AutoHashtagsResponse, common.ErrorWithAttachment)
|
||||||
|
CheckBannedHashtag(ctx context.Context, in *CheckBannedHashtagRequest, opts ...grpc_go.CallOption) (*CheckBannedHashtagResponse, common.ErrorWithAttachment)
|
||||||
|
RecommendHashtags(ctx context.Context, in *RecommendHashtagsRequest, opts ...grpc_go.CallOption) (*RecommendHashtagsResponse, common.ErrorWithAttachment)
|
||||||
|
SearchHashtags(ctx context.Context, in *SearchHashtagsRequest, opts ...grpc_go.CallOption) (*SearchHashtagsResponse, common.ErrorWithAttachment)
|
||||||
}
|
}
|
||||||
|
|
||||||
type ayrshareClient struct {
|
type ayrshareClient struct {
|
||||||
@ -44,12 +65,28 @@ type ayrshareClient struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type AyrshareClientImpl struct {
|
type AyrshareClientImpl struct {
|
||||||
Post func(ctx context.Context, in *PostRequest) (*PostResponse, error)
|
Post func(ctx context.Context, in *PostRequest) (*PostResponse, error)
|
||||||
GetPost func(ctx context.Context, in *GetPostRequest) (*GetPostResponse, error)
|
GetPost func(ctx context.Context, in *GetPostRequest) (*GetPostResponse, error)
|
||||||
GetUser func(ctx context.Context, in *GetUserRequest) (*GetUserResponse, error)
|
GetUser func(ctx context.Context, in *GetUserRequest) (*GetUserResponse, error)
|
||||||
CreateProfile func(ctx context.Context, in *CreateProfileRequest) (*CreateProfileResponse, error)
|
CreateProfile func(ctx context.Context, in *CreateProfileRequest) (*CreateProfileResponse, error)
|
||||||
GetProfiles func(ctx context.Context, in *GetProfilesRequest) (*GetProfilesResponse, error)
|
GetProfiles func(ctx context.Context, in *GetProfilesRequest) (*GetProfilesResponse, error)
|
||||||
GenerateJWT func(ctx context.Context, in *GenerateJWTRequest) (*GenerateJWTResponse, error)
|
GenerateJWT func(ctx context.Context, in *GenerateJWTRequest) (*GenerateJWTResponse, error)
|
||||||
|
GetHistory func(ctx context.Context, in *GetHistoryRequest) (*GetHistoryResponse, error)
|
||||||
|
GetHistoryById func(ctx context.Context, in *GetHistoryByIdRequest) (*GetHistoryByIdResponse, error)
|
||||||
|
GetHistoryByPlatform func(ctx context.Context, in *GetHistoryByPlatformRequest) (*GetHistoryByPlatformResponse, error)
|
||||||
|
SendMessage func(ctx context.Context, in *SendMessageRequest) (*SendMessageResponse, error)
|
||||||
|
GetMessages func(ctx context.Context, in *GetMessagesRequest) (*GetMessagesResponse, error)
|
||||||
|
PostComment func(ctx context.Context, in *PostCommentRequest) (*PostCommentResponse, error)
|
||||||
|
GetComment func(ctx context.Context, in *GetCommentRequest) (*GetCommentResponse, error)
|
||||||
|
DeleteComment func(ctx context.Context, in *DeleteCommentRequest) (*DeleteCommentResponse, error)
|
||||||
|
ReplyComment func(ctx context.Context, in *ReplyCommentRequest) (*ReplyCommentResponse, error)
|
||||||
|
GetPostAnalytics func(ctx context.Context, in *GetPostAnalyticsRequest) (*GetPostAnalyticsResponse, error)
|
||||||
|
GetPostAnalyticsBySocialID func(ctx context.Context, in *GetPostAnalyticsBySocialIDRequest) (*GetPostAnalyticsResponse, error)
|
||||||
|
GetSocialAnalytics func(ctx context.Context, in *GetSocialAnalyticsRequest) (*GetSocialAnalyticsResponse, error)
|
||||||
|
AutoHashtags func(ctx context.Context, in *AutoHashtagsRequest) (*AutoHashtagsResponse, error)
|
||||||
|
CheckBannedHashtag func(ctx context.Context, in *CheckBannedHashtagRequest) (*CheckBannedHashtagResponse, error)
|
||||||
|
RecommendHashtags func(ctx context.Context, in *RecommendHashtagsRequest) (*RecommendHashtagsResponse, error)
|
||||||
|
SearchHashtags func(ctx context.Context, in *SearchHashtagsRequest) (*SearchHashtagsResponse, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *AyrshareClientImpl) GetDubboStub(cc *triple.TripleConn) AyrshareClient {
|
func (c *AyrshareClientImpl) GetDubboStub(cc *triple.TripleConn) AyrshareClient {
|
||||||
@ -100,6 +137,102 @@ func (c *ayrshareClient) GenerateJWT(ctx context.Context, in *GenerateJWTRequest
|
|||||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GenerateJWT", in, out)
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GenerateJWT", in, out)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *ayrshareClient) GetHistory(ctx context.Context, in *GetHistoryRequest, opts ...grpc_go.CallOption) (*GetHistoryResponse, common.ErrorWithAttachment) {
|
||||||
|
out := new(GetHistoryResponse)
|
||||||
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetHistory", in, out)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *ayrshareClient) GetHistoryById(ctx context.Context, in *GetHistoryByIdRequest, opts ...grpc_go.CallOption) (*GetHistoryByIdResponse, common.ErrorWithAttachment) {
|
||||||
|
out := new(GetHistoryByIdResponse)
|
||||||
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetHistoryById", in, out)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *ayrshareClient) GetHistoryByPlatform(ctx context.Context, in *GetHistoryByPlatformRequest, opts ...grpc_go.CallOption) (*GetHistoryByPlatformResponse, common.ErrorWithAttachment) {
|
||||||
|
out := new(GetHistoryByPlatformResponse)
|
||||||
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetHistoryByPlatform", in, out)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *ayrshareClient) SendMessage(ctx context.Context, in *SendMessageRequest, opts ...grpc_go.CallOption) (*SendMessageResponse, common.ErrorWithAttachment) {
|
||||||
|
out := new(SendMessageResponse)
|
||||||
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/SendMessage", in, out)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *ayrshareClient) GetMessages(ctx context.Context, in *GetMessagesRequest, opts ...grpc_go.CallOption) (*GetMessagesResponse, common.ErrorWithAttachment) {
|
||||||
|
out := new(GetMessagesResponse)
|
||||||
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetMessages", in, out)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *ayrshareClient) PostComment(ctx context.Context, in *PostCommentRequest, opts ...grpc_go.CallOption) (*PostCommentResponse, common.ErrorWithAttachment) {
|
||||||
|
out := new(PostCommentResponse)
|
||||||
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/PostComment", in, out)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *ayrshareClient) GetComment(ctx context.Context, in *GetCommentRequest, opts ...grpc_go.CallOption) (*GetCommentResponse, common.ErrorWithAttachment) {
|
||||||
|
out := new(GetCommentResponse)
|
||||||
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetComment", in, out)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *ayrshareClient) DeleteComment(ctx context.Context, in *DeleteCommentRequest, opts ...grpc_go.CallOption) (*DeleteCommentResponse, common.ErrorWithAttachment) {
|
||||||
|
out := new(DeleteCommentResponse)
|
||||||
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/DeleteComment", in, out)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *ayrshareClient) ReplyComment(ctx context.Context, in *ReplyCommentRequest, opts ...grpc_go.CallOption) (*ReplyCommentResponse, common.ErrorWithAttachment) {
|
||||||
|
out := new(ReplyCommentResponse)
|
||||||
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/ReplyComment", in, out)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *ayrshareClient) GetPostAnalytics(ctx context.Context, in *GetPostAnalyticsRequest, opts ...grpc_go.CallOption) (*GetPostAnalyticsResponse, common.ErrorWithAttachment) {
|
||||||
|
out := new(GetPostAnalyticsResponse)
|
||||||
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetPostAnalytics", in, out)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *ayrshareClient) GetPostAnalyticsBySocialID(ctx context.Context, in *GetPostAnalyticsBySocialIDRequest, opts ...grpc_go.CallOption) (*GetPostAnalyticsResponse, common.ErrorWithAttachment) {
|
||||||
|
out := new(GetPostAnalyticsResponse)
|
||||||
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetPostAnalyticsBySocialID", in, out)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *ayrshareClient) GetSocialAnalytics(ctx context.Context, in *GetSocialAnalyticsRequest, opts ...grpc_go.CallOption) (*GetSocialAnalyticsResponse, common.ErrorWithAttachment) {
|
||||||
|
out := new(GetSocialAnalyticsResponse)
|
||||||
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetSocialAnalytics", in, out)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *ayrshareClient) AutoHashtags(ctx context.Context, in *AutoHashtagsRequest, opts ...grpc_go.CallOption) (*AutoHashtagsResponse, common.ErrorWithAttachment) {
|
||||||
|
out := new(AutoHashtagsResponse)
|
||||||
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/AutoHashtags", in, out)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *ayrshareClient) CheckBannedHashtag(ctx context.Context, in *CheckBannedHashtagRequest, opts ...grpc_go.CallOption) (*CheckBannedHashtagResponse, common.ErrorWithAttachment) {
|
||||||
|
out := new(CheckBannedHashtagResponse)
|
||||||
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/CheckBannedHashtag", in, out)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *ayrshareClient) RecommendHashtags(ctx context.Context, in *RecommendHashtagsRequest, opts ...grpc_go.CallOption) (*RecommendHashtagsResponse, common.ErrorWithAttachment) {
|
||||||
|
out := new(RecommendHashtagsResponse)
|
||||||
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/RecommendHashtags", in, out)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *ayrshareClient) SearchHashtags(ctx context.Context, in *SearchHashtagsRequest, opts ...grpc_go.CallOption) (*SearchHashtagsResponse, common.ErrorWithAttachment) {
|
||||||
|
out := new(SearchHashtagsResponse)
|
||||||
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/SearchHashtags", in, out)
|
||||||
|
}
|
||||||
|
|
||||||
// AyrshareServer is the server API for Ayrshare service.
|
// AyrshareServer is the server API for Ayrshare service.
|
||||||
// All implementations must embed UnimplementedAyrshareServer
|
// All implementations must embed UnimplementedAyrshareServer
|
||||||
// for forward compatibility
|
// for forward compatibility
|
||||||
@ -113,6 +246,27 @@ type AyrshareServer interface {
|
|||||||
CreateProfile(context.Context, *CreateProfileRequest) (*CreateProfileResponse, error)
|
CreateProfile(context.Context, *CreateProfileRequest) (*CreateProfileResponse, error)
|
||||||
GetProfiles(context.Context, *GetProfilesRequest) (*GetProfilesResponse, error)
|
GetProfiles(context.Context, *GetProfilesRequest) (*GetProfilesResponse, error)
|
||||||
GenerateJWT(context.Context, *GenerateJWTRequest) (*GenerateJWTResponse, error)
|
GenerateJWT(context.Context, *GenerateJWTRequest) (*GenerateJWTResponse, error)
|
||||||
|
// 历史记录相关 api
|
||||||
|
GetHistory(context.Context, *GetHistoryRequest) (*GetHistoryResponse, error)
|
||||||
|
GetHistoryById(context.Context, *GetHistoryByIdRequest) (*GetHistoryByIdResponse, error)
|
||||||
|
GetHistoryByPlatform(context.Context, *GetHistoryByPlatformRequest) (*GetHistoryByPlatformResponse, error)
|
||||||
|
// 消息相关 api
|
||||||
|
SendMessage(context.Context, *SendMessageRequest) (*SendMessageResponse, error)
|
||||||
|
GetMessages(context.Context, *GetMessagesRequest) (*GetMessagesResponse, error)
|
||||||
|
// 评论相关 api
|
||||||
|
PostComment(context.Context, *PostCommentRequest) (*PostCommentResponse, error)
|
||||||
|
GetComment(context.Context, *GetCommentRequest) (*GetCommentResponse, error)
|
||||||
|
DeleteComment(context.Context, *DeleteCommentRequest) (*DeleteCommentResponse, error)
|
||||||
|
ReplyComment(context.Context, *ReplyCommentRequest) (*ReplyCommentResponse, error)
|
||||||
|
// 分析相关 api
|
||||||
|
GetPostAnalytics(context.Context, *GetPostAnalyticsRequest) (*GetPostAnalyticsResponse, error)
|
||||||
|
GetPostAnalyticsBySocialID(context.Context, *GetPostAnalyticsBySocialIDRequest) (*GetPostAnalyticsResponse, error)
|
||||||
|
GetSocialAnalytics(context.Context, *GetSocialAnalyticsRequest) (*GetSocialAnalyticsResponse, error)
|
||||||
|
// Hashtags 相关 api
|
||||||
|
AutoHashtags(context.Context, *AutoHashtagsRequest) (*AutoHashtagsResponse, error)
|
||||||
|
CheckBannedHashtag(context.Context, *CheckBannedHashtagRequest) (*CheckBannedHashtagResponse, error)
|
||||||
|
RecommendHashtags(context.Context, *RecommendHashtagsRequest) (*RecommendHashtagsResponse, error)
|
||||||
|
SearchHashtags(context.Context, *SearchHashtagsRequest) (*SearchHashtagsResponse, error)
|
||||||
mustEmbedUnimplementedAyrshareServer()
|
mustEmbedUnimplementedAyrshareServer()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -139,6 +293,54 @@ func (UnimplementedAyrshareServer) GetProfiles(context.Context, *GetProfilesRequ
|
|||||||
func (UnimplementedAyrshareServer) GenerateJWT(context.Context, *GenerateJWTRequest) (*GenerateJWTResponse, error) {
|
func (UnimplementedAyrshareServer) GenerateJWT(context.Context, *GenerateJWTRequest) (*GenerateJWTResponse, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method GenerateJWT not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method GenerateJWT not implemented")
|
||||||
}
|
}
|
||||||
|
func (UnimplementedAyrshareServer) GetHistory(context.Context, *GetHistoryRequest) (*GetHistoryResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method GetHistory not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedAyrshareServer) GetHistoryById(context.Context, *GetHistoryByIdRequest) (*GetHistoryByIdResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method GetHistoryById not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedAyrshareServer) GetHistoryByPlatform(context.Context, *GetHistoryByPlatformRequest) (*GetHistoryByPlatformResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method GetHistoryByPlatform not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedAyrshareServer) SendMessage(context.Context, *SendMessageRequest) (*SendMessageResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method SendMessage not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedAyrshareServer) GetMessages(context.Context, *GetMessagesRequest) (*GetMessagesResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method GetMessages not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedAyrshareServer) PostComment(context.Context, *PostCommentRequest) (*PostCommentResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method PostComment not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedAyrshareServer) GetComment(context.Context, *GetCommentRequest) (*GetCommentResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method GetComment not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedAyrshareServer) DeleteComment(context.Context, *DeleteCommentRequest) (*DeleteCommentResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method DeleteComment not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedAyrshareServer) ReplyComment(context.Context, *ReplyCommentRequest) (*ReplyCommentResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method ReplyComment not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedAyrshareServer) GetPostAnalytics(context.Context, *GetPostAnalyticsRequest) (*GetPostAnalyticsResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method GetPostAnalytics not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedAyrshareServer) GetPostAnalyticsBySocialID(context.Context, *GetPostAnalyticsBySocialIDRequest) (*GetPostAnalyticsResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method GetPostAnalyticsBySocialID not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedAyrshareServer) GetSocialAnalytics(context.Context, *GetSocialAnalyticsRequest) (*GetSocialAnalyticsResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method GetSocialAnalytics not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedAyrshareServer) AutoHashtags(context.Context, *AutoHashtagsRequest) (*AutoHashtagsResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method AutoHashtags not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedAyrshareServer) CheckBannedHashtag(context.Context, *CheckBannedHashtagRequest) (*CheckBannedHashtagResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method CheckBannedHashtag not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedAyrshareServer) RecommendHashtags(context.Context, *RecommendHashtagsRequest) (*RecommendHashtagsResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method RecommendHashtags not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedAyrshareServer) SearchHashtags(context.Context, *SearchHashtagsRequest) (*SearchHashtagsResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method SearchHashtags not implemented")
|
||||||
|
}
|
||||||
func (s *UnimplementedAyrshareServer) XXX_SetProxyImpl(impl protocol.Invoker) {
|
func (s *UnimplementedAyrshareServer) XXX_SetProxyImpl(impl protocol.Invoker) {
|
||||||
s.proxyImpl = impl
|
s.proxyImpl = impl
|
||||||
}
|
}
|
||||||
@ -341,6 +543,470 @@ func _Ayrshare_GenerateJWT_Handler(srv interface{}, ctx context.Context, dec fun
|
|||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func _Ayrshare_GetHistory_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(GetHistoryRequest)
|
||||||
|
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("GetHistory", 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 _Ayrshare_GetHistoryById_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(GetHistoryByIdRequest)
|
||||||
|
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("GetHistoryById", 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 _Ayrshare_GetHistoryByPlatform_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(GetHistoryByPlatformRequest)
|
||||||
|
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("GetHistoryByPlatform", 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 _Ayrshare_SendMessage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(SendMessageRequest)
|
||||||
|
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("SendMessage", 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 _Ayrshare_GetMessages_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(GetMessagesRequest)
|
||||||
|
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("GetMessages", 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 _Ayrshare_PostComment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(PostCommentRequest)
|
||||||
|
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("PostComment", 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 _Ayrshare_GetComment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(GetCommentRequest)
|
||||||
|
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("GetComment", 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 _Ayrshare_DeleteComment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(DeleteCommentRequest)
|
||||||
|
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("DeleteComment", 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 _Ayrshare_ReplyComment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(ReplyCommentRequest)
|
||||||
|
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("ReplyComment", 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 _Ayrshare_GetPostAnalytics_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(GetPostAnalyticsRequest)
|
||||||
|
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("GetPostAnalytics", 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 _Ayrshare_GetPostAnalyticsBySocialID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(GetPostAnalyticsBySocialIDRequest)
|
||||||
|
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("GetPostAnalyticsBySocialID", 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 _Ayrshare_GetSocialAnalytics_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(GetSocialAnalyticsRequest)
|
||||||
|
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("GetSocialAnalytics", 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 _Ayrshare_AutoHashtags_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(AutoHashtagsRequest)
|
||||||
|
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("AutoHashtags", 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 _Ayrshare_CheckBannedHashtag_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(CheckBannedHashtagRequest)
|
||||||
|
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("CheckBannedHashtag", 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 _Ayrshare_RecommendHashtags_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(RecommendHashtagsRequest)
|
||||||
|
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("RecommendHashtags", 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 _Ayrshare_SearchHashtags_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(SearchHashtagsRequest)
|
||||||
|
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("SearchHashtags", 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)
|
||||||
|
}
|
||||||
|
|
||||||
// Ayrshare_ServiceDesc is the grpc_go.ServiceDesc for Ayrshare service.
|
// Ayrshare_ServiceDesc is the grpc_go.ServiceDesc for Ayrshare service.
|
||||||
// It's only intended for direct use with grpc_go.RegisterService,
|
// It's only intended for direct use with grpc_go.RegisterService,
|
||||||
// and not to be introspected or modified (even as a copy)
|
// and not to be introspected or modified (even as a copy)
|
||||||
@ -372,6 +1038,70 @@ var Ayrshare_ServiceDesc = grpc_go.ServiceDesc{
|
|||||||
MethodName: "GenerateJWT",
|
MethodName: "GenerateJWT",
|
||||||
Handler: _Ayrshare_GenerateJWT_Handler,
|
Handler: _Ayrshare_GenerateJWT_Handler,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
MethodName: "GetHistory",
|
||||||
|
Handler: _Ayrshare_GetHistory_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "GetHistoryById",
|
||||||
|
Handler: _Ayrshare_GetHistoryById_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "GetHistoryByPlatform",
|
||||||
|
Handler: _Ayrshare_GetHistoryByPlatform_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "SendMessage",
|
||||||
|
Handler: _Ayrshare_SendMessage_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "GetMessages",
|
||||||
|
Handler: _Ayrshare_GetMessages_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "PostComment",
|
||||||
|
Handler: _Ayrshare_PostComment_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "GetComment",
|
||||||
|
Handler: _Ayrshare_GetComment_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "DeleteComment",
|
||||||
|
Handler: _Ayrshare_DeleteComment_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "ReplyComment",
|
||||||
|
Handler: _Ayrshare_ReplyComment_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "GetPostAnalytics",
|
||||||
|
Handler: _Ayrshare_GetPostAnalytics_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "GetPostAnalyticsBySocialID",
|
||||||
|
Handler: _Ayrshare_GetPostAnalyticsBySocialID_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "GetSocialAnalytics",
|
||||||
|
Handler: _Ayrshare_GetSocialAnalytics_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "AutoHashtags",
|
||||||
|
Handler: _Ayrshare_AutoHashtags_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "CheckBannedHashtag",
|
||||||
|
Handler: _Ayrshare_CheckBannedHashtag_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "RecommendHashtags",
|
||||||
|
Handler: _Ayrshare_RecommendHashtags_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "SearchHashtags",
|
||||||
|
Handler: _Ayrshare_SearchHashtags_Handler,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
Streams: []grpc_go.StreamDesc{},
|
Streams: []grpc_go.StreamDesc{},
|
||||||
Metadata: "pb/ayrshare.proto",
|
Metadata: "pb/ayrshare.proto",
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -17,6 +17,32 @@ var _ = proto.Marshal
|
|||||||
var _ = fmt.Errorf
|
var _ = fmt.Errorf
|
||||||
var _ = math.Inf
|
var _ = math.Inf
|
||||||
|
|
||||||
|
func (this *QueryTheOrderSnapshotInformationReq) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *QueryTheOrderSnapshotInformationResp) Validate() error {
|
||||||
|
for _, item := range this.BundleOrder {
|
||||||
|
if item != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("BundleOrder", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for _, item := range this.AddBundleOrder {
|
||||||
|
if item != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("AddBundleOrder", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *ServiceInformation) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *ReSignTheContractRequest) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
func (this *DeleteValueAddServiceRequest) Validate() error {
|
func (this *DeleteValueAddServiceRequest) Validate() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@ -714,6 +740,9 @@ func (this *SetPendingTaskLayoutReq) Validate() error {
|
|||||||
func (this *SetPendingTaskLayoutResp) Validate() error {
|
func (this *SetPendingTaskLayoutResp) Validate() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
func (this *CreateTaskWorkLogRequest) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
func (this *MetricsBusinessReq) Validate() error {
|
func (this *MetricsBusinessReq) Validate() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
@ -50,6 +50,7 @@ type BundleClient interface {
|
|||||||
OrderRecordsListV2(ctx context.Context, in *OrderRecordsRequestV2, opts ...grpc_go.CallOption) (*OrderRecordsResponseV2, common.ErrorWithAttachment)
|
OrderRecordsListV2(ctx context.Context, in *OrderRecordsRequestV2, opts ...grpc_go.CallOption) (*OrderRecordsResponseV2, common.ErrorWithAttachment)
|
||||||
OrderListByOrderNo(ctx context.Context, in *OrderInfoByOrderNoRequest, opts ...grpc_go.CallOption) (*OrderInfoByOrderNoResp, common.ErrorWithAttachment)
|
OrderListByOrderNo(ctx context.Context, in *OrderInfoByOrderNoRequest, opts ...grpc_go.CallOption) (*OrderInfoByOrderNoResp, common.ErrorWithAttachment)
|
||||||
OnlyAddValueListByOrderNo(ctx context.Context, in *OnlyAddValueListByOrderNoRequest, opts ...grpc_go.CallOption) (*OnlyAddValueListByOrderNoResp, common.ErrorWithAttachment)
|
OnlyAddValueListByOrderNo(ctx context.Context, in *OnlyAddValueListByOrderNoRequest, opts ...grpc_go.CallOption) (*OnlyAddValueListByOrderNoResp, common.ErrorWithAttachment)
|
||||||
|
ReSignTheContract(ctx context.Context, in *ReSignTheContractRequest, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment)
|
||||||
// 增值套餐
|
// 增值套餐
|
||||||
CreateValueAddBundle(ctx context.Context, in *CreateValueAddBundleRequest, opts ...grpc_go.CallOption) (*CreateValueAddBundleResponse, common.ErrorWithAttachment)
|
CreateValueAddBundle(ctx context.Context, in *CreateValueAddBundleRequest, opts ...grpc_go.CallOption) (*CreateValueAddBundleResponse, common.ErrorWithAttachment)
|
||||||
ValueAddBundleList(ctx context.Context, in *ValueAddBundleListRequest, opts ...grpc_go.CallOption) (*ValueAddBundleListResponse, common.ErrorWithAttachment)
|
ValueAddBundleList(ctx context.Context, in *ValueAddBundleListRequest, opts ...grpc_go.CallOption) (*ValueAddBundleListResponse, common.ErrorWithAttachment)
|
||||||
@ -109,6 +110,7 @@ type BundleClient interface {
|
|||||||
GetPendingAssign(ctx context.Context, in *PendingAssignRequest, opts ...grpc_go.CallOption) (*PendingAssignResponse, common.ErrorWithAttachment)
|
GetPendingAssign(ctx context.Context, in *PendingAssignRequest, opts ...grpc_go.CallOption) (*PendingAssignResponse, common.ErrorWithAttachment)
|
||||||
RevertTaskCompletionByUUIDItem(ctx context.Context, in *RevertTaskCompletionByUUIDItemRequest, opts ...grpc_go.CallOption) (*ComResponse, common.ErrorWithAttachment)
|
RevertTaskCompletionByUUIDItem(ctx context.Context, in *RevertTaskCompletionByUUIDItemRequest, opts ...grpc_go.CallOption) (*ComResponse, common.ErrorWithAttachment)
|
||||||
AddHiddenTaskAssignee(ctx context.Context, in *AddHiddenTaskAssigneeRequest, opts ...grpc_go.CallOption) (*ComResponse, common.ErrorWithAttachment)
|
AddHiddenTaskAssignee(ctx context.Context, in *AddHiddenTaskAssigneeRequest, opts ...grpc_go.CallOption) (*ComResponse, common.ErrorWithAttachment)
|
||||||
|
CreateTaskWorkLog(ctx context.Context, in *CreateTaskWorkLogRequest, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment)
|
||||||
// 数据指标
|
// 数据指标
|
||||||
MetricsBusiness(ctx context.Context, in *MetricsBusinessReq, opts ...grpc_go.CallOption) (*MetricsBusinessResp, common.ErrorWithAttachment)
|
MetricsBusiness(ctx context.Context, in *MetricsBusinessReq, opts ...grpc_go.CallOption) (*MetricsBusinessResp, common.ErrorWithAttachment)
|
||||||
MetricsOperatingCreate(ctx context.Context, in *MetricsOperatingCreateReq, opts ...grpc_go.CallOption) (*MetricsOperatingCreateResp, common.ErrorWithAttachment)
|
MetricsOperatingCreate(ctx context.Context, in *MetricsOperatingCreateReq, opts ...grpc_go.CallOption) (*MetricsOperatingCreateResp, common.ErrorWithAttachment)
|
||||||
@ -116,6 +118,7 @@ type BundleClient interface {
|
|||||||
MetricsBundlePurchaseExport(ctx context.Context, in *MetricsBundlePurchaseExportReq, opts ...grpc_go.CallOption) (*MetricsBundlePurchaseExportResp, common.ErrorWithAttachment)
|
MetricsBundlePurchaseExport(ctx context.Context, in *MetricsBundlePurchaseExportReq, opts ...grpc_go.CallOption) (*MetricsBundlePurchaseExportResp, common.ErrorWithAttachment)
|
||||||
MetricsArtistAccountExport(ctx context.Context, in *MetricsArtistAccountExportReq, opts ...grpc_go.CallOption) (*MetricsArtistAccountExportResp, common.ErrorWithAttachment)
|
MetricsArtistAccountExport(ctx context.Context, in *MetricsArtistAccountExportReq, opts ...grpc_go.CallOption) (*MetricsArtistAccountExportResp, common.ErrorWithAttachment)
|
||||||
MetricsVideoSubmitExport(ctx context.Context, in *MetricsVideoSubmitExportReq, opts ...grpc_go.CallOption) (*MetricsVideoSubmitExportResp, common.ErrorWithAttachment)
|
MetricsVideoSubmitExport(ctx context.Context, in *MetricsVideoSubmitExportReq, opts ...grpc_go.CallOption) (*MetricsVideoSubmitExportResp, common.ErrorWithAttachment)
|
||||||
|
QueryTheOrderSnapshotInformation(ctx context.Context, in *QueryTheOrderSnapshotInformationReq, opts ...grpc_go.CallOption) (*QueryTheOrderSnapshotInformationResp, common.ErrorWithAttachment)
|
||||||
}
|
}
|
||||||
|
|
||||||
type bundleClient struct {
|
type bundleClient struct {
|
||||||
@ -145,6 +148,7 @@ type BundleClientImpl struct {
|
|||||||
OrderRecordsListV2 func(ctx context.Context, in *OrderRecordsRequestV2) (*OrderRecordsResponseV2, error)
|
OrderRecordsListV2 func(ctx context.Context, in *OrderRecordsRequestV2) (*OrderRecordsResponseV2, error)
|
||||||
OrderListByOrderNo func(ctx context.Context, in *OrderInfoByOrderNoRequest) (*OrderInfoByOrderNoResp, error)
|
OrderListByOrderNo func(ctx context.Context, in *OrderInfoByOrderNoRequest) (*OrderInfoByOrderNoResp, error)
|
||||||
OnlyAddValueListByOrderNo func(ctx context.Context, in *OnlyAddValueListByOrderNoRequest) (*OnlyAddValueListByOrderNoResp, error)
|
OnlyAddValueListByOrderNo func(ctx context.Context, in *OnlyAddValueListByOrderNoRequest) (*OnlyAddValueListByOrderNoResp, error)
|
||||||
|
ReSignTheContract func(ctx context.Context, in *ReSignTheContractRequest) (*CommonResponse, error)
|
||||||
CreateValueAddBundle func(ctx context.Context, in *CreateValueAddBundleRequest) (*CreateValueAddBundleResponse, error)
|
CreateValueAddBundle func(ctx context.Context, in *CreateValueAddBundleRequest) (*CreateValueAddBundleResponse, error)
|
||||||
ValueAddBundleList func(ctx context.Context, in *ValueAddBundleListRequest) (*ValueAddBundleListResponse, error)
|
ValueAddBundleList func(ctx context.Context, in *ValueAddBundleListRequest) (*ValueAddBundleListResponse, error)
|
||||||
ValueAddBundleDetail func(ctx context.Context, in *ValueAddBundleDetailRequest) (*ValueAddBundleDetailResponse, error)
|
ValueAddBundleDetail func(ctx context.Context, in *ValueAddBundleDetailRequest) (*ValueAddBundleDetailResponse, error)
|
||||||
@ -197,12 +201,14 @@ type BundleClientImpl struct {
|
|||||||
GetPendingAssign func(ctx context.Context, in *PendingAssignRequest) (*PendingAssignResponse, error)
|
GetPendingAssign func(ctx context.Context, in *PendingAssignRequest) (*PendingAssignResponse, error)
|
||||||
RevertTaskCompletionByUUIDItem func(ctx context.Context, in *RevertTaskCompletionByUUIDItemRequest) (*ComResponse, error)
|
RevertTaskCompletionByUUIDItem func(ctx context.Context, in *RevertTaskCompletionByUUIDItemRequest) (*ComResponse, error)
|
||||||
AddHiddenTaskAssignee func(ctx context.Context, in *AddHiddenTaskAssigneeRequest) (*ComResponse, error)
|
AddHiddenTaskAssignee func(ctx context.Context, in *AddHiddenTaskAssigneeRequest) (*ComResponse, error)
|
||||||
|
CreateTaskWorkLog func(ctx context.Context, in *CreateTaskWorkLogRequest) (*CommonResponse, error)
|
||||||
MetricsBusiness func(ctx context.Context, in *MetricsBusinessReq) (*MetricsBusinessResp, error)
|
MetricsBusiness func(ctx context.Context, in *MetricsBusinessReq) (*MetricsBusinessResp, error)
|
||||||
MetricsOperatingCreate func(ctx context.Context, in *MetricsOperatingCreateReq) (*MetricsOperatingCreateResp, error)
|
MetricsOperatingCreate func(ctx context.Context, in *MetricsOperatingCreateReq) (*MetricsOperatingCreateResp, error)
|
||||||
MetricsOperatingStatus func(ctx context.Context, in *MetricsOperatingStatusReq) (*MetricsOperatingStatusResp, error)
|
MetricsOperatingStatus func(ctx context.Context, in *MetricsOperatingStatusReq) (*MetricsOperatingStatusResp, error)
|
||||||
MetricsBundlePurchaseExport func(ctx context.Context, in *MetricsBundlePurchaseExportReq) (*MetricsBundlePurchaseExportResp, error)
|
MetricsBundlePurchaseExport func(ctx context.Context, in *MetricsBundlePurchaseExportReq) (*MetricsBundlePurchaseExportResp, error)
|
||||||
MetricsArtistAccountExport func(ctx context.Context, in *MetricsArtistAccountExportReq) (*MetricsArtistAccountExportResp, error)
|
MetricsArtistAccountExport func(ctx context.Context, in *MetricsArtistAccountExportReq) (*MetricsArtistAccountExportResp, error)
|
||||||
MetricsVideoSubmitExport func(ctx context.Context, in *MetricsVideoSubmitExportReq) (*MetricsVideoSubmitExportResp, error)
|
MetricsVideoSubmitExport func(ctx context.Context, in *MetricsVideoSubmitExportReq) (*MetricsVideoSubmitExportResp, error)
|
||||||
|
QueryTheOrderSnapshotInformation func(ctx context.Context, in *QueryTheOrderSnapshotInformationReq) (*QueryTheOrderSnapshotInformationResp, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *BundleClientImpl) GetDubboStub(cc *triple.TripleConn) BundleClient {
|
func (c *BundleClientImpl) GetDubboStub(cc *triple.TripleConn) BundleClient {
|
||||||
@ -349,6 +355,12 @@ func (c *bundleClient) OnlyAddValueListByOrderNo(ctx context.Context, in *OnlyAd
|
|||||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/OnlyAddValueListByOrderNo", in, out)
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/OnlyAddValueListByOrderNo", in, out)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *bundleClient) ReSignTheContract(ctx context.Context, in *ReSignTheContractRequest, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment) {
|
||||||
|
out := new(CommonResponse)
|
||||||
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/ReSignTheContract", in, out)
|
||||||
|
}
|
||||||
|
|
||||||
func (c *bundleClient) CreateValueAddBundle(ctx context.Context, in *CreateValueAddBundleRequest, opts ...grpc_go.CallOption) (*CreateValueAddBundleResponse, common.ErrorWithAttachment) {
|
func (c *bundleClient) CreateValueAddBundle(ctx context.Context, in *CreateValueAddBundleRequest, opts ...grpc_go.CallOption) (*CreateValueAddBundleResponse, common.ErrorWithAttachment) {
|
||||||
out := new(CreateValueAddBundleResponse)
|
out := new(CreateValueAddBundleResponse)
|
||||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
@ -661,6 +673,12 @@ func (c *bundleClient) AddHiddenTaskAssignee(ctx context.Context, in *AddHiddenT
|
|||||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/AddHiddenTaskAssignee", in, out)
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/AddHiddenTaskAssignee", in, out)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *bundleClient) CreateTaskWorkLog(ctx context.Context, in *CreateTaskWorkLogRequest, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment) {
|
||||||
|
out := new(CommonResponse)
|
||||||
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/CreateTaskWorkLog", in, out)
|
||||||
|
}
|
||||||
|
|
||||||
func (c *bundleClient) MetricsBusiness(ctx context.Context, in *MetricsBusinessReq, opts ...grpc_go.CallOption) (*MetricsBusinessResp, common.ErrorWithAttachment) {
|
func (c *bundleClient) MetricsBusiness(ctx context.Context, in *MetricsBusinessReq, opts ...grpc_go.CallOption) (*MetricsBusinessResp, common.ErrorWithAttachment) {
|
||||||
out := new(MetricsBusinessResp)
|
out := new(MetricsBusinessResp)
|
||||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
@ -697,6 +715,12 @@ func (c *bundleClient) MetricsVideoSubmitExport(ctx context.Context, in *Metrics
|
|||||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/MetricsVideoSubmitExport", in, out)
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/MetricsVideoSubmitExport", in, out)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *bundleClient) QueryTheOrderSnapshotInformation(ctx context.Context, in *QueryTheOrderSnapshotInformationReq, opts ...grpc_go.CallOption) (*QueryTheOrderSnapshotInformationResp, common.ErrorWithAttachment) {
|
||||||
|
out := new(QueryTheOrderSnapshotInformationResp)
|
||||||
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/QueryTheOrderSnapshotInformation", in, out)
|
||||||
|
}
|
||||||
|
|
||||||
// BundleServer is the server API for Bundle service.
|
// BundleServer is the server API for Bundle service.
|
||||||
// All implementations must embed UnimplementedBundleServer
|
// All implementations must embed UnimplementedBundleServer
|
||||||
// for forward compatibility
|
// for forward compatibility
|
||||||
@ -723,6 +747,7 @@ type BundleServer interface {
|
|||||||
OrderRecordsListV2(context.Context, *OrderRecordsRequestV2) (*OrderRecordsResponseV2, error)
|
OrderRecordsListV2(context.Context, *OrderRecordsRequestV2) (*OrderRecordsResponseV2, error)
|
||||||
OrderListByOrderNo(context.Context, *OrderInfoByOrderNoRequest) (*OrderInfoByOrderNoResp, error)
|
OrderListByOrderNo(context.Context, *OrderInfoByOrderNoRequest) (*OrderInfoByOrderNoResp, error)
|
||||||
OnlyAddValueListByOrderNo(context.Context, *OnlyAddValueListByOrderNoRequest) (*OnlyAddValueListByOrderNoResp, error)
|
OnlyAddValueListByOrderNo(context.Context, *OnlyAddValueListByOrderNoRequest) (*OnlyAddValueListByOrderNoResp, error)
|
||||||
|
ReSignTheContract(context.Context, *ReSignTheContractRequest) (*CommonResponse, error)
|
||||||
// 增值套餐
|
// 增值套餐
|
||||||
CreateValueAddBundle(context.Context, *CreateValueAddBundleRequest) (*CreateValueAddBundleResponse, error)
|
CreateValueAddBundle(context.Context, *CreateValueAddBundleRequest) (*CreateValueAddBundleResponse, error)
|
||||||
ValueAddBundleList(context.Context, *ValueAddBundleListRequest) (*ValueAddBundleListResponse, error)
|
ValueAddBundleList(context.Context, *ValueAddBundleListRequest) (*ValueAddBundleListResponse, error)
|
||||||
@ -782,6 +807,7 @@ type BundleServer interface {
|
|||||||
GetPendingAssign(context.Context, *PendingAssignRequest) (*PendingAssignResponse, error)
|
GetPendingAssign(context.Context, *PendingAssignRequest) (*PendingAssignResponse, error)
|
||||||
RevertTaskCompletionByUUIDItem(context.Context, *RevertTaskCompletionByUUIDItemRequest) (*ComResponse, error)
|
RevertTaskCompletionByUUIDItem(context.Context, *RevertTaskCompletionByUUIDItemRequest) (*ComResponse, error)
|
||||||
AddHiddenTaskAssignee(context.Context, *AddHiddenTaskAssigneeRequest) (*ComResponse, error)
|
AddHiddenTaskAssignee(context.Context, *AddHiddenTaskAssigneeRequest) (*ComResponse, error)
|
||||||
|
CreateTaskWorkLog(context.Context, *CreateTaskWorkLogRequest) (*CommonResponse, error)
|
||||||
// 数据指标
|
// 数据指标
|
||||||
MetricsBusiness(context.Context, *MetricsBusinessReq) (*MetricsBusinessResp, error)
|
MetricsBusiness(context.Context, *MetricsBusinessReq) (*MetricsBusinessResp, error)
|
||||||
MetricsOperatingCreate(context.Context, *MetricsOperatingCreateReq) (*MetricsOperatingCreateResp, error)
|
MetricsOperatingCreate(context.Context, *MetricsOperatingCreateReq) (*MetricsOperatingCreateResp, error)
|
||||||
@ -789,6 +815,7 @@ type BundleServer interface {
|
|||||||
MetricsBundlePurchaseExport(context.Context, *MetricsBundlePurchaseExportReq) (*MetricsBundlePurchaseExportResp, error)
|
MetricsBundlePurchaseExport(context.Context, *MetricsBundlePurchaseExportReq) (*MetricsBundlePurchaseExportResp, error)
|
||||||
MetricsArtistAccountExport(context.Context, *MetricsArtistAccountExportReq) (*MetricsArtistAccountExportResp, error)
|
MetricsArtistAccountExport(context.Context, *MetricsArtistAccountExportReq) (*MetricsArtistAccountExportResp, error)
|
||||||
MetricsVideoSubmitExport(context.Context, *MetricsVideoSubmitExportReq) (*MetricsVideoSubmitExportResp, error)
|
MetricsVideoSubmitExport(context.Context, *MetricsVideoSubmitExportReq) (*MetricsVideoSubmitExportResp, error)
|
||||||
|
QueryTheOrderSnapshotInformation(context.Context, *QueryTheOrderSnapshotInformationReq) (*QueryTheOrderSnapshotInformationResp, error)
|
||||||
mustEmbedUnimplementedBundleServer()
|
mustEmbedUnimplementedBundleServer()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -863,6 +890,9 @@ func (UnimplementedBundleServer) OrderListByOrderNo(context.Context, *OrderInfoB
|
|||||||
func (UnimplementedBundleServer) OnlyAddValueListByOrderNo(context.Context, *OnlyAddValueListByOrderNoRequest) (*OnlyAddValueListByOrderNoResp, error) {
|
func (UnimplementedBundleServer) OnlyAddValueListByOrderNo(context.Context, *OnlyAddValueListByOrderNoRequest) (*OnlyAddValueListByOrderNoResp, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method OnlyAddValueListByOrderNo not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method OnlyAddValueListByOrderNo not implemented")
|
||||||
}
|
}
|
||||||
|
func (UnimplementedBundleServer) ReSignTheContract(context.Context, *ReSignTheContractRequest) (*CommonResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method ReSignTheContract not implemented")
|
||||||
|
}
|
||||||
func (UnimplementedBundleServer) CreateValueAddBundle(context.Context, *CreateValueAddBundleRequest) (*CreateValueAddBundleResponse, error) {
|
func (UnimplementedBundleServer) CreateValueAddBundle(context.Context, *CreateValueAddBundleRequest) (*CreateValueAddBundleResponse, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method CreateValueAddBundle not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method CreateValueAddBundle not implemented")
|
||||||
}
|
}
|
||||||
@ -1019,6 +1049,9 @@ func (UnimplementedBundleServer) RevertTaskCompletionByUUIDItem(context.Context,
|
|||||||
func (UnimplementedBundleServer) AddHiddenTaskAssignee(context.Context, *AddHiddenTaskAssigneeRequest) (*ComResponse, error) {
|
func (UnimplementedBundleServer) AddHiddenTaskAssignee(context.Context, *AddHiddenTaskAssigneeRequest) (*ComResponse, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method AddHiddenTaskAssignee not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method AddHiddenTaskAssignee not implemented")
|
||||||
}
|
}
|
||||||
|
func (UnimplementedBundleServer) CreateTaskWorkLog(context.Context, *CreateTaskWorkLogRequest) (*CommonResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method CreateTaskWorkLog not implemented")
|
||||||
|
}
|
||||||
func (UnimplementedBundleServer) MetricsBusiness(context.Context, *MetricsBusinessReq) (*MetricsBusinessResp, error) {
|
func (UnimplementedBundleServer) MetricsBusiness(context.Context, *MetricsBusinessReq) (*MetricsBusinessResp, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method MetricsBusiness not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method MetricsBusiness not implemented")
|
||||||
}
|
}
|
||||||
@ -1037,6 +1070,9 @@ func (UnimplementedBundleServer) MetricsArtistAccountExport(context.Context, *Me
|
|||||||
func (UnimplementedBundleServer) MetricsVideoSubmitExport(context.Context, *MetricsVideoSubmitExportReq) (*MetricsVideoSubmitExportResp, error) {
|
func (UnimplementedBundleServer) MetricsVideoSubmitExport(context.Context, *MetricsVideoSubmitExportReq) (*MetricsVideoSubmitExportResp, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method MetricsVideoSubmitExport not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method MetricsVideoSubmitExport not implemented")
|
||||||
}
|
}
|
||||||
|
func (UnimplementedBundleServer) QueryTheOrderSnapshotInformation(context.Context, *QueryTheOrderSnapshotInformationReq) (*QueryTheOrderSnapshotInformationResp, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method QueryTheOrderSnapshotInformation not implemented")
|
||||||
|
}
|
||||||
func (s *UnimplementedBundleServer) XXX_SetProxyImpl(impl protocol.Invoker) {
|
func (s *UnimplementedBundleServer) XXX_SetProxyImpl(impl protocol.Invoker) {
|
||||||
s.proxyImpl = impl
|
s.proxyImpl = impl
|
||||||
}
|
}
|
||||||
@ -1703,6 +1739,35 @@ func _Bundle_OnlyAddValueListByOrderNo_Handler(srv interface{}, ctx context.Cont
|
|||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func _Bundle_ReSignTheContract_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(ReSignTheContractRequest)
|
||||||
|
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("ReSignTheContract", 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 _Bundle_CreateValueAddBundle_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
func _Bundle_CreateValueAddBundle_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
in := new(CreateValueAddBundleRequest)
|
in := new(CreateValueAddBundleRequest)
|
||||||
if err := dec(in); err != nil {
|
if err := dec(in); err != nil {
|
||||||
@ -3211,6 +3276,35 @@ func _Bundle_AddHiddenTaskAssignee_Handler(srv interface{}, ctx context.Context,
|
|||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func _Bundle_CreateTaskWorkLog_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(CreateTaskWorkLogRequest)
|
||||||
|
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("CreateTaskWorkLog", 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 _Bundle_MetricsBusiness_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
func _Bundle_MetricsBusiness_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
in := new(MetricsBusinessReq)
|
in := new(MetricsBusinessReq)
|
||||||
if err := dec(in); err != nil {
|
if err := dec(in); err != nil {
|
||||||
@ -3385,6 +3479,35 @@ func _Bundle_MetricsVideoSubmitExport_Handler(srv interface{}, ctx context.Conte
|
|||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func _Bundle_QueryTheOrderSnapshotInformation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(QueryTheOrderSnapshotInformationReq)
|
||||||
|
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("QueryTheOrderSnapshotInformation", 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)
|
||||||
|
}
|
||||||
|
|
||||||
// Bundle_ServiceDesc is the grpc_go.ServiceDesc for Bundle service.
|
// Bundle_ServiceDesc is the grpc_go.ServiceDesc for Bundle service.
|
||||||
// It's only intended for direct use with grpc_go.RegisterService,
|
// It's only intended for direct use with grpc_go.RegisterService,
|
||||||
// and not to be introspected or modified (even as a copy)
|
// and not to be introspected or modified (even as a copy)
|
||||||
@ -3480,6 +3603,10 @@ var Bundle_ServiceDesc = grpc_go.ServiceDesc{
|
|||||||
MethodName: "OnlyAddValueListByOrderNo",
|
MethodName: "OnlyAddValueListByOrderNo",
|
||||||
Handler: _Bundle_OnlyAddValueListByOrderNo_Handler,
|
Handler: _Bundle_OnlyAddValueListByOrderNo_Handler,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
MethodName: "ReSignTheContract",
|
||||||
|
Handler: _Bundle_ReSignTheContract_Handler,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
MethodName: "CreateValueAddBundle",
|
MethodName: "CreateValueAddBundle",
|
||||||
Handler: _Bundle_CreateValueAddBundle_Handler,
|
Handler: _Bundle_CreateValueAddBundle_Handler,
|
||||||
@ -3688,6 +3815,10 @@ var Bundle_ServiceDesc = grpc_go.ServiceDesc{
|
|||||||
MethodName: "AddHiddenTaskAssignee",
|
MethodName: "AddHiddenTaskAssignee",
|
||||||
Handler: _Bundle_AddHiddenTaskAssignee_Handler,
|
Handler: _Bundle_AddHiddenTaskAssignee_Handler,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
MethodName: "CreateTaskWorkLog",
|
||||||
|
Handler: _Bundle_CreateTaskWorkLog_Handler,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
MethodName: "MetricsBusiness",
|
MethodName: "MetricsBusiness",
|
||||||
Handler: _Bundle_MetricsBusiness_Handler,
|
Handler: _Bundle_MetricsBusiness_Handler,
|
||||||
@ -3712,6 +3843,10 @@ var Bundle_ServiceDesc = grpc_go.ServiceDesc{
|
|||||||
MethodName: "MetricsVideoSubmitExport",
|
MethodName: "MetricsVideoSubmitExport",
|
||||||
Handler: _Bundle_MetricsVideoSubmitExport_Handler,
|
Handler: _Bundle_MetricsVideoSubmitExport_Handler,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
MethodName: "QueryTheOrderSnapshotInformation",
|
||||||
|
Handler: _Bundle_QueryTheOrderSnapshotInformation_Handler,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
Streams: []grpc_go.StreamDesc{},
|
Streams: []grpc_go.StreamDesc{},
|
||||||
Metadata: "pb/bundle.proto",
|
Metadata: "pb/bundle.proto",
|
||||||
|
|||||||
5029
api/cast/cast.pb.go
5029
api/cast/cast.pb.go
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -36,6 +36,7 @@ type CastClient interface {
|
|||||||
UpdateWorkImage(ctx context.Context, in *UpdateWorkImageReq, opts ...grpc_go.CallOption) (*UpdateWorkImageResp, common.ErrorWithAttachment)
|
UpdateWorkImage(ctx context.Context, in *UpdateWorkImageReq, opts ...grpc_go.CallOption) (*UpdateWorkImageResp, common.ErrorWithAttachment)
|
||||||
UpdateWorkVideo(ctx context.Context, in *UpdateWorkVideoReq, opts ...grpc_go.CallOption) (*UpdateWorkVideoResp, common.ErrorWithAttachment)
|
UpdateWorkVideo(ctx context.Context, in *UpdateWorkVideoReq, opts ...grpc_go.CallOption) (*UpdateWorkVideoResp, common.ErrorWithAttachment)
|
||||||
MediaInfo(ctx context.Context, in *MediaInfoReq, opts ...grpc_go.CallOption) (*MediaInfoResp, common.ErrorWithAttachment)
|
MediaInfo(ctx context.Context, in *MediaInfoReq, opts ...grpc_go.CallOption) (*MediaInfoResp, common.ErrorWithAttachment)
|
||||||
|
MediaInfoByPlatform(ctx context.Context, in *MediaInfoByPlatformReq, opts ...grpc_go.CallOption) (*MediaInfoByPlatformResp, common.ErrorWithAttachment)
|
||||||
WorkList(ctx context.Context, in *WorkListReq, opts ...grpc_go.CallOption) (*WorkListResp, common.ErrorWithAttachment)
|
WorkList(ctx context.Context, in *WorkListReq, opts ...grpc_go.CallOption) (*WorkListResp, common.ErrorWithAttachment)
|
||||||
WorkDetail(ctx context.Context, in *WorkDetailReq, opts ...grpc_go.CallOption) (*WorkDetailResp, common.ErrorWithAttachment)
|
WorkDetail(ctx context.Context, in *WorkDetailReq, opts ...grpc_go.CallOption) (*WorkDetailResp, common.ErrorWithAttachment)
|
||||||
UpdateStatus(ctx context.Context, in *UpdateStatusReq, opts ...grpc_go.CallOption) (*emptypb.Empty, common.ErrorWithAttachment)
|
UpdateStatus(ctx context.Context, in *UpdateStatusReq, opts ...grpc_go.CallOption) (*emptypb.Empty, common.ErrorWithAttachment)
|
||||||
@ -56,7 +57,7 @@ type CastClient interface {
|
|||||||
UpdateOAuth(ctx context.Context, in *UpdateOAuthReq, opts ...grpc_go.CallOption) (*emptypb.Empty, common.ErrorWithAttachment)
|
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)
|
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)
|
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)
|
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)
|
GetVideoScript(ctx context.Context, in *GetVideoScriptReq, opts ...grpc_go.CallOption) (*GetVideoScriptResp, common.ErrorWithAttachment)
|
||||||
@ -96,10 +97,26 @@ type CastClient interface {
|
|||||||
// 日级指标批量更新接口
|
// 日级指标批量更新接口
|
||||||
UpsertMediaMetricsDailyBatch(ctx context.Context, in *UpsertMediaMetricsDailyBatchReq, opts ...grpc_go.CallOption) (*UpsertMediaMetricsDailyBatchResp, common.ErrorWithAttachment)
|
UpsertMediaMetricsDailyBatch(ctx context.Context, in *UpsertMediaMetricsDailyBatchReq, opts ...grpc_go.CallOption) (*UpsertMediaMetricsDailyBatchResp, common.ErrorWithAttachment)
|
||||||
UpsertWorkMetricsDailyBatch(ctx context.Context, in *UpsertWorkMetricsDailyBatchReq, opts ...grpc_go.CallOption) (*UpsertWorkMetricsDailyBatchResp, common.ErrorWithAttachment)
|
UpsertWorkMetricsDailyBatch(ctx context.Context, in *UpsertWorkMetricsDailyBatchReq, opts ...grpc_go.CallOption) (*UpsertWorkMetricsDailyBatchResp, common.ErrorWithAttachment)
|
||||||
|
// 日级指标查询接口
|
||||||
|
ListMediaMetricsDaily(ctx context.Context, in *ListMediaMetricsDailyReq, opts ...grpc_go.CallOption) (*ListMediaMetricsDailyResp, common.ErrorWithAttachment)
|
||||||
|
ListWorkMetricsDaily(ctx context.Context, in *ListWorkMetricsDailyReq, opts ...grpc_go.CallOption) (*ListWorkMetricsDailyResp, common.ErrorWithAttachment)
|
||||||
|
// 日级指标计算接口
|
||||||
|
CalculateMediaMetricsByWorks(ctx context.Context, in *CalculateMediaMetricsByWorksReq, opts ...grpc_go.CallOption) (*CalculateMediaMetricsByWorksResp, common.ErrorWithAttachment)
|
||||||
// 艺人AyrShare信息相关接口
|
// 艺人AyrShare信息相关接口
|
||||||
GetArtistAyrShareInfo(ctx context.Context, in *GetArtistAyrShareInfoReq, opts ...grpc_go.CallOption) (*GetArtistAyrShareInfoResp, common.ErrorWithAttachment)
|
GetArtistAyrShareInfo(ctx context.Context, in *GetArtistAyrShareInfoReq, opts ...grpc_go.CallOption) (*GetArtistAyrShareInfoResp, common.ErrorWithAttachment)
|
||||||
// 作品平台信息相关接口
|
// 作品平台信息相关接口
|
||||||
ListWorkPlatformInfo(ctx context.Context, in *ListWorkPlatformInfoReq, opts ...grpc_go.CallOption) (*ListWorkPlatformInfoResp, common.ErrorWithAttachment)
|
ListWorkPlatformInfo(ctx context.Context, in *ListWorkPlatformInfoReq, opts ...grpc_go.CallOption) (*ListWorkPlatformInfoResp, common.ErrorWithAttachment)
|
||||||
|
// 任务列表相关接口
|
||||||
|
UpsertTaskList(ctx context.Context, in *UpsertTaskListReq, opts ...grpc_go.CallOption) (*UpsertTaskListResp, common.ErrorWithAttachment)
|
||||||
|
GetTaskList(ctx context.Context, in *GetTaskListReq, opts ...grpc_go.CallOption) (*GetTaskListResp, common.ErrorWithAttachment)
|
||||||
|
ListTaskList(ctx context.Context, in *ListTaskListReq, opts ...grpc_go.CallOption) (*ListTaskListResp, common.ErrorWithAttachment)
|
||||||
|
DeleteTaskList(ctx context.Context, in *DeleteTaskListReq, opts ...grpc_go.CallOption) (*emptypb.Empty, common.ErrorWithAttachment)
|
||||||
|
// 话题标签相关接口
|
||||||
|
UpdateCastTag(ctx context.Context, in *UpdateCastTagReq, opts ...grpc_go.CallOption) (*UpdateCastTagResp, common.ErrorWithAttachment)
|
||||||
|
ListCastTags(ctx context.Context, in *ListCastTagsReq, opts ...grpc_go.CallOption) (*ListCastTagsResp, common.ErrorWithAttachment)
|
||||||
|
UpdateCastTagBatch(ctx context.Context, in *UpdateCastTagBatchReq, opts ...grpc_go.CallOption) (*UpdateCastTagBatchResp, common.ErrorWithAttachment)
|
||||||
|
UpdateCastTagStatus(ctx context.Context, in *UpdateCastTagStatusReq, opts ...grpc_go.CallOption) (*emptypb.Empty, common.ErrorWithAttachment)
|
||||||
|
RecalculateCastTagQuoteCount(ctx context.Context, in *emptypb.Empty, opts ...grpc_go.CallOption) (*RecalculateCastTagQuoteCountResp, common.ErrorWithAttachment)
|
||||||
}
|
}
|
||||||
|
|
||||||
type castClient struct {
|
type castClient struct {
|
||||||
@ -114,6 +131,7 @@ type CastClientImpl struct {
|
|||||||
UpdateWorkImage func(ctx context.Context, in *UpdateWorkImageReq) (*UpdateWorkImageResp, error)
|
UpdateWorkImage func(ctx context.Context, in *UpdateWorkImageReq) (*UpdateWorkImageResp, error)
|
||||||
UpdateWorkVideo func(ctx context.Context, in *UpdateWorkVideoReq) (*UpdateWorkVideoResp, error)
|
UpdateWorkVideo func(ctx context.Context, in *UpdateWorkVideoReq) (*UpdateWorkVideoResp, error)
|
||||||
MediaInfo func(ctx context.Context, in *MediaInfoReq) (*MediaInfoResp, error)
|
MediaInfo func(ctx context.Context, in *MediaInfoReq) (*MediaInfoResp, error)
|
||||||
|
MediaInfoByPlatform func(ctx context.Context, in *MediaInfoByPlatformReq) (*MediaInfoByPlatformResp, error)
|
||||||
WorkList func(ctx context.Context, in *WorkListReq) (*WorkListResp, error)
|
WorkList func(ctx context.Context, in *WorkListReq) (*WorkListResp, error)
|
||||||
WorkDetail func(ctx context.Context, in *WorkDetailReq) (*WorkDetailResp, error)
|
WorkDetail func(ctx context.Context, in *WorkDetailReq) (*WorkDetailResp, error)
|
||||||
UpdateStatus func(ctx context.Context, in *UpdateStatusReq) (*emptypb.Empty, error)
|
UpdateStatus func(ctx context.Context, in *UpdateStatusReq) (*emptypb.Empty, error)
|
||||||
@ -134,7 +152,7 @@ type CastClientImpl struct {
|
|||||||
UpdateOAuth func(ctx context.Context, in *UpdateOAuthReq) (*emptypb.Empty, error)
|
UpdateOAuth func(ctx context.Context, in *UpdateOAuthReq) (*emptypb.Empty, error)
|
||||||
RefreshToken func(ctx context.Context, in *RefreshTokenReq) (*RefreshTokenResp, error)
|
RefreshToken func(ctx context.Context, in *RefreshTokenReq) (*RefreshTokenResp, error)
|
||||||
PublishMediaInfo func(ctx context.Context, in *PublishMediaInfoReq) (*PublishMediaInfoResp, 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)
|
UpdateVideoScript func(ctx context.Context, in *UpdateVideoScriptReq) (*UpdateVideoScriptResp, error)
|
||||||
GetVideoScript func(ctx context.Context, in *GetVideoScriptReq) (*GetVideoScriptResp, error)
|
GetVideoScript func(ctx context.Context, in *GetVideoScriptReq) (*GetVideoScriptResp, error)
|
||||||
ListVideoScripts func(ctx context.Context, in *ListVideoScriptsReq) (*ListVideoScriptsResp, error)
|
ListVideoScripts func(ctx context.Context, in *ListVideoScriptsReq) (*ListVideoScriptsResp, error)
|
||||||
@ -166,8 +184,20 @@ type CastClientImpl struct {
|
|||||||
TobeConfirmedList func(ctx context.Context, in *TobeConfirmedListReq) (*TobeConfirmedListResp, error)
|
TobeConfirmedList func(ctx context.Context, in *TobeConfirmedListReq) (*TobeConfirmedListResp, error)
|
||||||
UpsertMediaMetricsDailyBatch func(ctx context.Context, in *UpsertMediaMetricsDailyBatchReq) (*UpsertMediaMetricsDailyBatchResp, error)
|
UpsertMediaMetricsDailyBatch func(ctx context.Context, in *UpsertMediaMetricsDailyBatchReq) (*UpsertMediaMetricsDailyBatchResp, error)
|
||||||
UpsertWorkMetricsDailyBatch func(ctx context.Context, in *UpsertWorkMetricsDailyBatchReq) (*UpsertWorkMetricsDailyBatchResp, error)
|
UpsertWorkMetricsDailyBatch func(ctx context.Context, in *UpsertWorkMetricsDailyBatchReq) (*UpsertWorkMetricsDailyBatchResp, error)
|
||||||
|
ListMediaMetricsDaily func(ctx context.Context, in *ListMediaMetricsDailyReq) (*ListMediaMetricsDailyResp, error)
|
||||||
|
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)
|
GetArtistAyrShareInfo func(ctx context.Context, in *GetArtistAyrShareInfoReq) (*GetArtistAyrShareInfoResp, error)
|
||||||
ListWorkPlatformInfo func(ctx context.Context, in *ListWorkPlatformInfoReq) (*ListWorkPlatformInfoResp, 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)
|
||||||
|
ListTaskList func(ctx context.Context, in *ListTaskListReq) (*ListTaskListResp, error)
|
||||||
|
DeleteTaskList func(ctx context.Context, in *DeleteTaskListReq) (*emptypb.Empty, error)
|
||||||
|
UpdateCastTag func(ctx context.Context, in *UpdateCastTagReq) (*UpdateCastTagResp, error)
|
||||||
|
ListCastTags func(ctx context.Context, in *ListCastTagsReq) (*ListCastTagsResp, error)
|
||||||
|
UpdateCastTagBatch func(ctx context.Context, in *UpdateCastTagBatchReq) (*UpdateCastTagBatchResp, error)
|
||||||
|
UpdateCastTagStatus func(ctx context.Context, in *UpdateCastTagStatusReq) (*emptypb.Empty, error)
|
||||||
|
RecalculateCastTagQuoteCount func(ctx context.Context, in *emptypb.Empty) (*RecalculateCastTagQuoteCountResp, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *CastClientImpl) GetDubboStub(cc *triple.TripleConn) CastClient {
|
func (c *CastClientImpl) GetDubboStub(cc *triple.TripleConn) CastClient {
|
||||||
@ -224,6 +254,12 @@ func (c *castClient) MediaInfo(ctx context.Context, in *MediaInfoReq, opts ...gr
|
|||||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/MediaInfo", in, out)
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/MediaInfo", in, out)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *castClient) MediaInfoByPlatform(ctx context.Context, in *MediaInfoByPlatformReq, opts ...grpc_go.CallOption) (*MediaInfoByPlatformResp, common.ErrorWithAttachment) {
|
||||||
|
out := new(MediaInfoByPlatformResp)
|
||||||
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/MediaInfoByPlatform", in, out)
|
||||||
|
}
|
||||||
|
|
||||||
func (c *castClient) WorkList(ctx context.Context, in *WorkListReq, opts ...grpc_go.CallOption) (*WorkListResp, common.ErrorWithAttachment) {
|
func (c *castClient) WorkList(ctx context.Context, in *WorkListReq, opts ...grpc_go.CallOption) (*WorkListResp, common.ErrorWithAttachment) {
|
||||||
out := new(WorkListResp)
|
out := new(WorkListResp)
|
||||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
@ -344,10 +380,10 @@ func (c *castClient) PublishMediaInfo(ctx context.Context, in *PublishMediaInfoR
|
|||||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/PublishMediaInfo", in, out)
|
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)
|
out := new(emptypb.Empty)
|
||||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
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) {
|
func (c *castClient) UpdateVideoScript(ctx context.Context, in *UpdateVideoScriptReq, opts ...grpc_go.CallOption) (*UpdateVideoScriptResp, common.ErrorWithAttachment) {
|
||||||
@ -536,6 +572,24 @@ func (c *castClient) UpsertWorkMetricsDailyBatch(ctx context.Context, in *Upsert
|
|||||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/UpsertWorkMetricsDailyBatch", in, out)
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/UpsertWorkMetricsDailyBatch", in, out)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *castClient) ListMediaMetricsDaily(ctx context.Context, in *ListMediaMetricsDailyReq, opts ...grpc_go.CallOption) (*ListMediaMetricsDailyResp, common.ErrorWithAttachment) {
|
||||||
|
out := new(ListMediaMetricsDailyResp)
|
||||||
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/ListMediaMetricsDaily", in, out)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *castClient) ListWorkMetricsDaily(ctx context.Context, in *ListWorkMetricsDailyReq, opts ...grpc_go.CallOption) (*ListWorkMetricsDailyResp, common.ErrorWithAttachment) {
|
||||||
|
out := new(ListWorkMetricsDailyResp)
|
||||||
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/ListWorkMetricsDaily", in, out)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *castClient) CalculateMediaMetricsByWorks(ctx context.Context, in *CalculateMediaMetricsByWorksReq, opts ...grpc_go.CallOption) (*CalculateMediaMetricsByWorksResp, common.ErrorWithAttachment) {
|
||||||
|
out := new(CalculateMediaMetricsByWorksResp)
|
||||||
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/CalculateMediaMetricsByWorks", in, out)
|
||||||
|
}
|
||||||
|
|
||||||
func (c *castClient) GetArtistAyrShareInfo(ctx context.Context, in *GetArtistAyrShareInfoReq, opts ...grpc_go.CallOption) (*GetArtistAyrShareInfoResp, common.ErrorWithAttachment) {
|
func (c *castClient) GetArtistAyrShareInfo(ctx context.Context, in *GetArtistAyrShareInfoReq, opts ...grpc_go.CallOption) (*GetArtistAyrShareInfoResp, common.ErrorWithAttachment) {
|
||||||
out := new(GetArtistAyrShareInfoResp)
|
out := new(GetArtistAyrShareInfoResp)
|
||||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
@ -548,6 +602,60 @@ func (c *castClient) ListWorkPlatformInfo(ctx context.Context, in *ListWorkPlatf
|
|||||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/ListWorkPlatformInfo", in, out)
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/ListWorkPlatformInfo", in, out)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *castClient) UpsertTaskList(ctx context.Context, in *UpsertTaskListReq, opts ...grpc_go.CallOption) (*UpsertTaskListResp, common.ErrorWithAttachment) {
|
||||||
|
out := new(UpsertTaskListResp)
|
||||||
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/UpsertTaskList", in, out)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *castClient) GetTaskList(ctx context.Context, in *GetTaskListReq, opts ...grpc_go.CallOption) (*GetTaskListResp, common.ErrorWithAttachment) {
|
||||||
|
out := new(GetTaskListResp)
|
||||||
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetTaskList", in, out)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *castClient) ListTaskList(ctx context.Context, in *ListTaskListReq, opts ...grpc_go.CallOption) (*ListTaskListResp, common.ErrorWithAttachment) {
|
||||||
|
out := new(ListTaskListResp)
|
||||||
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/ListTaskList", in, out)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *castClient) DeleteTaskList(ctx context.Context, in *DeleteTaskListReq, 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+"/DeleteTaskList", in, out)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *castClient) UpdateCastTag(ctx context.Context, in *UpdateCastTagReq, opts ...grpc_go.CallOption) (*UpdateCastTagResp, common.ErrorWithAttachment) {
|
||||||
|
out := new(UpdateCastTagResp)
|
||||||
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/UpdateCastTag", in, out)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *castClient) ListCastTags(ctx context.Context, in *ListCastTagsReq, opts ...grpc_go.CallOption) (*ListCastTagsResp, common.ErrorWithAttachment) {
|
||||||
|
out := new(ListCastTagsResp)
|
||||||
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/ListCastTags", in, out)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *castClient) UpdateCastTagBatch(ctx context.Context, in *UpdateCastTagBatchReq, opts ...grpc_go.CallOption) (*UpdateCastTagBatchResp, common.ErrorWithAttachment) {
|
||||||
|
out := new(UpdateCastTagBatchResp)
|
||||||
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/UpdateCastTagBatch", in, out)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *castClient) UpdateCastTagStatus(ctx context.Context, in *UpdateCastTagStatusReq, 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+"/UpdateCastTagStatus", in, out)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *castClient) RecalculateCastTagQuoteCount(ctx context.Context, in *emptypb.Empty, opts ...grpc_go.CallOption) (*RecalculateCastTagQuoteCountResp, common.ErrorWithAttachment) {
|
||||||
|
out := new(RecalculateCastTagQuoteCountResp)
|
||||||
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/RecalculateCastTagQuoteCount", in, out)
|
||||||
|
}
|
||||||
|
|
||||||
// CastServer is the server API for Cast service.
|
// CastServer is the server API for Cast service.
|
||||||
// All implementations must embed UnimplementedCastServer
|
// All implementations must embed UnimplementedCastServer
|
||||||
// for forward compatibility
|
// for forward compatibility
|
||||||
@ -559,6 +667,7 @@ type CastServer interface {
|
|||||||
UpdateWorkImage(context.Context, *UpdateWorkImageReq) (*UpdateWorkImageResp, error)
|
UpdateWorkImage(context.Context, *UpdateWorkImageReq) (*UpdateWorkImageResp, error)
|
||||||
UpdateWorkVideo(context.Context, *UpdateWorkVideoReq) (*UpdateWorkVideoResp, error)
|
UpdateWorkVideo(context.Context, *UpdateWorkVideoReq) (*UpdateWorkVideoResp, error)
|
||||||
MediaInfo(context.Context, *MediaInfoReq) (*MediaInfoResp, error)
|
MediaInfo(context.Context, *MediaInfoReq) (*MediaInfoResp, error)
|
||||||
|
MediaInfoByPlatform(context.Context, *MediaInfoByPlatformReq) (*MediaInfoByPlatformResp, error)
|
||||||
WorkList(context.Context, *WorkListReq) (*WorkListResp, error)
|
WorkList(context.Context, *WorkListReq) (*WorkListResp, error)
|
||||||
WorkDetail(context.Context, *WorkDetailReq) (*WorkDetailResp, error)
|
WorkDetail(context.Context, *WorkDetailReq) (*WorkDetailResp, error)
|
||||||
UpdateStatus(context.Context, *UpdateStatusReq) (*emptypb.Empty, error)
|
UpdateStatus(context.Context, *UpdateStatusReq) (*emptypb.Empty, error)
|
||||||
@ -579,7 +688,7 @@ type CastServer interface {
|
|||||||
UpdateOAuth(context.Context, *UpdateOAuthReq) (*emptypb.Empty, error)
|
UpdateOAuth(context.Context, *UpdateOAuthReq) (*emptypb.Empty, error)
|
||||||
RefreshToken(context.Context, *RefreshTokenReq) (*RefreshTokenResp, error)
|
RefreshToken(context.Context, *RefreshTokenReq) (*RefreshTokenResp, error)
|
||||||
PublishMediaInfo(context.Context, *PublishMediaInfoReq) (*PublishMediaInfoResp, 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)
|
UpdateVideoScript(context.Context, *UpdateVideoScriptReq) (*UpdateVideoScriptResp, error)
|
||||||
GetVideoScript(context.Context, *GetVideoScriptReq) (*GetVideoScriptResp, error)
|
GetVideoScript(context.Context, *GetVideoScriptReq) (*GetVideoScriptResp, error)
|
||||||
@ -619,10 +728,26 @@ type CastServer interface {
|
|||||||
// 日级指标批量更新接口
|
// 日级指标批量更新接口
|
||||||
UpsertMediaMetricsDailyBatch(context.Context, *UpsertMediaMetricsDailyBatchReq) (*UpsertMediaMetricsDailyBatchResp, error)
|
UpsertMediaMetricsDailyBatch(context.Context, *UpsertMediaMetricsDailyBatchReq) (*UpsertMediaMetricsDailyBatchResp, error)
|
||||||
UpsertWorkMetricsDailyBatch(context.Context, *UpsertWorkMetricsDailyBatchReq) (*UpsertWorkMetricsDailyBatchResp, error)
|
UpsertWorkMetricsDailyBatch(context.Context, *UpsertWorkMetricsDailyBatchReq) (*UpsertWorkMetricsDailyBatchResp, error)
|
||||||
|
// 日级指标查询接口
|
||||||
|
ListMediaMetricsDaily(context.Context, *ListMediaMetricsDailyReq) (*ListMediaMetricsDailyResp, error)
|
||||||
|
ListWorkMetricsDaily(context.Context, *ListWorkMetricsDailyReq) (*ListWorkMetricsDailyResp, error)
|
||||||
|
// 日级指标计算接口
|
||||||
|
CalculateMediaMetricsByWorks(context.Context, *CalculateMediaMetricsByWorksReq) (*CalculateMediaMetricsByWorksResp, error)
|
||||||
// 艺人AyrShare信息相关接口
|
// 艺人AyrShare信息相关接口
|
||||||
GetArtistAyrShareInfo(context.Context, *GetArtistAyrShareInfoReq) (*GetArtistAyrShareInfoResp, error)
|
GetArtistAyrShareInfo(context.Context, *GetArtistAyrShareInfoReq) (*GetArtistAyrShareInfoResp, error)
|
||||||
// 作品平台信息相关接口
|
// 作品平台信息相关接口
|
||||||
ListWorkPlatformInfo(context.Context, *ListWorkPlatformInfoReq) (*ListWorkPlatformInfoResp, error)
|
ListWorkPlatformInfo(context.Context, *ListWorkPlatformInfoReq) (*ListWorkPlatformInfoResp, error)
|
||||||
|
// 任务列表相关接口
|
||||||
|
UpsertTaskList(context.Context, *UpsertTaskListReq) (*UpsertTaskListResp, error)
|
||||||
|
GetTaskList(context.Context, *GetTaskListReq) (*GetTaskListResp, error)
|
||||||
|
ListTaskList(context.Context, *ListTaskListReq) (*ListTaskListResp, error)
|
||||||
|
DeleteTaskList(context.Context, *DeleteTaskListReq) (*emptypb.Empty, error)
|
||||||
|
// 话题标签相关接口
|
||||||
|
UpdateCastTag(context.Context, *UpdateCastTagReq) (*UpdateCastTagResp, error)
|
||||||
|
ListCastTags(context.Context, *ListCastTagsReq) (*ListCastTagsResp, error)
|
||||||
|
UpdateCastTagBatch(context.Context, *UpdateCastTagBatchReq) (*UpdateCastTagBatchResp, error)
|
||||||
|
UpdateCastTagStatus(context.Context, *UpdateCastTagStatusReq) (*emptypb.Empty, error)
|
||||||
|
RecalculateCastTagQuoteCount(context.Context, *emptypb.Empty) (*RecalculateCastTagQuoteCountResp, error)
|
||||||
mustEmbedUnimplementedCastServer()
|
mustEmbedUnimplementedCastServer()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -652,6 +777,9 @@ func (UnimplementedCastServer) UpdateWorkVideo(context.Context, *UpdateWorkVideo
|
|||||||
func (UnimplementedCastServer) MediaInfo(context.Context, *MediaInfoReq) (*MediaInfoResp, error) {
|
func (UnimplementedCastServer) MediaInfo(context.Context, *MediaInfoReq) (*MediaInfoResp, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method MediaInfo not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method MediaInfo not implemented")
|
||||||
}
|
}
|
||||||
|
func (UnimplementedCastServer) MediaInfoByPlatform(context.Context, *MediaInfoByPlatformReq) (*MediaInfoByPlatformResp, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method MediaInfoByPlatform not implemented")
|
||||||
|
}
|
||||||
func (UnimplementedCastServer) WorkList(context.Context, *WorkListReq) (*WorkListResp, error) {
|
func (UnimplementedCastServer) WorkList(context.Context, *WorkListReq) (*WorkListResp, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method WorkList not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method WorkList not implemented")
|
||||||
}
|
}
|
||||||
@ -712,8 +840,8 @@ func (UnimplementedCastServer) RefreshToken(context.Context, *RefreshTokenReq) (
|
|||||||
func (UnimplementedCastServer) PublishMediaInfo(context.Context, *PublishMediaInfoReq) (*PublishMediaInfoResp, error) {
|
func (UnimplementedCastServer) PublishMediaInfo(context.Context, *PublishMediaInfoReq) (*PublishMediaInfoResp, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method PublishMediaInfo not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method PublishMediaInfo not implemented")
|
||||||
}
|
}
|
||||||
func (UnimplementedCastServer) Test(context.Context, *emptypb.Empty) (*emptypb.Empty, error) {
|
func (UnimplementedCastServer) Tools(context.Context, *ToolsReq) (*emptypb.Empty, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method Test not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method Tools not implemented")
|
||||||
}
|
}
|
||||||
func (UnimplementedCastServer) UpdateVideoScript(context.Context, *UpdateVideoScriptReq) (*UpdateVideoScriptResp, error) {
|
func (UnimplementedCastServer) UpdateVideoScript(context.Context, *UpdateVideoScriptReq) (*UpdateVideoScriptResp, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method UpdateVideoScript not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method UpdateVideoScript not implemented")
|
||||||
@ -808,12 +936,48 @@ func (UnimplementedCastServer) UpsertMediaMetricsDailyBatch(context.Context, *Up
|
|||||||
func (UnimplementedCastServer) UpsertWorkMetricsDailyBatch(context.Context, *UpsertWorkMetricsDailyBatchReq) (*UpsertWorkMetricsDailyBatchResp, error) {
|
func (UnimplementedCastServer) UpsertWorkMetricsDailyBatch(context.Context, *UpsertWorkMetricsDailyBatchReq) (*UpsertWorkMetricsDailyBatchResp, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method UpsertWorkMetricsDailyBatch not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method UpsertWorkMetricsDailyBatch not implemented")
|
||||||
}
|
}
|
||||||
|
func (UnimplementedCastServer) ListMediaMetricsDaily(context.Context, *ListMediaMetricsDailyReq) (*ListMediaMetricsDailyResp, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method ListMediaMetricsDaily not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedCastServer) ListWorkMetricsDaily(context.Context, *ListWorkMetricsDailyReq) (*ListWorkMetricsDailyResp, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method ListWorkMetricsDaily not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedCastServer) CalculateMediaMetricsByWorks(context.Context, *CalculateMediaMetricsByWorksReq) (*CalculateMediaMetricsByWorksResp, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method CalculateMediaMetricsByWorks not implemented")
|
||||||
|
}
|
||||||
func (UnimplementedCastServer) GetArtistAyrShareInfo(context.Context, *GetArtistAyrShareInfoReq) (*GetArtistAyrShareInfoResp, error) {
|
func (UnimplementedCastServer) GetArtistAyrShareInfo(context.Context, *GetArtistAyrShareInfoReq) (*GetArtistAyrShareInfoResp, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method GetArtistAyrShareInfo not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method GetArtistAyrShareInfo not implemented")
|
||||||
}
|
}
|
||||||
func (UnimplementedCastServer) ListWorkPlatformInfo(context.Context, *ListWorkPlatformInfoReq) (*ListWorkPlatformInfoResp, error) {
|
func (UnimplementedCastServer) ListWorkPlatformInfo(context.Context, *ListWorkPlatformInfoReq) (*ListWorkPlatformInfoResp, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method ListWorkPlatformInfo not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method ListWorkPlatformInfo not implemented")
|
||||||
}
|
}
|
||||||
|
func (UnimplementedCastServer) UpsertTaskList(context.Context, *UpsertTaskListReq) (*UpsertTaskListResp, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method UpsertTaskList not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedCastServer) GetTaskList(context.Context, *GetTaskListReq) (*GetTaskListResp, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method GetTaskList not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedCastServer) ListTaskList(context.Context, *ListTaskListReq) (*ListTaskListResp, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method ListTaskList not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedCastServer) DeleteTaskList(context.Context, *DeleteTaskListReq) (*emptypb.Empty, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method DeleteTaskList not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedCastServer) UpdateCastTag(context.Context, *UpdateCastTagReq) (*UpdateCastTagResp, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method UpdateCastTag not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedCastServer) ListCastTags(context.Context, *ListCastTagsReq) (*ListCastTagsResp, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method ListCastTags not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedCastServer) UpdateCastTagBatch(context.Context, *UpdateCastTagBatchReq) (*UpdateCastTagBatchResp, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method UpdateCastTagBatch not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedCastServer) UpdateCastTagStatus(context.Context, *UpdateCastTagStatusReq) (*emptypb.Empty, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method UpdateCastTagStatus not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedCastServer) RecalculateCastTagQuoteCount(context.Context, *emptypb.Empty) (*RecalculateCastTagQuoteCountResp, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method RecalculateCastTagQuoteCount not implemented")
|
||||||
|
}
|
||||||
func (s *UnimplementedCastServer) XXX_SetProxyImpl(impl protocol.Invoker) {
|
func (s *UnimplementedCastServer) XXX_SetProxyImpl(impl protocol.Invoker) {
|
||||||
s.proxyImpl = impl
|
s.proxyImpl = impl
|
||||||
}
|
}
|
||||||
@ -1045,6 +1209,35 @@ func _Cast_MediaInfo_Handler(srv interface{}, ctx context.Context, dec func(inte
|
|||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func _Cast_MediaInfoByPlatform_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(MediaInfoByPlatformReq)
|
||||||
|
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("MediaInfoByPlatform", 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_WorkList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
func _Cast_WorkList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
in := new(WorkListReq)
|
in := new(WorkListReq)
|
||||||
if err := dec(in); err != nil {
|
if err := dec(in); err != nil {
|
||||||
@ -1625,8 +1818,8 @@ func _Cast_PublishMediaInfo_Handler(srv interface{}, ctx context.Context, dec fu
|
|||||||
return interceptor(ctx, in, info, handler)
|
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) {
|
func _Cast_Tools_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
in := new(emptypb.Empty)
|
in := new(ToolsReq)
|
||||||
if err := dec(in); err != nil {
|
if err := dec(in); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -1638,7 +1831,7 @@ func _Cast_Test_Handler(srv interface{}, ctx context.Context, dec func(interface
|
|||||||
for k, v := range md {
|
for k, v := range md {
|
||||||
invAttachment[k] = v
|
invAttachment[k] = v
|
||||||
}
|
}
|
||||||
invo := invocation.NewRPCInvocation("Test", args, invAttachment)
|
invo := invocation.NewRPCInvocation("Tools", args, invAttachment)
|
||||||
if interceptor == nil {
|
if interceptor == nil {
|
||||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||||
return result, result.Error()
|
return result, result.Error()
|
||||||
@ -2553,6 +2746,93 @@ func _Cast_UpsertWorkMetricsDailyBatch_Handler(srv interface{}, ctx context.Cont
|
|||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func _Cast_ListMediaMetricsDaily_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(ListMediaMetricsDailyReq)
|
||||||
|
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("ListMediaMetricsDaily", 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_ListWorkMetricsDaily_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(ListWorkMetricsDailyReq)
|
||||||
|
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("ListWorkMetricsDaily", 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_CalculateMediaMetricsByWorks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(CalculateMediaMetricsByWorksReq)
|
||||||
|
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("CalculateMediaMetricsByWorks", 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_GetArtistAyrShareInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
func _Cast_GetArtistAyrShareInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
in := new(GetArtistAyrShareInfoReq)
|
in := new(GetArtistAyrShareInfoReq)
|
||||||
if err := dec(in); err != nil {
|
if err := dec(in); err != nil {
|
||||||
@ -2611,6 +2891,267 @@ func _Cast_ListWorkPlatformInfo_Handler(srv interface{}, ctx context.Context, de
|
|||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func _Cast_UpsertTaskList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(UpsertTaskListReq)
|
||||||
|
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("UpsertTaskList", 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_GetTaskList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(GetTaskListReq)
|
||||||
|
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("GetTaskList", 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_ListTaskList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(ListTaskListReq)
|
||||||
|
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("ListTaskList", 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_DeleteTaskList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(DeleteTaskListReq)
|
||||||
|
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("DeleteTaskList", 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_UpdateCastTag_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(UpdateCastTagReq)
|
||||||
|
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("UpdateCastTag", 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_ListCastTags_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(ListCastTagsReq)
|
||||||
|
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("ListCastTags", 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_UpdateCastTagBatch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(UpdateCastTagBatchReq)
|
||||||
|
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("UpdateCastTagBatch", 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_UpdateCastTagStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(UpdateCastTagStatusReq)
|
||||||
|
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("UpdateCastTagStatus", 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_RecalculateCastTagQuoteCount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(emptypb.Empty)
|
||||||
|
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("RecalculateCastTagQuoteCount", 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)
|
||||||
|
}
|
||||||
|
|
||||||
// Cast_ServiceDesc is the grpc_go.ServiceDesc for Cast service.
|
// Cast_ServiceDesc is the grpc_go.ServiceDesc for Cast service.
|
||||||
// It's only intended for direct use with grpc_go.RegisterService,
|
// It's only intended for direct use with grpc_go.RegisterService,
|
||||||
// and not to be introspected or modified (even as a copy)
|
// and not to be introspected or modified (even as a copy)
|
||||||
@ -2646,6 +3187,10 @@ var Cast_ServiceDesc = grpc_go.ServiceDesc{
|
|||||||
MethodName: "MediaInfo",
|
MethodName: "MediaInfo",
|
||||||
Handler: _Cast_MediaInfo_Handler,
|
Handler: _Cast_MediaInfo_Handler,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
MethodName: "MediaInfoByPlatform",
|
||||||
|
Handler: _Cast_MediaInfoByPlatform_Handler,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
MethodName: "WorkList",
|
MethodName: "WorkList",
|
||||||
Handler: _Cast_WorkList_Handler,
|
Handler: _Cast_WorkList_Handler,
|
||||||
@ -2727,8 +3272,8 @@ var Cast_ServiceDesc = grpc_go.ServiceDesc{
|
|||||||
Handler: _Cast_PublishMediaInfo_Handler,
|
Handler: _Cast_PublishMediaInfo_Handler,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
MethodName: "Test",
|
MethodName: "Tools",
|
||||||
Handler: _Cast_Test_Handler,
|
Handler: _Cast_Tools_Handler,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
MethodName: "UpdateVideoScript",
|
MethodName: "UpdateVideoScript",
|
||||||
@ -2854,6 +3399,18 @@ var Cast_ServiceDesc = grpc_go.ServiceDesc{
|
|||||||
MethodName: "UpsertWorkMetricsDailyBatch",
|
MethodName: "UpsertWorkMetricsDailyBatch",
|
||||||
Handler: _Cast_UpsertWorkMetricsDailyBatch_Handler,
|
Handler: _Cast_UpsertWorkMetricsDailyBatch_Handler,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
MethodName: "ListMediaMetricsDaily",
|
||||||
|
Handler: _Cast_ListMediaMetricsDaily_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "ListWorkMetricsDaily",
|
||||||
|
Handler: _Cast_ListWorkMetricsDaily_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "CalculateMediaMetricsByWorks",
|
||||||
|
Handler: _Cast_CalculateMediaMetricsByWorks_Handler,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
MethodName: "GetArtistAyrShareInfo",
|
MethodName: "GetArtistAyrShareInfo",
|
||||||
Handler: _Cast_GetArtistAyrShareInfo_Handler,
|
Handler: _Cast_GetArtistAyrShareInfo_Handler,
|
||||||
@ -2862,6 +3419,42 @@ var Cast_ServiceDesc = grpc_go.ServiceDesc{
|
|||||||
MethodName: "ListWorkPlatformInfo",
|
MethodName: "ListWorkPlatformInfo",
|
||||||
Handler: _Cast_ListWorkPlatformInfo_Handler,
|
Handler: _Cast_ListWorkPlatformInfo_Handler,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
MethodName: "UpsertTaskList",
|
||||||
|
Handler: _Cast_UpsertTaskList_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "GetTaskList",
|
||||||
|
Handler: _Cast_GetTaskList_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "ListTaskList",
|
||||||
|
Handler: _Cast_ListTaskList_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "DeleteTaskList",
|
||||||
|
Handler: _Cast_DeleteTaskList_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "UpdateCastTag",
|
||||||
|
Handler: _Cast_UpdateCastTag_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "ListCastTags",
|
||||||
|
Handler: _Cast_ListCastTags_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "UpdateCastTagBatch",
|
||||||
|
Handler: _Cast_UpdateCastTagBatch_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "UpdateCastTagStatus",
|
||||||
|
Handler: _Cast_UpdateCastTagStatus_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "RecalculateCastTagQuoteCount",
|
||||||
|
Handler: _Cast_RecalculateCastTagQuoteCount_Handler,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
Streams: []grpc_go.StreamDesc{},
|
Streams: []grpc_go.StreamDesc{},
|
||||||
Metadata: "pb/fiee/cast.proto",
|
Metadata: "pb/fiee/cast.proto",
|
||||||
|
|||||||
2296
api/cron/cron.pb.go
Normal file
2296
api/cron/cron.pb.go
Normal file
File diff suppressed because it is too large
Load Diff
169
api/cron/cron.validator.pb.go
Normal file
169
api/cron/cron.validator.pb.go
Normal file
@ -0,0 +1,169 @@
|
|||||||
|
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||||
|
// source: pb/cron.proto
|
||||||
|
|
||||||
|
package cron
|
||||||
|
|
||||||
|
import (
|
||||||
|
fmt "fmt"
|
||||||
|
math "math"
|
||||||
|
proto "github.com/golang/protobuf/proto"
|
||||||
|
github_com_mwitkow_go_proto_validators "github.com/mwitkow/go-proto-validators"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Reference imports to suppress errors if they are not otherwise used.
|
||||||
|
var _ = proto.Marshal
|
||||||
|
var _ = fmt.Errorf
|
||||||
|
var _ = math.Inf
|
||||||
|
|
||||||
|
func (this *CommonIDRequest) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *CommonResponse) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *ScheduleTask) Validate() error {
|
||||||
|
if this.TaskDetail != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.TaskDetail); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("TaskDetail", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for _, item := range this.ExecutionRecords {
|
||||||
|
if item != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("ExecutionRecords", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *TaskDetail) Validate() error {
|
||||||
|
for _, item := range this.Artists {
|
||||||
|
if item != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Artists", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *ArtistInfo) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *ExecutionRecord) Validate() error {
|
||||||
|
for _, item := range this.ExecutionResults {
|
||||||
|
if item != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("ExecutionResults", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *ExecutionResult) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *CreateScheduleTaskRequest) Validate() error {
|
||||||
|
if this.TaskDetail != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.TaskDetail); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("TaskDetail", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *TaskDetailRequest) Validate() error {
|
||||||
|
for _, item := range this.Artists {
|
||||||
|
if item != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Artists", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *CreateScheduleTaskResponse) Validate() error {
|
||||||
|
if this.Data != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Data); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Data", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *UpdateScheduleTaskRequest) Validate() error {
|
||||||
|
if this.TaskDetail != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.TaskDetail); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("TaskDetail", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *UpdateScheduleTaskRequestTaskDetail) Validate() error {
|
||||||
|
for _, item := range this.Artists {
|
||||||
|
if item != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Artists", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *UpdateScheduleTaskResponse) Validate() error {
|
||||||
|
if this.Data != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Data); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Data", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *GetListScheduleTaskRequest) Validate() error {
|
||||||
|
// Validation of proto3 map<> fields is unsupported.
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *GetListScheduleTaskResponse) Validate() error {
|
||||||
|
for _, item := range this.Data {
|
||||||
|
if item != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Data", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *GetListExecutionRecordRequest) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *GetListExecutionRecordResponse) Validate() error {
|
||||||
|
for _, item := range this.Data {
|
||||||
|
if item != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Data", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *GetListExecutionResultRequest) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *GetListExecutionResultResponse) Validate() error {
|
||||||
|
for _, item := range this.Data {
|
||||||
|
if item != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Data", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *TaskStatus) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *GetScheduleTaskStatusResponse) Validate() error {
|
||||||
|
for _, item := range this.Data {
|
||||||
|
if item != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Data", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
508
api/cron/cron_triple.pb.go
Normal file
508
api/cron/cron_triple.pb.go
Normal file
@ -0,0 +1,508 @@
|
|||||||
|
// Code generated by protoc-gen-go-triple. DO NOT EDIT.
|
||||||
|
// versions:
|
||||||
|
// - protoc-gen-go-triple v1.0.5
|
||||||
|
// - protoc v6.32.0
|
||||||
|
// source: pb/cron.proto
|
||||||
|
|
||||||
|
package cron
|
||||||
|
|
||||||
|
import (
|
||||||
|
context "context"
|
||||||
|
protocol "dubbo.apache.org/dubbo-go/v3/protocol"
|
||||||
|
dubbo3 "dubbo.apache.org/dubbo-go/v3/protocol/dubbo3"
|
||||||
|
invocation "dubbo.apache.org/dubbo-go/v3/protocol/invocation"
|
||||||
|
grpc_go "github.com/dubbogo/grpc-go"
|
||||||
|
codes "github.com/dubbogo/grpc-go/codes"
|
||||||
|
metadata "github.com/dubbogo/grpc-go/metadata"
|
||||||
|
status "github.com/dubbogo/grpc-go/status"
|
||||||
|
common "github.com/dubbogo/triple/pkg/common"
|
||||||
|
constant "github.com/dubbogo/triple/pkg/common/constant"
|
||||||
|
triple "github.com/dubbogo/triple/pkg/triple"
|
||||||
|
emptypb "google.golang.org/protobuf/types/known/emptypb"
|
||||||
|
)
|
||||||
|
|
||||||
|
// This is a compile-time assertion to ensure that this generated file
|
||||||
|
// is compatible with the grpc package it is being compiled against.
|
||||||
|
const _ = grpc_go.SupportPackageIsVersion7
|
||||||
|
|
||||||
|
// CronClient is the client API for Cron service.
|
||||||
|
//
|
||||||
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||||
|
type CronClient interface {
|
||||||
|
CreateScheduleTask(ctx context.Context, in *CreateScheduleTaskRequest, opts ...grpc_go.CallOption) (*CreateScheduleTaskResponse, common.ErrorWithAttachment)
|
||||||
|
UpdateScheduleTask(ctx context.Context, in *UpdateScheduleTaskRequest, opts ...grpc_go.CallOption) (*UpdateScheduleTaskResponse, common.ErrorWithAttachment)
|
||||||
|
GetListScheduleTask(ctx context.Context, in *GetListScheduleTaskRequest, opts ...grpc_go.CallOption) (*GetListScheduleTaskResponse, common.ErrorWithAttachment)
|
||||||
|
GetListExecutionRecord(ctx context.Context, in *GetListExecutionRecordRequest, opts ...grpc_go.CallOption) (*GetListExecutionRecordResponse, common.ErrorWithAttachment)
|
||||||
|
GetListExecutionResult(ctx context.Context, in *GetListExecutionResultRequest, opts ...grpc_go.CallOption) (*GetListExecutionResultResponse, common.ErrorWithAttachment)
|
||||||
|
PauseScheduleTask(ctx context.Context, in *CommonIDRequest, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment)
|
||||||
|
StartScheduleTask(ctx context.Context, in *CommonIDRequest, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment)
|
||||||
|
DeleteScheduleTask(ctx context.Context, in *CommonIDRequest, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment)
|
||||||
|
GetScheduleTaskStatus(ctx context.Context, in *emptypb.Empty, opts ...grpc_go.CallOption) (*GetScheduleTaskStatusResponse, common.ErrorWithAttachment)
|
||||||
|
}
|
||||||
|
|
||||||
|
type cronClient struct {
|
||||||
|
cc *triple.TripleConn
|
||||||
|
}
|
||||||
|
|
||||||
|
type CronClientImpl struct {
|
||||||
|
CreateScheduleTask func(ctx context.Context, in *CreateScheduleTaskRequest) (*CreateScheduleTaskResponse, error)
|
||||||
|
UpdateScheduleTask func(ctx context.Context, in *UpdateScheduleTaskRequest) (*UpdateScheduleTaskResponse, error)
|
||||||
|
GetListScheduleTask func(ctx context.Context, in *GetListScheduleTaskRequest) (*GetListScheduleTaskResponse, error)
|
||||||
|
GetListExecutionRecord func(ctx context.Context, in *GetListExecutionRecordRequest) (*GetListExecutionRecordResponse, error)
|
||||||
|
GetListExecutionResult func(ctx context.Context, in *GetListExecutionResultRequest) (*GetListExecutionResultResponse, error)
|
||||||
|
PauseScheduleTask func(ctx context.Context, in *CommonIDRequest) (*CommonResponse, error)
|
||||||
|
StartScheduleTask func(ctx context.Context, in *CommonIDRequest) (*CommonResponse, error)
|
||||||
|
DeleteScheduleTask func(ctx context.Context, in *CommonIDRequest) (*CommonResponse, error)
|
||||||
|
GetScheduleTaskStatus func(ctx context.Context, in *emptypb.Empty) (*GetScheduleTaskStatusResponse, error)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *CronClientImpl) GetDubboStub(cc *triple.TripleConn) CronClient {
|
||||||
|
return NewCronClient(cc)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *CronClientImpl) XXX_InterfaceName() string {
|
||||||
|
return "cron.Cron"
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewCronClient(cc *triple.TripleConn) CronClient {
|
||||||
|
return &cronClient{cc}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *cronClient) CreateScheduleTask(ctx context.Context, in *CreateScheduleTaskRequest, opts ...grpc_go.CallOption) (*CreateScheduleTaskResponse, common.ErrorWithAttachment) {
|
||||||
|
out := new(CreateScheduleTaskResponse)
|
||||||
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/CreateScheduleTask", in, out)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *cronClient) UpdateScheduleTask(ctx context.Context, in *UpdateScheduleTaskRequest, opts ...grpc_go.CallOption) (*UpdateScheduleTaskResponse, common.ErrorWithAttachment) {
|
||||||
|
out := new(UpdateScheduleTaskResponse)
|
||||||
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/UpdateScheduleTask", in, out)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *cronClient) GetListScheduleTask(ctx context.Context, in *GetListScheduleTaskRequest, opts ...grpc_go.CallOption) (*GetListScheduleTaskResponse, common.ErrorWithAttachment) {
|
||||||
|
out := new(GetListScheduleTaskResponse)
|
||||||
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetListScheduleTask", in, out)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *cronClient) GetListExecutionRecord(ctx context.Context, in *GetListExecutionRecordRequest, opts ...grpc_go.CallOption) (*GetListExecutionRecordResponse, common.ErrorWithAttachment) {
|
||||||
|
out := new(GetListExecutionRecordResponse)
|
||||||
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetListExecutionRecord", in, out)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *cronClient) GetListExecutionResult(ctx context.Context, in *GetListExecutionResultRequest, opts ...grpc_go.CallOption) (*GetListExecutionResultResponse, common.ErrorWithAttachment) {
|
||||||
|
out := new(GetListExecutionResultResponse)
|
||||||
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetListExecutionResult", in, out)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *cronClient) PauseScheduleTask(ctx context.Context, in *CommonIDRequest, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment) {
|
||||||
|
out := new(CommonResponse)
|
||||||
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/PauseScheduleTask", in, out)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *cronClient) StartScheduleTask(ctx context.Context, in *CommonIDRequest, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment) {
|
||||||
|
out := new(CommonResponse)
|
||||||
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/StartScheduleTask", in, out)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *cronClient) DeleteScheduleTask(ctx context.Context, in *CommonIDRequest, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment) {
|
||||||
|
out := new(CommonResponse)
|
||||||
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/DeleteScheduleTask", in, out)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *cronClient) GetScheduleTaskStatus(ctx context.Context, in *emptypb.Empty, opts ...grpc_go.CallOption) (*GetScheduleTaskStatusResponse, common.ErrorWithAttachment) {
|
||||||
|
out := new(GetScheduleTaskStatusResponse)
|
||||||
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetScheduleTaskStatus", in, out)
|
||||||
|
}
|
||||||
|
|
||||||
|
// CronServer is the server API for Cron service.
|
||||||
|
// All implementations must embed UnimplementedCronServer
|
||||||
|
// for forward compatibility
|
||||||
|
type CronServer interface {
|
||||||
|
CreateScheduleTask(context.Context, *CreateScheduleTaskRequest) (*CreateScheduleTaskResponse, error)
|
||||||
|
UpdateScheduleTask(context.Context, *UpdateScheduleTaskRequest) (*UpdateScheduleTaskResponse, error)
|
||||||
|
GetListScheduleTask(context.Context, *GetListScheduleTaskRequest) (*GetListScheduleTaskResponse, error)
|
||||||
|
GetListExecutionRecord(context.Context, *GetListExecutionRecordRequest) (*GetListExecutionRecordResponse, error)
|
||||||
|
GetListExecutionResult(context.Context, *GetListExecutionResultRequest) (*GetListExecutionResultResponse, error)
|
||||||
|
PauseScheduleTask(context.Context, *CommonIDRequest) (*CommonResponse, error)
|
||||||
|
StartScheduleTask(context.Context, *CommonIDRequest) (*CommonResponse, error)
|
||||||
|
DeleteScheduleTask(context.Context, *CommonIDRequest) (*CommonResponse, error)
|
||||||
|
GetScheduleTaskStatus(context.Context, *emptypb.Empty) (*GetScheduleTaskStatusResponse, error)
|
||||||
|
mustEmbedUnimplementedCronServer()
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnimplementedCronServer must be embedded to have forward compatible implementations.
|
||||||
|
type UnimplementedCronServer struct {
|
||||||
|
proxyImpl protocol.Invoker
|
||||||
|
}
|
||||||
|
|
||||||
|
func (UnimplementedCronServer) CreateScheduleTask(context.Context, *CreateScheduleTaskRequest) (*CreateScheduleTaskResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method CreateScheduleTask not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedCronServer) UpdateScheduleTask(context.Context, *UpdateScheduleTaskRequest) (*UpdateScheduleTaskResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method UpdateScheduleTask not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedCronServer) GetListScheduleTask(context.Context, *GetListScheduleTaskRequest) (*GetListScheduleTaskResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method GetListScheduleTask not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedCronServer) GetListExecutionRecord(context.Context, *GetListExecutionRecordRequest) (*GetListExecutionRecordResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method GetListExecutionRecord not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedCronServer) GetListExecutionResult(context.Context, *GetListExecutionResultRequest) (*GetListExecutionResultResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method GetListExecutionResult not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedCronServer) PauseScheduleTask(context.Context, *CommonIDRequest) (*CommonResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method PauseScheduleTask not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedCronServer) StartScheduleTask(context.Context, *CommonIDRequest) (*CommonResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method StartScheduleTask not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedCronServer) DeleteScheduleTask(context.Context, *CommonIDRequest) (*CommonResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method DeleteScheduleTask not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedCronServer) GetScheduleTaskStatus(context.Context, *emptypb.Empty) (*GetScheduleTaskStatusResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method GetScheduleTaskStatus not implemented")
|
||||||
|
}
|
||||||
|
func (s *UnimplementedCronServer) XXX_SetProxyImpl(impl protocol.Invoker) {
|
||||||
|
s.proxyImpl = impl
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *UnimplementedCronServer) XXX_GetProxyImpl() protocol.Invoker {
|
||||||
|
return s.proxyImpl
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *UnimplementedCronServer) XXX_ServiceDesc() *grpc_go.ServiceDesc {
|
||||||
|
return &Cron_ServiceDesc
|
||||||
|
}
|
||||||
|
func (s *UnimplementedCronServer) XXX_InterfaceName() string {
|
||||||
|
return "cron.Cron"
|
||||||
|
}
|
||||||
|
|
||||||
|
func (UnimplementedCronServer) mustEmbedUnimplementedCronServer() {}
|
||||||
|
|
||||||
|
// UnsafeCronServer may be embedded to opt out of forward compatibility for this service.
|
||||||
|
// Use of this interface is not recommended, as added methods to CronServer will
|
||||||
|
// result in compilation errors.
|
||||||
|
type UnsafeCronServer interface {
|
||||||
|
mustEmbedUnimplementedCronServer()
|
||||||
|
}
|
||||||
|
|
||||||
|
func RegisterCronServer(s grpc_go.ServiceRegistrar, srv CronServer) {
|
||||||
|
s.RegisterService(&Cron_ServiceDesc, srv)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Cron_CreateScheduleTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(CreateScheduleTaskRequest)
|
||||||
|
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("CreateScheduleTask", 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 _Cron_UpdateScheduleTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(UpdateScheduleTaskRequest)
|
||||||
|
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("UpdateScheduleTask", 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 _Cron_GetListScheduleTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(GetListScheduleTaskRequest)
|
||||||
|
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("GetListScheduleTask", 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 _Cron_GetListExecutionRecord_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(GetListExecutionRecordRequest)
|
||||||
|
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("GetListExecutionRecord", 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 _Cron_GetListExecutionResult_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(GetListExecutionResultRequest)
|
||||||
|
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("GetListExecutionResult", 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 _Cron_PauseScheduleTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(CommonIDRequest)
|
||||||
|
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("PauseScheduleTask", 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 _Cron_StartScheduleTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(CommonIDRequest)
|
||||||
|
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("StartScheduleTask", 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 _Cron_DeleteScheduleTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(CommonIDRequest)
|
||||||
|
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("DeleteScheduleTask", 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 _Cron_GetScheduleTaskStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(emptypb.Empty)
|
||||||
|
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("GetScheduleTaskStatus", 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)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Cron_ServiceDesc is the grpc_go.ServiceDesc for Cron service.
|
||||||
|
// It's only intended for direct use with grpc_go.RegisterService,
|
||||||
|
// and not to be introspected or modified (even as a copy)
|
||||||
|
var Cron_ServiceDesc = grpc_go.ServiceDesc{
|
||||||
|
ServiceName: "cron.Cron",
|
||||||
|
HandlerType: (*CronServer)(nil),
|
||||||
|
Methods: []grpc_go.MethodDesc{
|
||||||
|
{
|
||||||
|
MethodName: "CreateScheduleTask",
|
||||||
|
Handler: _Cron_CreateScheduleTask_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "UpdateScheduleTask",
|
||||||
|
Handler: _Cron_UpdateScheduleTask_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "GetListScheduleTask",
|
||||||
|
Handler: _Cron_GetListScheduleTask_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "GetListExecutionRecord",
|
||||||
|
Handler: _Cron_GetListExecutionRecord_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "GetListExecutionResult",
|
||||||
|
Handler: _Cron_GetListExecutionResult_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "PauseScheduleTask",
|
||||||
|
Handler: _Cron_PauseScheduleTask_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "StartScheduleTask",
|
||||||
|
Handler: _Cron_StartScheduleTask_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "DeleteScheduleTask",
|
||||||
|
Handler: _Cron_DeleteScheduleTask_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "GetScheduleTaskStatus",
|
||||||
|
Handler: _Cron_GetScheduleTaskStatus_Handler,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Streams: []grpc_go.StreamDesc{},
|
||||||
|
Metadata: "pb/cron.proto",
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@ -126,3 +126,44 @@ func (this *UsageReq) Validate() error {
|
|||||||
func (this *UsageResp) Validate() error {
|
func (this *UsageResp) Validate() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
func (this *SecurityStatusData) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *SecurityScanReq) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *SecurityScanResp) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *UpdateFileSecurityStatusReq) Validate() error {
|
||||||
|
for _, item := range this.SecurityStatusData {
|
||||||
|
if item != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("SecurityStatusData", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *UpdateFileSecurityStatusResp) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *ManualAntiReq) Validate() error {
|
||||||
|
for _, item := range this.SecurityStatusData {
|
||||||
|
if item != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("SecurityStatusData", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *ManualAntiResp) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *GetFileSecurityStatusReq) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *GetFileSecurityStatusResp) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|||||||
@ -42,6 +42,10 @@ type FileClient interface {
|
|||||||
Action(ctx context.Context, in *ActionReq, opts ...grpc_go.CallOption) (*ActionResp, common.ErrorWithAttachment)
|
Action(ctx context.Context, in *ActionReq, opts ...grpc_go.CallOption) (*ActionResp, common.ErrorWithAttachment)
|
||||||
DirDownload(ctx context.Context, in *DirDownloadReq, opts ...grpc_go.CallOption) (File_DirDownloadClient, error)
|
DirDownload(ctx context.Context, in *DirDownloadReq, opts ...grpc_go.CallOption) (File_DirDownloadClient, error)
|
||||||
Usage(ctx context.Context, in *UsageReq, opts ...grpc_go.CallOption) (*UsageResp, common.ErrorWithAttachment)
|
Usage(ctx context.Context, in *UsageReq, opts ...grpc_go.CallOption) (*UsageResp, common.ErrorWithAttachment)
|
||||||
|
SecurityScan(ctx context.Context, in *SecurityScanReq, opts ...grpc_go.CallOption) (*SecurityScanResp, common.ErrorWithAttachment)
|
||||||
|
UpdateFileSecurityStatus(ctx context.Context, in *UpdateFileSecurityStatusReq, opts ...grpc_go.CallOption) (*UpdateFileSecurityStatusResp, common.ErrorWithAttachment)
|
||||||
|
ManualAnti(ctx context.Context, in *ManualAntiReq, opts ...grpc_go.CallOption) (*ManualAntiResp, common.ErrorWithAttachment)
|
||||||
|
GetFileSecurityStatus(ctx context.Context, in *GetFileSecurityStatusReq, opts ...grpc_go.CallOption) (*GetFileSecurityStatusResp, common.ErrorWithAttachment)
|
||||||
}
|
}
|
||||||
|
|
||||||
type fileClient struct {
|
type fileClient struct {
|
||||||
@ -49,19 +53,23 @@ type fileClient struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type FileClientImpl struct {
|
type FileClientImpl struct {
|
||||||
List func(ctx context.Context, in *FileListReq) (*FileListResp, error)
|
List func(ctx context.Context, in *FileListReq) (*FileListResp, error)
|
||||||
Info func(ctx context.Context, in *FileInfoReq) (*FileInfoResp, error)
|
Info func(ctx context.Context, in *FileInfoReq) (*FileInfoResp, error)
|
||||||
Create func(ctx context.Context, in *CreateReq) (*CreateResp, error)
|
Create func(ctx context.Context, in *CreateReq) (*CreateResp, error)
|
||||||
Delete func(ctx context.Context, in *DeleteReq) (*DeleteResp, error)
|
Delete func(ctx context.Context, in *DeleteReq) (*DeleteResp, error)
|
||||||
Search func(ctx context.Context, in *SearchReq) (*SearchResp, error)
|
Search func(ctx context.Context, in *SearchReq) (*SearchResp, error)
|
||||||
Upload func(ctx context.Context, in *UploadReq) (*UploadResp, error)
|
Upload func(ctx context.Context, in *UploadReq) (*UploadResp, error)
|
||||||
TusCreate func(ctx context.Context, in *TusCreateReq) (*TusCreateResp, error)
|
TusCreate func(ctx context.Context, in *TusCreateReq) (*TusCreateResp, error)
|
||||||
TusUpload func(ctx context.Context, in *TusUploadReq) (*TusUploadResp, error)
|
TusUpload func(ctx context.Context, in *TusUploadReq) (*TusUploadResp, error)
|
||||||
ResumableTransfer func(ctx context.Context, in *ResumableTransferReq) (*ResumableTransferResp, error)
|
ResumableTransfer func(ctx context.Context, in *ResumableTransferReq) (*ResumableTransferResp, error)
|
||||||
Preview func(ctx context.Context, in *PreviewReq) (*PreviewResp, error)
|
Preview func(ctx context.Context, in *PreviewReq) (*PreviewResp, error)
|
||||||
Action func(ctx context.Context, in *ActionReq) (*ActionResp, error)
|
Action func(ctx context.Context, in *ActionReq) (*ActionResp, error)
|
||||||
DirDownload func(ctx context.Context, in *DirDownloadReq) (File_DirDownloadClient, error)
|
DirDownload func(ctx context.Context, in *DirDownloadReq) (File_DirDownloadClient, error)
|
||||||
Usage func(ctx context.Context, in *UsageReq) (*UsageResp, error)
|
Usage func(ctx context.Context, in *UsageReq) (*UsageResp, error)
|
||||||
|
SecurityScan func(ctx context.Context, in *SecurityScanReq) (*SecurityScanResp, error)
|
||||||
|
UpdateFileSecurityStatus func(ctx context.Context, in *UpdateFileSecurityStatusReq) (*UpdateFileSecurityStatusResp, error)
|
||||||
|
ManualAnti func(ctx context.Context, in *ManualAntiReq) (*ManualAntiResp, error)
|
||||||
|
GetFileSecurityStatus func(ctx context.Context, in *GetFileSecurityStatusReq) (*GetFileSecurityStatusResp, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *FileClientImpl) GetDubboStub(cc *triple.TripleConn) FileClient {
|
func (c *FileClientImpl) GetDubboStub(cc *triple.TripleConn) FileClient {
|
||||||
@ -181,6 +189,30 @@ func (c *fileClient) Usage(ctx context.Context, in *UsageReq, opts ...grpc_go.Ca
|
|||||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/Usage", in, out)
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/Usage", in, out)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *fileClient) SecurityScan(ctx context.Context, in *SecurityScanReq, opts ...grpc_go.CallOption) (*SecurityScanResp, common.ErrorWithAttachment) {
|
||||||
|
out := new(SecurityScanResp)
|
||||||
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/SecurityScan", in, out)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *fileClient) UpdateFileSecurityStatus(ctx context.Context, in *UpdateFileSecurityStatusReq, opts ...grpc_go.CallOption) (*UpdateFileSecurityStatusResp, common.ErrorWithAttachment) {
|
||||||
|
out := new(UpdateFileSecurityStatusResp)
|
||||||
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/UpdateFileSecurityStatus", in, out)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *fileClient) ManualAnti(ctx context.Context, in *ManualAntiReq, opts ...grpc_go.CallOption) (*ManualAntiResp, common.ErrorWithAttachment) {
|
||||||
|
out := new(ManualAntiResp)
|
||||||
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/ManualAnti", in, out)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *fileClient) GetFileSecurityStatus(ctx context.Context, in *GetFileSecurityStatusReq, opts ...grpc_go.CallOption) (*GetFileSecurityStatusResp, common.ErrorWithAttachment) {
|
||||||
|
out := new(GetFileSecurityStatusResp)
|
||||||
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetFileSecurityStatus", in, out)
|
||||||
|
}
|
||||||
|
|
||||||
// FileServer is the server API for File service.
|
// FileServer is the server API for File service.
|
||||||
// All implementations must embed UnimplementedFileServer
|
// All implementations must embed UnimplementedFileServer
|
||||||
// for forward compatibility
|
// for forward compatibility
|
||||||
@ -198,6 +230,10 @@ type FileServer interface {
|
|||||||
Action(context.Context, *ActionReq) (*ActionResp, error)
|
Action(context.Context, *ActionReq) (*ActionResp, error)
|
||||||
DirDownload(*DirDownloadReq, File_DirDownloadServer) error
|
DirDownload(*DirDownloadReq, File_DirDownloadServer) error
|
||||||
Usage(context.Context, *UsageReq) (*UsageResp, error)
|
Usage(context.Context, *UsageReq) (*UsageResp, error)
|
||||||
|
SecurityScan(context.Context, *SecurityScanReq) (*SecurityScanResp, error)
|
||||||
|
UpdateFileSecurityStatus(context.Context, *UpdateFileSecurityStatusReq) (*UpdateFileSecurityStatusResp, error)
|
||||||
|
ManualAnti(context.Context, *ManualAntiReq) (*ManualAntiResp, error)
|
||||||
|
GetFileSecurityStatus(context.Context, *GetFileSecurityStatusReq) (*GetFileSecurityStatusResp, error)
|
||||||
mustEmbedUnimplementedFileServer()
|
mustEmbedUnimplementedFileServer()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -245,6 +281,18 @@ func (UnimplementedFileServer) DirDownload(*DirDownloadReq, File_DirDownloadServ
|
|||||||
func (UnimplementedFileServer) Usage(context.Context, *UsageReq) (*UsageResp, error) {
|
func (UnimplementedFileServer) Usage(context.Context, *UsageReq) (*UsageResp, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method Usage not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method Usage not implemented")
|
||||||
}
|
}
|
||||||
|
func (UnimplementedFileServer) SecurityScan(context.Context, *SecurityScanReq) (*SecurityScanResp, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method SecurityScan not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedFileServer) UpdateFileSecurityStatus(context.Context, *UpdateFileSecurityStatusReq) (*UpdateFileSecurityStatusResp, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method UpdateFileSecurityStatus not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedFileServer) ManualAnti(context.Context, *ManualAntiReq) (*ManualAntiResp, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method ManualAnti not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedFileServer) GetFileSecurityStatus(context.Context, *GetFileSecurityStatusReq) (*GetFileSecurityStatusResp, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method GetFileSecurityStatus not implemented")
|
||||||
|
}
|
||||||
func (s *UnimplementedFileServer) XXX_SetProxyImpl(impl protocol.Invoker) {
|
func (s *UnimplementedFileServer) XXX_SetProxyImpl(impl protocol.Invoker) {
|
||||||
s.proxyImpl = impl
|
s.proxyImpl = impl
|
||||||
}
|
}
|
||||||
@ -648,6 +696,122 @@ func _File_Usage_Handler(srv interface{}, ctx context.Context, dec func(interfac
|
|||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func _File_SecurityScan_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(SecurityScanReq)
|
||||||
|
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("SecurityScan", 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 _File_UpdateFileSecurityStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(UpdateFileSecurityStatusReq)
|
||||||
|
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("UpdateFileSecurityStatus", 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 _File_ManualAnti_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(ManualAntiReq)
|
||||||
|
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("ManualAnti", 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 _File_GetFileSecurityStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(GetFileSecurityStatusReq)
|
||||||
|
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("GetFileSecurityStatus", 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)
|
||||||
|
}
|
||||||
|
|
||||||
// File_ServiceDesc is the grpc_go.ServiceDesc for File service.
|
// File_ServiceDesc is the grpc_go.ServiceDesc for File service.
|
||||||
// It's only intended for direct use with grpc_go.RegisterService,
|
// It's only intended for direct use with grpc_go.RegisterService,
|
||||||
// and not to be introspected or modified (even as a copy)
|
// and not to be introspected or modified (even as a copy)
|
||||||
@ -703,6 +867,22 @@ var File_ServiceDesc = grpc_go.ServiceDesc{
|
|||||||
MethodName: "Usage",
|
MethodName: "Usage",
|
||||||
Handler: _File_Usage_Handler,
|
Handler: _File_Usage_Handler,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
MethodName: "SecurityScan",
|
||||||
|
Handler: _File_SecurityScan_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "UpdateFileSecurityStatus",
|
||||||
|
Handler: _File_UpdateFileSecurityStatus_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "ManualAnti",
|
||||||
|
Handler: _File_ManualAnti_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "GetFileSecurityStatus",
|
||||||
|
Handler: _File_GetFileSecurityStatus_Handler,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
Streams: []grpc_go.StreamDesc{
|
Streams: []grpc_go.StreamDesc{
|
||||||
{
|
{
|
||||||
|
|||||||
@ -8,7 +8,7 @@ ErpHost = "http://erpapi.test.fontree.cn:8081"
|
|||||||
FieeHost = "http://erpapi.test.fontree.cn:8081"
|
FieeHost = "http://erpapi.test.fontree.cn:8081"
|
||||||
AuthRedirectUrl = "http://saas-erp.test.fontree.cn:8081/media_account"
|
AuthRedirectUrl = "http://saas-erp.test.fontree.cn:8081/media_account"
|
||||||
AuthCallback = "https://saas-test.szjixun.cn/api/fiee/media/as-oauth2callback"
|
AuthCallback = "https://saas-test.szjixun.cn/api/fiee/media/as-oauth2callback"
|
||||||
CronOpen = true
|
CronOpen = false
|
||||||
proxyUrl = "http://47.84.75.255:6785"
|
proxyUrl = "http://47.84.75.255:6785"
|
||||||
[bos]
|
[bos]
|
||||||
Ak = "ALTAKxrqOQHnAN525Tb2GX4Bhe"
|
Ak = "ALTAKxrqOQHnAN525Tb2GX4Bhe"
|
||||||
|
|||||||
@ -49,7 +49,11 @@ dubbo:
|
|||||||
interface: com.fontree.microservices.fiee.SecFiling
|
interface: com.fontree.microservices.fiee.SecFiling
|
||||||
AyrshareClientImpl:
|
AyrshareClientImpl:
|
||||||
protocol: tri
|
protocol: tri
|
||||||
|
request-timeout: 1800s
|
||||||
interface: com.fontree.microservices.fiee.ayrshare
|
interface: com.fontree.microservices.fiee.ayrshare
|
||||||
|
FieeCronClientImpl:
|
||||||
|
protocol: tri
|
||||||
|
interface: com.fontree.microservices.fiee.cron
|
||||||
logger:
|
logger:
|
||||||
zap-config:
|
zap-config:
|
||||||
level: error # 日志级别
|
level: error # 日志级别
|
||||||
|
|||||||
16
data/alibabacloud.env
Normal file
16
data/alibabacloud.env
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
#=========== 阿里云内容安全配置 ===========
|
||||||
|
# STS登录模式配置
|
||||||
|
# RAM用户AccessKey ID(用于获取STS临时凭证)
|
||||||
|
RAM_ACCESS_KEY_ID=LTAI5tNBzbeEbG1yCitvHsMb
|
||||||
|
|
||||||
|
# RAM用户AccessKey Secret
|
||||||
|
RAM_ACCESS_KEY_SECRET=G1xAUB8G6WDVo0SLr6DJaJjNWIlpmO
|
||||||
|
|
||||||
|
# 要扮演的RAM角色ARN
|
||||||
|
RAM_ROLE_ARN=acs:ram::5828544250383902:role/content-secret
|
||||||
|
|
||||||
|
# 阿里云区域(可选,默认为cn-shanghai)
|
||||||
|
ALIBABA_CLOUD_REGION=ap-southeast-1
|
||||||
|
|
||||||
|
# 阿里云端点(可选,默认为green.cn-shanghai.aliyuncs.com)
|
||||||
|
ALIBABA_CLOUD_ENDPOINT=green-cip.ap-southeast-1.aliyuncs.com
|
||||||
BIN
data/图文导入模板.xlsx
BIN
data/图文导入模板.xlsx
Binary file not shown.
BIN
data/自媒体账号导入模板.xlsx
Normal file
BIN
data/自媒体账号导入模板.xlsx
Normal file
Binary file not shown.
@ -48,8 +48,19 @@ dubbo:
|
|||||||
retries: 0
|
retries: 0
|
||||||
interface: com.fontree.microservices.fiee.SecFiling
|
interface: com.fontree.microservices.fiee.SecFiling
|
||||||
AyrshareClientImpl:
|
AyrshareClientImpl:
|
||||||
|
request-timeout: 1800s
|
||||||
protocol: tri
|
protocol: tri
|
||||||
interface: com.fontree.microservices.fiee.ayrshare
|
interface: com.fontree.microservices.fiee.ayrshare
|
||||||
|
FieeCronClientImpl:
|
||||||
|
protocol: tri
|
||||||
|
interface: com.fontree.microservices.fiee.cron
|
||||||
|
FileClientImpl:
|
||||||
|
protocol: tri
|
||||||
|
retries: 0
|
||||||
|
interface: files.File
|
||||||
|
methods:
|
||||||
|
- name: SecurityScan
|
||||||
|
timeout: 120000
|
||||||
logger:
|
logger:
|
||||||
zap-config:
|
zap-config:
|
||||||
level: error # 日志级别
|
level: error # 日志级别
|
||||||
|
|||||||
@ -50,8 +50,19 @@ dubbo:
|
|||||||
retries: 0
|
retries: 0
|
||||||
interface: com.fontree.microservices.fiee.SecFiling
|
interface: com.fontree.microservices.fiee.SecFiling
|
||||||
AyrshareClientImpl:
|
AyrshareClientImpl:
|
||||||
|
request-timeout: 1800s
|
||||||
protocol: tri
|
protocol: tri
|
||||||
interface: com.fontree.microservices.fiee.ayrshare
|
interface: com.fontree.microservices.fiee.ayrshare
|
||||||
|
FieeCronClientImpl:
|
||||||
|
protocol: tri
|
||||||
|
interface: com.fontree.microservices.fiee.cron
|
||||||
|
FileClientImpl:
|
||||||
|
protocol: tri
|
||||||
|
retries: 0
|
||||||
|
interface: files.File
|
||||||
|
methods:
|
||||||
|
- name: SecurityScan
|
||||||
|
timeout: 120000
|
||||||
logger:
|
logger:
|
||||||
zap-config:
|
zap-config:
|
||||||
level: error # 日志级别
|
level: error # 日志级别
|
||||||
|
|||||||
@ -48,8 +48,19 @@ dubbo:
|
|||||||
retries: 0
|
retries: 0
|
||||||
interface: com.fontree.microservices.fiee.SecFiling
|
interface: com.fontree.microservices.fiee.SecFiling
|
||||||
AyrshareClientImpl:
|
AyrshareClientImpl:
|
||||||
|
request-timeout: 1800s
|
||||||
protocol: tri
|
protocol: tri
|
||||||
interface: com.fontree.microservices.fiee.ayrshare
|
interface: com.fontree.microservices.fiee.ayrshare
|
||||||
|
FieeCronClientImpl:
|
||||||
|
protocol: tri
|
||||||
|
interface: com.fontree.microservices.fiee.cron
|
||||||
|
FileClientImpl:
|
||||||
|
protocol: tri
|
||||||
|
retries: 0
|
||||||
|
interface: files.File
|
||||||
|
methods:
|
||||||
|
- name: SecurityScan
|
||||||
|
timeout: 120000
|
||||||
logger:
|
logger:
|
||||||
zap-config:
|
zap-config:
|
||||||
level: error # 日志级别
|
level: error # 日志级别
|
||||||
|
|||||||
2
go.mod
2
go.mod
@ -9,6 +9,7 @@ replace (
|
|||||||
//github.com/fonchain_enterprise/utils/objstorage => ../../tyfon-新/utils/objstorage
|
//github.com/fonchain_enterprise/utils/objstorage => ../../tyfon-新/utils/objstorage
|
||||||
github.com/fonchain/utils/voice => ../utils/voice
|
github.com/fonchain/utils/voice => ../utils/voice
|
||||||
github.com/fonchain_enterprise/utils/aes => ../utils/aes
|
github.com/fonchain_enterprise/utils/aes => ../utils/aes
|
||||||
|
github.com/fonchain_enterprise/utils/baidu => ../utils/baidu
|
||||||
github.com/fonchain_enterprise/utils/objstorage => ../utils/objstorage
|
github.com/fonchain_enterprise/utils/objstorage => ../utils/objstorage
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -109,6 +110,7 @@ require (
|
|||||||
github.com/envoyproxy/protoc-gen-validate v0.1.0
|
github.com/envoyproxy/protoc-gen-validate v0.1.0
|
||||||
github.com/fonchain/utils/security v0.0.0-00010101000000-000000000000
|
github.com/fonchain/utils/security v0.0.0-00010101000000-000000000000
|
||||||
github.com/fonchain/utils/voice v0.0.0-00010101000000-000000000000
|
github.com/fonchain/utils/voice v0.0.0-00010101000000-000000000000
|
||||||
|
github.com/fonchain_enterprise/utils/baidu v0.0.0-00010101000000-000000000000
|
||||||
github.com/fonchain_enterprise/utils/objstorage v0.0.0-00010101000000-000000000000
|
github.com/fonchain_enterprise/utils/objstorage v0.0.0-00010101000000-000000000000
|
||||||
github.com/gin-contrib/pprof v1.4.0
|
github.com/gin-contrib/pprof v1.4.0
|
||||||
github.com/go-redis/redis v6.15.9+incompatible
|
github.com/go-redis/redis v6.15.9+incompatible
|
||||||
|
|||||||
@ -236,6 +236,7 @@ func (o *ChatRoom) SendSessionMessage(sender *accountFiee.ChatUserData, sessionI
|
|||||||
o.Session[sessionId] = usableClients
|
o.Session[sessionId] = usableClients
|
||||||
fmt.Printf("sessionId:[%s],客户端数量%d\n", sessionId, len(o.Session[sessionId]))
|
fmt.Printf("sessionId:[%s],客户端数量%d\n", sessionId, len(o.Session[sessionId]))
|
||||||
fmt.Println("userIdInSession", userIdInSession)
|
fmt.Println("userIdInSession", userIdInSession)
|
||||||
|
fmt.Println("pushed", pushed)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
func (o *ChatRoom) GetUserIdInSession(sessionId string, withoutUserId ...int64) (userIds []int64) {
|
func (o *ChatRoom) GetUserIdInSession(sessionId string, withoutUserId ...int64) (userIds []int64) {
|
||||||
|
|||||||
240
pkg/cron/task.go
240
pkg/cron/task.go
@ -11,6 +11,7 @@ import (
|
|||||||
bundleModel "fonchain-fiee/pkg/model/bundle"
|
bundleModel "fonchain-fiee/pkg/model/bundle"
|
||||||
modelCast "fonchain-fiee/pkg/model/cast"
|
modelCast "fonchain-fiee/pkg/model/cast"
|
||||||
"fonchain-fiee/pkg/service"
|
"fonchain-fiee/pkg/service"
|
||||||
|
"fonchain-fiee/pkg/service/bundle/common"
|
||||||
serverCast "fonchain-fiee/pkg/service/cast"
|
serverCast "fonchain-fiee/pkg/service/cast"
|
||||||
"log"
|
"log"
|
||||||
"math/rand"
|
"math/rand"
|
||||||
@ -28,13 +29,21 @@ func InitTasks() error {
|
|||||||
err = cm.AddTask("artistAutoConfirm", "0 */1 * * * *", ArtistAutoConfirmTask)
|
err = cm.AddTask("artistAutoConfirm", "0 */1 * * * *", ArtistAutoConfirmTask)
|
||||||
err = cm.AddTask("refreshPublishStatus", "0 */1 * * * *", RefreshPublishStatusTask)
|
err = cm.AddTask("refreshPublishStatus", "0 */1 * * * *", RefreshPublishStatusTask)
|
||||||
err = cm.AddTask("scheduledPublish", "0 */1 * * * *", ScheduledPublishTask)
|
err = cm.AddTask("scheduledPublish", "0 */1 * * * *", ScheduledPublishTask)
|
||||||
|
|
||||||
|
err = cm.AddTask("artistAutoConfirmAnalysis", "0 */1 * * * *", ArtistAutoConfirmAnalysisTask)
|
||||||
|
err = cm.AddTask("refreshWorkAnalysisApprovalStatus", "0 */1 * * * *", RefreshWorkAnalysisApprovalStatusTask)
|
||||||
|
err = cm.AddTask("refreshArtistOrder", "0 */30 * * * *", RefreshArtistOrderTask)
|
||||||
|
|
||||||
|
// 每天 00:30 和 12:30 执行 Ayrshare 指标采集任务
|
||||||
|
// err = cm.AddTask("ayrshareMetricsCollector", "0 30 0,12 * * *", AyrshareMetricsCollectorTask)
|
||||||
|
err = cm.AddTask("ayrshareMetricsCollector", "0 30 0 * * *", AyrshareMetricsCollectorTask)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("添加定时任务失败: %v", err)
|
log.Printf("添加定时任务失败: %v", err)
|
||||||
}
|
}
|
||||||
cm.Start()
|
cm.Start()
|
||||||
|
|
||||||
// 启动队列消费者
|
// 启动队列消费者
|
||||||
go WorkPublishQueueConsumer()
|
//go WorkPublishQueueConsumer()
|
||||||
|
|
||||||
// 启动随机间隔的自动确认任务
|
// 启动随机间隔的自动确认任务
|
||||||
go AutoManuallyConfirmWorkTaskWithRandomInterval()
|
go AutoManuallyConfirmWorkTaskWithRandomInterval()
|
||||||
@ -62,12 +71,29 @@ func RefreshWorkApprovalStatusTask() {
|
|||||||
func AutoManuallyConfirmWorkTaskWithRandomInterval() {
|
func AutoManuallyConfirmWorkTaskWithRandomInterval() {
|
||||||
|
|
||||||
for {
|
for {
|
||||||
// 执行任务
|
// 添加 panic 恢复机制
|
||||||
AutoManuallyConfirmWorkTask()
|
func() {
|
||||||
|
defer func() {
|
||||||
|
if r := recover(); r != nil {
|
||||||
|
zap.L().Error("自动确认任务执行panic",
|
||||||
|
zap.Any("panic", r),
|
||||||
|
zap.Stack("stack"))
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
|
// 执行任务
|
||||||
|
zap.L().Debug("开始执行自动确认任务")
|
||||||
|
AutoManuallyConfirmWorkTask()
|
||||||
|
zap.L().Debug("自动确认任务执行完成")
|
||||||
|
}()
|
||||||
|
|
||||||
// 生成3-7分钟之间的随机间隔(单位:分钟)
|
// 生成3-7分钟之间的随机间隔(单位:分钟)
|
||||||
randomMinutes := rand.Intn(5) + 3 // 3-7分钟
|
randomMinutes := rand.Intn(5) + 3 // 3-7分钟
|
||||||
randomDuration := time.Duration(randomMinutes) * time.Minute
|
randomDuration := time.Duration(randomMinutes) * time.Minute
|
||||||
|
log.Printf("自动确认任务等待下次执行,间隔:%d分钟,时长:%s", randomMinutes, randomDuration)
|
||||||
|
zap.L().Info("自动确认任务等待下次执行",
|
||||||
|
zap.Int("minutes", randomMinutes),
|
||||||
|
zap.Duration("duration", randomDuration))
|
||||||
|
|
||||||
// 等待随机时间
|
// 等待随机时间
|
||||||
time.Sleep(randomDuration)
|
time.Sleep(randomDuration)
|
||||||
@ -90,7 +116,7 @@ func AutoManuallyConfirmWorkTask() {
|
|||||||
artistId, err := strconv.ParseInt(work.ArtistUuid, 10, 64)
|
artistId, err := strconv.ParseInt(work.ArtistUuid, 10, 64)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
zap.L().Error("解析艺术家ID失败", zap.Error(err))
|
zap.L().Error("解析艺术家ID失败", zap.Error(err))
|
||||||
return
|
continue
|
||||||
}
|
}
|
||||||
if req.ConfirmStatus == 2 { // 驳回完直接结束
|
if req.ConfirmStatus == 2 { // 驳回完直接结束
|
||||||
_, err := service.CastProvider.UpdateStatus(context.Background(), &cast.UpdateStatusReq{
|
_, err := service.CastProvider.UpdateStatus(context.Background(), &cast.UpdateStatusReq{
|
||||||
@ -113,6 +139,17 @@ func AutoManuallyConfirmWorkTask() {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if balanceInfoRes.BundleStatus == common.BundleExpired {
|
||||||
|
_, err = service.CastProvider.UpdateStatus(context.Background(), &cast.UpdateStatusReq{
|
||||||
|
WorkAction: cast.WorkActionENUM_CONFIRM,
|
||||||
|
WorkUuid: req.WorkUuid,
|
||||||
|
ConfirmRemark: req.ConfirmRemark,
|
||||||
|
ConfirmStatus: 3,
|
||||||
|
})
|
||||||
|
log.Printf("套餐已过期,作品uuid:"+req.WorkUuid, zap.Error(err))
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
wordInfoRes, err := service.CastProvider.WorkDetail(context.Background(), &cast.WorkDetailReq{
|
wordInfoRes, err := service.CastProvider.WorkDetail(context.Background(), &cast.WorkDetailReq{
|
||||||
WorkUuid: req.WorkUuid,
|
WorkUuid: req.WorkUuid,
|
||||||
})
|
})
|
||||||
@ -174,11 +211,27 @@ func AutoManuallyConfirmWorkTask() {
|
|||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("更新作品状态失败,作品uuid:"+req.WorkUuid, zap.Error(err))
|
log.Printf("更新作品状态失败,作品uuid:"+req.WorkUuid, zap.Error(err))
|
||||||
return
|
continue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func RefreshWorkAnalysisApprovalStatusTask() {
|
||||||
|
resp, err := service.CastProvider.ListWorkAnalysis(context.Background(), &cast.ListWorkAnalysisReq{
|
||||||
|
Page: 1,
|
||||||
|
StatusList: []uint32{2}, // 状态为2表示待审批
|
||||||
|
PageSize: 999999,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
log.Printf("获取数据分析列表失败: %v", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if resp.Data == nil || len(resp.Data) == 0 {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
serverCast.RefreshWorkAnalysisApproval(nil, resp.Data)
|
||||||
|
}
|
||||||
|
|
||||||
func ArtistAutoConfirmTask() {
|
func ArtistAutoConfirmTask() {
|
||||||
now := float64(time.Now().Unix())
|
now := float64(time.Now().Unix())
|
||||||
opt := redis.ZRangeBy{
|
opt := redis.ZRangeBy{
|
||||||
@ -191,7 +244,7 @@ func ArtistAutoConfirmTask() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if len(workUuids) == 0 {
|
if len(workUuids) == 0 {
|
||||||
zap.L().Debug("没有到期的任务")
|
zap.L().Info("没有到期的任务")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
zap.L().Info("发现到期任务", zap.Int("count", len(workUuids)))
|
zap.L().Info("发现到期任务", zap.Int("count", len(workUuids)))
|
||||||
@ -216,7 +269,7 @@ func RefreshPublishStatusTask() {
|
|||||||
zap.L().Error("刷新发布状态失败", zap.Error(err))
|
zap.L().Error("刷新发布状态失败", zap.Error(err))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
zap.L().Info("刷新发布状态成功")
|
//zap.L().Info("刷新发布状态成功")
|
||||||
}
|
}
|
||||||
|
|
||||||
// ScheduledPublishTask 定时发布任务,从Redis Sorted Set中获取所有workUuid并根据score判断处理
|
// ScheduledPublishTask 定时发布任务,从Redis Sorted Set中获取所有workUuid并根据score判断处理
|
||||||
@ -244,20 +297,24 @@ func ScheduledPublishTask() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if len(workList) == 0 {
|
if len(workList) == 0 {
|
||||||
zap.L().Debug("没有定时发布任务")
|
zap.L().Info("没有定时发布任务")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
publishCount := 0
|
publishCount := 0
|
||||||
expiredCount := 0
|
expiredCount := 0
|
||||||
|
const batchSize = 10 // 每批发布10个
|
||||||
|
|
||||||
zap.L().Info("发现定时发布任务", zap.Int("total_count", len(workList)))
|
zap.L().Info("发现定时发布任务", zap.Int("total_count", len(workList)))
|
||||||
|
|
||||||
|
now := float64(time.Now().Unix())
|
||||||
|
publishBatch := make([]string, 0, batchSize)
|
||||||
|
|
||||||
// 遍历所有数据,根据score判断处理
|
// 遍历所有数据,根据score判断处理
|
||||||
for _, item := range workList {
|
for _, item := range workList {
|
||||||
workUuid := item.Member.(string)
|
workUuid := item.Member.(string)
|
||||||
score := item.Score
|
score := item.Score
|
||||||
now := float64(time.Now().Unix())
|
|
||||||
// 如果score小于当前时间,删除但不消费(不发布)
|
// 如果score小于当前时间,删除但不消费(不发布)
|
||||||
if score < now {
|
if score < now {
|
||||||
zap.L().Info("发现过期的定时发布任务,直接删除不发布",
|
zap.L().Info("发现过期的定时发布任务,直接删除不发布",
|
||||||
@ -274,21 +331,51 @@ func ScheduledPublishTask() {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
// score大于等于当前时间,正常发布
|
// score大于等于当前时间,添加到待发布批次
|
||||||
zap.L().Info("处理定时发布任务",
|
zap.L().Info("添加到发布批次",
|
||||||
zap.String("work_uuid", workUuid),
|
zap.String("work_uuid", workUuid),
|
||||||
zap.Float64("score", score))
|
zap.Float64("score", score))
|
||||||
_ = serverCast.PublishWork(context.Background(), &cast.PublishReq{
|
publishBatch = append(publishBatch, workUuid)
|
||||||
WorkUuids: []string{workUuid},
|
|
||||||
})
|
// 当批次达到指定大小时,批量发布
|
||||||
removed, delErr := cache.RedisClient.ZRem(modelCast.ScheduledPublishQueueKey, workUuid).Result()
|
if len(publishBatch) >= batchSize {
|
||||||
if delErr != nil {
|
zap.L().Info("批量发布作品", zap.Int("batch_size", len(publishBatch)), zap.Strings("work_uuids", publishBatch))
|
||||||
zap.L().Error("删除定时发布任务失败", zap.Error(delErr), zap.String("work_uuid", workUuid))
|
_ = serverCast.PublishWork(context.Background(), &cast.PublishReq{
|
||||||
} else if removed > 0 {
|
WorkUuids: publishBatch,
|
||||||
publishCount++
|
})
|
||||||
zap.L().Info("已发布并删除定时发布任务", zap.String("work_uuid", workUuid))
|
// 批量删除已发布的任务
|
||||||
|
for _, uuid := range publishBatch {
|
||||||
|
removed, delErr := cache.RedisClient.ZRem(modelCast.ScheduledPublishQueueKey, uuid).Result()
|
||||||
|
if delErr != nil {
|
||||||
|
zap.L().Error("删除定时发布任务失败", zap.Error(delErr), zap.String("work_uuid", uuid))
|
||||||
|
} else if removed > 0 {
|
||||||
|
publishCount++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
zap.L().Info("批次发布完成", zap.Int("published", len(publishBatch)))
|
||||||
|
// 清空批次,准备下一批
|
||||||
|
publishBatch = make([]string, 0, batchSize)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 处理剩余的作品(不足一批的)
|
||||||
|
if len(publishBatch) > 0 {
|
||||||
|
zap.L().Info("批量发布剩余作品", zap.Int("batch_size", len(publishBatch)), zap.Strings("work_uuids", publishBatch))
|
||||||
|
_ = serverCast.PublishWork(context.Background(), &cast.PublishReq{
|
||||||
|
WorkUuids: publishBatch,
|
||||||
|
})
|
||||||
|
// 批量删除已发布的任务
|
||||||
|
for _, uuid := range publishBatch {
|
||||||
|
removed, delErr := cache.RedisClient.ZRem(modelCast.ScheduledPublishQueueKey, uuid).Result()
|
||||||
|
if delErr != nil {
|
||||||
|
zap.L().Error("删除定时发布任务失败", zap.Error(delErr), zap.String("work_uuid", uuid))
|
||||||
|
} else if removed > 0 {
|
||||||
|
publishCount++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
zap.L().Info("剩余批次发布完成", zap.Int("published", len(publishBatch)))
|
||||||
|
}
|
||||||
|
|
||||||
zap.L().Info("定时发布任务处理完成",
|
zap.L().Info("定时发布任务处理完成",
|
||||||
zap.Int("published_count", publishCount),
|
zap.Int("published_count", publishCount),
|
||||||
zap.Int("expired_count", expiredCount),
|
zap.Int("expired_count", expiredCount),
|
||||||
@ -297,8 +384,12 @@ func ScheduledPublishTask() {
|
|||||||
|
|
||||||
// WorkPublishQueueConsumer 监听work:publish:queue队列的消费者
|
// WorkPublishQueueConsumer 监听work:publish:queue队列的消费者
|
||||||
func WorkPublishQueueConsumer() {
|
func WorkPublishQueueConsumer() {
|
||||||
zap.L().Info("开始监听work:publish:queue队列")
|
zap.L().Info("开始监听work:publish:queue队列(批量处理模式)")
|
||||||
|
const batchSize = 10
|
||||||
|
|
||||||
for {
|
for {
|
||||||
|
batch := make([]string, 0, batchSize)
|
||||||
|
|
||||||
result, err := cache.RedisClient.BRPop(0*time.Second, modelCast.WorkPublishQueueKey).Result()
|
result, err := cache.RedisClient.BRPop(0*time.Second, modelCast.WorkPublishQueueKey).Result()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
zap.L().Error("监听work:publish:queue队列失败", zap.Error(err))
|
zap.L().Error("监听work:publish:queue队列失败", zap.Error(err))
|
||||||
@ -312,39 +403,108 @@ func WorkPublishQueueConsumer() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
workData := result[1] // BRPOP返回[key, value],value在第二个元素
|
workData := result[1] // BRPOP返回[key, value],value在第二个元素
|
||||||
zap.L().Info("从work:publish:queue队列收到数据", zap.String("data", workData))
|
zap.L().Info("从work:publish:queue队列收到第一条数据", zap.String("data", workData))
|
||||||
|
|
||||||
// 处理队列数据
|
batch = append(batch, workData)
|
||||||
if err = processWorkPublishQueueData(workData); err != nil {
|
for len(batch) < batchSize {
|
||||||
zap.L().Error("处理work:publish:queue队列数据失败", zap.Error(err), zap.String("data", workData))
|
// 使用RPOP非阻塞获取,如果没有数据立即返回
|
||||||
|
data, err := cache.RedisClient.RPop(modelCast.WorkPublishQueueKey).Result()
|
||||||
|
if err == redis.Nil {
|
||||||
|
// 队列为空,跳出循环
|
||||||
|
zap.L().Info("队列暂时为空,开始处理当前批次", zap.Int("batch_size", len(batch)))
|
||||||
|
break
|
||||||
|
} else if err != nil {
|
||||||
|
zap.L().Error("从队列获取数据失败", zap.Error(err))
|
||||||
|
break
|
||||||
|
}
|
||||||
|
batch = append(batch, data)
|
||||||
|
}
|
||||||
|
zap.L().Info("收集到批次数据,准备批量处理", zap.Int("batch_size", len(batch)))
|
||||||
|
// 批量处理数据
|
||||||
|
if err = processBatchWorkPublishQueueData(batch); err != nil {
|
||||||
|
zap.L().Error("批量处理work:publish:queue队列数据失败",
|
||||||
|
zap.Error(err),
|
||||||
|
zap.Int("batch_size", len(batch)))
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
zap.L().Info("成功处理work:publish:queue队列数据", zap.String("data", workData))
|
zap.L().Info("成功批量处理work:publish:queue队列数据", zap.Int("batch_size", len(batch)))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// processWorkPublishQueueData 处理从work:publish:queue队列中取出的数据
|
// processBatchWorkPublishQueueData 批量处理从work:publish:queue队列中取出的数据
|
||||||
func processWorkPublishQueueData(data string) error {
|
func processBatchWorkPublishQueueData(batchData []string) error {
|
||||||
// 延时1秒消费
|
// 延时1秒消费
|
||||||
time.Sleep(time.Second * 1)
|
time.Sleep(time.Second * 1)
|
||||||
var workData map[string]string
|
workUuids := make([]string, 0, len(batchData))
|
||||||
_ = json.Unmarshal([]byte(data), &workData)
|
// 解析所有数据,提取workUuid
|
||||||
workUuid := workData["workUuid"]
|
for _, data := range batchData {
|
||||||
if workUuid == "" {
|
var workData map[string]string
|
||||||
zap.L().Error("队列数据为空", zap.String("raw_data", data))
|
if err := json.Unmarshal([]byte(data), &workData); err != nil {
|
||||||
return errors.New("队列数据为空")
|
zap.L().Error("解析队列数据失败", zap.String("raw_data", data), zap.Error(err))
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
workUuid := workData["workUuid"]
|
||||||
|
if workUuid == "" {
|
||||||
|
zap.L().Error("队列数据中workUuid为空", zap.String("raw_data", data))
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
workUuids = append(workUuids, workUuid)
|
||||||
}
|
}
|
||||||
zap.L().Info("处理发布工作队列数据", zap.String("work_uuid", workUuid))
|
|
||||||
// 调用发布工作逻辑
|
if len(workUuids) == 0 {
|
||||||
|
zap.L().Warn("批次中没有有效的workUuid")
|
||||||
|
return errors.New("批次中没有有效的workUuid")
|
||||||
|
}
|
||||||
|
|
||||||
|
zap.L().Info("批量处理发布工作队列数据",
|
||||||
|
zap.Strings("work_uuids", workUuids),
|
||||||
|
zap.Int("count", len(workUuids)))
|
||||||
|
|
||||||
|
// 批量调用发布工作逻辑
|
||||||
err := serverCast.PublishWork(context.Background(), &cast.PublishReq{
|
err := serverCast.PublishWork(context.Background(), &cast.PublishReq{
|
||||||
WorkUuids: []string{workUuid},
|
WorkUuids: workUuids,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
zap.L().Error("发布工作失败",
|
zap.L().Error("批量发布工作失败",
|
||||||
zap.String("work_uuid", workUuid),
|
zap.Strings("work_uuids", workUuids),
|
||||||
zap.Error(err))
|
zap.Error(err))
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
zap.L().Info("发布工作成功", zap.String("work_uuid", workUuid))
|
|
||||||
|
zap.L().Info("批量发布工作成功",
|
||||||
|
zap.Strings("work_uuids", workUuids),
|
||||||
|
zap.Int("count", len(workUuids)))
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func ArtistAutoConfirmAnalysisTask() {
|
||||||
|
now := float64(time.Now().Unix())
|
||||||
|
opt := redis.ZRangeBy{
|
||||||
|
Min: fmt.Sprintf("%d", 0),
|
||||||
|
Max: fmt.Sprintf("%f", now),
|
||||||
|
}
|
||||||
|
analysisUuids, err := cache.RedisClient.ZRangeByScore(modelCast.AutoConfirmAnalysisQueueKey, opt).Result()
|
||||||
|
if err != nil {
|
||||||
|
zap.L().Error("获取到期数据分析任务失败", zap.Error(err))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if len(analysisUuids) == 0 {
|
||||||
|
zap.L().Debug("没有到期的数据分析任务")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
zap.L().Info("发现到期数据分析任务", zap.Int("count", len(analysisUuids)))
|
||||||
|
for _, analysisUuid := range analysisUuids {
|
||||||
|
serverCast.ProcessAnalysisTask(context.Background(), analysisUuid)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// AyrshareMetricsCollectorTask Ayrshare 指标采集定时任务(每天 00:30 和 12:30 执行)
|
||||||
|
func AyrshareMetricsCollectorTask() {
|
||||||
|
serverCast.ExecuteAyrshareMetricsCollector()
|
||||||
|
}
|
||||||
|
|
||||||
|
func RefreshArtistOrderTask() {
|
||||||
|
service.CastProvider.Tools(context.Background(), &cast.ToolsReq{Action: "refreshArtistOrder"})
|
||||||
|
}
|
||||||
|
|||||||
@ -24,7 +24,8 @@ func (w *Work) ExportExcelWorkList(data []*cast.WorkListResp_Info) (*excelize.Fi
|
|||||||
|
|
||||||
// 表头
|
// 表头
|
||||||
headers := []interface{}{
|
headers := []interface{}{
|
||||||
"艺人", "艺人手机号", "作品标题", "作品类型", "类型", "发布平台", "提交时间", "作品状态", "发布账号", "管理人",
|
"艺人", "手机号", "用户编号", "作品标题", "脚本", "作品类型", "类型", "Ins", "Tiktok", "DM", "Youtube", "Bulesky", "作品状态", "验收确认类型",
|
||||||
|
"说明", "发布账号", "管理人", "上传时间", "待艺人确认时间", "验收确认通过时间", "发布成功时间",
|
||||||
}
|
}
|
||||||
if err := sw.SetRow("A1", headers); err != nil {
|
if err := sw.SetRow("A1", headers); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@ -34,13 +35,13 @@ func (w *Work) ExportExcelWorkList(data []*cast.WorkListResp_Info) (*excelize.Fi
|
|||||||
rowIndex := 2
|
rowIndex := 2
|
||||||
for _, info := range data {
|
for _, info := range data {
|
||||||
// 拼接字段
|
// 拼接字段
|
||||||
platformNames := strings.Join(func() []string {
|
//platformNames := strings.Join(func() []string {
|
||||||
arr := make([]string, 0, len(info.PlatformIDs))
|
// arr := make([]string, 0, len(info.PlatformIDs))
|
||||||
for _, v := range info.PlatformIDs {
|
// for _, v := range info.PlatformIDs {
|
||||||
arr = append(arr, modelCast.PlatformIDMM[int(v)])
|
// arr = append(arr, modelCast.PlatformIDMM[int(v)])
|
||||||
}
|
// }
|
||||||
return arr
|
// return arr
|
||||||
}(), "/")
|
//}(), "/")
|
||||||
|
|
||||||
var mediaAccountNames string
|
var mediaAccountNames string
|
||||||
var managerNames string
|
var managerNames string
|
||||||
@ -63,14 +64,27 @@ func (w *Work) ExportExcelWorkList(data []*cast.WorkListResp_Info) (*excelize.Fi
|
|||||||
row := []interface{}{
|
row := []interface{}{
|
||||||
info.ArtistName,
|
info.ArtistName,
|
||||||
info.ArtistPhone,
|
info.ArtistPhone,
|
||||||
|
info.ArtistSubNum,
|
||||||
info.Title,
|
info.Title,
|
||||||
|
info.ScriptTitle,
|
||||||
modelCast.WorkCategoryMM[int(info.WorkCategory)],
|
modelCast.WorkCategoryMM[int(info.WorkCategory)],
|
||||||
modelCast.WorkCostTypeMM[int(info.CostType)],
|
modelCast.WorkCostTypeMM[int(info.CostType)],
|
||||||
platformNames,
|
modelCast.PlatformPublishStatusMM[cast.PublishStatusENUM(info.InsStatus)],
|
||||||
info.SubmitTime,
|
modelCast.PlatformPublishStatusMM[cast.PublishStatusENUM(info.TiktokStatus)],
|
||||||
|
modelCast.PlatformPublishStatusMM[cast.PublishStatusENUM(info.DmStatus)],
|
||||||
|
modelCast.PlatformPublishStatusMM[cast.PublishStatusENUM(info.YoutubeStatus)],
|
||||||
|
modelCast.PlatformPublishStatusMM[cast.PublishStatusENUM(info.BlueskyStatus)],
|
||||||
modelCast.WorkStatusMM[int(info.WorkStatus)],
|
modelCast.WorkStatusMM[int(info.WorkStatus)],
|
||||||
|
modelCast.ConfirmTypeMM[int(info.ConfirmType)],
|
||||||
|
info.Remark,
|
||||||
mediaAccountNames,
|
mediaAccountNames,
|
||||||
managerNames,
|
managerNames,
|
||||||
|
info.Status1Time,
|
||||||
|
info.Status4Time,
|
||||||
|
info.Status9Time,
|
||||||
|
info.Status6Time,
|
||||||
|
//platformNames,
|
||||||
|
//info.SubmitTime,
|
||||||
}
|
}
|
||||||
|
|
||||||
cell, _ := excelize.CoordinatesToCellName(1, rowIndex)
|
cell, _ := excelize.CoordinatesToCellName(1, rowIndex)
|
||||||
|
|||||||
@ -69,6 +69,8 @@ func CheckLogin(provider *api.AccountFieeClientImpl) gin.HandlerFunc {
|
|||||||
Domain: infoRes.Domain,
|
Domain: infoRes.Domain,
|
||||||
TelNum: jwt.Phone,
|
TelNum: jwt.Phone,
|
||||||
SubscriberNumber: infoRes.SubscriberNumber,
|
SubscriberNumber: infoRes.SubscriberNumber,
|
||||||
|
IdNumber: infoRes.IdNumber,
|
||||||
|
InviterID: infoRes.InviterId,
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx.Set("jwtInfo", loginInfo)
|
ctx.Set("jwtInfo", loginInfo)
|
||||||
|
|||||||
@ -6,6 +6,12 @@ type UserWorkConfirmReq struct {
|
|||||||
ConfirmStatus int `json:"confirmStatus"` // 1确认 2 驳回
|
ConfirmStatus int `json:"confirmStatus"` // 1确认 2 驳回
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type UserWorkAnalysisConfirmReq struct {
|
||||||
|
Uuid string `json:"uuid"` // 分析UUID
|
||||||
|
ConfirmRemark string `json:"confirmRemark"` // 确认备注
|
||||||
|
ConfirmStatus int `json:"confirmStatus"` // 1确认 2 驳回
|
||||||
|
}
|
||||||
|
|
||||||
type GetBundleBalanceListResp struct {
|
type GetBundleBalanceListResp struct {
|
||||||
|
|
||||||
Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total"`
|
Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total"`
|
||||||
|
|||||||
@ -18,8 +18,9 @@ type Data struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type Item struct {
|
type Item struct {
|
||||||
ID int `json:"ID"`
|
ID int `json:"ID"`
|
||||||
Domain string `json:"Domain"`
|
Domain string `json:"Domain"`
|
||||||
Status int `json:"Status"`
|
Status int `json:"Status"`
|
||||||
Reply string `json:"Reply"`
|
Reply string `json:"Reply"`
|
||||||
|
UpdatedAt string `json:"UpdatedAt"`
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1 +1,30 @@
|
|||||||
package cast
|
package cast
|
||||||
|
|
||||||
|
type SendMessageReq struct {
|
||||||
|
MediaAccountUuid string `json:"mediaAccountUuid"`
|
||||||
|
Message string `json:"message"`
|
||||||
|
RecipientId string `json:"recipientId"`
|
||||||
|
PlatformID uint32 `json:"platformID"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type PostCommentReq struct {
|
||||||
|
PublishMediaID string `json:"publishMediaID"`
|
||||||
|
Comment string `json:"comment"`
|
||||||
|
PlatformID int `json:"platformID"`
|
||||||
|
ArtistUuid string `json:"artistUuid"`
|
||||||
|
}
|
||||||
|
type GetCommentReq struct {
|
||||||
|
ArtistUuid string `json:"artistUuid"`
|
||||||
|
PublishMediaID string `json:"publishMediaID"`
|
||||||
|
}
|
||||||
|
type DeleteCommentReq struct {
|
||||||
|
ArtistUuid string `json:"artistUuid"`
|
||||||
|
CommentId string `json:"commentId"`
|
||||||
|
PlatformID int `json:"platformID"`
|
||||||
|
}
|
||||||
|
type ReplyCommentReq struct {
|
||||||
|
ArtistUuid string `json:"artistUuid"`
|
||||||
|
CommentId string `json:"commentId"`
|
||||||
|
Comment string `json:"comment"`
|
||||||
|
PlatformID int `json:"platformID"`
|
||||||
|
}
|
||||||
|
|||||||
@ -16,17 +16,16 @@ const (
|
|||||||
|
|
||||||
var PlatformNameKv = map[uint32]string{
|
var PlatformNameKv = map[uint32]string{
|
||||||
1: "tiktok",
|
1: "tiktok",
|
||||||
|
2: "youtube",
|
||||||
3: "instagram",
|
3: "instagram",
|
||||||
4: "DM",
|
4: "DM",
|
||||||
|
5: "bluesky",
|
||||||
}
|
}
|
||||||
|
|
||||||
var NamePlatformIDKv = map[string]uint32{
|
var NamePlatformIDKv = map[string]uint32{
|
||||||
"tiktok": 1,
|
"tiktok": 1,
|
||||||
|
"youtube": 2,
|
||||||
"instagram": 3,
|
"instagram": 3,
|
||||||
"DM": 4,
|
"DM": 4,
|
||||||
}
|
"bluesky": 5,
|
||||||
var PlatformIDStrKv = map[string]uint8{
|
|
||||||
"TIKTOK": 1,
|
|
||||||
"INS": 2,
|
|
||||||
"DM": 4,
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
package cast
|
package cast
|
||||||
|
|
||||||
|
import "fonchain-fiee/api/cast"
|
||||||
|
|
||||||
const (
|
const (
|
||||||
WorkStatusPending = 1 // 待提交
|
WorkStatusPending = 1 // 待提交
|
||||||
WorkStatusReviewing = 2 // 审核中
|
WorkStatusReviewing = 2 // 审核中
|
||||||
@ -15,6 +17,12 @@ const (
|
|||||||
AutoConfirmLockKey = "auto_confirm:lock:%s"
|
AutoConfirmLockKey = "auto_confirm:lock:%s"
|
||||||
WorkPublishQueueKey = "work:publish:queue"
|
WorkPublishQueueKey = "work:publish:queue"
|
||||||
ScheduledPublishQueueKey = "scheduled:publish:queue" // 定时发布队列
|
ScheduledPublishQueueKey = "scheduled:publish:queue" // 定时发布队列
|
||||||
|
|
||||||
|
AutoConfirmAnalysisQueueKey = "auto_confirm:analysis:queue"
|
||||||
|
AutoConfirmAnalysisLockKey = "auto_confirm:analysis:lock:%s"
|
||||||
|
|
||||||
|
// AyrshareMetricsCollectorLockKey Ayrshare 指标采集任务锁
|
||||||
|
AyrshareMetricsCollectorLockKey = "ayrshare:metrics:collector:lock"
|
||||||
)
|
)
|
||||||
|
|
||||||
var WorkCategoryMM = map[int]string{
|
var WorkCategoryMM = map[int]string{
|
||||||
@ -27,6 +35,14 @@ var WorkCostTypeMM = map[int]string{
|
|||||||
2: "增值",
|
2: "增值",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var PlatformPublishStatusMM = map[cast.PublishStatusENUM]string{
|
||||||
|
cast.PublishStatusENUM_PublishMediaStatus_ING: "正常",
|
||||||
|
cast.PublishStatusENUM_PublishMediaStatus_DONE: "正常",
|
||||||
|
cast.PublishStatusENUM_PublishMediaStatus_NO: "异常",
|
||||||
|
cast.PublishStatusENUM_PublishMediaStatus_FAIL: "异常",
|
||||||
|
cast.PublishStatusENUM_PublishMediaStatus_EXCEPTION: "异常",
|
||||||
|
}
|
||||||
|
|
||||||
var PlatformIDMM = map[int]string{
|
var PlatformIDMM = map[int]string{
|
||||||
1: "TIKTOK",
|
1: "TIKTOK",
|
||||||
2: "YouTube",
|
2: "YouTube",
|
||||||
@ -45,6 +61,10 @@ var WorkStatusMM = map[int]string{
|
|||||||
8: "未知",
|
8: "未知",
|
||||||
9: "验收确认",
|
9: "验收确认",
|
||||||
}
|
}
|
||||||
|
var ConfirmTypeMM = map[int]string{
|
||||||
|
1: "艺人确认",
|
||||||
|
2: "系统确认",
|
||||||
|
}
|
||||||
|
|
||||||
type DMPost struct {
|
type DMPost struct {
|
||||||
ID string `json:"id"`
|
ID string `json:"id"`
|
||||||
|
|||||||
@ -2,6 +2,7 @@ package login
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -27,6 +28,8 @@ type Info struct {
|
|||||||
Domain string `json:"domain"`
|
Domain string `json:"domain"`
|
||||||
TelNum string `json:"telNum"`
|
TelNum string `json:"telNum"`
|
||||||
SubscriberNumber string `json:"subscriberNumber"`
|
SubscriberNumber string `json:"subscriberNumber"`
|
||||||
|
IdNumber string `json:"idNumber"`
|
||||||
|
InviterID uint64 `json:"inviterId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetUserInfoFromC(c *gin.Context) Info {
|
func GetUserInfoFromC(c *gin.Context) Info {
|
||||||
|
|||||||
@ -8,3 +8,11 @@ type MsgLangQuery struct {
|
|||||||
Lang string `json:"lang" binding:"required"` //环境
|
Lang string `json:"lang" binding:"required"` //环境
|
||||||
Msg string `json:"msg" binding:"required"` //环境
|
Msg string `json:"msg" binding:"required"` //环境
|
||||||
}
|
}
|
||||||
|
type OcrRes struct {
|
||||||
|
RealName string `json:"realName"`
|
||||||
|
IDNum string `json:"iDNum"`
|
||||||
|
Path string `json:"path"`
|
||||||
|
Age int `json:"age"`
|
||||||
|
Birthday string `json:"birthday"`
|
||||||
|
Sex string `json:"sex"`
|
||||||
|
}
|
||||||
|
|||||||
13
pkg/model/security/file.go
Normal file
13
pkg/model/security/file.go
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
package security
|
||||||
|
|
||||||
|
import "time"
|
||||||
|
|
||||||
|
type FileInfo struct {
|
||||||
|
SubmitTime time.Time
|
||||||
|
FileName string
|
||||||
|
FileUrl string
|
||||||
|
FileType string
|
||||||
|
SecurityStatus string
|
||||||
|
Describe string
|
||||||
|
ProblemTimeFrame string
|
||||||
|
}
|
||||||
50
pkg/router/analysis.go
Normal file
50
pkg/router/analysis.go
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
package router
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fonchain-fiee/pkg/middleware"
|
||||||
|
"fonchain-fiee/pkg/service"
|
||||||
|
"fonchain-fiee/pkg/service/bundle"
|
||||||
|
serviceCast "fonchain-fiee/pkg/service/cast"
|
||||||
|
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
|
)
|
||||||
|
|
||||||
|
func AnalysisRouter(r *gin.RouterGroup) {
|
||||||
|
// r.POST("analysis/trigger-ayrshare-metrics", serviceCast.TriggerAyrshareMetricsCollector)
|
||||||
|
|
||||||
|
analysis := r.Group("analysis")
|
||||||
|
analysis.Use(middleware.CheckWebLogin(service.AccountProvider))
|
||||||
|
{
|
||||||
|
analysis.POST("create", serviceCast.CreateWorkAnalysis)
|
||||||
|
analysis.POST("update", serviceCast.UpdateWorkAnalysis)
|
||||||
|
analysis.POST("update-status", serviceCast.UpdateWorkAnalysisStatus)
|
||||||
|
analysis.POST("detail", serviceCast.GetWorkAnalysis)
|
||||||
|
analysis.POST("latest", serviceCast.GetLatestWorkAnalysis)
|
||||||
|
analysis.POST("list", serviceCast.ListWorkAnalysis)
|
||||||
|
analysis.POST("delete", serviceCast.DeleteWorkAnalysis)
|
||||||
|
analysis.POST("export-list", serviceCast.ListWorkAnalysisExport) // 数据分析分析列表导出
|
||||||
|
analysis.POST("export-single-list", serviceCast.ListWorkAnalysisSingleExport) // 数据分析分析单个列表导出
|
||||||
|
analysis.POST("artist-data-list", serviceCast.ArtistDataList) // 艺人数据列表
|
||||||
|
analysis.POST("media-data-list", serviceCast.MediaDataList) // 自媒体数据列表
|
||||||
|
analysis.POST("data-overview", serviceCast.DataOverview) // 数据概览
|
||||||
|
analysis.POST("artist-metrics", serviceCast.ArtistMetricsSeries) // 艺人指标系列
|
||||||
|
analysis.POST("artist-metrics-single", serviceCast.ArtistMetricsDailyWindow) // 艺人指标日窗口
|
||||||
|
analysis.POST("tobe-confirmed-list", serviceCast.TobeConfirmedList) // 待确认数据列表
|
||||||
|
analysis.POST("update-approval-id", serviceCast.UpdateWorkAnalysisApprovalID) // 更新作品分析审批ID
|
||||||
|
|
||||||
|
analysis.POST("trigger-ayrshare-metrics", serviceCast.TriggerAyrshareMetricsCollector) // 手动触发 Ayrshare 指标采集任务
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// 员工任务相关路由(需要App登录验证
|
||||||
|
analysisAppRoute := r.Group("app/analysis")
|
||||||
|
analysisAppRoute.Use(middleware.CheckLogin(service.AccountFieeProvider))
|
||||||
|
{
|
||||||
|
analysisAppRoute.POST("list", serviceCast.ListWorkAnalysis) // 作品列表
|
||||||
|
analysisAppRoute.POST("detail", serviceCast.GetWorkAnalysis) // 作品分析详情
|
||||||
|
analysisAppRoute.POST("update-status", serviceCast.UpdateWorkAnalysisStatus) // 用户确认
|
||||||
|
analysisAppRoute.POST("check-balance", serviceCast.CheckBundleBalance) // 检查套餐余量
|
||||||
|
analysisAppRoute.POST("tobe-confirmed-list", serviceCast.TobeConfirmedList) // 待确认数据列表
|
||||||
|
analysisAppRoute.POST("work-analysis-confirm", bundle.WorkAnalysisConfirm)
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -27,6 +27,7 @@ func BundleOrderRouter(r *gin.RouterGroup) {
|
|||||||
bundleOrderClientWebRoute.POST("bundle-order-list-download", bundle.OrderRecordsListDownload)
|
bundleOrderClientWebRoute.POST("bundle-order-list-download", bundle.OrderRecordsListDownload)
|
||||||
bundleOrderClientWebRoute.POST("reconciliation-list", bundle.GetReconciliationList)
|
bundleOrderClientWebRoute.POST("reconciliation-list", bundle.GetReconciliationList)
|
||||||
bundleOrderClientWebRoute.POST("reconciliation-list-download", bundle.GetReconciliationListDownload)
|
bundleOrderClientWebRoute.POST("reconciliation-list-download", bundle.GetReconciliationListDownload)
|
||||||
|
bundleOrderClientWebRoute.POST("query-order-snapshot-information", bundle.QueryTheOrderSnapshotInformation)
|
||||||
// 自动创建用户和订单
|
// 自动创建用户和订单
|
||||||
bundleOrderClientWebRoute.POST("auto-create-user-order", bundle.AutoCreateUserAndOrder)
|
bundleOrderClientWebRoute.POST("auto-create-user-order", bundle.AutoCreateUserAndOrder)
|
||||||
}
|
}
|
||||||
@ -44,6 +45,8 @@ func BundleOrderRouter(r *gin.RouterGroup) {
|
|||||||
bundleOrderAppRoute := bundleOrderRoute.Group("app")
|
bundleOrderAppRoute := bundleOrderRoute.Group("app")
|
||||||
{
|
{
|
||||||
bundleOrderAppRoute.POST("order-signature", bundle.CreateBundleOrderSignature)
|
bundleOrderAppRoute.POST("order-signature", bundle.CreateBundleOrderSignature)
|
||||||
|
bundleOrderAppRoute.POST("verification-signature", bundle.VerificationSignature) //校验签署
|
||||||
|
bundleOrderAppRoute.POST("restart-signature", bundle.RestartSignature) //重新签署
|
||||||
//bundleOrderAppRoute.POST("order-add-signature", bundle.CreateBundleOrderAddSignature)
|
//bundleOrderAppRoute.POST("order-add-signature", bundle.CreateBundleOrderAddSignature)
|
||||||
bundleOrderAppRoute.POST("order-del", bundle.DeleteBundleOrder)
|
bundleOrderAppRoute.POST("order-del", bundle.DeleteBundleOrder)
|
||||||
bundleOrderAppRoute.POST("update-pay", bundle.UpdateBundleOrderStatusPaid)
|
bundleOrderAppRoute.POST("update-pay", bundle.UpdateBundleOrderStatusPaid)
|
||||||
|
|||||||
29
pkg/router/cron.go
Normal file
29
pkg/router/cron.go
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
package router
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fonchain-fiee/pkg/middleware"
|
||||||
|
"fonchain-fiee/pkg/service"
|
||||||
|
cronService "fonchain-fiee/pkg/service/cron"
|
||||||
|
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
|
)
|
||||||
|
|
||||||
|
func cronRouter(r *gin.RouterGroup) {
|
||||||
|
auth := r.Group("")
|
||||||
|
auth.Use(middleware.CheckWebLogin(service.AccountProvider))
|
||||||
|
cron := auth.Group("cron")
|
||||||
|
{
|
||||||
|
cron.POST("createScheduleTask", cronService.CreateScheduleTask)
|
||||||
|
cron.POST("updateScheduleTask", cronService.UpdateScheduleTask)
|
||||||
|
cron.POST("pauseScheduleTask", cronService.PauseScheduleTask)
|
||||||
|
cron.POST("startScheduleTask", cronService.StartScheduleTask)
|
||||||
|
cron.POST("deleteScheduleTask", cronService.DeleteScheduleTask)
|
||||||
|
cron.POST("getListScheduleTask", cronService.GetListScheduleTask)
|
||||||
|
cron.POST("getListExecutionResult", cronService.GetListExecutionResult)
|
||||||
|
cron.POST("exportExcelExecutionResult", cronService.ExportExcelExecutionResult)
|
||||||
|
cron.POST("getListExecutionRecord", cronService.GetListExecutionRecord)
|
||||||
|
cron.POST("getScheduleTaskStatus", cronService.GetScheduleTaskStatus)
|
||||||
|
cron.POST("getImportData", cronService.GetImportData)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -23,6 +23,7 @@ func MediaRouter(r *gin.RouterGroup) {
|
|||||||
media.POST("refresh-token", serviceCast.RefreshToken)
|
media.POST("refresh-token", serviceCast.RefreshToken)
|
||||||
media.POST("artist-info", serviceCast.ArtistInfo)
|
media.POST("artist-info", serviceCast.ArtistInfo)
|
||||||
media.POST("sync-as-profile", serviceCast.SyncAsProfile)
|
media.POST("sync-as-profile", serviceCast.SyncAsProfile)
|
||||||
|
media.POST("import-media-account", serviceCast.ImportMediaAccount)
|
||||||
}
|
}
|
||||||
mediaNoLogin := r.Group("media")
|
mediaNoLogin := r.Group("media")
|
||||||
{
|
{
|
||||||
@ -58,6 +59,12 @@ func MediaRouter(r *gin.RouterGroup) {
|
|||||||
script.POST("delete", serviceCast.DeleteVideoScript)
|
script.POST("delete", serviceCast.DeleteVideoScript)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
task := auth.Group("task")
|
||||||
|
{
|
||||||
|
task.POST("list", serviceCast.TaskList)
|
||||||
|
task.POST("delete", serviceCast.DeleteTasK)
|
||||||
|
}
|
||||||
|
|
||||||
layout := auth.Group("layout")
|
layout := auth.Group("layout")
|
||||||
{
|
{
|
||||||
layout.POST("update", serviceCast.LayoutUpdate)
|
layout.POST("update", serviceCast.LayoutUpdate)
|
||||||
@ -89,4 +96,13 @@ func MediaRouter(r *gin.RouterGroup) {
|
|||||||
{
|
{
|
||||||
social.GET("tiktok-redirect", serviceCast.TikTokRedirect)
|
social.GET("tiktok-redirect", serviceCast.TikTokRedirect)
|
||||||
}
|
}
|
||||||
|
interact := auth.Group("interact")
|
||||||
|
{
|
||||||
|
interact.POST("send-message", serviceCast.SendMessage)
|
||||||
|
interact.POST("get-message", serviceCast.GetMessage)
|
||||||
|
interact.POST("post-comment", serviceCast.PostComment)
|
||||||
|
interact.POST("get-comment", serviceCast.GetComment)
|
||||||
|
interact.POST("delete-comment", serviceCast.DeleteComment)
|
||||||
|
interact.POST("replay-comment", serviceCast.ReplyComment)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,6 +7,7 @@ import (
|
|||||||
"fonchain-fiee/pkg/service/account"
|
"fonchain-fiee/pkg/service/account"
|
||||||
"fonchain-fiee/pkg/service/asChat"
|
"fonchain-fiee/pkg/service/asChat"
|
||||||
"fonchain-fiee/pkg/service/auth"
|
"fonchain-fiee/pkg/service/auth"
|
||||||
|
"fonchain-fiee/pkg/service/bundle"
|
||||||
"fonchain-fiee/pkg/service/file"
|
"fonchain-fiee/pkg/service/file"
|
||||||
"fonchain-fiee/pkg/service/governance"
|
"fonchain-fiee/pkg/service/governance"
|
||||||
imports "fonchain-fiee/pkg/service/import"
|
imports "fonchain-fiee/pkg/service/import"
|
||||||
@ -53,8 +54,10 @@ func NewRouter() *gin.Engine {
|
|||||||
ValueAddBundleRouter(privateGroup)
|
ValueAddBundleRouter(privateGroup)
|
||||||
TaskBenchRouter(privateGroup) // 新增任务台路由
|
TaskBenchRouter(privateGroup) // 新增任务台路由
|
||||||
MediaRouter(privateGroup)
|
MediaRouter(privateGroup)
|
||||||
|
AnalysisRouter(privateGroup)
|
||||||
SecFilingRouter(privateGroup)
|
SecFilingRouter(privateGroup)
|
||||||
app.MediaAppRouter(privateGroup)
|
app.MediaAppRouter(privateGroup)
|
||||||
|
cronRouter(privateGroup)
|
||||||
{
|
{
|
||||||
v1.POST("version", version.Version) //版本号公共
|
v1.POST("version", version.Version) //版本号公共
|
||||||
}
|
}
|
||||||
@ -67,19 +70,23 @@ func NewRouter() *gin.Engine {
|
|||||||
privateGroup.POST("user/check/msg", account.CheckMsg) //校验验证码
|
privateGroup.POST("user/check/msg", account.CheckMsg) //校验验证码
|
||||||
privateGroup.POST("generate/captcha", account.GenerateCaptcha) //生成滑块验证码
|
privateGroup.POST("generate/captcha", account.GenerateCaptcha) //生成滑块验证码
|
||||||
privateGroup.POST("validate/captcha", account.ValidateCaptcha) //验证滑块验证码
|
privateGroup.POST("validate/captcha", account.ValidateCaptcha) //验证滑块验证码
|
||||||
|
privateGroup.POST("check/register", account.CheckRegister) //校验是否注册
|
||||||
acRoute := privateGroup.Group("/user")
|
acRoute := privateGroup.Group("/user")
|
||||||
acRoute.Use(middleware.CheckLogin(service.AccountFieeProvider))
|
acRoute.Use(middleware.CheckLogin(service.AccountFieeProvider))
|
||||||
{
|
{
|
||||||
acRoute.POST("real-name", account.RealName) //实名
|
acRoute.POST("real-name", account.RealName) //实名
|
||||||
acRoute.POST("info", account.UserInfo) //用户详情
|
acRoute.POST("info", account.UserInfo) //用户详情
|
||||||
acRoute.POST("update", account.UserUpdate) //用户更新
|
acRoute.POST("update", account.UserUpdate) //用户更新
|
||||||
|
acRoute.POST("ocr", account.CheckIdOcr) //
|
||||||
}
|
}
|
||||||
webAcRouter := privateGroup.Group("/user")
|
webAcRouter := privateGroup.Group("/user")
|
||||||
//webAcRouter.Use(middleware.CheckWebLogin(service.AccountProvider))
|
//webAcRouter.Use(middleware.CheckWebLogin(service.AccountProvider))
|
||||||
webAcRouter.Use(middleware.CheckWebLogin(service.AccountProvider))
|
webAcRouter.Use(middleware.CheckWebLogin(service.AccountProvider))
|
||||||
{
|
{
|
||||||
webAcRouter.POST("list", account.UserList) //用户列表
|
webAcRouter.POST("list", account.UserList) //用户列表
|
||||||
webAcRouter.POST("approval", account.UserApproval) //实名审核
|
webAcRouter.POST("approval", account.UserApproval) //实名审核
|
||||||
|
webAcRouter.POST("admin-update", account.AdminUpdate) //更新用户信息
|
||||||
|
webAcRouter.POST("excel/download", account.UserExcelDownload) //excel下载
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
@ -146,7 +153,8 @@ func NewRouter() *gin.Engine {
|
|||||||
|
|
||||||
{
|
{
|
||||||
// 素材库
|
// 素材库
|
||||||
resourceRoute := v1.Group("/resource").Use(middleware.CheckWebLogin(service.AccountProvider))
|
resourceRoute := v1.Group("/resource")
|
||||||
|
// .Use(middleware.CheckWebLogin(service.AccountProvider))
|
||||||
|
|
||||||
resourceRoute.GET("", file.Info)
|
resourceRoute.GET("", file.Info)
|
||||||
resourceRoute.DELETE("", file.Delete)
|
resourceRoute.DELETE("", file.Delete)
|
||||||
@ -161,6 +169,10 @@ func NewRouter() *gin.Engine {
|
|||||||
resourceRoute.GET("/preview/:size/*path", file.Preview)
|
resourceRoute.GET("/preview/:size/*path", file.Preview)
|
||||||
resourceRoute.GET("/list", file.List)
|
resourceRoute.GET("/list", file.List)
|
||||||
resourceRoute.GET("/usage", file.Usage)
|
resourceRoute.GET("/usage", file.Usage)
|
||||||
|
resourceRoute.POST("/security/scan", file.SecurityScan)
|
||||||
|
resourceRoute.POST("/security/updata/securitystatus", file.UpdateFileSecurityStatus)
|
||||||
|
resourceRoute.POST("/security/anti", file.ManualAnti)
|
||||||
|
resourceRoute.POST("/security/status", file.GetFileSecurityStatus)
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -206,6 +218,10 @@ func NewRouter() *gin.Engine {
|
|||||||
importRoute.GET("generate/photo/test2", imports.Test2)
|
importRoute.GET("generate/photo/test2", imports.Test2)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
//健康检测
|
||||||
|
v1.GET("health", bundle.HealthCheck)
|
||||||
|
}
|
||||||
//静态文件
|
//静态文件
|
||||||
r.StaticFS("/api/fiee/static", http.Dir("./runtime"))
|
r.StaticFS("/api/fiee/static", http.Dir("./runtime"))
|
||||||
r.NoRoute(func(c *gin.Context) {
|
r.NoRoute(func(c *gin.Context) {
|
||||||
|
|||||||
@ -1,11 +1,18 @@
|
|||||||
package security
|
package security
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"sync"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/fonchain/utils/security"
|
"github.com/fonchain/utils/security"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
)
|
)
|
||||||
|
|
||||||
var ImageScanner *security.ImageScanner
|
var (
|
||||||
|
ImageScanner *security.ImageScanner
|
||||||
|
globalConfig *security.Config
|
||||||
|
configMutex sync.RWMutex
|
||||||
|
)
|
||||||
|
|
||||||
func Init() {
|
func Init() {
|
||||||
config, err := security.LoadConfigFromFile("../conf/alibabacloud.env")
|
config, err := security.LoadConfigFromFile("../conf/alibabacloud.env")
|
||||||
@ -25,3 +32,37 @@ func Init() {
|
|||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetGlobalConfig 获取全局配置实例(单例模式)
|
||||||
|
func GetGlobalConfig(configFile string) (*security.Config, error) {
|
||||||
|
configMutex.RLock()
|
||||||
|
if globalConfig != nil {
|
||||||
|
// 检查 token 是否还有效
|
||||||
|
if !globalConfig.TokenExpiration.IsZero() &&
|
||||||
|
time.Now().Before(globalConfig.TokenExpiration.Add(-5*time.Minute)) {
|
||||||
|
configMutex.RUnlock()
|
||||||
|
return globalConfig, nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
configMutex.RUnlock()
|
||||||
|
|
||||||
|
// 需要重新加载或刷新
|
||||||
|
configMutex.Lock()
|
||||||
|
defer configMutex.Unlock()
|
||||||
|
|
||||||
|
// 双重检查
|
||||||
|
if globalConfig != nil &&
|
||||||
|
!globalConfig.TokenExpiration.IsZero() &&
|
||||||
|
time.Now().Before(globalConfig.TokenExpiration.Add(-5*time.Minute)) {
|
||||||
|
return globalConfig, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// 加载配置
|
||||||
|
config, err := security.LoadConfigFromFile(configFile)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
globalConfig = config
|
||||||
|
return globalConfig, nil
|
||||||
|
}
|
||||||
|
|||||||
@ -2,16 +2,74 @@ package account
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"encoding/base64"
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
account "fonchain-fiee/api/accountFiee"
|
account "fonchain-fiee/api/accountFiee"
|
||||||
"fonchain-fiee/pkg/e"
|
"fonchain-fiee/pkg/e"
|
||||||
"fonchain-fiee/pkg/model/login"
|
"fonchain-fiee/pkg/model/login"
|
||||||
|
"fonchain-fiee/pkg/model/query"
|
||||||
"fonchain-fiee/pkg/model/union"
|
"fonchain-fiee/pkg/model/union"
|
||||||
"fonchain-fiee/pkg/service"
|
"fonchain-fiee/pkg/service"
|
||||||
|
"fonchain-fiee/pkg/service/bundle"
|
||||||
|
"fonchain-fiee/pkg/utils"
|
||||||
|
"io/ioutil"
|
||||||
|
"net/http"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/fonchain_enterprise/utils/baidu"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/gin-gonic/gin/binding"
|
"github.com/gin-gonic/gin/binding"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func UserExcelDownload(c *gin.Context) {
|
||||||
|
var req account.UserListRequest
|
||||||
|
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
|
||||||
|
service.Error(c, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
req.Domain = "app"
|
||||||
|
res, err := service.AccountFieeProvider.UserList(context.Background(), &req)
|
||||||
|
if err != nil {
|
||||||
|
service.Error(c, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
titleList := []string{
|
||||||
|
"用户编号", "姓名", "性别", "国籍", "手机号", "证件类型", "有效期至", "证件号码", "出生日期", "年龄", "现所在地", "注册时间", "审核时间", "审核状态", "不通过备注",
|
||||||
|
}
|
||||||
|
var dataList []interface{}
|
||||||
|
|
||||||
|
for _, i := range res.UserList {
|
||||||
|
DocumentType := bundle.GetDocumentTypeText(i.DocumentType)
|
||||||
|
Status := bundle.GetUserStatusText(i.Status)
|
||||||
|
data := []any{
|
||||||
|
i.SubNum,
|
||||||
|
i.Name,
|
||||||
|
i.Sex,
|
||||||
|
i.Nationality,
|
||||||
|
i.TelNum,
|
||||||
|
DocumentType,
|
||||||
|
i.Validity,
|
||||||
|
i.IdNumber,
|
||||||
|
i.DateOfBirth,
|
||||||
|
i.Age,
|
||||||
|
i.PlaceOfResidence,
|
||||||
|
i.RegistrationTime,
|
||||||
|
i.AuditTime,
|
||||||
|
Status,
|
||||||
|
i.NotPassRemarks,
|
||||||
|
}
|
||||||
|
dataList = append(dataList, &data)
|
||||||
|
}
|
||||||
|
content, err := utils.ToExcelByType(titleList, dataList, "slice", "")
|
||||||
|
if err != nil {
|
||||||
|
service.Error(c, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
utils.ResponseXls(c, content, "艺人管理")
|
||||||
|
return
|
||||||
|
}
|
||||||
func UserApproval(c *gin.Context) {
|
func UserApproval(c *gin.Context) {
|
||||||
var req account.CheckRealNameRequest
|
var req account.CheckRealNameRequest
|
||||||
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
|
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
|
||||||
@ -68,10 +126,13 @@ func UserUpdate(c *gin.Context) {
|
|||||||
req.ID = user.ID
|
req.ID = user.ID
|
||||||
req.Domain = user.Domain
|
req.Domain = user.Domain
|
||||||
res, err := service.AccountFieeProvider.Update(c, &account.UpdateRequest{
|
res, err := service.AccountFieeProvider.Update(c, &account.UpdateRequest{
|
||||||
ID: req.ID,
|
ID: req.ID,
|
||||||
Domain: req.Domain,
|
Domain: req.Domain,
|
||||||
Language: req.Language,
|
Language: req.Language,
|
||||||
NickName: req.NickName,
|
NickName: req.NickName,
|
||||||
|
Email: req.Email,
|
||||||
|
AbroadTel: req.AbroadTel,
|
||||||
|
AbroadTelAreaCode: req.AbroadTelAreaCode,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
service.Error(c, err)
|
service.Error(c, err)
|
||||||
@ -81,6 +142,119 @@ func UserUpdate(c *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func AdminUpdate(c *gin.Context) {
|
||||||
|
var req account.UpdateRequest
|
||||||
|
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
|
||||||
|
service.Error(c, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if req.ID == 0 {
|
||||||
|
service.Error(c, errors.New("用户ID不能为空"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
req.Domain = "app"
|
||||||
|
res, err := service.AccountFieeProvider.Update(c, &account.UpdateRequest{
|
||||||
|
ID: req.ID,
|
||||||
|
Domain: req.Domain,
|
||||||
|
//Language: req.Language,
|
||||||
|
//NickName: req.NickName,
|
||||||
|
Email: req.Email,
|
||||||
|
AbroadTel: req.AbroadTel,
|
||||||
|
AbroadTelAreaCode: req.AbroadTelAreaCode,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
service.Error(c, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
service.Success(c, res)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
func CheckIdOcr(c *gin.Context) {
|
||||||
|
|
||||||
|
var req account.RealNameRequest
|
||||||
|
|
||||||
|
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
|
||||||
|
service.Error(c, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
res, err := getFormIdCar(req.CertificatePicture)
|
||||||
|
if err != nil {
|
||||||
|
service.Error(c, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
service.Success(c, res)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取身份证OCR识别结果
|
||||||
|
* @param realIDImgA string - 身份证图片的URL地址
|
||||||
|
* @return res query.OcrRes - OCR识别结果结构体,包含身份证号、姓名、图片路径、年龄、生日、性别等信息
|
||||||
|
* @return err error - 错误信息,如果请求或处理过程中出现错误则返回错误
|
||||||
|
*/
|
||||||
|
func getFormIdCar(realIDImgA string) (res query.OcrRes, err error) {
|
||||||
|
// 发送HTTP GET请求获取图片
|
||||||
|
resObj, err := http.Get(realIDImgA)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println("网络请求错误:", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 确保在函数返回前关闭响应体
|
||||||
|
defer resObj.Body.Close()
|
||||||
|
|
||||||
|
// 读取图片数据
|
||||||
|
imageData, err := ioutil.ReadAll(resObj.Body)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println("读取图片数据错误:", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 将图片数据转换为base64编码
|
||||||
|
base64Data := base64.StdEncoding.EncodeToString(imageData)
|
||||||
|
fmt.Println(base64Data)
|
||||||
|
|
||||||
|
// 调用百度OCR接口识别身份证信息
|
||||||
|
result, err := baidu.OcrGetIdCard(base64Data, "front")
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 构造并返回OCR识别结果
|
||||||
|
res = query.OcrRes{
|
||||||
|
IDNum: result.IdCard, // 身份证号
|
||||||
|
RealName: result.Name, // 姓名
|
||||||
|
Path: result.Path, // 图片路径
|
||||||
|
Age: result.Age, // 年龄
|
||||||
|
Birthday: dd(result.Birthday), // 生日
|
||||||
|
Sex: result.Sex, // 性别
|
||||||
|
}
|
||||||
|
|
||||||
|
return res, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// dd 实在没时间好好写代码
|
||||||
|
func dd(dateStr string) string {
|
||||||
|
// 1. 解析字符串为time.Time类型
|
||||||
|
// 注意:Go的布局字符串必须使用参考时间"2006-01-02 15:04:05"的格式
|
||||||
|
t, err := time.Parse("20060102", dateStr)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Printf("日期解析错误: %v\n", err)
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2. 格式化为目标格式
|
||||||
|
formattedDate := t.Format("2006-01-02")
|
||||||
|
|
||||||
|
fmt.Println("原始日期:", dateStr)
|
||||||
|
fmt.Println("转换后日期:", formattedDate)
|
||||||
|
return formattedDate
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
// SendMsg 用户发送验证码
|
// SendMsg 用户发送验证码
|
||||||
func SendMsg(c *gin.Context) {
|
func SendMsg(c *gin.Context) {
|
||||||
var req account.SendMsgRequest
|
var req account.SendMsgRequest
|
||||||
@ -187,6 +361,17 @@ func RealName(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
user := login.GetUserInfoFromC(c)
|
user := login.GetUserInfoFromC(c)
|
||||||
req.Id = user.ID
|
req.Id = user.ID
|
||||||
|
if req.DocumentType == 2 {
|
||||||
|
if len(req.IdNumber) != 18 {
|
||||||
|
service.Error(c, errors.New("身份证号格式错误"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if req.IdNumber == "" {
|
||||||
|
service.Error(c, errors.New("证件号码不能为空"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
res, err := service.AccountFieeProvider.RealName(context.Background(), &req)
|
res, err := service.AccountFieeProvider.RealName(context.Background(), &req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
service.Error(c, err)
|
service.Error(c, err)
|
||||||
@ -255,6 +440,31 @@ func ValidateCaptcha(c *gin.Context) {
|
|||||||
service.Success(c, res)
|
service.Success(c, res)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
func CheckRegister(c *gin.Context) {
|
||||||
|
type CheckRegisterRes struct {
|
||||||
|
IsRegister bool `json:"is_register"`
|
||||||
|
}
|
||||||
|
req := account.UserByTelRequest{}
|
||||||
|
req.Domain = "app"
|
||||||
|
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
|
||||||
|
service.Error(c, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
data, err := service.AccountFieeProvider.UserByTel(context.Background(), &req)
|
||||||
|
if err != nil {
|
||||||
|
service.Error(c, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var res CheckRegisterRes
|
||||||
|
if data.Id == 0 {
|
||||||
|
res.IsRegister = false
|
||||||
|
} else {
|
||||||
|
res.IsRegister = true
|
||||||
|
}
|
||||||
|
service.Success(c, res)
|
||||||
|
return
|
||||||
|
}
|
||||||
func UserLogout(c *gin.Context) {
|
func UserLogout(c *gin.Context) {
|
||||||
req := account.DecryptJwtRequest{}
|
req := account.DecryptJwtRequest{}
|
||||||
req.Token = c.GetHeader(e.Authorization)
|
req.Token = c.GetHeader(e.Authorization)
|
||||||
@ -274,6 +484,16 @@ func UserRegister(c *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
req.Domain = "app"
|
req.Domain = "app"
|
||||||
|
if req.InviterCode != "" {
|
||||||
|
codeRes, err := service.AccountFieeProvider.GetInviterInfo(context.Background(), &account.InviterInfoRequest{
|
||||||
|
Code: req.InviterCode,
|
||||||
|
})
|
||||||
|
if err != nil || codeRes.Id == 0 {
|
||||||
|
service.Error(c, errors.New("邀请码错误"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
req.InviterID = codeRes.Id
|
||||||
|
}
|
||||||
res, err := service.AccountFieeProvider.Register(context.Background(), &req)
|
res, err := service.AccountFieeProvider.Register(context.Background(), &req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
service.Error(c, err)
|
service.Error(c, err)
|
||||||
|
|||||||
@ -8,6 +8,7 @@ import (
|
|||||||
"fonchain-fiee/pkg/model/login"
|
"fonchain-fiee/pkg/model/login"
|
||||||
modelQwen "fonchain-fiee/pkg/model/qwen"
|
modelQwen "fonchain-fiee/pkg/model/qwen"
|
||||||
"fonchain-fiee/pkg/service"
|
"fonchain-fiee/pkg/service"
|
||||||
|
"fonchain-fiee/pkg/utils"
|
||||||
"regexp"
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
@ -217,6 +218,8 @@ func OneText(ctx *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
resultAll.Title, resultAll.Content = extractTitleAndContent(req.Prompt)
|
resultAll.Title, resultAll.Content = extractTitleAndContent(req.Prompt)
|
||||||
|
resultAll.Title = utils.TruncateString(resultAll.Title, 100)
|
||||||
|
resultAll.Content = utils.TruncateString(resultAll.Content, 200)
|
||||||
for _, v := range result.Output.Results {
|
for _, v := range result.Output.Results {
|
||||||
resultAll.Result = append(resultAll.Result, struct {
|
resultAll.Result = append(resultAll.Result, struct {
|
||||||
Url string `json:"url"`
|
Url string `json:"url"`
|
||||||
@ -384,6 +387,8 @@ func MoreText(ctx *gin.Context) {
|
|||||||
}
|
}
|
||||||
resultAll.Content = contentRes.content
|
resultAll.Content = contentRes.content
|
||||||
|
|
||||||
|
resultAll.Title = utils.TruncateString(resultAll.Title, 100)
|
||||||
|
resultAll.Content = utils.TruncateString(resultAll.Content, 200)
|
||||||
// 处理图片结果
|
// 处理图片结果
|
||||||
if imageRes.err != nil {
|
if imageRes.err != nil {
|
||||||
service.Error(ctx, fmt.Errorf("生成图片失败: %v", imageRes.err))
|
service.Error(ctx, fmt.Errorf("生成图片失败: %v", imageRes.err))
|
||||||
|
|||||||
@ -630,13 +630,13 @@ func (a *ChatHandler) UserSwitchAutoReplyStatus(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
service.Success(c, resp)
|
service.Success(c, resp)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *ChatHandler) SetSwitchAutoReplyStatus(c *gin.Context) {
|
func (a *ChatHandler) SetSwitchAutoReplyStatus(c *gin.Context) {
|
||||||
chatUser, code := jwt.ParseToChatUser(c)
|
chatUser, code := jwt.ParseToChatUser(c)
|
||||||
if code != 0 {
|
if code != 0 {
|
||||||
service.ErrWithCode(c, code)
|
service.ErrWithCode(c, code)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
sessionId := a.cache.GetUserSession(chatUser.ID)
|
||||||
var req dto.UserSwitchAutoReplyReq
|
var req dto.UserSwitchAutoReplyReq
|
||||||
if err := c.ShouldBindJSON(&req); err != nil {
|
if err := c.ShouldBindJSON(&req); err != nil {
|
||||||
service.Error(c, err)
|
service.Error(c, err)
|
||||||
@ -652,9 +652,18 @@ func (a *ChatHandler) SetSwitchAutoReplyStatus(c *gin.Context) {
|
|||||||
} else {
|
} else {
|
||||||
msg.Text = "已进入人工,不会接收自动消息"
|
msg.Text = "已进入人工,不会接收自动消息"
|
||||||
}
|
}
|
||||||
err := logic.NewMessage(c, &a.cache, chatUser, dto.NewMessageRequest{
|
sender := &accountFiee.ChatUserData{
|
||||||
|
ID: a.robot.Info.ID,
|
||||||
|
NickName: a.robot.Name,
|
||||||
|
Account: a.robot.Info.Account,
|
||||||
|
Role: 3,
|
||||||
|
Origin: a.robot.Info.Origin,
|
||||||
|
OriginId: a.robot.Info.OriginId,
|
||||||
|
Avatar: a.robot.Info.Avatar,
|
||||||
|
}
|
||||||
|
err := logic.NewMessage(c, &a.cache, sender, dto.NewMessageRequest{
|
||||||
Robot: true,
|
Robot: true,
|
||||||
SessionId: fmt.Sprintf("%d", chatUser.ID),
|
SessionId: sessionId,
|
||||||
Message: msg,
|
Message: msg,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@ -105,6 +105,7 @@ func NewMessage(ctx context.Context, cache *chatCache.ChatCache, sender *account
|
|||||||
notice.BuildMessage(resp.Data)
|
notice.BuildMessage(resp.Data)
|
||||||
fmt.Printf("ws消息提醒:%+v\n", notice)
|
fmt.Printf("ws消息提醒:%+v\n", notice)
|
||||||
_, err = consts.ChatRoom.SendSessionMessage(sender, request.SessionId, ws.NewChatMsgType, notice)
|
_, err = consts.ChatRoom.SendSessionMessage(sender, request.SessionId, ws.NewChatMsgType, notice)
|
||||||
|
fmt.Println("消息提醒结果:", err)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Print("发送新消息通知失败", zap.Error(err), zap.Any("notice", notice))
|
log.Print("发送新消息通知失败", zap.Error(err), zap.Any("notice", notice))
|
||||||
}
|
}
|
||||||
|
|||||||
@ -197,6 +197,18 @@ func WorkConfirm(c *gin.Context) { // 确认作品并扣除余量
|
|||||||
service.Error(c, errors.New(common.GetWorkDetailFailed))
|
service.Error(c, errors.New(common.GetWorkDetailFailed))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if balanceInfoRes.BundleStatus == common.BundleExpired {
|
||||||
|
_, err = service.CastProvider.UpdateStatus(c, &cast.UpdateStatusReq{
|
||||||
|
WorkAction: cast.WorkActionENUM_CONFIRM,
|
||||||
|
WorkUuid: req.WorkUuid,
|
||||||
|
ConfirmRemark: req.ConfirmRemark,
|
||||||
|
ConfirmStatus: 3,
|
||||||
|
})
|
||||||
|
service.Error(c, errors.New("套餐已过期"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if wordInfoRes.WorkStatus != 4 {
|
if wordInfoRes.WorkStatus != 4 {
|
||||||
service.Error(c, errors.New("作品不是待确认状态"))
|
service.Error(c, errors.New("作品不是待确认状态"))
|
||||||
return
|
return
|
||||||
@ -209,6 +221,12 @@ func WorkConfirm(c *gin.Context) { // 确认作品并扣除余量
|
|||||||
case 1:
|
case 1:
|
||||||
{
|
{
|
||||||
if balanceInfoRes.ImageExtendConsumptionNumber >= balanceInfoRes.ImageExtendNumber { // 图文余量不足
|
if balanceInfoRes.ImageExtendConsumptionNumber >= balanceInfoRes.ImageExtendNumber { // 图文余量不足
|
||||||
|
_, err = service.CastProvider.UpdateStatus(c, &cast.UpdateStatusReq{
|
||||||
|
WorkAction: cast.WorkActionENUM_CONFIRM,
|
||||||
|
WorkUuid: req.WorkUuid,
|
||||||
|
ConfirmRemark: req.ConfirmRemark,
|
||||||
|
ConfirmStatus: 3,
|
||||||
|
})
|
||||||
service.Error(c, errors.New("图文余量不足"))
|
service.Error(c, errors.New("图文余量不足"))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -217,6 +235,12 @@ func WorkConfirm(c *gin.Context) { // 确认作品并扣除余量
|
|||||||
case 2:
|
case 2:
|
||||||
{
|
{
|
||||||
if balanceInfoRes.VideoExtendConsumptionNumber >= balanceInfoRes.VideoExtendNumber { // 视频余量不足
|
if balanceInfoRes.VideoExtendConsumptionNumber >= balanceInfoRes.VideoExtendNumber { // 视频余量不足
|
||||||
|
_, err = service.CastProvider.UpdateStatus(c, &cast.UpdateStatusReq{
|
||||||
|
WorkAction: cast.WorkActionENUM_CONFIRM,
|
||||||
|
WorkUuid: req.WorkUuid,
|
||||||
|
ConfirmRemark: req.ConfirmRemark,
|
||||||
|
ConfirmStatus: 3,
|
||||||
|
})
|
||||||
service.Error(c, errors.New("视频余量不足"))
|
service.Error(c, errors.New("视频余量不足"))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -245,6 +269,90 @@ func WorkConfirm(c *gin.Context) { // 确认作品并扣除余量
|
|||||||
service.Success(c, res)
|
service.Success(c, res)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func WorkAnalysisConfirm(c *gin.Context) { // 确认数据分析并扣除余量
|
||||||
|
var req bundleModel.UserWorkAnalysisConfirmReq
|
||||||
|
|
||||||
|
if err := c.ShouldBindJSON(&req); err != nil {
|
||||||
|
service.Error(c, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if req.ConfirmStatus == 2 { // 驳回完直接结束
|
||||||
|
res, err := service.CastProvider.UpdateWorkAnalysisStatus(c, &cast.UpdateWorkAnalysisStatusReq{
|
||||||
|
WorkAction: cast.WorkActionENUM_CONFIRM,
|
||||||
|
Uuid: req.Uuid,
|
||||||
|
ConfirmRemark: req.ConfirmRemark,
|
||||||
|
ConfirmStatus: 2,
|
||||||
|
})
|
||||||
|
fmt.Println("res:", res)
|
||||||
|
fmt.Println("err:", err)
|
||||||
|
if err != nil {
|
||||||
|
service.Error(c, errors.New(common.UpdateWorkStatusFailed))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
service.Success(c, res)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
userInfo := login.GetUserInfoFromC(c)
|
||||||
|
balanceInfoRes, err := service.BundleProvider.GetBundleBalanceByUserId(context.Background(), &bundle.GetBundleBalanceByUserIdReq{
|
||||||
|
UserId: int32(userInfo.ID),
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
service.Error(c, errors.New(common.GetUserBalanceFailed))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
analysisInfoRes, err := service.CastProvider.GetWorkAnalysis(c, &cast.GetWorkAnalysisDetailReq{
|
||||||
|
Uuid: req.Uuid,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
service.Error(c, errors.New(common.GetWorkDetailFailed))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if analysisInfoRes.WorkAnalysisStatus != 4 {
|
||||||
|
service.Error(c, errors.New("数据分析不是待确认状态"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
var addBalanceReq bundle.AddBundleBalanceReq
|
||||||
|
addBalanceReq.UserId = int32(userInfo.ID)
|
||||||
|
// 检查数据分析余量
|
||||||
|
if balanceInfoRes.DataAnalysisConsumptionNumber >= balanceInfoRes.DataAnalysisNumber {
|
||||||
|
service.Error(c, errors.New("数据分析余量不足"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
addBalanceReq.DataAnalysisConsumptionNumber = 1
|
||||||
|
|
||||||
|
resp, err := service.BundleProvider.AddBundleBalance(c, &addBalanceReq)
|
||||||
|
if err != nil {
|
||||||
|
service.Error(c, errors.New(common.AddBundleBalanceFailed))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
res, err := service.CastProvider.UpdateWorkAnalysisStatus(c, &cast.UpdateWorkAnalysisStatusReq{
|
||||||
|
WorkAction: cast.WorkActionENUM_CONFIRM,
|
||||||
|
Uuid: req.Uuid,
|
||||||
|
ConfirmRemark: req.ConfirmRemark,
|
||||||
|
CostType: resp.UsedType,
|
||||||
|
ConfirmStatus: 1,
|
||||||
|
})
|
||||||
|
fmt.Println("res:", res)
|
||||||
|
fmt.Println("err:", err)
|
||||||
|
if err != nil {
|
||||||
|
service.Error(c, errors.New(common.UpdateWorkStatusFailed))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// 如果是艺人手动确认,确认操作后,自动标记为待阅读状态
|
||||||
|
_, err = service.CastProvider.UpdateWorkAnalysisStatus(c, &cast.UpdateWorkAnalysisStatusReq{
|
||||||
|
WorkAction: cast.WorkActionENUM_READ,
|
||||||
|
Uuid: req.Uuid,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
service.Error(c, errors.New(common.UpdateWorkStatusFailed))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
service.Success(c, res)
|
||||||
|
}
|
||||||
|
|
||||||
func CastLogConfirm(ctx *gin.Context) {
|
func CastLogConfirm(ctx *gin.Context) {
|
||||||
var req bundle.ConfirmWorkReq
|
var req bundle.ConfirmWorkReq
|
||||||
if err := ctx.ShouldBindJSON(&req); err != nil {
|
if err := ctx.ShouldBindJSON(&req); err != nil {
|
||||||
|
|||||||
@ -93,9 +93,30 @@ func MetricsBundlePurchaseExport(ctx *gin.Context) {
|
|||||||
sumFee := decimal.Zero
|
sumFee := decimal.Zero
|
||||||
|
|
||||||
for _, i := range data {
|
for _, i := range data {
|
||||||
sumPayment = sumPayment.Add(decimal.NewFromFloat(float64(i.PaymentAmount)))
|
|
||||||
sumFinal = sumFinal.Add(decimal.NewFromFloat(float64(i.FinalAmount)))
|
s := fmt.Sprintf("%.2f", i.PaymentAmount)
|
||||||
sumFee = sumFee.Add(decimal.NewFromFloat(float64(i.FeeAmount)))
|
d, err := decimal.NewFromString(s)
|
||||||
|
if err != nil {
|
||||||
|
service.Error(ctx, errors.New(common.MetricsBundlePurchaseExportFailed))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
sumPayment = sumPayment.Add(d)
|
||||||
|
|
||||||
|
s = fmt.Sprintf("%.2f", i.FinalAmount)
|
||||||
|
d, err = decimal.NewFromString(s)
|
||||||
|
if err != nil {
|
||||||
|
service.Error(ctx, errors.New(common.MetricsBundlePurchaseExportFailed))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
sumFinal = sumFinal.Add(d)
|
||||||
|
|
||||||
|
s = fmt.Sprintf("%.2f", i.FeeAmount)
|
||||||
|
d, err = decimal.NewFromString(s)
|
||||||
|
if err != nil {
|
||||||
|
service.Error(ctx, errors.New(common.MetricsBundlePurchaseExportFailed))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
sumFee = sumFee.Add(d)
|
||||||
}
|
}
|
||||||
|
|
||||||
f.SetCellValue(sheet, fmt.Sprintf("A%d", endRow+1), "合计支付金额(美元)")
|
f.SetCellValue(sheet, fmt.Sprintf("A%d", endRow+1), "合计支付金额(美元)")
|
||||||
|
|||||||
@ -22,6 +22,8 @@ import (
|
|||||||
"github.com/gin-gonic/gin/binding"
|
"github.com/gin-gonic/gin/binding"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const ContractUrl = "https://e-cdn.fontree.cn/fonchain-main/prod/file/contract/saas/template-25122501.pdf"
|
||||||
|
|
||||||
func DeleteBundleOrder(c *gin.Context) {
|
func DeleteBundleOrder(c *gin.Context) {
|
||||||
var req bundle.DeleteValueAddServiceRequest
|
var req bundle.DeleteValueAddServiceRequest
|
||||||
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
|
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
|
||||||
@ -239,15 +241,21 @@ func CreateBundleOrderSignature(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 签合同(金额 + 有效期)
|
// 签合同(金额 + 有效期)
|
||||||
signContract, err := logic.SignContractV2(req.CustomerNum, bundleDetail.Contract, bundleDetail.Price+addTotalPrice, expirationDay)
|
signContract, err := logic.SignContractV2(req.CustomerNum, bundleDetail.Contract, bundleDetail.Price+addTotalPrice, expirationDay, userInfo.Name, userInfo.IdNumber, userInfo.PlaceOfResidence)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
service.Error(c, err)
|
service.Error(c, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if userInfo.InviterID != 0 && logic.CheckUserFirstOrder(userInfo.ID) {
|
||||||
|
req.InviterId = userInfo.InviterID
|
||||||
|
}
|
||||||
// 组装订单信息
|
// 组装订单信息
|
||||||
req = logic.BuildOrderRequest(req, userInfo, bundleDetail, addRecords, addTotalPrice, lastContractNo, signContract)
|
req = logic.BuildOrderRequest(req, userInfo, bundleDetail, addRecords, addTotalPrice, lastContractNo, signContract)
|
||||||
|
|
||||||
|
// 校验发布平台
|
||||||
|
if len(req.PlatformIds) == 0 {
|
||||||
|
req.PlatformIds = []uint32{1, 4, 5}
|
||||||
|
}
|
||||||
// 创建订单
|
// 创建订单
|
||||||
res, err := service.BundleProvider.CreateOrderRecord(context.Background(), &req)
|
res, err := service.BundleProvider.CreateOrderRecord(context.Background(), &req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -257,7 +265,129 @@ func CreateBundleOrderSignature(c *gin.Context) {
|
|||||||
service.Success(c, res)
|
service.Success(c, res)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
func VerificationSignature(c *gin.Context) {
|
||||||
|
type VerificationSignature struct {
|
||||||
|
Signature bool `json:"signature"`
|
||||||
|
SignatureUrl string `json:"signature_url"`
|
||||||
|
}
|
||||||
|
res := VerificationSignature{Signature: false}
|
||||||
|
userInfo := login.GetUserInfoFromC(c)
|
||||||
|
|
||||||
|
// 添加用户信息验证
|
||||||
|
if userInfo.ID == 0 {
|
||||||
|
service.Success(c, res)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
req := bundle.OrderRecordsDetailRequest{
|
||||||
|
CustomerID: strconv.FormatUint(userInfo.ID, 10),
|
||||||
|
}
|
||||||
|
|
||||||
|
records, err := service.BundleProvider.OrderRecordsDetail(c, &req)
|
||||||
|
if err != nil {
|
||||||
|
// 添加错误日志但继续返回false(业务逻辑)
|
||||||
|
service.Success(c, res)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 优化空值判断链
|
||||||
|
if records == nil || records.OrderRecord == nil {
|
||||||
|
service.Success(c, res)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
order := records.OrderRecord
|
||||||
|
|
||||||
|
customerID, err := strconv.ParseUint(order.CustomerID, 10, 64)
|
||||||
|
if err != nil || customerID != userInfo.ID {
|
||||||
|
service.Success(c, res)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
//
|
||||||
|
//if order.Status != bundleModel.OrderPaid {
|
||||||
|
// service.Success(c, res)
|
||||||
|
// return
|
||||||
|
//}
|
||||||
|
expirationTime, err := time.Parse("2006-01-02 15:04:05", order.ExpirationTime)
|
||||||
|
if err != nil {
|
||||||
|
service.Success(c, res)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if expirationTime.Before(time.Now()) {
|
||||||
|
service.Success(c, res)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if order.ReSignature == 1 {
|
||||||
|
res.Signature = true
|
||||||
|
contract := ContractUrl
|
||||||
|
expirationDate := expirationTime.Format("2006-01-02")
|
||||||
|
signContract, err := logic.SignContractV2(userInfo.SubNum, contract, 0, expirationDate, userInfo.Name, userInfo.IdNumber, userInfo.PlaceOfResidence)
|
||||||
|
if err != nil {
|
||||||
|
service.Error(c, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
res.SignatureUrl = signContract
|
||||||
|
}
|
||||||
|
|
||||||
|
service.Success(c, res)
|
||||||
|
}
|
||||||
|
func RestartSignature(c *gin.Context) {
|
||||||
|
userInfo := login.GetUserInfoFromC(c)
|
||||||
|
|
||||||
|
req := bundle.OrderRecordsDetailRequest{
|
||||||
|
CustomerID: strconv.FormatUint(userInfo.ID, 10),
|
||||||
|
}
|
||||||
|
records, err := service.BundleProvider.OrderRecordsDetail(c, &req)
|
||||||
|
if err != nil {
|
||||||
|
service.Error(c, errors.New("获取订单信息失败"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// 优化空值判断链
|
||||||
|
if records == nil || records.OrderRecord == nil {
|
||||||
|
service.Error(c, errors.New("获取订单信息失败"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
order := records.OrderRecord
|
||||||
|
expirationTime, err := time.Parse("2006-01-02 15:04:05", order.ExpirationTime)
|
||||||
|
if err != nil {
|
||||||
|
service.Error(c, errors.New("获取订单过期日期错误"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if expirationTime.Before(time.Now()) {
|
||||||
|
service.Error(c, errors.New("订单已过期"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
expirationDate := expirationTime.Format("2006-01-02")
|
||||||
|
|
||||||
|
if order.ReSignature == 2 {
|
||||||
|
service.Error(c, errors.New("订单无需重新签署"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// 获取最后一次合同编号
|
||||||
|
lastContractNo, err := logic.GetLastContractNo()
|
||||||
|
if err != nil {
|
||||||
|
service.Error(c, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
contract := ContractUrl
|
||||||
|
signContract, err := logic.SignContractV2(userInfo.SubNum, contract, 0, expirationDate, userInfo.Name, userInfo.IdNumber, userInfo.PlaceOfResidence)
|
||||||
|
if err != nil {
|
||||||
|
service.Error(c, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
res, err := service.BundleProvider.ReSignTheContract(c, &bundle.ReSignTheContractRequest{
|
||||||
|
OrderNo: records.OrderRecord.OrderNo,
|
||||||
|
ContractNo: lastContractNo,
|
||||||
|
SignContract: signContract,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
service.Error(c, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
service.Success(c, res)
|
||||||
|
return
|
||||||
|
}
|
||||||
func UpdateBundleOrderStatusPaid(c *gin.Context) {
|
func UpdateBundleOrderStatusPaid(c *gin.Context) {
|
||||||
var req bundle.OrderRecord
|
var req bundle.OrderRecord
|
||||||
|
|
||||||
@ -390,7 +520,6 @@ func OrderRecordsListV2(c *gin.Context) {
|
|||||||
for id := range userIdSet {
|
for id := range userIdSet {
|
||||||
userIds = append(userIds, id)
|
userIds = append(userIds, id)
|
||||||
}
|
}
|
||||||
|
|
||||||
userListResp, err := service.AccountFieeProvider.UserList(context.Background(), &accountFiee.UserListRequest{
|
userListResp, err := service.AccountFieeProvider.UserList(context.Background(), &accountFiee.UserListRequest{
|
||||||
Ids: userIds,
|
Ids: userIds,
|
||||||
Domain: "app",
|
Domain: "app",
|
||||||
@ -412,6 +541,10 @@ func OrderRecordsListV2(c *gin.Context) {
|
|||||||
item.CustomerName = u.Name
|
item.CustomerName = u.Name
|
||||||
item.TelNum = u.TelNum
|
item.TelNum = u.TelNum
|
||||||
item.SubNum = u.SubNum
|
item.SubNum = u.SubNum
|
||||||
|
if item.InviterId != 0 {
|
||||||
|
item.InviterCode = u.InviterCode
|
||||||
|
item.InviterName = u.InviterName
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -494,6 +627,10 @@ func OrderRecordsListDownload(c *gin.Context) {
|
|||||||
item.CustomerName = u.Name
|
item.CustomerName = u.Name
|
||||||
item.TelNum = u.TelNum
|
item.TelNum = u.TelNum
|
||||||
item.SubNum = u.SubNum
|
item.SubNum = u.SubNum
|
||||||
|
if item.InviterId != 0 {
|
||||||
|
item.InviterCode = u.InviterCode
|
||||||
|
item.InviterName = u.InviterName
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -518,7 +655,7 @@ func exportExcel(orderList []*bundle.OrderBundleRecordInfo) (*excelize.File, err
|
|||||||
|
|
||||||
headers := []string{
|
headers := []string{
|
||||||
"套餐订单号", "套餐类型", "套餐付款状态", "艺人手机号", "用户编号", "艺人", "套餐订单创建时间", "套餐支付时间", "套餐金额",
|
"套餐订单号", "套餐类型", "套餐付款状态", "艺人手机号", "用户编号", "艺人", "套餐订单创建时间", "套餐支付时间", "套餐金额",
|
||||||
"增值服务订单号", "增值税服务金额", "支付金额", "币种", "手续费", "增值订单创建时间", "增值付款状态",
|
"增值服务订单号", "增值税服务金额", "支付金额", "币种", "手续费", "增值订单创建时间", "增值付款状态", "邀请码", "邀请码所属人",
|
||||||
}
|
}
|
||||||
for i, h := range headers {
|
for i, h := range headers {
|
||||||
cell := fmt.Sprintf("%s%d", string(rune('A'+i)), 1)
|
cell := fmt.Sprintf("%s%d", string(rune('A'+i)), 1)
|
||||||
@ -552,6 +689,8 @@ func exportExcel(orderList []*bundle.OrderBundleRecordInfo) (*excelize.File, err
|
|||||||
f.SetCellValue(sheetName, fmt.Sprintf("G%d", rowIndex), bundleInfo.BundleCreateAt)
|
f.SetCellValue(sheetName, fmt.Sprintf("G%d", rowIndex), bundleInfo.BundleCreateAt)
|
||||||
f.SetCellValue(sheetName, fmt.Sprintf("H%d", rowIndex), bundleInfo.PayTime)
|
f.SetCellValue(sheetName, fmt.Sprintf("H%d", rowIndex), bundleInfo.PayTime)
|
||||||
f.SetCellValue(sheetName, fmt.Sprintf("I%d", rowIndex), bundleInfo.Amount)
|
f.SetCellValue(sheetName, fmt.Sprintf("I%d", rowIndex), bundleInfo.Amount)
|
||||||
|
f.SetCellValue(sheetName, fmt.Sprintf("Q%d", rowIndex), bundleInfo.InviterCode)
|
||||||
|
f.SetCellValue(sheetName, fmt.Sprintf("R%d", rowIndex), bundleInfo.InviterName)
|
||||||
|
|
||||||
if addCount > 0 {
|
if addCount > 0 {
|
||||||
for i, add := range bundleInfo.AddBundleInfo {
|
for i, add := range bundleInfo.AddBundleInfo {
|
||||||
@ -598,6 +737,38 @@ func GetCurrencyTypeText(currencyType int32) string {
|
|||||||
return strconv.Itoa(int(currencyType))
|
return strconv.Itoa(int(currencyType))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
func GetUserStatusText(status int32) string {
|
||||||
|
switch status {
|
||||||
|
case 1:
|
||||||
|
return "未实名"
|
||||||
|
case 2:
|
||||||
|
return "审核中"
|
||||||
|
case 3:
|
||||||
|
return "审核失败"
|
||||||
|
case 4:
|
||||||
|
return "审核通过"
|
||||||
|
default:
|
||||||
|
return strconv.Itoa(int(status))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
func GetDocumentTypeText(documentType int32) string {
|
||||||
|
switch documentType {
|
||||||
|
case 1:
|
||||||
|
return "护照"
|
||||||
|
case 2:
|
||||||
|
return "身份证"
|
||||||
|
case 3:
|
||||||
|
return "驾驶证"
|
||||||
|
case 4:
|
||||||
|
return "居住证"
|
||||||
|
case 5:
|
||||||
|
return "自拍照"
|
||||||
|
case 6:
|
||||||
|
return "社保卡"
|
||||||
|
default:
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
}
|
||||||
func OrderRecordsList(c *gin.Context) {
|
func OrderRecordsList(c *gin.Context) {
|
||||||
var req bundle.OrderRecordsRequest
|
var req bundle.OrderRecordsRequest
|
||||||
|
|
||||||
|
|||||||
@ -21,6 +21,36 @@ const (
|
|||||||
OnlyAddValueListByOrderNoFailed = "根据订单号查询增值套餐失败"
|
OnlyAddValueListByOrderNoFailed = "根据订单号查询增值套餐失败"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
//官网报告
|
||||||
|
const (
|
||||||
|
ErrorCreateReportFailed = "创建官网报告失败"
|
||||||
|
ErrorDeleteReportFailed = "删除官网报告失败"
|
||||||
|
ErrorListReportFailed = "官网报告列表查询失败"
|
||||||
|
ErrorEditReportFailed = "编辑官网报告失败"
|
||||||
|
ErrorDisplayReportFailed = "显示官网报告失败"
|
||||||
|
)
|
||||||
|
|
||||||
|
//官网成员管理
|
||||||
|
const (
|
||||||
|
ErrorCreateMemberFailed = "创建官网成员失败"
|
||||||
|
ErrorDeleteMemberFailed = "删除官网成员失败"
|
||||||
|
ErrorListMemberFailed = "官网成员列表查询失败"
|
||||||
|
ErrorEditMemberFailed = "编辑官网成员失败"
|
||||||
|
ErrorDisplayMemberFailed = "显示官网成员失败"
|
||||||
|
ErrorEditBoardOfDirectorsFailed = "编辑董事会成员失败"
|
||||||
|
ErrorEditCommitteeAppointmentsFailed = "编辑委员会成员失败"
|
||||||
|
ErrorDisplayCommitteeAppointmentsFailed = "显示委员会成员失败"
|
||||||
|
ErrorEditManagementFailed = "编辑管理员失败"
|
||||||
|
ErrorDisplayManagementFailed = "显示管理员失败"
|
||||||
|
ErrorDisplayBoardOfDirectorsFailed = "显示董事会成员失败"
|
||||||
|
)
|
||||||
|
|
||||||
|
//官网邮箱通知
|
||||||
|
const (
|
||||||
|
ErrorEmailAlertSubmitFailed = "提交邮箱通知失败"
|
||||||
|
ErrorGetEmailInformationListFailed = "获取邮箱通知列表失败"
|
||||||
|
)
|
||||||
|
|
||||||
// 订单
|
// 订单
|
||||||
const (
|
const (
|
||||||
MissOrderNo = "缺少订单号"
|
MissOrderNo = "缺少订单号"
|
||||||
@ -69,13 +99,15 @@ const (
|
|||||||
BundleUnBindingAddService = "套餐未绑定增值服务"
|
BundleUnBindingAddService = "套餐未绑定增值服务"
|
||||||
)
|
)
|
||||||
|
|
||||||
//发布
|
// 发布
|
||||||
const (
|
const (
|
||||||
UpdateWorkStatusFailed = "更新作品状态失败"
|
UpdateWorkStatusFailed = "更新作品状态失败"
|
||||||
GetWorkDetailFailed = "获取作品详情失败"
|
GetWorkDetailFailed = "获取作品详情失败"
|
||||||
)
|
)
|
||||||
|
|
||||||
//余量
|
//用户套餐状态
|
||||||
|
|
||||||
|
// 余量
|
||||||
const (
|
const (
|
||||||
BundleExtendFailed = "套餐扩展失败"
|
BundleExtendFailed = "套餐扩展失败"
|
||||||
BundleExtendRecordsListFailed = "套餐扩展记录列表查询失败"
|
BundleExtendRecordsListFailed = "套餐扩展记录列表查询失败"
|
||||||
@ -92,7 +124,13 @@ const (
|
|||||||
InsufficientBalance = "余量不足"
|
InsufficientBalance = "余量不足"
|
||||||
)
|
)
|
||||||
|
|
||||||
//数据指标
|
//用户套餐状态
|
||||||
|
const (
|
||||||
|
BundleExpired = 1 //已过期
|
||||||
|
BundleNotExpired = 0 //未过期
|
||||||
|
)
|
||||||
|
|
||||||
|
// 数据指标
|
||||||
const (
|
const (
|
||||||
MetricsBusinessFailed = "业务概览查询失败"
|
MetricsBusinessFailed = "业务概览查询失败"
|
||||||
MetricsOperatingFailed = "运营数据查询失败"
|
MetricsOperatingFailed = "运营数据查询失败"
|
||||||
@ -103,7 +141,7 @@ const (
|
|||||||
BalanceMetricsExportFailed = "服务使用明细数据导出失败"
|
BalanceMetricsExportFailed = "服务使用明细数据导出失败"
|
||||||
)
|
)
|
||||||
|
|
||||||
//素材库
|
// 素材库
|
||||||
const (
|
const (
|
||||||
FileListFailed = "素材库列表查询失败"
|
FileListFailed = "素材库列表查询失败"
|
||||||
FileUsageFailed = "素材库使用情况查询失败"
|
FileUsageFailed = "素材库使用情况查询失败"
|
||||||
@ -121,7 +159,7 @@ const (
|
|||||||
ERROR_OPEN_FILE = "打开文件错误"
|
ERROR_OPEN_FILE = "打开文件错误"
|
||||||
)
|
)
|
||||||
|
|
||||||
//官网
|
// 官网
|
||||||
const (
|
const (
|
||||||
CreateSecFilingFailed = "创建官方信息失败"
|
CreateSecFilingFailed = "创建官方信息失败"
|
||||||
UpdateSecFilingFailed = "更新官方信息失败"
|
UpdateSecFilingFailed = "更新官方信息失败"
|
||||||
|
|||||||
180
pkg/service/bundle/healthCheck.go
Normal file
180
pkg/service/bundle/healthCheck.go
Normal file
@ -0,0 +1,180 @@
|
|||||||
|
package bundle
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"fonchain-fiee/api/bundle"
|
||||||
|
"fonchain-fiee/api/cast"
|
||||||
|
"fonchain-fiee/api/files"
|
||||||
|
"fonchain-fiee/api/governance"
|
||||||
|
"fonchain-fiee/api/order"
|
||||||
|
"fonchain-fiee/api/payment"
|
||||||
|
"fonchain-fiee/pkg/cache"
|
||||||
|
"fonchain-fiee/pkg/service"
|
||||||
|
"net/http"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
|
)
|
||||||
|
|
||||||
|
// HealthCheck 健康检测接口
|
||||||
|
func HealthCheck(c *gin.Context) {
|
||||||
|
healthStatus := gin.H{
|
||||||
|
"status": "ok",
|
||||||
|
"timestamp": time.Now().Unix(),
|
||||||
|
"checks": make(map[string]interface{}),
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查 Redis 连接
|
||||||
|
redisStatus := "ok"
|
||||||
|
redisErr := ""
|
||||||
|
if cache.RedisClient != nil {
|
||||||
|
_, cancel := context.WithTimeout(context.Background(), 2*time.Second)
|
||||||
|
defer cancel()
|
||||||
|
_, err := cache.RedisClient.Ping().Result()
|
||||||
|
if err != nil {
|
||||||
|
redisStatus = "failed"
|
||||||
|
redisErr = err.Error()
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
redisStatus = "failed"
|
||||||
|
redisErr = "Redis client is nil"
|
||||||
|
}
|
||||||
|
healthStatus["checks"].(map[string]interface{})["redis"] = gin.H{
|
||||||
|
"status": redisStatus,
|
||||||
|
"error": redisErr,
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查微服务连接(调用一个简单的服务方法)
|
||||||
|
serviceStatus := "ok"
|
||||||
|
serviceErr := ""
|
||||||
|
ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second)
|
||||||
|
defer cancel()
|
||||||
|
|
||||||
|
// 调用 BundleProvider 的简单方法进行健康检测
|
||||||
|
_, err := service.BundleProvider.GetBundleBalanceByUserId(ctx, &bundle.GetBundleBalanceByUserIdReq{
|
||||||
|
UserId: 0, // 使用一个不存在的用户ID,只检测服务连通性
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
// 检查是否是超时或连接错误
|
||||||
|
if ctx.Err() == context.DeadlineExceeded {
|
||||||
|
serviceStatus = "Bundle Service timeout"
|
||||||
|
serviceErr = "Service timeout"
|
||||||
|
} else {
|
||||||
|
// 其他错误(如业务错误)认为服务是可用的
|
||||||
|
serviceStatus = "ok"
|
||||||
|
serviceErr = ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
healthStatus["checks"].(map[string]interface{})["bundleService"] = gin.H{
|
||||||
|
"status": serviceStatus,
|
||||||
|
"error": serviceErr,
|
||||||
|
}
|
||||||
|
//调用 OrderProvider 的简单方法进行健康检测
|
||||||
|
_, err = service.OrderProvider.GetOrder(ctx, &order.CommonRequest{
|
||||||
|
ID: 0,
|
||||||
|
Domain: "",
|
||||||
|
SeriesUid: "", // 使用一个不存在的订单ID,只检测服务连通性
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
if ctx.Err() == context.DeadlineExceeded {
|
||||||
|
serviceStatus = "Order Service timeout"
|
||||||
|
serviceErr = "Service timeout"
|
||||||
|
} else {
|
||||||
|
// 其他错误(如业务错误)认为服务是可用的
|
||||||
|
serviceStatus = "ok"
|
||||||
|
serviceErr = ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
healthStatus["checks"].(map[string]interface{})["orderService"] = gin.H{
|
||||||
|
"status": serviceStatus,
|
||||||
|
"error": serviceErr,
|
||||||
|
}
|
||||||
|
//调用 FilesProvider 的简单方法进行健康检测
|
||||||
|
_, err = service.FilesProvider.List(ctx, &files.FileListReq{
|
||||||
|
Path: "/",
|
||||||
|
UserSpacePath: "/fiee",
|
||||||
|
Page: 1,
|
||||||
|
PageSize: 50,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
if ctx.Err() == context.DeadlineExceeded {
|
||||||
|
serviceStatus = "Filesbrowser Service timeout"
|
||||||
|
serviceErr = "Service timeout"
|
||||||
|
} else {
|
||||||
|
// 其他错误(如业务错误)认为服务是可用的
|
||||||
|
serviceStatus = "ok"
|
||||||
|
serviceErr = ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
healthStatus["checks"].(map[string]interface{})["filesbrowserService"] = gin.H{
|
||||||
|
"status": serviceStatus,
|
||||||
|
"error": serviceErr,
|
||||||
|
}
|
||||||
|
//调用 PaymentProvider 的简单方法进行健康检测
|
||||||
|
_, err = service.PaymentProvider.QueryPayByOutTradeNo(ctx, &payment.PayQueryRequest{
|
||||||
|
PayType: "2",
|
||||||
|
OutTradeNo: "1234567890",
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
if ctx.Err() == context.DeadlineExceeded {
|
||||||
|
serviceStatus = "Payment Service timeout"
|
||||||
|
serviceErr = "Service timeout"
|
||||||
|
} else {
|
||||||
|
// 其他错误(如业务错误)认为服务是可用的
|
||||||
|
serviceStatus = "ok"
|
||||||
|
serviceErr = ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
healthStatus["checks"].(map[string]interface{})["paymentService"] = gin.H{
|
||||||
|
"status": serviceStatus,
|
||||||
|
"error": serviceErr,
|
||||||
|
}
|
||||||
|
|
||||||
|
//调用 CastProvider 的简单方法进行健康检测
|
||||||
|
_, err = service.CastProvider.WorkList(ctx, &cast.WorkListReq{
|
||||||
|
Page: 1,
|
||||||
|
PageSize: 10,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
if ctx.Err() == context.DeadlineExceeded {
|
||||||
|
serviceStatus = "Cast Service timeout"
|
||||||
|
serviceErr = "Service timeout"
|
||||||
|
} else {
|
||||||
|
// 其他错误(如业务错误)认为服务是可用的
|
||||||
|
serviceStatus = "ok"
|
||||||
|
serviceErr = ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
healthStatus["checks"].(map[string]interface{})["castService"] = gin.H{
|
||||||
|
"status": serviceStatus,
|
||||||
|
"error": serviceErr,
|
||||||
|
}
|
||||||
|
//调用 GovernanceProvider 的简单方法进行健康检测
|
||||||
|
_, err = service.GovernanceProvider.List(ctx, &governance.ListReq{
|
||||||
|
Page: 1,
|
||||||
|
PageSize: 10,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
if ctx.Err() == context.DeadlineExceeded {
|
||||||
|
serviceStatus = "Document Service timeout"
|
||||||
|
serviceErr = "Service timeout"
|
||||||
|
} else {
|
||||||
|
// 其他错误(如业务错误)认为服务是可用的
|
||||||
|
serviceStatus = "ok"
|
||||||
|
serviceErr = ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
healthStatus["checks"].(map[string]interface{})["documentService"] = gin.H{
|
||||||
|
"status": serviceStatus,
|
||||||
|
"error": serviceErr,
|
||||||
|
}
|
||||||
|
|
||||||
|
// 如果所有检查都通过,返回 200,否则返回 503
|
||||||
|
httpStatus := http.StatusOK
|
||||||
|
if redisStatus != "ok" || serviceStatus != "ok" {
|
||||||
|
httpStatus = http.StatusServiceUnavailable
|
||||||
|
healthStatus["status"] = "degraded"
|
||||||
|
}
|
||||||
|
|
||||||
|
c.JSON(httpStatus, healthStatus)
|
||||||
|
}
|
||||||
@ -63,6 +63,24 @@ func CheckUserOrder(userID uint64) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 校验用户是否首次购买
|
||||||
|
func CheckUserFirstOrder(userID uint64) bool {
|
||||||
|
req := bundle.OrderRecordsDetailRequest{
|
||||||
|
CustomerID: strconv.FormatUint(userID, 10),
|
||||||
|
Status: 2,
|
||||||
|
}
|
||||||
|
records, _ := service.BundleProvider.OrderRecordsDetail(context.Background(), &req)
|
||||||
|
// 用户没有任何订单记录
|
||||||
|
if records.OrderRecord == nil {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
// 检查订单是否属于该用户
|
||||||
|
if records.OrderRecord.CustomerID != strconv.FormatUint(userID, 10) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
// 获取最后一次合同编号
|
// 获取最后一次合同编号
|
||||||
func GetLastContractNo() (string, error) {
|
func GetLastContractNo() (string, error) {
|
||||||
records, err := service.BundleProvider.OrderRecordsList(context.Background(), &bundle.OrderRecordsRequest{
|
records, err := service.BundleProvider.OrderRecordsList(context.Background(), &bundle.OrderRecordsRequest{
|
||||||
@ -94,6 +112,7 @@ func BuildServiceRecords(req *bundle.OrderCreateRecord, bundleDetail *bundle.Bun
|
|||||||
expirationDay string
|
expirationDay string
|
||||||
addUidService = make(map[string]bool)
|
addUidService = make(map[string]bool)
|
||||||
bundleUidService = make(map[string]bool)
|
bundleUidService = make(map[string]bool)
|
||||||
|
foundExpiration = false
|
||||||
)
|
)
|
||||||
|
|
||||||
// 分类权益
|
// 分类权益
|
||||||
@ -149,12 +168,15 @@ func BuildServiceRecords(req *bundle.OrderCreateRecord, bundleDetail *bundle.Bun
|
|||||||
addRecords = append(addRecords, buildAddRecord(addService, uid, 0, num, 1))
|
addRecords = append(addRecords, buildAddRecord(addService, uid, 0, num, 1))
|
||||||
|
|
||||||
// 计算到期时间
|
// 计算到期时间
|
||||||
if addService.ServiceType == 5 {
|
if !foundExpiration && addService.ServiceType == 5 {
|
||||||
expirationDay = calculateExpirationDate(time.Now(), num, addService.Unit)
|
expirationDay = calculateExpirationDate(time.Now(), num, addService.Unit)
|
||||||
} else {
|
foundExpiration = true
|
||||||
expirationDay = time.Now().AddDate(0, 0, 7).Format("2006-01-02")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 如果没有找到服务类型为5的,使用默认值
|
||||||
|
if !foundExpiration {
|
||||||
|
expirationDay = time.Now().AddDate(0, 0, 7).Format("2006-01-02")
|
||||||
|
}
|
||||||
|
|
||||||
return addRecords, addTotalPrice, expirationDay, nil
|
return addRecords, addTotalPrice, expirationDay, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,14 +8,13 @@ import (
|
|||||||
"fonchain-fiee/pkg/service/upload"
|
"fonchain-fiee/pkg/service/upload"
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"strconv"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/signintech/gopdf"
|
"github.com/signintech/gopdf"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
)
|
)
|
||||||
|
|
||||||
func SignContractV2(customerNum, contract string, price float32, expirationDate string) (outputUrl string, err error) {
|
func SignContractV2(customerNum, contract string, price float32, expirationDate string, nickName string, idCard string, address string) (outputUrl string, err error) {
|
||||||
filePath := model.MediaPath + customerNum + time.Now().Format("20060102150405") + ".pdf"
|
filePath := model.MediaPath + customerNum + time.Now().Format("20060102150405") + ".pdf"
|
||||||
downloadFileErr := DownloadFile(filePath, contract)
|
downloadFileErr := DownloadFile(filePath, contract)
|
||||||
if downloadFileErr != nil {
|
if downloadFileErr != nil {
|
||||||
@ -32,7 +31,7 @@ func SignContractV2(customerNum, contract string, price float32, expirationDate
|
|||||||
return outputUrl, errors.New(common.ErrorInsertSignature)
|
return outputUrl, errors.New(common.ErrorInsertSignature)
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
signErr := InsertSignatureV2(filePath, signFile, price, expirationDate)
|
signErr := InsertSignatureV2(filePath, signFile, price, expirationDate, nickName, idCard, address)
|
||||||
if signErr != nil {
|
if signErr != nil {
|
||||||
zap.L().Error("insert signature error: ", zap.Error(signErr))
|
zap.L().Error("insert signature error: ", zap.Error(signErr))
|
||||||
return outputUrl, errors.New(common.ErrorInsertSignature)
|
return outputUrl, errors.New(common.ErrorInsertSignature)
|
||||||
@ -47,7 +46,7 @@ func SignContractV2(customerNum, contract string, price float32, expirationDate
|
|||||||
return outputUrl, nil
|
return outputUrl, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func InsertSignatureV2(templatePath, outputPath string, price float32, expirationDate string) error {
|
func InsertSignatureV2(templatePath, outputPath string, price float32, expirationDate string, nickName string, idCard string, address string) error {
|
||||||
fmt.Println("================================templatePath:", templatePath)
|
fmt.Println("================================templatePath:", templatePath)
|
||||||
fmt.Println("================================outputPath:", outputPath)
|
fmt.Println("================================outputPath:", outputPath)
|
||||||
fmt.Println("================================price:", price)
|
fmt.Println("================================price:", price)
|
||||||
@ -65,9 +64,9 @@ func InsertSignatureV2(templatePath, outputPath string, price float32, expiratio
|
|||||||
totalPages := pdf.GetNumberOfPages()
|
totalPages := pdf.GetNumberOfPages()
|
||||||
fmt.Printf("模板文件的总页数: %d\n", totalPages)
|
fmt.Printf("模板文件的总页数: %d\n", totalPages)
|
||||||
|
|
||||||
pricePage := 3
|
onePage := 1
|
||||||
|
sixPage := 6
|
||||||
limitTimePage := 4
|
tenPage := 10
|
||||||
|
|
||||||
tffErr := pdf.AddTTFFont("simfang", "./data/simfang.ttf")
|
tffErr := pdf.AddTTFFont("simfang", "./data/simfang.ttf")
|
||||||
if tffErr != nil {
|
if tffErr != nil {
|
||||||
@ -82,42 +81,54 @@ func InsertSignatureV2(templatePath, outputPath string, price float32, expiratio
|
|||||||
log.Fatalf("设置字体失败: %v", err)
|
log.Fatalf("设置字体失败: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 填 金额
|
|
||||||
pdf.SetPage(pricePage)
|
|
||||||
pdf.SetX(383)
|
|
||||||
pdf.SetY(351)
|
|
||||||
pdf.Cell(nil, strconv.FormatFloat(float64(price), 'f', 2, 64))
|
|
||||||
|
|
||||||
pdf.SetX(345)
|
|
||||||
pdf.SetY(383)
|
|
||||||
pdf.Cell(nil, strconv.FormatFloat(float64(price), 'f', 2, 64))
|
|
||||||
// 写 有效期
|
|
||||||
pdf.SetPage(limitTimePage)
|
|
||||||
|
|
||||||
// 英文格式的时间
|
// 英文格式的时间
|
||||||
parsedTime, err := time.Parse("2006-01-02", expirationDate)
|
parsedTime, err := time.Parse("2006-01-02", expirationDate)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic("日期格式错误!")
|
fmt.Println("时间解析错误: %v", err)
|
||||||
|
fmt.Println(expirationDate)
|
||||||
|
return errors.New("时间解析错误")
|
||||||
}
|
}
|
||||||
year := parsedTime.Format("2006") // "2006"
|
year := parsedTime.Format("2006") // "2006"
|
||||||
month := parsedTime.Format("01") // "01"
|
month := parsedTime.Format("01") // "01"
|
||||||
day := parsedTime.Format("02") // "02"
|
day := parsedTime.Format("02") // "02"
|
||||||
pdf.SetX(160)
|
// 填 第一页 日期-姓名-身份证号
|
||||||
pdf.SetY(387)
|
pdf.SetPage(onePage)
|
||||||
pdf.Cell(nil, expirationDate)
|
pdf.SetX(232)
|
||||||
|
pdf.SetY(152)
|
||||||
pdf.SetX(330)
|
|
||||||
pdf.SetY(403)
|
|
||||||
pdf.Cell(nil, year)
|
pdf.Cell(nil, year)
|
||||||
|
pdf.SetX(279)
|
||||||
pdf.SetX(396)
|
pdf.SetY(152)
|
||||||
pdf.SetY(403)
|
|
||||||
pdf.Cell(nil, month)
|
pdf.Cell(nil, month)
|
||||||
|
pdf.SetX(313)
|
||||||
pdf.SetX(443)
|
pdf.SetY(152)
|
||||||
pdf.SetY(403)
|
|
||||||
pdf.Cell(nil, day)
|
pdf.Cell(nil, day)
|
||||||
|
pdf.SetX(370)
|
||||||
|
pdf.SetY(152)
|
||||||
|
pdf.Cell(nil, nickName)
|
||||||
|
pdf.SetX(175)
|
||||||
|
pdf.SetY(170)
|
||||||
|
pdf.Cell(nil, idCard)
|
||||||
|
//pdf.Cell(nil, strconv.FormatFloat(float64(price), 'f', 2, 64))
|
||||||
|
|
||||||
|
// 写 第六页 日期
|
||||||
|
pdf.SetPage(sixPage)
|
||||||
|
pdf.SetX(343)
|
||||||
|
pdf.SetY(138)
|
||||||
|
pdf.Cell(nil, year)
|
||||||
|
pdf.SetX(401)
|
||||||
|
pdf.SetY(138)
|
||||||
|
pdf.Cell(nil, month)
|
||||||
|
pdf.SetX(447)
|
||||||
|
pdf.SetY(138)
|
||||||
|
pdf.Cell(nil, day)
|
||||||
|
// 写 第十页 地址 姓名 邮件
|
||||||
|
pdf.SetPage(tenPage)
|
||||||
|
pdf.SetX(195)
|
||||||
|
pdf.SetY(253)
|
||||||
|
pdf.Cell(nil, address)
|
||||||
|
pdf.SetX(215)
|
||||||
|
pdf.SetY(270)
|
||||||
|
pdf.Cell(nil, nickName)
|
||||||
// 生成新的 PDF
|
// 生成新的 PDF
|
||||||
if err = pdf.WritePdf(outputPath); err != nil {
|
if err = pdf.WritePdf(outputPath); err != nil {
|
||||||
//zap.L().Error("WritePdf err", zap.Error(err))
|
//zap.L().Error("WritePdf err", zap.Error(err))
|
||||||
|
|||||||
@ -2,7 +2,6 @@ package bundle
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"dubbo.apache.org/dubbo-go/v3/common/logger"
|
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
@ -10,6 +9,7 @@ import (
|
|||||||
"fonchain-fiee/api/bundle"
|
"fonchain-fiee/api/bundle"
|
||||||
"fonchain-fiee/api/order"
|
"fonchain-fiee/api/order"
|
||||||
"fonchain-fiee/api/payment"
|
"fonchain-fiee/api/payment"
|
||||||
|
"fonchain-fiee/pkg/cache"
|
||||||
"fonchain-fiee/pkg/config"
|
"fonchain-fiee/pkg/config"
|
||||||
"fonchain-fiee/pkg/model/login"
|
"fonchain-fiee/pkg/model/login"
|
||||||
"fonchain-fiee/pkg/service"
|
"fonchain-fiee/pkg/service"
|
||||||
@ -19,6 +19,9 @@ import (
|
|||||||
"math"
|
"math"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"dubbo.apache.org/dubbo-go/v3/common/logger"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/gin-gonic/gin/binding"
|
"github.com/gin-gonic/gin/binding"
|
||||||
@ -141,7 +144,13 @@ func CreateAntomPay(c *gin.Context) {
|
|||||||
|
|
||||||
// 获取 用户信息
|
// 获取 用户信息
|
||||||
userInfo := login.GetUserInfoFromC(c)
|
userInfo := login.GetUserInfoFromC(c)
|
||||||
|
// 创建审批 防止重复提交
|
||||||
|
lockKey := fmt.Sprintf("create_antom_pay_%v", userInfo.ID)
|
||||||
|
reply := cache.RedisClient.SetNX(lockKey, 0, 5*time.Second)
|
||||||
|
if !reply.Val() {
|
||||||
|
service.Error(c, errors.New(common.CreateBundleFailed))
|
||||||
|
return
|
||||||
|
}
|
||||||
// outTradeNo就是orderNo,根据这个去查询子表的source,如果是2就时单独的子套餐,如果是1就是主套餐
|
// outTradeNo就是orderNo,根据这个去查询子表的source,如果是2就时单独的子套餐,如果是1就是主套餐
|
||||||
orderLimit, err := service.BundleProvider.OrderListByOrderNo(context.Background(), &bundle.OrderInfoByOrderNoRequest{
|
orderLimit, err := service.BundleProvider.OrderListByOrderNo(context.Background(), &bundle.OrderInfoByOrderNoRequest{
|
||||||
OrderNo: req.OutTradeNo,
|
OrderNo: req.OutTradeNo,
|
||||||
|
|||||||
@ -2,6 +2,7 @@ package bundle
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"fonchain-fiee/api/accountFiee"
|
"fonchain-fiee/api/accountFiee"
|
||||||
"fonchain-fiee/api/bundle"
|
"fonchain-fiee/api/bundle"
|
||||||
@ -276,6 +277,7 @@ func AutoCreateUserAndOrder(c *gin.Context) {
|
|||||||
var TotalPrice float32
|
var TotalPrice float32
|
||||||
var expirationDay string
|
var expirationDay string
|
||||||
numMap := make(map[string]int32)
|
numMap := make(map[string]int32)
|
||||||
|
numMap["1500.00"] = 0
|
||||||
numMap["3150.00"] = 3
|
numMap["3150.00"] = 3
|
||||||
numMap["4200.00"] = 5
|
numMap["4200.00"] = 5
|
||||||
numMap["5600.00"] = 8
|
numMap["5600.00"] = 8
|
||||||
@ -288,6 +290,7 @@ func AutoCreateUserAndOrder(c *gin.Context) {
|
|||||||
numMap["18300.00"] = 40
|
numMap["18300.00"] = 40
|
||||||
numMap["26700.00"] = 60
|
numMap["26700.00"] = 60
|
||||||
incrMap := make(map[string]float32)
|
incrMap := make(map[string]float32)
|
||||||
|
incrMap["1500.00"] = 0
|
||||||
incrMap["3150.00"] = 1650
|
incrMap["3150.00"] = 1650
|
||||||
incrMap["4200.00"] = 2700
|
incrMap["4200.00"] = 2700
|
||||||
incrMap["5600.00"] = 4100
|
incrMap["5600.00"] = 4100
|
||||||
@ -363,7 +366,7 @@ func AutoCreateUserAndOrder(c *gin.Context) {
|
|||||||
ValueUid: accountUuid,
|
ValueUid: accountUuid,
|
||||||
CurrencyType: 2, //美元
|
CurrencyType: 2, //美元
|
||||||
Amount: 0, //增值服务金额
|
Amount: 0, //增值服务金额
|
||||||
Num: 3,
|
Num: 5,
|
||||||
Unit: "个",
|
Unit: "个",
|
||||||
Source: 1,
|
Source: 1,
|
||||||
PaymentStatus: 1,
|
PaymentStatus: 1,
|
||||||
@ -385,9 +388,10 @@ func AutoCreateUserAndOrder(c *gin.Context) {
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
// 当前 未将 签名 写入合同中 todo 金额和有效时间待修改
|
// 当前 未将 签名 写入合同中 todo 金额和有效时间待修改
|
||||||
contract := "https://e-cdn.fontree.cn/fonchain-main/prod/file/saas/contract/template-25032801.pdf"
|
contract := ContractUrl
|
||||||
expirationDay = t.AddDate(1, 0, 0).Format("2006-01-02")
|
expirationDay = t.AddDate(1, 0, 0).Format("2006-01-02")
|
||||||
signContract, signContractErr := logic.SignContractV2(userReq.UserNum, contract, TotalPrice, expirationDay)
|
|
||||||
|
signContract, signContractErr := logic.SignContractV2(userReq.UserNum, contract, TotalPrice, expirationDay, unfinishInfo.UserName, unfinishInfo.CardNum, unfinishInfo.PlaceOfResidence)
|
||||||
if signContractErr != nil {
|
if signContractErr != nil {
|
||||||
service.Error(c, signContractErr)
|
service.Error(c, signContractErr)
|
||||||
return
|
return
|
||||||
@ -414,6 +418,7 @@ func AutoCreateUserAndOrder(c *gin.Context) {
|
|||||||
orderReq.OrderNo = unfinishInfo.OrderNo
|
orderReq.OrderNo = unfinishInfo.OrderNo
|
||||||
//expirationTime := t.AddDate(10, 0, 0).Format("2006-01-02 15:04:05")
|
//expirationTime := t.AddDate(10, 0, 0).Format("2006-01-02 15:04:05")
|
||||||
//orderReq.ExpirationTime = expirationTime
|
//orderReq.ExpirationTime = expirationTime
|
||||||
|
orderReq.PlatformIds = []uint32{1, 4, 5}
|
||||||
_, err = service.BundleProvider.CreateOrderRecord(context.Background(), &orderReq)
|
_, err = service.BundleProvider.CreateOrderRecord(context.Background(), &orderReq)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
service.Error(c, err)
|
service.Error(c, err)
|
||||||
@ -547,3 +552,21 @@ func AutoCreateUserAndOrder(c *gin.Context) {
|
|||||||
return
|
return
|
||||||
|
|
||||||
}
|
}
|
||||||
|
func QueryTheOrderSnapshotInformation(c *gin.Context) {
|
||||||
|
var req bundle.QueryTheOrderSnapshotInformationReq
|
||||||
|
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
|
||||||
|
service.Error(c, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if req.OrderNo == "" {
|
||||||
|
service.Error(c, errors.New("订单号不能为空"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
res, err := service.BundleProvider.QueryTheOrderSnapshotInformation(context.Background(), &req)
|
||||||
|
if err != nil {
|
||||||
|
service.Error(c, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
service.Success(c, res)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|||||||
2683
pkg/service/cast/analysis.go
Normal file
2683
pkg/service/cast/analysis.go
Normal file
File diff suppressed because it is too large
Load Diff
@ -6,6 +6,10 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"fonchain-fiee/api/aryshare"
|
||||||
|
"fonchain-fiee/api/cast"
|
||||||
|
modelCast "fonchain-fiee/pkg/model/cast"
|
||||||
|
"fonchain-fiee/pkg/service"
|
||||||
"fonchain-fiee/pkg/utils"
|
"fonchain-fiee/pkg/utils"
|
||||||
"io"
|
"io"
|
||||||
"mime/multipart"
|
"mime/multipart"
|
||||||
@ -14,6 +18,7 @@ import (
|
|||||||
"path/filepath"
|
"path/filepath"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -56,7 +61,7 @@ func UploadMediaByURL(ctx context.Context, fileURL, fileName, description string
|
|||||||
if fileURL == "" {
|
if fileURL == "" {
|
||||||
return nil, errors.New("文件URL不能为空")
|
return nil, errors.New("文件URL不能为空")
|
||||||
}
|
}
|
||||||
ok, err := VerifyMediaURL(ctx, fileURL)
|
/*ok, err := VerifyMediaURL(ctx, fileURL) // 检测文件是否OK, 关闭遇到了检测OK 发布不OK的 不相信API了
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -68,11 +73,11 @@ func UploadMediaByURL(ctx context.Context, fileURL, fileName, description string
|
|||||||
Description: "",
|
Description: "",
|
||||||
IsAs: false,
|
IsAs: false,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}*/
|
||||||
// 下载文件到临时目录
|
// 下载文件到临时目录
|
||||||
tempFile, fileSize, err := downloadFile(ctx, fileURL)
|
tempFile, fileSize, err := downloadFile(ctx, fileURL)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("下载文件失败: %v", err)
|
return nil, fmt.Errorf("下载文件失败")
|
||||||
}
|
}
|
||||||
defer os.Remove(tempFile) // 清理临时文件
|
defer os.Remove(tempFile) // 清理临时文件
|
||||||
|
|
||||||
@ -82,14 +87,34 @@ func UploadMediaByURL(ctx context.Context, fileURL, fileName, description string
|
|||||||
if fileName == "" {
|
if fileName == "" {
|
||||||
fileName = filepath.Base(fileURL)
|
fileName = filepath.Base(fileURL)
|
||||||
}
|
}
|
||||||
|
var result *UploadMediaResponse
|
||||||
// 根据文件大小选择上传方式
|
// 根据文件大小选择上传方式
|
||||||
if fileSize < maxSmallFileSize {
|
if fileSize < maxSmallFileSize {
|
||||||
zap.L().Info("使用小文件上传方式", zap.Int64("fileSize", fileSize))
|
zap.L().Info("使用小文件上传方式", zap.Int64("fileSize", fileSize))
|
||||||
return uploadSmallMedia(ctx, tempFile, apiKey, fileName, description)
|
result, err = uploadSmallMedia(ctx, tempFile, apiKey, fileName, description)
|
||||||
|
} else {
|
||||||
|
zap.L().Info("使用大文件上传方式", zap.Int64("fileSize", fileSize))
|
||||||
|
result, err = uploadLargeMedia(ctx, tempFile, apiKey, fileName, description)
|
||||||
}
|
}
|
||||||
zap.L().Info("使用大文件上传方式", zap.Int64("fileSize", fileSize))
|
if err != nil {
|
||||||
return uploadLargeMedia(ctx, tempFile, apiKey, fileName, description)
|
return nil, err
|
||||||
|
}
|
||||||
|
// 上传后等待并验证 URL 是否可访问
|
||||||
|
maxRetries := 5
|
||||||
|
var ok bool
|
||||||
|
for i := 0; i < maxRetries; i++ {
|
||||||
|
time.Sleep(2 * time.Second)
|
||||||
|
ok, err = VerifyMediaURL(ctx, result.URL)
|
||||||
|
if err == nil && ok {
|
||||||
|
zap.L().Info("媒体URL验证成功", zap.String("url", result.URL), zap.Int("retry", i))
|
||||||
|
return result, nil
|
||||||
|
}
|
||||||
|
zap.L().Warn("媒体URL验证失败,重试中",
|
||||||
|
zap.String("url", result.URL),
|
||||||
|
zap.Int("retry", i+1),
|
||||||
|
zap.Int("maxRetries", maxRetries))
|
||||||
|
}
|
||||||
|
return nil, fmt.Errorf("媒体URL验证失败")
|
||||||
}
|
}
|
||||||
|
|
||||||
// downloadFile 下载文件到临时目录
|
// downloadFile 下载文件到临时目录
|
||||||
@ -107,7 +132,7 @@ func downloadFile(ctx context.Context, fileURL string) (string, int64, error) {
|
|||||||
defer resp.Body.Close()
|
defer resp.Body.Close()
|
||||||
|
|
||||||
if resp.StatusCode != http.StatusOK {
|
if resp.StatusCode != http.StatusOK {
|
||||||
return "", 0, fmt.Errorf("下载文件失败,HTTP状态码: %d", resp.StatusCode)
|
return "", 0, fmt.Errorf("下载文件失败")
|
||||||
}
|
}
|
||||||
|
|
||||||
// 创建临时文件
|
// 创建临时文件
|
||||||
@ -131,7 +156,7 @@ func downloadFile(ctx context.Context, fileURL string) (string, int64, error) {
|
|||||||
func uploadSmallMedia(ctx context.Context, filePath, apiKey, fileName, description string) (*UploadMediaResponse, error) {
|
func uploadSmallMedia(ctx context.Context, filePath, apiKey, fileName, description string) (*UploadMediaResponse, error) {
|
||||||
file, err := os.Open(filePath)
|
file, err := os.Open(filePath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("打开文件失败: %v", err)
|
return nil, fmt.Errorf("打开文件失败")
|
||||||
}
|
}
|
||||||
defer file.Close()
|
defer file.Close()
|
||||||
|
|
||||||
@ -173,23 +198,23 @@ func uploadSmallMedia(ctx context.Context, filePath, apiKey, fileName, descripti
|
|||||||
client := &http.Client{Timeout: 10 * time.Minute}
|
client := &http.Client{Timeout: 10 * time.Minute}
|
||||||
resp, err := client.Do(req)
|
resp, err := client.Do(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("请求失败: %v", err)
|
return nil, fmt.Errorf("请求失败")
|
||||||
}
|
}
|
||||||
defer resp.Body.Close()
|
defer resp.Body.Close()
|
||||||
|
|
||||||
respBody, err := io.ReadAll(resp.Body)
|
respBody, err := io.ReadAll(resp.Body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("读取响应失败: %v", err)
|
return nil, fmt.Errorf("读取响应失败")
|
||||||
}
|
}
|
||||||
|
|
||||||
if resp.StatusCode != http.StatusOK {
|
if resp.StatusCode != http.StatusOK {
|
||||||
zap.L().Error("上传小文件失败", zap.Int("statusCode", resp.StatusCode), zap.String("response", string(respBody)))
|
zap.L().Error("上传小文件失败", zap.Int("statusCode", resp.StatusCode), zap.String("response", string(respBody)))
|
||||||
return nil, fmt.Errorf("上传失败: HTTP %d, %s", resp.StatusCode, string(respBody))
|
return nil, fmt.Errorf("上传失败")
|
||||||
}
|
}
|
||||||
|
|
||||||
var result UploadMediaResponse
|
var result UploadMediaResponse
|
||||||
if err := json.Unmarshal(respBody, &result); err != nil {
|
if err := json.Unmarshal(respBody, &result); err != nil {
|
||||||
return nil, fmt.Errorf("解析响应失败: %v", err)
|
return nil, fmt.Errorf("解析响应失败")
|
||||||
}
|
}
|
||||||
|
|
||||||
zap.L().Info("小文件上传成功", zap.Any("response", result))
|
zap.L().Info("小文件上传成功", zap.Any("response", result))
|
||||||
@ -207,7 +232,7 @@ func uploadLargeMedia(ctx context.Context, filePath, apiKey, fileName, descripti
|
|||||||
// Step 1: 获取上传URL
|
// Step 1: 获取上传URL
|
||||||
uploadURLResp, err := getUploadURL(ctx, apiKey, fileName, ext)
|
uploadURLResp, err := getUploadURL(ctx, apiKey, fileName, ext)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("获取上传URL失败: %v", err)
|
return nil, fmt.Errorf("获取上传URL失败")
|
||||||
}
|
}
|
||||||
|
|
||||||
zap.L().Info("获取上传URL成功", zap.Any("uploadURLResp", uploadURLResp))
|
zap.L().Info("获取上传URL成功", zap.Any("uploadURLResp", uploadURLResp))
|
||||||
@ -215,28 +240,36 @@ func uploadLargeMedia(ctx context.Context, filePath, apiKey, fileName, descripti
|
|||||||
// Step 2: 上传文件到presigned URL
|
// Step 2: 上传文件到presigned URL
|
||||||
file, err := os.Open(filePath)
|
file, err := os.Open(filePath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("打开文件失败: %v", err)
|
return nil, fmt.Errorf("打开文件失败")
|
||||||
}
|
}
|
||||||
defer file.Close()
|
defer file.Close()
|
||||||
|
|
||||||
|
// 获取文件大小
|
||||||
|
fileInfo, err := file.Stat()
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("获取文件信息失败")
|
||||||
|
}
|
||||||
|
fileSize := fileInfo.Size()
|
||||||
|
|
||||||
req, err := http.NewRequestWithContext(ctx, "PUT", uploadURLResp.UploadURL, file)
|
req, err := http.NewRequestWithContext(ctx, "PUT", uploadURLResp.UploadURL, file)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
req.Header.Set("Content-Type", uploadURLResp.ContentType)
|
req.Header.Set("Content-Type", uploadURLResp.ContentType)
|
||||||
|
req.ContentLength = fileSize // 设置Content-Length
|
||||||
|
|
||||||
client := &http.Client{Timeout: 30 * time.Minute}
|
client := &http.Client{Timeout: 30 * time.Minute}
|
||||||
resp, err := client.Do(req)
|
resp, err := client.Do(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("上传文件失败: %v", err)
|
return nil, fmt.Errorf("上传文件失败")
|
||||||
}
|
}
|
||||||
defer resp.Body.Close()
|
defer resp.Body.Close()
|
||||||
|
|
||||||
if resp.StatusCode != http.StatusOK {
|
if resp.StatusCode != http.StatusOK {
|
||||||
respBody, _ := io.ReadAll(resp.Body)
|
respBody, _ := io.ReadAll(resp.Body)
|
||||||
zap.L().Error("上传大文件失败", zap.Int("statusCode", resp.StatusCode), zap.String("response", string(respBody)))
|
zap.L().Error("上传大文件失败", zap.Int("statusCode", resp.StatusCode), zap.String("response", string(respBody)))
|
||||||
return nil, fmt.Errorf("上传失败: HTTP %d", resp.StatusCode)
|
return nil, fmt.Errorf("上传失败")
|
||||||
}
|
}
|
||||||
|
|
||||||
zap.L().Info("大文件上传成功")
|
zap.L().Info("大文件上传成功")
|
||||||
@ -277,12 +310,12 @@ func getUploadURL(ctx context.Context, apiKey, fileName, contentType string) (*U
|
|||||||
|
|
||||||
if resp.StatusCode != http.StatusOK {
|
if resp.StatusCode != http.StatusOK {
|
||||||
zap.L().Error("获取上传URL失败", zap.Int("statusCode", resp.StatusCode), zap.String("response", string(respBody)))
|
zap.L().Error("获取上传URL失败", zap.Int("statusCode", resp.StatusCode), zap.String("response", string(respBody)))
|
||||||
return nil, fmt.Errorf("获取上传URL失败: HTTP %d, %s", resp.StatusCode, string(respBody))
|
return nil, fmt.Errorf("获取上传URL失败了")
|
||||||
}
|
}
|
||||||
|
|
||||||
var result UploadURLResponse
|
var result UploadURLResponse
|
||||||
if err := json.Unmarshal(respBody, &result); err != nil {
|
if err := json.Unmarshal(respBody, &result); err != nil {
|
||||||
return nil, fmt.Errorf("解析响应失败: %v", err)
|
return nil, fmt.Errorf("解析响应失败")
|
||||||
}
|
}
|
||||||
|
|
||||||
return &result, nil
|
return &result, nil
|
||||||
@ -313,3 +346,215 @@ func VerifyMediaURL(ctx context.Context, mediaURL string) (bool, error) {
|
|||||||
}
|
}
|
||||||
return true, nil
|
return true, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func SendMessage(ctx *gin.Context) {
|
||||||
|
var req modelCast.SendMessageReq
|
||||||
|
if err := ctx.ShouldBindJSON(&req); err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if req.RecipientId == "" {
|
||||||
|
service.Error(ctx, errors.New("请选择接收者"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
mediaUserInfo, err := GetMediaInfo(req.MediaAccountUuid)
|
||||||
|
if err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var platformName = modelCast.PlatformNameKv[req.PlatformID]
|
||||||
|
if platformName != "facebook" && platformName != "instagram" && platformName != "twitter" {
|
||||||
|
service.Error(ctx, errors.New("不支持的媒体"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
sendResp, err := service.AyrshareProvider.SendMessage(context.Background(), &aryshare.SendMessageRequest{
|
||||||
|
Platform: platformName,
|
||||||
|
RecipientId: req.RecipientId,
|
||||||
|
Message: req.Message,
|
||||||
|
MediaUrls: []string{},
|
||||||
|
ProfileKey: mediaUserInfo.AsInfo.ProfileKey,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
zap.L().Error("发送消息失败", zap.Error(err), zap.Any("mediaInfo", mediaUserInfo))
|
||||||
|
service.Error(ctx, errors.New("发送消息异常"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if sendResp.Status != "success" {
|
||||||
|
zap.L().Error("发送消息失败", zap.Any("sendResp", sendResp))
|
||||||
|
service.Error(ctx, errors.New("发送消息失败"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
service.Success(ctx, sendResp)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func GetMessage(ctx *gin.Context) {
|
||||||
|
var req modelCast.SendMessageReq
|
||||||
|
if err := ctx.ShouldBindJSON(&req); err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
mediaUserInfo, err := GetMediaInfo(req.MediaAccountUuid)
|
||||||
|
if err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var platformName = modelCast.PlatformNameKv[mediaUserInfo.PlatformID]
|
||||||
|
messageResp, err := service.AyrshareProvider.GetMessages(context.Background(), &aryshare.GetMessagesRequest{
|
||||||
|
Platform: platformName,
|
||||||
|
Status: "active", // active 主动 archived 已存档
|
||||||
|
ConversationId: "",
|
||||||
|
ConversationsOnly: false,
|
||||||
|
ProfileKey: mediaUserInfo.AsInfo.ProfileKey,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
zap.L().Error("获取消息失败", zap.Error(err), zap.Any("mediaInfo", mediaUserInfo))
|
||||||
|
service.Error(ctx, errors.New("获取消息异常"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if messageResp.Status != "success" {
|
||||||
|
zap.L().Error("获取消息失败", zap.Any("messageResp", messageResp))
|
||||||
|
service.Error(ctx, errors.New("获取消息失败"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
service.Success(ctx, messageResp)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetMediaInfo 根据自媒体ID查询信息
|
||||||
|
func GetMediaInfo(mediaUserID string) (*cast.MediaUserInfo, error) {
|
||||||
|
userListResp, err := service.CastProvider.MediaUserList(context.Background(), &cast.MediaUserListReq{
|
||||||
|
MediaUserID: mediaUserID,
|
||||||
|
NeedAsInfo: true,
|
||||||
|
PageSize: 1,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if userListResp == nil || len(userListResp.Data) == 0 {
|
||||||
|
return nil, errors.New("未找到该自媒体")
|
||||||
|
}
|
||||||
|
return userListResp.Data[0], nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func PostComment(ctx *gin.Context) {
|
||||||
|
var req modelCast.PostCommentReq
|
||||||
|
if err := ctx.ShouldBindJSON(&req); err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
artistInfo, err := service.CastProvider.ArtistInfo(context.Background(), &cast.ArtistInfoReq{
|
||||||
|
ArtistUuid: req.ArtistUuid,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
commentReq := &aryshare.PostCommentRequest{
|
||||||
|
Id: req.PublishMediaID,
|
||||||
|
Comment: req.Comment,
|
||||||
|
Platforms: []string{modelCast.PlatformNameKv[uint32(req.PlatformID)]},
|
||||||
|
SearchPlatformId: false,
|
||||||
|
MediaUrls: nil,
|
||||||
|
ProfileKey: artistInfo.ProfileKey,
|
||||||
|
}
|
||||||
|
zap.L().Info("发布评论", zap.Any("commentReq", commentReq))
|
||||||
|
commentResp, err := service.AyrshareProvider.PostComment(context.Background(), commentReq)
|
||||||
|
if err != nil {
|
||||||
|
zap.L().Error("发布评论异常", zap.Error(err), zap.Any("artistInfo", artistInfo))
|
||||||
|
service.Error(ctx, errors.New("发布评论异常"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if commentResp.Status != "success" {
|
||||||
|
service.Error(ctx, errors.New("发布评论失败"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
service.Success(ctx, commentResp)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func GetComment(ctx *gin.Context) {
|
||||||
|
var req modelCast.GetCommentReq
|
||||||
|
if err := ctx.ShouldBindJSON(&req); err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
artistInfo, err := service.CastProvider.ArtistInfo(context.Background(), &cast.ArtistInfoReq{
|
||||||
|
ArtistUuid: req.ArtistUuid,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
commentResp, err := service.AyrshareProvider.GetComment(context.Background(), &aryshare.GetCommentRequest{
|
||||||
|
Id: req.PublishMediaID,
|
||||||
|
ProfileKey: artistInfo.ProfileKey,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
service.Success(ctx, commentResp)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func DeleteComment(ctx *gin.Context) {
|
||||||
|
var req modelCast.DeleteCommentReq
|
||||||
|
if err := ctx.ShouldBindJSON(&req); err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
artistInfo, err := service.CastProvider.ArtistInfo(context.Background(), &cast.ArtistInfoReq{
|
||||||
|
ArtistUuid: req.ArtistUuid,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
commentResp, err := service.AyrshareProvider.DeleteComment(context.Background(), &aryshare.DeleteCommentRequest{
|
||||||
|
Id: req.CommentId,
|
||||||
|
Platforms: nil,
|
||||||
|
Platform: modelCast.PlatformNameKv[uint32(req.PlatformID)],
|
||||||
|
SearchPlatformId: true,
|
||||||
|
ProfileKey: artistInfo.ProfileKey,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
zap.L().Error("删除评论异常", zap.Error(err), zap.Any("artistInfo", artistInfo))
|
||||||
|
service.Error(ctx, errors.New("删除评论异常"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if commentResp.Status != "success" {
|
||||||
|
service.Error(ctx, errors.New("删除评论失败"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
service.Success(ctx, commentResp)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func ReplyComment(ctx *gin.Context) {
|
||||||
|
var req modelCast.ReplyCommentReq
|
||||||
|
if err := ctx.ShouldBindJSON(&req); err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
artistInfo, err := service.CastProvider.ArtistInfo(context.Background(), &cast.ArtistInfoReq{
|
||||||
|
ArtistUuid: req.ArtistUuid,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
commentResp, err := service.AyrshareProvider.ReplyComment(context.Background(), &aryshare.ReplyCommentRequest{
|
||||||
|
Id: req.CommentId,
|
||||||
|
Comment: req.Comment,
|
||||||
|
Platforms: []string{modelCast.PlatformNameKv[uint32(req.PlatformID)]},
|
||||||
|
ProfileKey: artistInfo.ProfileKey,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
zap.L().Error("回复评论异常", zap.Error(err), zap.Any("artistInfo", artistInfo))
|
||||||
|
service.Error(ctx, errors.New("回复评论异常"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
service.Success(ctx, commentResp)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|||||||
@ -12,12 +12,19 @@ import (
|
|||||||
"fonchain-fiee/cmd/config"
|
"fonchain-fiee/cmd/config"
|
||||||
"fonchain-fiee/pkg/e"
|
"fonchain-fiee/pkg/e"
|
||||||
modelCast "fonchain-fiee/pkg/model/cast"
|
modelCast "fonchain-fiee/pkg/model/cast"
|
||||||
|
"fonchain-fiee/pkg/model/login"
|
||||||
"fonchain-fiee/pkg/service"
|
"fonchain-fiee/pkg/service"
|
||||||
|
"fonchain-fiee/pkg/utils"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
"os"
|
||||||
|
"path/filepath"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
"strings"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
"github.com/xuri/excelize/v2"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -37,6 +44,45 @@ func MediaUserList(ctx *gin.Context) {
|
|||||||
service.Error(ctx, err)
|
service.Error(ctx, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if req.NeedStats {
|
||||||
|
var statResp *bundle.ArtistUploadStatsResponse
|
||||||
|
zap.L().Info("MediaUserList 1")
|
||||||
|
//取出艺人num
|
||||||
|
var artistSubNums []string
|
||||||
|
for _, v := range resp.Data {
|
||||||
|
artistSubNums = append(artistSubNums, v.ArtistSubNum)
|
||||||
|
}
|
||||||
|
statResp, err = service.BundleProvider.GetArtistUploadStatsList(context.Background(), &bundle.TaskQueryRequest{
|
||||||
|
Keyword: "",
|
||||||
|
Page: 0,
|
||||||
|
PageSize: 0,
|
||||||
|
SortBy: "",
|
||||||
|
SortType: "",
|
||||||
|
LastTaskAssignee: "",
|
||||||
|
SubNums: artistSubNums,
|
||||||
|
})
|
||||||
|
zap.L().Info("MediaUserList 2")
|
||||||
|
if err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
for _, v := range resp.Data {
|
||||||
|
for _, vv := range statResp.Items {
|
||||||
|
if v.ArtistSubNum == vv.SubNum {
|
||||||
|
info := vv
|
||||||
|
// "pendingVideoCount": 10, // 待上传视频数 "uploadedVideoCount": 25, // 已上传视频数 "releasedVideoTotal": 35, // 已释放视频总数
|
||||||
|
//"pendingPostCount": 14, // 待上传图文数 "uploadedPostCount": 21, // 已上传图文数 "releasedPostTotal": 35, // 已释放图文总数
|
||||||
|
v.PendingVideoCount = info.PendingVideoCount
|
||||||
|
v.UploadedVideoCount = info.UploadedVideoCount
|
||||||
|
v.ReleasedVideoTotal = info.ReleasedVideoTotal
|
||||||
|
v.PendingPostCount = info.PendingPostCount
|
||||||
|
v.UploadedPostCount = info.UploadedPostCount
|
||||||
|
v.ReleasedPostTotal = info.ReleasedPostTotal
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
zap.L().Info("MediaUserList 3")
|
||||||
go func() {
|
go func() {
|
||||||
for _, v := range resp.Data {
|
for _, v := range resp.Data {
|
||||||
_ = SyncAsAuth(v.ArtistUuid)
|
_ = SyncAsAuth(v.ArtistUuid)
|
||||||
@ -130,7 +176,7 @@ func UpdateMediaAccount(ctx *gin.Context) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 字符串转整型
|
// 字符串转整型
|
||||||
artistID, err := strconv.ParseUint(req.ArtistUuid, 10, 64)
|
artistID, _ := strconv.ParseUint(req.ArtistUuid, 10, 64)
|
||||||
infoResp, err = GetArtistAccountInfo(artistID)
|
infoResp, err = GetArtistAccountInfo(artistID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
service.Error(ctx, err)
|
service.Error(ctx, err)
|
||||||
@ -140,8 +186,6 @@ func UpdateMediaAccount(ctx *gin.Context) {
|
|||||||
service.Error(ctx, errors.New("用户不存在"))
|
service.Error(ctx, errors.New("用户不存在"))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO 判断是否注册ay
|
|
||||||
if err = CheckAsProfile(infoResp); err != nil {
|
if err = CheckAsProfile(infoResp); err != nil {
|
||||||
service.Error(ctx, err)
|
service.Error(ctx, err)
|
||||||
return
|
return
|
||||||
@ -149,13 +193,14 @@ func UpdateMediaAccount(ctx *gin.Context) {
|
|||||||
req.ArtistName = infoResp.Name
|
req.ArtistName = infoResp.Name
|
||||||
req.ArtistPhone = infoResp.TelNum
|
req.ArtistPhone = infoResp.TelNum
|
||||||
req.ArtistPhoneAreaCode = infoResp.TelAreaCode
|
req.ArtistPhoneAreaCode = infoResp.TelAreaCode
|
||||||
|
req.ArtistSubNum = infoResp.SubNum
|
||||||
if _, ok := cast.PlatformIDENUM_name[int32(req.PlatformID)]; !ok {
|
if _, ok := cast.PlatformIDENUM_name[int32(req.PlatformID)]; !ok {
|
||||||
service.Error(ctx, errors.New(e.GetMsg(e.InvalidParams)))
|
service.Error(ctx, errors.New(e.GetMsg(e.InvalidParams)))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
userID, _ := strconv.ParseInt(req.ArtistUuid, 10, 64)
|
userID, _ := strconv.ParseInt(req.ArtistUuid, 10, 64)
|
||||||
if req.MediaAccountUuid == "" {
|
if req.MediaAccountUuid == "" {
|
||||||
if err = CheckUserBundleBalance(int32(userID), modelCast.BalanceTypeAccountValue); err != nil {
|
if _, err = CheckUserBundleBalance(int32(userID), modelCast.BalanceTypeAccountValue); err != nil {
|
||||||
service.Error(ctx, err)
|
service.Error(ctx, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -280,6 +325,7 @@ func OAuth2Callback(ctx *gin.Context) {
|
|||||||
service.Error(ctx, errors.New(e.GetMsg(e.InvalidParams)))
|
service.Error(ctx, errors.New(e.GetMsg(e.InvalidParams)))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
req.State = state
|
||||||
zap.L().Info("OAuth2Callback", zap.Any("req", req), zap.Any("code", code), zap.Any("state", state))
|
zap.L().Info("OAuth2Callback", zap.Any("req", req), zap.Any("code", code), zap.Any("state", state))
|
||||||
_, err := service.CastProvider.OAuthCodeToToken(ctx, req)
|
_, err := service.CastProvider.OAuthCodeToToken(ctx, req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -325,6 +371,7 @@ func AsOAuth2Callback(ctx *gin.Context) {
|
|||||||
func SyncAsAuth(artistUuid string) error {
|
func SyncAsAuth(artistUuid string) error {
|
||||||
resp, err := service.CastProvider.GetArtist(context.Background(), &cast.GetArtistReq{ArtistUuid: artistUuid})
|
resp, err := service.CastProvider.GetArtist(context.Background(), &cast.GetArtistReq{ArtistUuid: artistUuid})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
zap.L().Error("SyncAsAuth error", zap.Error(err))
|
||||||
return errors.New("获取艺人信息错误")
|
return errors.New("获取艺人信息错误")
|
||||||
}
|
}
|
||||||
if resp == nil || resp.ArtistInfo == nil || resp.ArtistInfo.ProfileKey == "" {
|
if resp == nil || resp.ArtistInfo == nil || resp.ArtistInfo.ProfileKey == "" {
|
||||||
@ -335,10 +382,10 @@ func SyncAsAuth(artistUuid string) error {
|
|||||||
InstagramDetails: true,
|
InstagramDetails: true,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
zap.L().Error("SyncAsAuth error", zap.Error(err))
|
||||||
return errors.New("获取艺人绑定信息错误")
|
return errors.New("获取艺人绑定信息错误")
|
||||||
}
|
}
|
||||||
var authReq *cast.UpdateOAuthReq
|
authReq := &cast.UpdateOAuthReq{Data: make([]*cast.UpdateOAuthReq_Info, 0)}
|
||||||
authReq = &cast.UpdateOAuthReq{Data: make([]*cast.UpdateOAuthReq_Info, 0)}
|
|
||||||
if len(userResp.DisplayNames) == 0 {
|
if len(userResp.DisplayNames) == 0 {
|
||||||
//return errors.New("没有授权信息")
|
//return errors.New("没有授权信息")
|
||||||
authReq.Data = append(authReq.Data, &cast.UpdateOAuthReq_Info{
|
authReq.Data = append(authReq.Data, &cast.UpdateOAuthReq_Info{
|
||||||
@ -362,10 +409,14 @@ func SyncAsAuth(artistUuid string) error {
|
|||||||
if platformIDENUM == cast.PlatformIDENUM_UNKNOWN {
|
if platformIDENUM == cast.PlatformIDENUM_UNKNOWN {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
asID := v.Id
|
||||||
|
if platformIDENUM == cast.PlatformIDENUM_BULESKY && asID == "" {
|
||||||
|
asID = v.Username
|
||||||
|
}
|
||||||
authReq.Data = append(authReq.Data, &cast.UpdateOAuthReq_Info{
|
authReq.Data = append(authReq.Data, &cast.UpdateOAuthReq_Info{
|
||||||
ArtistUuid: artistUuid,
|
ArtistUuid: artistUuid,
|
||||||
PlatformID: platformIDENUM,
|
PlatformID: platformIDENUM,
|
||||||
AsID: v.Id,
|
AsID: asID,
|
||||||
PlatformUserName: v.Username,
|
PlatformUserName: v.Username,
|
||||||
AutInfo: string(asInfoB),
|
AutInfo: string(asInfoB),
|
||||||
})
|
})
|
||||||
@ -487,3 +538,233 @@ func SyncAsProfile(ctx *gin.Context) {
|
|||||||
service.Success(ctx, infoResp)
|
service.Success(ctx, infoResp)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ImportMediaAccount 导入自媒体账号
|
||||||
|
func ImportMediaAccount(ctx *gin.Context) {
|
||||||
|
excelFile, err := ctx.FormFile("file")
|
||||||
|
if err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
tempDir := "./runtime/media"
|
||||||
|
_, err = utils.CheckDirPath(tempDir, true)
|
||||||
|
if err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
fileName := fmt.Sprintf("%d_media_account.xlsx", time.Now().UnixMicro())
|
||||||
|
excelPath := filepath.Join(tempDir, fileName)
|
||||||
|
if err = ctx.SaveUploadedFile(excelFile, excelPath); err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// Linux系统下需要显式设置文件权限
|
||||||
|
if err = os.Chmod(excelPath, 0666); err != nil {
|
||||||
|
zap.L().Warn("设置文件权限失败", zap.Error(err))
|
||||||
|
}
|
||||||
|
excelData, err := excelize.OpenFile(excelPath)
|
||||||
|
if err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
defer excelData.Close()
|
||||||
|
rows, err := excelData.GetRows("Sheet1")
|
||||||
|
if err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
loginInfo := login.GetUserInfoFromC(ctx)
|
||||||
|
for line, row := range rows {
|
||||||
|
if line == 0 {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if len(row) < 3 {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
subNum := strings.TrimSpace(row[1])
|
||||||
|
if subNum == "" {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
var subInfoResp *accountFiee.UserInfoResponse
|
||||||
|
//查询艺人信息
|
||||||
|
//if config.AppConfig.System.AppMode == "dev" {
|
||||||
|
//subInfoResp = &accountFiee.UserInfoResponse{
|
||||||
|
// Id: 1245,
|
||||||
|
// SubNum: "FL00023",
|
||||||
|
// Status: 0,
|
||||||
|
// Name: "测试远",
|
||||||
|
// TelNum: "1826145872",
|
||||||
|
// TelAreaCode: "86",
|
||||||
|
//}
|
||||||
|
//} else {
|
||||||
|
subInfoResp, err = service.AccountFieeProvider.SubNumGetInfo(context.Background(), &accountFiee.SubNumGetInfoRequest{
|
||||||
|
SubNum: subNum,
|
||||||
|
Domain: "app",
|
||||||
|
})
|
||||||
|
//}
|
||||||
|
if err != nil {
|
||||||
|
zap.L().Error("查询艺人出错", zap.Error(err))
|
||||||
|
excelSetRemark(excelData, line, "查询艺人出错")
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
zap.L().Info("查询艺人成功", zap.Any("subInfoResp", subInfoResp))
|
||||||
|
if subInfoResp.Id == 0 {
|
||||||
|
excelSetRemark(excelData, line, "艺人不存在")
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
var tiktokName, insName, dmName, youtubeName, blueskyName string
|
||||||
|
if len(row) >= 3 {
|
||||||
|
tiktokName = strings.TrimSpace(row[2])
|
||||||
|
}
|
||||||
|
if len(row) >= 4 {
|
||||||
|
insName = strings.TrimSpace(row[3])
|
||||||
|
}
|
||||||
|
if len(row) >= 5 {
|
||||||
|
dmName = strings.TrimSpace(row[4])
|
||||||
|
}
|
||||||
|
if len(row) >= 6 {
|
||||||
|
youtubeName = strings.TrimSpace(row[5])
|
||||||
|
}
|
||||||
|
if len(row) >= 7 {
|
||||||
|
blueskyName = strings.TrimSpace(row[6])
|
||||||
|
}
|
||||||
|
if tiktokName == "" && insName == "" && dmName == "" && youtubeName == "" && blueskyName == "" {
|
||||||
|
excelSetRemark(excelData, line, "请填写账号")
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if tiktokName != "" {
|
||||||
|
if err = updateMediaAccount(tiktokName, cast.PlatformIDENUM_TIKTOK, subInfoResp, loginInfo); err != nil {
|
||||||
|
excelSetRemark(excelData, line, fmt.Sprintf("%s:%s", tiktokName, err.Error()))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if insName != "" {
|
||||||
|
if err = updateMediaAccount(insName, cast.PlatformIDENUM_INS, subInfoResp, loginInfo); err != nil {
|
||||||
|
excelSetRemark(excelData, line, fmt.Sprintf("%s:%s", insName, err.Error()))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if dmName != "" {
|
||||||
|
if err = updateMediaAccount(dmName, cast.PlatformIDENUM_DM, subInfoResp, loginInfo); err != nil {
|
||||||
|
excelSetRemark(excelData, line, fmt.Sprintf("%s:%s", dmName, err.Error()))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if youtubeName != "" {
|
||||||
|
if err = updateMediaAccount(youtubeName, cast.PlatformIDENUM_YOUTUBE, subInfoResp, loginInfo); err != nil {
|
||||||
|
excelSetRemark(excelData, line, fmt.Sprintf("%s:%s", youtubeName, err.Error()))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if blueskyName != "" {
|
||||||
|
if err = updateMediaAccount(blueskyName, cast.PlatformIDENUM_BULESKY, subInfoResp, loginInfo); err != nil {
|
||||||
|
excelSetRemark(excelData, line, fmt.Sprintf("%s:%s", blueskyName, err.Error()))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_ = CheckAsProfile(subInfoResp)
|
||||||
|
}
|
||||||
|
// 保存Excel文件到磁盘
|
||||||
|
resultPath := fmt.Sprintf("./runtime/media/%s", fileName)
|
||||||
|
if err = excelData.SaveAs(resultPath); err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// Linux系统下需要显式设置文件权限
|
||||||
|
if err = os.Chmod(resultPath, 0666); err != nil {
|
||||||
|
zap.L().Warn("设置文件权限失败", zap.Error(err))
|
||||||
|
}
|
||||||
|
|
||||||
|
// 打开文件 遍历一下 F列没有数据success + 1 并且删掉,有值的fail+1 留着
|
||||||
|
var successCount, failCount int
|
||||||
|
rows, err = excelData.GetRows("Sheet1")
|
||||||
|
if err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 记录需要删除的行(从后往前删除,避免行号变化)
|
||||||
|
rowsToDelete := make([]int, 0)
|
||||||
|
for line := 1; line < len(rows); line++ { // 从第2行开始(跳过表头)
|
||||||
|
remarkCell := fmt.Sprintf("H%d", line+1) // 备注列已移动到H列
|
||||||
|
remark, _ := excelData.GetCellValue("Sheet1", remarkCell)
|
||||||
|
if remark == "" {
|
||||||
|
// H列没有数据,表示成功
|
||||||
|
successCount++
|
||||||
|
rowsToDelete = append(rowsToDelete, line+1)
|
||||||
|
} else {
|
||||||
|
// H列有值,表示失败
|
||||||
|
failCount++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 从后往前删除成功的行
|
||||||
|
for i := len(rowsToDelete) - 1; i >= 0; i-- {
|
||||||
|
if err = excelData.RemoveRow("Sheet1", rowsToDelete[i]); err != nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 再次保存文件
|
||||||
|
if err = excelData.SaveAs(resultPath); err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// Linux系统下需要显式设置文件权限
|
||||||
|
if err = os.Chmod(resultPath, 0666); err != nil {
|
||||||
|
zap.L().Warn("设置文件权限失败", zap.Error(err))
|
||||||
|
}
|
||||||
|
|
||||||
|
urlHost := config.AppConfig.System.FieeHost
|
||||||
|
urlResult := fmt.Sprintf("%s/api/fiee/static/media/%s", urlHost, fileName)
|
||||||
|
service.Success(ctx, map[string]interface{}{
|
||||||
|
"successCount": successCount,
|
||||||
|
"failCount": failCount,
|
||||||
|
"url": urlResult,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
func excelSetRemark(excelData *excelize.File, line int, remark string) {
|
||||||
|
zap.L().Info("设置备注", zap.Int("line", line), zap.String("remark", remark))
|
||||||
|
oldRemark, _ := excelData.GetCellValue("Sheet1", fmt.Sprintf("%s%d", "H", line+1))
|
||||||
|
if oldRemark != "" {
|
||||||
|
remark = fmt.Sprintf("%s\n;%s", oldRemark, remark)
|
||||||
|
}
|
||||||
|
excelData.SetCellValue("Sheet1", fmt.Sprintf("%s%d", "H", line+1), remark)
|
||||||
|
}
|
||||||
|
|
||||||
|
func updateMediaAccount(platformName string, platformId cast.PlatformIDENUM, subInfoResp *accountFiee.UserInfoResponse, loginInfo login.Info) error {
|
||||||
|
var err error
|
||||||
|
//if config.AppConfig.System.AppMode != "dev" {
|
||||||
|
if _, err = CheckUserBundleBalance(int32(subInfoResp.Id), modelCast.BalanceTypeAccountValue); err != nil {
|
||||||
|
zap.L().Error("CheckUserBundleBalance err", zap.Error(err), zap.Any("platformName", platformName))
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
_, err = service.BundleProvider.AddBundleBalance(context.Background(), &bundle.AddBundleBalanceReq{
|
||||||
|
UserId: int32(subInfoResp.Id),
|
||||||
|
AccountConsumptionNumber: 1,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
zap.L().Error("AddBundleBalance err", zap.Error(err), zap.Any("platformName", platformName))
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
//}
|
||||||
|
_, err = service.CastProvider.UpdateMediaAccount(context.Background(), &cast.UpdateMediaAccountReq{
|
||||||
|
PlatformID: platformId,
|
||||||
|
PlatformUserName: platformName,
|
||||||
|
PlatformUserID: "",
|
||||||
|
ArtistUuid: fmt.Sprint(subInfoResp.Id),
|
||||||
|
ArtistName: subInfoResp.Name,
|
||||||
|
ArtistPhone: subInfoResp.TelNum,
|
||||||
|
MediaAccountUuid: "",
|
||||||
|
ManagerUuid: fmt.Sprint(loginInfo.ID),
|
||||||
|
ManagerUserName: loginInfo.Name,
|
||||||
|
ArtistSubNum: subInfoResp.SubNum,
|
||||||
|
})
|
||||||
|
//if config.AppConfig.System.AppMode != "dev" {
|
||||||
|
if err != nil {
|
||||||
|
zap.L().Error("UpdateMediaAccount err", zap.Error(err), zap.Any("platformName", platformName))
|
||||||
|
_, _err := service.BundleProvider.AddBundleBalance(context.Background(), &bundle.AddBundleBalanceReq{
|
||||||
|
UserId: int32(subInfoResp.Id),
|
||||||
|
AccountConsumptionNumber: -1,
|
||||||
|
})
|
||||||
|
zap.L().Error("AddBundleBalance err", zap.Error(_err), zap.Any("platformName", platformName))
|
||||||
|
}
|
||||||
|
//}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|||||||
46
pkg/service/cast/task.go
Normal file
46
pkg/service/cast/task.go
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
package cast
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"fmt"
|
||||||
|
"fonchain-fiee/api/cast"
|
||||||
|
"fonchain-fiee/pkg/model/login"
|
||||||
|
"fonchain-fiee/pkg/service"
|
||||||
|
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TaskList(ctx *gin.Context) {
|
||||||
|
var req *cast.ListTaskListReq
|
||||||
|
var err error
|
||||||
|
if err = ctx.ShouldBind(&req); err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
loginInfo := login.GetUserInfoFromC(ctx)
|
||||||
|
req.OperatorID = fmt.Sprint(loginInfo.ID)
|
||||||
|
resp, err := service.CastProvider.ListTaskList(context.Background(), req)
|
||||||
|
if err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
service.Success(ctx, resp)
|
||||||
|
}
|
||||||
|
|
||||||
|
func DeleteTasK(ctx *gin.Context) {
|
||||||
|
var req *cast.DeleteTaskListReq
|
||||||
|
var err error
|
||||||
|
if err = ctx.ShouldBind(&req); err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
//loginInfo := login.GetUserInfoFromC(ctx)
|
||||||
|
//req.OperatorID = fmt.Sprint(loginInfo.ID)
|
||||||
|
resp, err := service.CastProvider.DeleteTaskList(context.Background(), req)
|
||||||
|
if err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
service.Success(ctx, resp)
|
||||||
|
return
|
||||||
|
}
|
||||||
@ -2,11 +2,13 @@ package cast
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"fonchain-fiee/api/aryshare"
|
"fonchain-fiee/api/aryshare"
|
||||||
"fonchain-fiee/api/cast"
|
"fonchain-fiee/api/cast"
|
||||||
"fonchain-fiee/cmd/config"
|
"fonchain-fiee/cmd/config"
|
||||||
"fonchain-fiee/pkg/service"
|
"fonchain-fiee/pkg/service"
|
||||||
|
"fonchain-fiee/pkg/service/check"
|
||||||
"fonchain-fiee/pkg/utils"
|
"fonchain-fiee/pkg/utils"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
@ -85,7 +87,7 @@ func Test(ctx *gin.Context) {
|
|||||||
//profileKey := ctx.PostForm("profileKey")
|
//profileKey := ctx.PostForm("profileKey")
|
||||||
resp, err := service.AyrshareProvider.GetProfiles(context.Background(), &aryshare.GetProfilesRequest{
|
resp, err := service.AyrshareProvider.GetProfiles(context.Background(), &aryshare.GetProfilesRequest{
|
||||||
Title: "",
|
Title: "",
|
||||||
RefId: "",
|
RefId: "79f8d38afe5922f19bd02b21f838354ae8927d66",
|
||||||
HasActiveSocialAccounts: false,
|
HasActiveSocialAccounts: false,
|
||||||
IncludesActiveSocialAccounts: nil,
|
IncludesActiveSocialAccounts: nil,
|
||||||
ActionLog: nil,
|
ActionLog: nil,
|
||||||
@ -119,6 +121,51 @@ func Test(ctx *gin.Context) {
|
|||||||
service.Success(ctx, uploadResp)
|
service.Success(ctx, uploadResp)
|
||||||
return
|
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
|
||||||
|
}
|
||||||
|
if action == "SecurityText" {
|
||||||
|
val := ctx.PostForm("val")
|
||||||
|
ok, err := check.SecurityFile(val)
|
||||||
|
if err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if !ok {
|
||||||
|
service.Error(ctx, errors.New("标题鉴定未通过"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
service.Success(ctx, "ok")
|
||||||
|
}
|
||||||
|
|
||||||
|
if action == "SecurityFile" {
|
||||||
|
val := ctx.PostForm("val")
|
||||||
|
ok, err := check.SecurityFile(val)
|
||||||
|
if err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if !ok {
|
||||||
|
service.Error(ctx, errors.New("标题鉴定未通过"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
service.Success(ctx, "ok")
|
||||||
|
}
|
||||||
|
if action == "SyncAsAuth" {
|
||||||
|
artistUuid := ctx.PostForm("artistUuid")
|
||||||
|
err := SyncAsAuth(artistUuid)
|
||||||
|
if err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
service.Success(ctx, "ok")
|
||||||
|
}
|
||||||
|
|
||||||
service.Success(ctx, "unknow")
|
service.Success(ctx, "unknow")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -1,52 +0,0 @@
|
|||||||
package check
|
|
||||||
|
|
||||||
import (
|
|
||||||
"errors"
|
|
||||||
"fmt"
|
|
||||||
"mime/multipart"
|
|
||||||
"time"
|
|
||||||
|
|
||||||
pkgSecurity "fonchain-fiee/pkg/security"
|
|
||||||
|
|
||||||
"github.com/fonchain/utils/security"
|
|
||||||
)
|
|
||||||
|
|
||||||
// ImageCheckUrlValid 图片黄疸检测 true 是通过
|
|
||||||
func ImageCheckUrlValid(imgUrl string) (bool, error) {
|
|
||||||
resp, err := pkgSecurity.ImageScanner.ScanImageByURL(imgUrl, fmt.Sprint(time.Now().UnixMicro()), security.BaselineCheckGlobal)
|
|
||||||
if err != nil {
|
|
||||||
err = errors.New("图片检测请求失败")
|
|
||||||
return false, err
|
|
||||||
}
|
|
||||||
if resp.Code != 200 {
|
|
||||||
err = errors.New("图片检测失败,错误码")
|
|
||||||
return false, err
|
|
||||||
}
|
|
||||||
if len(resp.Data) == 0 || len(resp.Data[0].Results) == 0 {
|
|
||||||
return false, errors.New("图片检测结果异常")
|
|
||||||
}
|
|
||||||
riskLevel := resp.Data[0].Results[0].RiskLevel
|
|
||||||
if *riskLevel == "none" {
|
|
||||||
return true, nil
|
|
||||||
}
|
|
||||||
return false, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func ImageCheckByte(file *multipart.FileHeader) (bool, error) {
|
|
||||||
//imageScanner, err := security.NewImageScanner(&security.Config{
|
|
||||||
// RAMAccessKeyID: "LTAI5tNBzbeEbG1yCitvHsMb",
|
|
||||||
// RAMAccessKeySecret: "G1xAUB8G6WDVo0SLr6DJaJjNWIlpmO",
|
|
||||||
// RAMRoleArn: "acs:ram::5828544250383902:role/content-secret",
|
|
||||||
// Region: "ap-southeast-1",
|
|
||||||
// Endpoint: "green-cip.ap-southeast-1.aliyuncs.com",
|
|
||||||
// TempAccessKeyID: "",
|
|
||||||
// TempAccessKeySecret: "",
|
|
||||||
// SecurityToken: "",
|
|
||||||
//})
|
|
||||||
//if err != nil {
|
|
||||||
// return false, err
|
|
||||||
//}
|
|
||||||
//resp, err := imageScanner.ScanImageByFileByte(file, fmt.Sprint(time.Now().UnixMicro()), security.BaselineCheckGlobal)
|
|
||||||
//fmt.Println(resp)
|
|
||||||
return false, nil
|
|
||||||
}
|
|
||||||
240
pkg/service/check/security.go
Normal file
240
pkg/service/check/security.go
Normal file
@ -0,0 +1,240 @@
|
|||||||
|
package check
|
||||||
|
|
||||||
|
import (
|
||||||
|
"errors"
|
||||||
|
"fmt"
|
||||||
|
"mime/multipart"
|
||||||
|
"path/filepath"
|
||||||
|
"strconv"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
modelSecurity "fonchain-fiee/pkg/model/security"
|
||||||
|
pkgSecurity "fonchain-fiee/pkg/security"
|
||||||
|
|
||||||
|
"github.com/fonchain/utils/security"
|
||||||
|
"go.uber.org/zap"
|
||||||
|
)
|
||||||
|
|
||||||
|
// ImageCheckUrlValid 图片黄疸检测 true 是通过
|
||||||
|
func ImageCheckUrlValid(imgUrl string) (bool, error) {
|
||||||
|
resp, err := pkgSecurity.ImageScanner.ScanImageByURL(imgUrl, fmt.Sprint(time.Now().UnixMicro()), security.BaselineCheckGlobal)
|
||||||
|
if err != nil {
|
||||||
|
err = errors.New("图片检测请求失败")
|
||||||
|
return false, err
|
||||||
|
}
|
||||||
|
if resp.Code != 200 {
|
||||||
|
err = errors.New("图片检测失败,错误码")
|
||||||
|
return false, err
|
||||||
|
}
|
||||||
|
if len(resp.Data) == 0 || len(resp.Data[0].Results) == 0 {
|
||||||
|
return false, errors.New("图片检测结果异常")
|
||||||
|
}
|
||||||
|
riskLevel := resp.Data[0].Results[0].RiskLevel
|
||||||
|
if *riskLevel == "none" {
|
||||||
|
return true, nil
|
||||||
|
}
|
||||||
|
return false, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func ImageCheckByte(file *multipart.FileHeader) (bool, error) {
|
||||||
|
//imageScanner, err := security.NewImageScanner(&security.Config{
|
||||||
|
// RAMAccessKeyID: "LTAI5tNBzbeEbG1yCitvHsMb",
|
||||||
|
// RAMAccessKeySecret: "G1xAUB8G6WDVo0SLr6DJaJjNWIlpmO",
|
||||||
|
// RAMRoleArn: "acs:ram::5828544250383902:role/content-secret",
|
||||||
|
// Region: "ap-southeast-1",
|
||||||
|
// Endpoint: "green-cip.ap-southeast-1.aliyuncs.com",
|
||||||
|
// TempAccessKeyID: "",
|
||||||
|
// TempAccessKeySecret: "",
|
||||||
|
// SecurityToken: "",
|
||||||
|
//})
|
||||||
|
//if err != nil {
|
||||||
|
// return false, err
|
||||||
|
//}
|
||||||
|
//resp, err := imageScanner.ScanImageByFileByte(file, fmt.Sprint(time.Now().UnixMicro()), security.BaselineCheckGlobal)
|
||||||
|
//fmt.Println(resp)
|
||||||
|
return false, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func SecurityFile(textVal string) (bool, error) {
|
||||||
|
return true, nil
|
||||||
|
if textVal == "" {
|
||||||
|
return true, nil
|
||||||
|
}
|
||||||
|
var fileInfo modelSecurity.FileInfo
|
||||||
|
fileInfo.FileName = textVal
|
||||||
|
fileInfo.FileUrl = textVal
|
||||||
|
//获取文件名称后缀
|
||||||
|
extension := filepath.Ext(textVal)
|
||||||
|
switch extension {
|
||||||
|
case ".jpg", ".jpeg", ".png", ".gif", ".bmp", ".webp":
|
||||||
|
fileInfo.FileType = "image"
|
||||||
|
case ".mp4", ".avi", ".mov", ".wmv", ".flv", ".mkv":
|
||||||
|
fileInfo.FileType = "video"
|
||||||
|
default:
|
||||||
|
return true, nil
|
||||||
|
}
|
||||||
|
err := securityScan(&fileInfo)
|
||||||
|
if err != nil {
|
||||||
|
return false, err
|
||||||
|
}
|
||||||
|
return true, nil
|
||||||
|
}
|
||||||
|
func SecurityText(textVal string) (bool, error) {
|
||||||
|
return true, nil
|
||||||
|
aliConfig, err := pkgSecurity.GetGlobalConfig("./data/alibabacloud.env")
|
||||||
|
if err != nil {
|
||||||
|
return false, err
|
||||||
|
}
|
||||||
|
err = aliConfig.GetSTSToken()
|
||||||
|
if err != nil {
|
||||||
|
zap.L().Error("获取凭证失败", zap.Error(err))
|
||||||
|
return false, errors.New("获取凭证失败")
|
||||||
|
}
|
||||||
|
if err = handleTextScan(aliConfig, textVal); err != nil {
|
||||||
|
return false, err
|
||||||
|
}
|
||||||
|
return true, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func securityScan(fileInfo *modelSecurity.FileInfo) (err error) {
|
||||||
|
//加载阿里云配置获取临时token
|
||||||
|
aliConfig, err := pkgSecurity.GetGlobalConfig("./data/alibabacloud.env")
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
err = aliConfig.GetSTSToken()
|
||||||
|
if err != nil {
|
||||||
|
zap.L().Error("获取凭证失败", zap.Error(err))
|
||||||
|
return errors.New("获取凭证失败")
|
||||||
|
}
|
||||||
|
switch fileInfo.FileType {
|
||||||
|
case "image":
|
||||||
|
return handleImageScan(aliConfig, fileInfo)
|
||||||
|
case "video":
|
||||||
|
return handleVideoScan(aliConfig, fileInfo)
|
||||||
|
default:
|
||||||
|
return errors.New("不支持的审核类型")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func handleVideoScan(config *security.Config, fileInfo *modelSecurity.FileInfo) (err error) {
|
||||||
|
fmt.Println("\n=== 视频内容安全审核 ===")
|
||||||
|
|
||||||
|
scanner, err := security.NewVideoScanner(config)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Printf("创建视频扫描器失败: %v\n", err)
|
||||||
|
return errors.New("创建视频扫描器失败")
|
||||||
|
}
|
||||||
|
|
||||||
|
if fileInfo.FileUrl == "" {
|
||||||
|
fmt.Println("视频不能为空")
|
||||||
|
return errors.New("视频不能为空")
|
||||||
|
}
|
||||||
|
serviceType := security.VideoPostCheckByVLGlobal
|
||||||
|
dataID := "video_" + time.Now().Format("20060102150405")
|
||||||
|
|
||||||
|
fmt.Println("正在扫描视频(这可能需要几分钟)...")
|
||||||
|
result, err := scanner.ScanVideoAndWait(fileInfo.FileUrl, dataID, serviceType, 10*time.Minute)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Printf("扫描失败: %v\n", err)
|
||||||
|
return errors.New("扫描失败")
|
||||||
|
}
|
||||||
|
scanner.PrintResult(result)
|
||||||
|
for _, v := range result.Data {
|
||||||
|
fileInfo.SecurityStatus = *v.Results.RiskLevel
|
||||||
|
if v.Results.FrameResult != nil {
|
||||||
|
frameResult := *v.Results.FrameResult
|
||||||
|
if len(frameResult.FrameSummarys) > 0 {
|
||||||
|
for _, summary := range frameResult.FrameSummarys {
|
||||||
|
fileInfo.Describe = fileInfo.Describe + *summary.Description + ";"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if len(frameResult.Frames) > 0 {
|
||||||
|
for _, frame := range frameResult.Frames {
|
||||||
|
fileInfo.ProblemTimeFrame = fileInfo.ProblemTimeFrame + strconv.FormatFloat(float64(*frame.Offset), 'f', 2, 64) + "秒;"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if v.Results.RiskLevel != nil {
|
||||||
|
lv := v.Results.RiskLevel
|
||||||
|
//if *lv == "none" {
|
||||||
|
if *lv != "high" {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
return errors.New("图片违规")
|
||||||
|
}
|
||||||
|
|
||||||
|
return errors.New("风险等级检测未成功")
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func handleImageScan(config *security.Config, fileInfo *modelSecurity.FileInfo) (err error) {
|
||||||
|
fmt.Println("\n=== 图片内容安全审核 ===")
|
||||||
|
|
||||||
|
scanner, err := security.NewImageScanner(config)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Printf("创建图片扫描器失败:%v", err)
|
||||||
|
return errors.New("创建图片扫描器失败")
|
||||||
|
}
|
||||||
|
|
||||||
|
if fileInfo.FileUrl == "" {
|
||||||
|
fmt.Println("文件不能为空")
|
||||||
|
return errors.New("文件不能为空")
|
||||||
|
}
|
||||||
|
|
||||||
|
serviceType := security.PostImageCheckByVLGlobal
|
||||||
|
|
||||||
|
fmt.Println("正在扫描图片...")
|
||||||
|
result, err := scanner.ScanImageByURL(fileInfo.FileUrl, "image_"+time.Now().Format("20060102150405"), serviceType)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Printf("扫描失败: %v\n", err)
|
||||||
|
return errors.New("扫描失败")
|
||||||
|
}
|
||||||
|
scanner.PrintResult(result)
|
||||||
|
for _, v := range result.Data {
|
||||||
|
for _, v2 := range v.Results {
|
||||||
|
fileInfo.SecurityStatus = *v2.RiskLevel
|
||||||
|
if v2.RiskLevel != nil {
|
||||||
|
lv := v2.RiskLevel
|
||||||
|
//if *lv == "none" {
|
||||||
|
if *lv != "high" {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
return errors.New("图片违规")
|
||||||
|
}
|
||||||
|
return errors.New("风险等级检测未成功")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func handleTextScan(config *security.Config, textVal string) (err error) {
|
||||||
|
fmt.Println("\n=== 图片内容安全审核 ===")
|
||||||
|
|
||||||
|
scanner, err := security.NewTextScanner(config)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Printf("创建扫描器失败:%v", err)
|
||||||
|
return errors.New("创建扫描器失败")
|
||||||
|
}
|
||||||
|
|
||||||
|
serviceType := security.TextBaselineCheckGlobal
|
||||||
|
|
||||||
|
fmt.Println("正在扫描图片...")
|
||||||
|
result, err := scanner.ScanText(textVal, "image_"+time.Now().Format("20060102150405"), serviceType)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Printf("扫描失败: %v\n", err)
|
||||||
|
return errors.New("扫描失败")
|
||||||
|
}
|
||||||
|
scanner.PrintResult(result)
|
||||||
|
for _, v := range result.Data {
|
||||||
|
for _, vv := range v.Results {
|
||||||
|
label := *vv.Label
|
||||||
|
if label != "nonLabel" {
|
||||||
|
return errors.New("风险等级过高")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fmt.Println(result)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
381
pkg/service/cron/cron.go
Normal file
381
pkg/service/cron/cron.go
Normal file
@ -0,0 +1,381 @@
|
|||||||
|
package cron
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"errors"
|
||||||
|
"fmt"
|
||||||
|
account "fonchain-fiee/api/accountFiee"
|
||||||
|
"fonchain-fiee/api/cron"
|
||||||
|
"fonchain-fiee/pkg/service"
|
||||||
|
"fonchain-fiee/pkg/utils"
|
||||||
|
"log"
|
||||||
|
"os"
|
||||||
|
"path/filepath"
|
||||||
|
"strings"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
|
"github.com/gin-gonic/gin/binding"
|
||||||
|
"github.com/xuri/excelize/v2"
|
||||||
|
"google.golang.org/protobuf/types/known/emptypb"
|
||||||
|
)
|
||||||
|
|
||||||
|
func CreateScheduleTask(c *gin.Context) {
|
||||||
|
var req cron.CreateScheduleTaskRequest
|
||||||
|
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
|
||||||
|
service.Error(c, errors.New("参数错误"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
res, err := service.CronProvider.CreateScheduleTask(context.Background(), &req)
|
||||||
|
if err != nil {
|
||||||
|
service.Error(c, errors.New("网络超时,请重试"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if res.Code != 200 {
|
||||||
|
service.Error(c, errors.New(res.Message))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
service.Success(c, res)
|
||||||
|
}
|
||||||
|
func UpdateScheduleTask(c *gin.Context) {
|
||||||
|
var req cron.UpdateScheduleTaskRequest
|
||||||
|
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
|
||||||
|
service.Error(c, errors.New("参数错误"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
res, err := service.CronProvider.UpdateScheduleTask(context.Background(), &req)
|
||||||
|
if err != nil {
|
||||||
|
service.Error(c, errors.New("网络超时,请重试"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if res.Code != 200 {
|
||||||
|
service.Error(c, errors.New(res.Message))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
service.Success(c, res)
|
||||||
|
}
|
||||||
|
|
||||||
|
func GetListScheduleTask(c *gin.Context) {
|
||||||
|
var req cron.GetListScheduleTaskRequest
|
||||||
|
if err := c.ShouldBindJSON(&req); err != nil {
|
||||||
|
service.Error(c, errors.New("参数错误"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
res, err := service.CronProvider.GetListScheduleTask(context.Background(), &req)
|
||||||
|
if err != nil {
|
||||||
|
service.Error(c, errors.New("网络超时,请重试"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if res.Code != 200 {
|
||||||
|
service.Error(c, errors.New(res.Message))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
service.Success(c, res)
|
||||||
|
}
|
||||||
|
|
||||||
|
func GetListExecutionRecord(c *gin.Context) {
|
||||||
|
var req cron.GetListExecutionRecordRequest
|
||||||
|
if err := c.ShouldBindJSON(&req); err != nil {
|
||||||
|
service.Error(c, errors.New("参数错误"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
res, err := service.CronProvider.GetListExecutionRecord(context.Background(), &req)
|
||||||
|
if err != nil {
|
||||||
|
service.Error(c, errors.New("网络超时,请重试"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if res.Code != 200 {
|
||||||
|
service.Error(c, errors.New(res.Message))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
service.Success(c, res)
|
||||||
|
}
|
||||||
|
func GetListExecutionResult(c *gin.Context) {
|
||||||
|
var req cron.GetListExecutionResultRequest
|
||||||
|
if err := c.ShouldBindJSON(&req); err != nil {
|
||||||
|
service.Error(c, errors.New("参数错误"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
res, err := service.CronProvider.GetListExecutionResult(context.Background(), &req)
|
||||||
|
if err != nil {
|
||||||
|
service.Error(c, errors.New("网络超时,请重试"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if res.Code != 200 {
|
||||||
|
service.Error(c, errors.New(res.Message))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
service.Success(c, res)
|
||||||
|
}
|
||||||
|
func ExportExcelExecutionResult(c *gin.Context) {
|
||||||
|
var req cron.GetListExecutionResultRequest
|
||||||
|
if err := c.ShouldBindJSON(&req); err != nil {
|
||||||
|
service.Error(c, errors.New("参数错误"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
res, err := service.CronProvider.GetListExecutionResult(context.Background(), &req)
|
||||||
|
if err != nil {
|
||||||
|
service.Error(c, errors.New("网络超时,请重试"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
userListRes, err := service.AccountFieeProvider.UserList(context.Background(), &account.UserListRequest{
|
||||||
|
Domain: "app",
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
service.Error(c, errors.New("用户查询失败"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
idFindSubName := make(map[uint64]string)
|
||||||
|
for _, v := range userListRes.UserList {
|
||||||
|
idFindSubName[v.Id] = v.SubNum
|
||||||
|
}
|
||||||
|
|
||||||
|
titleList := []string{
|
||||||
|
"任务标题", "艺人编号", "艺人姓名", "内容类型", "内容标题", "执行结果", "原因",
|
||||||
|
}
|
||||||
|
var dataList []interface{}
|
||||||
|
for _, task := range res.Data {
|
||||||
|
data := []interface{}{
|
||||||
|
task.TaskTitle,
|
||||||
|
idFindSubName[uint64(task.ArtistId)],
|
||||||
|
task.ArtistName,
|
||||||
|
task.ContentTypeDescription,
|
||||||
|
task.WorkTitle,
|
||||||
|
task.ResultDescription,
|
||||||
|
task.ResultDesc,
|
||||||
|
}
|
||||||
|
dataList = append(dataList, &data)
|
||||||
|
}
|
||||||
|
|
||||||
|
content, err := utils.ToExcelByType(titleList, dataList, "slice", "")
|
||||||
|
if err != nil {
|
||||||
|
service.Error(c, errors.New("生成excel失败"))
|
||||||
|
|
||||||
|
}
|
||||||
|
utils.ResponseXls(c, content, fmt.Sprintf("失败任务报告_%s.xlsx", time.Now().Format("20060102150405")))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func StartScheduleTask(c *gin.Context) {
|
||||||
|
var req cron.CommonIDRequest
|
||||||
|
if err := c.ShouldBindJSON(&req); err != nil {
|
||||||
|
service.Error(c, errors.New("参数错误"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
res, err := service.CronProvider.StartScheduleTask(context.Background(), &req)
|
||||||
|
if err != nil {
|
||||||
|
service.Error(c, errors.New("网络超时,请重试"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if res.Code != 200 {
|
||||||
|
service.Error(c, errors.New(res.Message))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
service.Success(c, res)
|
||||||
|
}
|
||||||
|
|
||||||
|
func PauseScheduleTask(c *gin.Context) {
|
||||||
|
var req cron.CommonIDRequest
|
||||||
|
if err := c.ShouldBindJSON(&req); err != nil {
|
||||||
|
service.Error(c, errors.New("参数错误"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
res, err := service.CronProvider.PauseScheduleTask(context.Background(), &req)
|
||||||
|
if err != nil {
|
||||||
|
service.Error(c, errors.New("网络超时,请重试"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if res.Code != 200 {
|
||||||
|
service.Error(c, errors.New(res.Message))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
service.Success(c, res)
|
||||||
|
}
|
||||||
|
|
||||||
|
func DeleteScheduleTask(c *gin.Context) {
|
||||||
|
var req cron.CommonIDRequest
|
||||||
|
if err := c.ShouldBindJSON(&req); err != nil {
|
||||||
|
service.Error(c, errors.New("参数错误"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
res, err := service.CronProvider.DeleteScheduleTask(context.Background(), &req)
|
||||||
|
if err != nil {
|
||||||
|
service.Error(c, errors.New("网络超时,请重试"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if res.Code != 200 {
|
||||||
|
service.Error(c, errors.New(res.Message))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
service.Success(c, res)
|
||||||
|
}
|
||||||
|
|
||||||
|
func GetScheduleTaskStatus(c *gin.Context) {
|
||||||
|
res, err := service.CronProvider.GetScheduleTaskStatus(context.Background(), &emptypb.Empty{})
|
||||||
|
if err != nil {
|
||||||
|
service.Error(c, errors.New("网络超时,请重试"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if res.Code != 200 {
|
||||||
|
service.Error(c, errors.New(res.Message))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
service.Success(c, res)
|
||||||
|
}
|
||||||
|
|
||||||
|
func GetImportData(c *gin.Context) {
|
||||||
|
defer func() {
|
||||||
|
if r := recover(); r != nil {
|
||||||
|
service.Error(c, errors.New("操作失败"))
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
|
// 导入excel
|
||||||
|
excelFile, err := c.FormFile("excel")
|
||||||
|
if err != nil {
|
||||||
|
service.Error(c, errors.New("缺少excel文件"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 创建临时文件
|
||||||
|
tempDir := "tmp"
|
||||||
|
if err = os.MkdirAll(tempDir, 0755); err != nil {
|
||||||
|
service.Error(c, errors.New("创建临时目录失败"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
defer os.RemoveAll(tempDir)
|
||||||
|
|
||||||
|
// 保存excel
|
||||||
|
excelPath := filepath.Join(tempDir, "excel.xlsx")
|
||||||
|
if err = c.SaveUploadedFile(excelFile, excelPath); err != nil {
|
||||||
|
service.Error(c, errors.New("保存excel文件失败"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 读取excel
|
||||||
|
readExcelResult, err := readExcel(excelPath)
|
||||||
|
if err != nil {
|
||||||
|
service.Error(c, fmt.Errorf("读取excel失败: %v", err))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if len(readExcelResult) == 0 {
|
||||||
|
service.Error(c, errors.New("请检查excel文件"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
//去重操作
|
||||||
|
set := make(map[string]struct{})
|
||||||
|
var uniqueExcelData []excelData
|
||||||
|
for _, data := range readExcelResult {
|
||||||
|
if _, exists := set[data.SubName]; !exists {
|
||||||
|
set[data.SubName] = struct{}{}
|
||||||
|
uniqueExcelData = append(uniqueExcelData, data)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
res, err := service.AccountFieeProvider.UserList(context.Background(), &account.UserListRequest{
|
||||||
|
Domain: "app",
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
service.Error(c, errors.New("用户查询失败"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
//检查subname是否正确是否存在
|
||||||
|
subNames := make(map[string]struct{}, len(res.UserList))
|
||||||
|
for _, v := range res.UserList {
|
||||||
|
subNames[v.SubNum] = struct{}{}
|
||||||
|
}
|
||||||
|
for _, v := range uniqueExcelData {
|
||||||
|
if _, ok := subNames[v.SubName]; !ok {
|
||||||
|
service.Error(c, errors.New(fmt.Sprintf("第 %d 行数据错误,请检查数据!", v.Line)))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//检查subname和name是否匹配
|
||||||
|
subNameFindExcelData := make(map[string]excelData, len(uniqueExcelData))
|
||||||
|
for _, v := range uniqueExcelData {
|
||||||
|
subNameFindExcelData[v.SubName] = v
|
||||||
|
}
|
||||||
|
subNameFindID := make(map[string]uint64, len(uniqueExcelData))
|
||||||
|
result := make([]excelDataResult, 0, len(uniqueExcelData))
|
||||||
|
for _, v := range res.UserList {
|
||||||
|
subNameFindID[v.SubNum] = v.Id
|
||||||
|
if subNameFindExcelData[v.SubNum].Name != v.Name && subNameFindExcelData[v.SubNum].Name != "" {
|
||||||
|
fmt.Println(subNameFindExcelData[v.SubNum], v.Name)
|
||||||
|
service.Error(c, errors.New(fmt.Sprintf("第 %d 行数据错误,请检查数据!", subNameFindExcelData[v.SubNum].Line)))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for _, v := range uniqueExcelData {
|
||||||
|
result = append(result, excelDataResult{
|
||||||
|
Id: subNameFindID[v.SubName],
|
||||||
|
Name: v.Name,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
service.Success(c, result)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
type excelData struct {
|
||||||
|
Line uint `json:"line"`
|
||||||
|
SubName string `json:"subName"`
|
||||||
|
Name string `json:"name"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type excelDataResult struct {
|
||||||
|
Id uint64 `json:"id"`
|
||||||
|
Name string `json:"name"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func readExcel(excelPath string) ([]excelData, error) {
|
||||||
|
//打开excel
|
||||||
|
f, err := excelize.OpenFile(excelPath)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
defer f.Close()
|
||||||
|
|
||||||
|
//读取第一页
|
||||||
|
sheetName := f.GetSheetName(0)
|
||||||
|
if sheetName == "" {
|
||||||
|
return nil, errors.New("excel文件中没有工作表")
|
||||||
|
}
|
||||||
|
|
||||||
|
//读取数据
|
||||||
|
rows, err := f.GetRows(sheetName)
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("读取工作表失败: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(rows) <= 1 {
|
||||||
|
return nil, errors.New("excel文件没有数据行(只有表头或为空)")
|
||||||
|
}
|
||||||
|
var result []excelData
|
||||||
|
for i := 1; i < len(rows); i++ { // 从第2行开始(跳过表头)
|
||||||
|
row := rows[i]
|
||||||
|
if len(row) == 0 {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
subName := getCellValue(f, sheetName, i, 0)
|
||||||
|
name := getCellValue(f, sheetName, i, 1)
|
||||||
|
data := excelData{
|
||||||
|
Line: uint(i + 1),
|
||||||
|
SubName: subName,
|
||||||
|
Name: name,
|
||||||
|
}
|
||||||
|
result = append(result, data)
|
||||||
|
}
|
||||||
|
|
||||||
|
return result, nil
|
||||||
|
}
|
||||||
|
func getCellValue(f *excelize.File, sheetName string, rowIndex, colIndex int) string {
|
||||||
|
colName, _ := excelize.ColumnNumberToName(colIndex + 1)
|
||||||
|
cell := fmt.Sprintf("%s%d", colName, rowIndex+1)
|
||||||
|
|
||||||
|
value, err := f.GetCellValue(sheetName, cell)
|
||||||
|
if err != nil {
|
||||||
|
log.Printf("读取单元格 %s 失败: %v", cell, err)
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
return strings.TrimSpace(value)
|
||||||
|
}
|
||||||
@ -2,7 +2,9 @@ package file
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
|
"fmt"
|
||||||
"fonchain-fiee/api/files"
|
"fonchain-fiee/api/files"
|
||||||
"fonchain-fiee/pkg/service"
|
"fonchain-fiee/pkg/service"
|
||||||
"fonchain-fiee/pkg/service/bundle/common"
|
"fonchain-fiee/pkg/service/bundle/common"
|
||||||
@ -14,6 +16,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
"go.uber.org/zap"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Raw(ctx *gin.Context) {
|
func Raw(ctx *gin.Context) {
|
||||||
@ -100,6 +103,15 @@ func Create(ctx *gin.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func Delete(ctx *gin.Context) {
|
func Delete(ctx *gin.Context) {
|
||||||
|
path := ctx.DefaultQuery("path", "/")
|
||||||
|
nowYear := time.Now().Year()
|
||||||
|
nowMonth := time.Now().Month()
|
||||||
|
nowYearPath := fmt.Sprintf("/fiee/video/%d", nowYear)
|
||||||
|
nowMonthPath := fmt.Sprintf("/fiee/video/%d/%d-%d", nowYear, nowYear, nowMonth)
|
||||||
|
if path == nowYearPath || path == nowMonthPath || path == "/fiee" || path == "/fiee/video" || path == "/fiee/video/old" {
|
||||||
|
service.Error(ctx, errors.New("无法删除该目录"))
|
||||||
|
return
|
||||||
|
}
|
||||||
resp, err := service.FilesProvider.Delete(ctx, &files.DeleteReq{
|
resp, err := service.FilesProvider.Delete(ctx, &files.DeleteReq{
|
||||||
Path: ctx.DefaultQuery("path", "/"),
|
Path: ctx.DefaultQuery("path", "/"),
|
||||||
UserSpacePath: getUserSpacePath(ctx),
|
UserSpacePath: getUserSpacePath(ctx),
|
||||||
@ -282,3 +294,81 @@ func getUserSpacePath(ctx *gin.Context) string {
|
|||||||
|
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func SecurityScan(ctx *gin.Context) {
|
||||||
|
var req files.SecurityScanReq
|
||||||
|
if err := ctx.ShouldBindJSON(&req); err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
go func() {
|
||||||
|
// 使用独立的 context,避免原请求 context 被取消
|
||||||
|
scanCtx, cancel := context.WithTimeout(context.Background(), 10*time.Minute)
|
||||||
|
defer cancel()
|
||||||
|
// 执行安全扫描
|
||||||
|
|
||||||
|
_, err := service.FilesProvider.SecurityScan(scanCtx, &req)
|
||||||
|
if err != nil {
|
||||||
|
// 记录错误日志
|
||||||
|
zap.L().Error("安全扫描失败",
|
||||||
|
zap.String("url", req.Url),
|
||||||
|
zap.String("fileName", req.FileName),
|
||||||
|
zap.Error(err))
|
||||||
|
} else {
|
||||||
|
zap.L().Info("安全扫描完成",
|
||||||
|
zap.String("url", req.Url),
|
||||||
|
zap.String("fileName", req.FileName))
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
service.Success(ctx, gin.H{
|
||||||
|
"message": "安全扫描任务已提交,正在后台处理",
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
func UpdateFileSecurityStatus(ctx *gin.Context) {
|
||||||
|
var req files.UpdateFileSecurityStatusReq
|
||||||
|
if err := ctx.ShouldBindJSON(&req); err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
resp, err := service.FilesProvider.UpdateFileSecurityStatus(ctx, &req)
|
||||||
|
if err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
service.Success(ctx, resp)
|
||||||
|
}
|
||||||
|
|
||||||
|
func ManualAnti(ctx *gin.Context) {
|
||||||
|
var req files.ManualAntiReq
|
||||||
|
if err := ctx.ShouldBindJSON(&req); err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
go func() {
|
||||||
|
resp, err := service.FilesProvider.ManualAnti(ctx, &req)
|
||||||
|
if err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
service.Success(ctx, resp)
|
||||||
|
}()
|
||||||
|
service.Success(ctx, gin.H{
|
||||||
|
"message": "手动反制任务已提交,正在后台处理",
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
func GetFileSecurityStatus(ctx *gin.Context) {
|
||||||
|
var req files.GetFileSecurityStatusReq
|
||||||
|
if err := ctx.ShouldBindJSON(&req); err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
resp, err := service.FilesProvider.GetFileSecurityStatus(ctx, &req)
|
||||||
|
if err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
service.Success(ctx, resp)
|
||||||
|
}
|
||||||
|
|||||||
@ -107,7 +107,7 @@ func ImportBind(c *gin.Context) {
|
|||||||
log.Printf(errors.New("查询平台信息失败:").Error())
|
log.Printf(errors.New("查询平台信息失败:").Error())
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if err = cast.CheckUserBundleBalance(int32(res.UserList[0].Id), modelCast.BalanceTypeAccountValue); err != nil {
|
if _, err = cast.CheckUserBundleBalance(int32(res.UserList[0].Id), modelCast.BalanceTypeAccountValue); err != nil {
|
||||||
failedRecords = append(failedRecords, FailedRecord{
|
failedRecords = append(failedRecords, FailedRecord{
|
||||||
Name: artist.Name,
|
Name: artist.Name,
|
||||||
Msg: fmt.Sprintf("查询检查用户账户数量失败: %s", err.Error()),
|
Msg: fmt.Sprintf("查询检查用户账户数量失败: %s", err.Error()),
|
||||||
|
|||||||
@ -30,6 +30,8 @@ type excelData struct {
|
|||||||
SubNum string //用户编号 必须字段
|
SubNum string //用户编号 必须字段
|
||||||
TikTok string
|
TikTok string
|
||||||
Instagram string
|
Instagram string
|
||||||
|
YouTube string
|
||||||
|
BlueSky string
|
||||||
Youtube string
|
Youtube string
|
||||||
Desc string //艺人简介
|
Desc string //艺人简介
|
||||||
TitleRequire string //标题要求 必须字段
|
TitleRequire string //标题要求 必须字段
|
||||||
@ -178,27 +180,30 @@ func readExcel(excelPath string) ([]excelData, error) {
|
|||||||
if subNum == "" {
|
if subNum == "" {
|
||||||
return nil, fmt.Errorf("第%d行应该有编号", i+1)
|
return nil, fmt.Errorf("第%d行应该有编号", i+1)
|
||||||
}
|
}
|
||||||
tikTok := getCellValue(f, sheetName, i, 2)
|
blueSky := getCellValue(f, sheetName, i, 2)
|
||||||
|
if blueSky == "" {
|
||||||
|
return nil, fmt.Errorf("第%d行应该有bluesky账号昵称", i+1)
|
||||||
|
}
|
||||||
|
tikTok := getCellValue(f, sheetName, i, 3)
|
||||||
if tikTok == "" {
|
if tikTok == "" {
|
||||||
return nil, fmt.Errorf("第%d行应该有tiktok账号昵称", i+1)
|
return nil, fmt.Errorf("第%d行应该有tiktok账号昵称", i+1)
|
||||||
}
|
}
|
||||||
instagram := getCellValue(f, sheetName, i, 3)
|
instagram := getCellValue(f, sheetName, i, 4)
|
||||||
if instagram == "" {
|
|
||||||
return nil, fmt.Errorf("第%d行应该有ins账号昵称", i+1)
|
desc := getCellValue(f, sheetName, i, 5)
|
||||||
}
|
|
||||||
desc := getCellValue(f, sheetName, i, 4)
|
titleRequire := getCellValue(f, sheetName, i, 6)
|
||||||
titleRequire := getCellValue(f, sheetName, i, 5)
|
|
||||||
if titleRequire == "" {
|
if titleRequire == "" {
|
||||||
return nil, fmt.Errorf("第%d行应该有标题要求", i+1)
|
return nil, fmt.Errorf("第%d行应该有标题要求", i+1)
|
||||||
}
|
}
|
||||||
contentRequire := getCellValue(f, sheetName, i, 6)
|
contentRequire := getCellValue(f, sheetName, i, 7)
|
||||||
if contentRequire == "" {
|
if contentRequire == "" {
|
||||||
return nil, fmt.Errorf("第%d行应该有内容要求", i+1)
|
return nil, fmt.Errorf("第%d行应该有内容要求", i+1)
|
||||||
}
|
}
|
||||||
photoRequire := getCellValue(f, sheetName, i, 7)
|
photoRequire := getCellValue(f, sheetName, i, 8)
|
||||||
photoUrl := getCellValue(f, sheetName, i, 8)
|
photoUrl := getCellValue(f, sheetName, i, 9)
|
||||||
photoNumStr := getCellValue(f, sheetName, i, 9)
|
photoNumStr := getCellValue(f, sheetName, i, 10)
|
||||||
photoDpi := getCellValue(f, sheetName, i, 10)
|
photoDpi := getCellValue(f, sheetName, i, 11)
|
||||||
var num int
|
var num int
|
||||||
if photoUrl == "" { //如果没有关联画作,数量必须有,需求必须有
|
if photoUrl == "" { //如果没有关联画作,数量必须有,需求必须有
|
||||||
//需求必须有
|
//需求必须有
|
||||||
@ -220,6 +225,7 @@ func readExcel(excelPath string) ([]excelData, error) {
|
|||||||
data := excelData{
|
data := excelData{
|
||||||
ArtistName: artistName,
|
ArtistName: artistName,
|
||||||
SubNum: subNum,
|
SubNum: subNum,
|
||||||
|
BlueSky: blueSky,
|
||||||
TikTok: tikTok,
|
TikTok: tikTok,
|
||||||
Instagram: instagram,
|
Instagram: instagram,
|
||||||
Desc: desc,
|
Desc: desc,
|
||||||
|
|||||||
@ -293,6 +293,7 @@ func (p *BatchProcessor) submitTask(req *excelData) error {
|
|||||||
if !tiktokFound {
|
if !tiktokFound {
|
||||||
return fmt.Errorf("未找到匹配的TikTok账号: %s", req.TikTok)
|
return fmt.Errorf("未找到匹配的TikTok账号: %s", req.TikTok)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取 Instagram 自媒体账号
|
// 获取 Instagram 自媒体账号
|
||||||
accountListIns, err := service.CastProvider.MediaUserList(context.Background(), &apiCast.MediaUserListReq{
|
accountListIns, err := service.CastProvider.MediaUserList(context.Background(), &apiCast.MediaUserListReq{
|
||||||
ArtistVal: req.ArtistName,
|
ArtistVal: req.ArtistName,
|
||||||
@ -307,7 +308,6 @@ func (p *BatchProcessor) submitTask(req *excelData) error {
|
|||||||
if accountListIns == nil || len(accountListIns.Data) == 0 {
|
if accountListIns == nil || len(accountListIns.Data) == 0 {
|
||||||
return fmt.Errorf("ins自媒体账号数量为0")
|
return fmt.Errorf("ins自媒体账号数量为0")
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查找 Instagram 账号
|
// 查找 Instagram 账号
|
||||||
insFound := false
|
insFound := false
|
||||||
for _, user := range accountListIns.Data {
|
for _, user := range accountListIns.Data {
|
||||||
@ -322,6 +322,34 @@ func (p *BatchProcessor) submitTask(req *excelData) error {
|
|||||||
return fmt.Errorf("未找到匹配的Instagram账号: %s", req.Instagram)
|
return fmt.Errorf("未找到匹配的Instagram账号: %s", req.Instagram)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取 Bluesky 自媒体账号
|
||||||
|
accountListBlueSky, err := service.CastProvider.MediaUserList(context.Background(), &apiCast.MediaUserListReq{
|
||||||
|
ArtistVal: req.ArtistName,
|
||||||
|
PlatformID: 5, // Bluesky platform ID
|
||||||
|
Page: 1,
|
||||||
|
PageSize: 10,
|
||||||
|
ArtistUuid: strconv.FormatUint(list.UserList[0].Id, 10),
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("获取 Bluesky 账号失败: %s", err.Error())
|
||||||
|
}
|
||||||
|
if accountListBlueSky == nil || len(accountListBlueSky.Data) == 0 {
|
||||||
|
return fmt.Errorf("bluesky自媒体账号数量为0")
|
||||||
|
}
|
||||||
|
// 查找 Bluesky 账号
|
||||||
|
blueSkyFound := false
|
||||||
|
for _, user := range accountListBlueSky.Data {
|
||||||
|
if user.PlatformUserName == req.BlueSky {
|
||||||
|
req.MediaAccountNames = append(req.MediaAccountNames, user.PlatformUserName)
|
||||||
|
req.MediaAccountUuids = append(req.MediaAccountUuids, user.MediaAccountUuid)
|
||||||
|
blueSkyFound = true
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if !blueSkyFound {
|
||||||
|
return fmt.Errorf("未找到匹配的Bluesky账号: %s", req.BlueSky)
|
||||||
|
}
|
||||||
|
|
||||||
switch {
|
switch {
|
||||||
case req.PhotoUrl == "": // 如果没有提供照片 URL,生成标题和内容
|
case req.PhotoUrl == "": // 如果没有提供照片 URL,生成标题和内容
|
||||||
// 生成标题和内容
|
// 生成标题和内容
|
||||||
|
|||||||
@ -127,7 +127,7 @@ func ImportPublish(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if err = cast.CheckUserBundleBalance(int32(list.UserList[0].Id), modelCast.BalanceTypeVideoValue); err != nil {
|
if _, err = cast.CheckUserBundleBalance(int32(list.UserList[0].Id), modelCast.BalanceTypeVideoValue); err != nil {
|
||||||
failedRecords = append(failedRecords, FailedRecord{
|
failedRecords = append(failedRecords, FailedRecord{
|
||||||
Name: artist.Name,
|
Name: artist.Name,
|
||||||
Msg: fmt.Sprintf("检查用户视频可消耗数量: %s", err.Error()),
|
Msg: fmt.Sprintf("检查用户视频可消耗数量: %s", err.Error()),
|
||||||
@ -346,7 +346,7 @@ func ImportPublishV2(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if err = cast.CheckUserBundleBalance(int32(list.UserList[0].Id), modelCast.BalanceTypeVideoValue); err != nil {
|
if _, err = cast.CheckUserBundleBalance(int32(list.UserList[0].Id), modelCast.BalanceTypeVideoValue); err != nil {
|
||||||
failedRecords = append(failedRecords, FailedRecord{
|
failedRecords = append(failedRecords, FailedRecord{
|
||||||
Name: artist.Name,
|
Name: artist.Name,
|
||||||
Msg: fmt.Sprintf("检查用户视频可消耗数量: %s", err.Error()),
|
Msg: fmt.Sprintf("检查用户视频可消耗数量: %s", err.Error()),
|
||||||
@ -771,7 +771,7 @@ func ImportPublishV3(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if err = cast.CheckUserBundleBalance(int32(list.UserList[0].Id), modelCast.BalanceTypeVideoValue); err != nil {
|
if _, err = cast.CheckUserBundleBalance(int32(list.UserList[0].Id), modelCast.BalanceTypeVideoValue); err != nil {
|
||||||
failedRecords = append(failedRecords, FailedRecord{
|
failedRecords = append(failedRecords, FailedRecord{
|
||||||
Name: artist.Name,
|
Name: artist.Name,
|
||||||
Msg: fmt.Sprintf("检查用户视频可消耗数量: %s", err.Error()),
|
Msg: fmt.Sprintf("检查用户视频可消耗数量: %s", err.Error()),
|
||||||
|
|||||||
@ -132,7 +132,7 @@ func ImportPublishV4(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------检查用户视频数量
|
//--------------------------------------------------检查用户视频数量
|
||||||
if err = cast.CheckUserBundleBalance(int32(list.UserList[0].Id), modelCast.BalanceTypeVideoValue); err != nil {
|
if _, err = cast.CheckUserBundleBalance(int32(list.UserList[0].Id), modelCast.BalanceTypeVideoValue); err != nil {
|
||||||
failedRecords = append(failedRecords, FailedRecord{
|
failedRecords = append(failedRecords, FailedRecord{
|
||||||
Name: artist.Name,
|
Name: artist.Name,
|
||||||
Msg: fmt.Sprintf("检查用户视频可消耗数量: %s", err.Error()),
|
Msg: fmt.Sprintf("检查用户视频可消耗数量: %s", err.Error()),
|
||||||
|
|||||||
@ -7,6 +7,7 @@ import (
|
|||||||
"fonchain-fiee/api/aryshare"
|
"fonchain-fiee/api/aryshare"
|
||||||
"fonchain-fiee/api/bundle"
|
"fonchain-fiee/api/bundle"
|
||||||
"fonchain-fiee/api/cast"
|
"fonchain-fiee/api/cast"
|
||||||
|
"fonchain-fiee/api/cron"
|
||||||
"fonchain-fiee/api/files"
|
"fonchain-fiee/api/files"
|
||||||
"fonchain-fiee/api/governance"
|
"fonchain-fiee/api/governance"
|
||||||
"fonchain-fiee/api/order"
|
"fonchain-fiee/api/order"
|
||||||
@ -33,6 +34,7 @@ var GovernanceProvider = new(governance.GovernanceClientImpl)
|
|||||||
var PressReleasesProvider = new(pressreleases.PressReleasesClientImpl)
|
var PressReleasesProvider = new(pressreleases.PressReleasesClientImpl)
|
||||||
var SecFilingProvider = new(secFilings.SecFilingsClientImpl)
|
var SecFilingProvider = new(secFilings.SecFilingsClientImpl)
|
||||||
var AyrshareProvider = new(aryshare.AyrshareClientImpl)
|
var AyrshareProvider = new(aryshare.AyrshareClientImpl)
|
||||||
|
var CronProvider = new(cron.CronClientImpl)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
config.SetConsumerService(BundleProvider)
|
config.SetConsumerService(BundleProvider)
|
||||||
@ -46,6 +48,7 @@ func init() {
|
|||||||
config.SetConsumerService(PressReleasesProvider)
|
config.SetConsumerService(PressReleasesProvider)
|
||||||
config.SetConsumerService(SecFilingProvider)
|
config.SetConsumerService(SecFilingProvider)
|
||||||
config.SetConsumerService(AyrshareProvider)
|
config.SetConsumerService(AyrshareProvider)
|
||||||
|
config.SetConsumerService(CronProvider)
|
||||||
|
|
||||||
if err := config.Load(); err != nil {
|
if err := config.Load(); err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
|
|||||||
@ -10,7 +10,6 @@ import (
|
|||||||
"fonchain-fiee/api/cast"
|
"fonchain-fiee/api/cast"
|
||||||
"fonchain-fiee/cmd/config"
|
"fonchain-fiee/cmd/config"
|
||||||
"fonchain-fiee/pkg/e"
|
"fonchain-fiee/pkg/e"
|
||||||
modelCast "fonchain-fiee/pkg/model/cast"
|
|
||||||
"fonchain-fiee/pkg/model/login"
|
"fonchain-fiee/pkg/model/login"
|
||||||
"fonchain-fiee/pkg/service"
|
"fonchain-fiee/pkg/service"
|
||||||
castService "fonchain-fiee/pkg/service/cast"
|
castService "fonchain-fiee/pkg/service/cast"
|
||||||
@ -377,6 +376,11 @@ func UpdateWorkImageWithTaskUUID(ctx *gin.Context) {
|
|||||||
service.Error(ctx, errors.New("任务已中止,不能上传图文"))
|
service.Error(ctx, errors.New("任务已中止,不能上传图文"))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
resp, err := castService.UpdateWorkImageCore(ctx, req.UpdateWorkImageReq)
|
||||||
|
if err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
if config.AppConfig.System.AppMode != "dev" {
|
if config.AppConfig.System.AppMode != "dev" {
|
||||||
artistId, _ := strconv.ParseUint(req.ArtistUuid, 10, 64)
|
artistId, _ := strconv.ParseUint(req.ArtistUuid, 10, 64)
|
||||||
infoResp, err = service.AccountFieeProvider.Info(context.Background(), &accountFiee.InfoRequest{
|
infoResp, err = service.AccountFieeProvider.Info(context.Background(), &accountFiee.InfoRequest{
|
||||||
@ -394,21 +398,6 @@ func UpdateWorkImageWithTaskUUID(ctx *gin.Context) {
|
|||||||
TelAreaCode: "86",
|
TelAreaCode: "86",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
req.ArtistName = infoResp.Name
|
|
||||||
req.ArtistPhone = infoResp.TelNum
|
|
||||||
req.ArtistPhoneAreaCode = infoResp.TelAreaCode
|
|
||||||
artistID, _ := strconv.ParseUint(req.ArtistUuid, 10, 64)
|
|
||||||
if err = castService.CheckUserBundleBalance(int32(artistID), modelCast.BalanceTypeImageValue); err != nil {
|
|
||||||
service.Error(ctx, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
newCtx := castService.NewCtxWithUserInfo(ctx)
|
|
||||||
req.Source = 1
|
|
||||||
resp, err := service.CastProvider.UpdateWorkImage(newCtx, req.UpdateWorkImageReq)
|
|
||||||
if err != nil {
|
|
||||||
service.Error(ctx, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
// EmployeeName 和 EmployeeNum 从 toekn 里面拿
|
// EmployeeName 和 EmployeeNum 从 toekn 里面拿
|
||||||
userInfo := login.GetUserInfoFromC(ctx)
|
userInfo := login.GetUserInfoFromC(ctx)
|
||||||
// 调用员工实际任务状态更新
|
// 调用员工实际任务状态更新
|
||||||
@ -425,6 +414,32 @@ func UpdateWorkImageWithTaskUUID(ctx *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
zap.L().Info("UpdateTaskProgress", zap.Any("resp", resp1))
|
zap.L().Info("UpdateTaskProgress", zap.Any("resp", resp1))
|
||||||
|
|
||||||
|
// 记录任务工作日志,如果失败不影响主流程
|
||||||
|
logReq := &bundle.CreateTaskWorkLogRequest{
|
||||||
|
AssignRecordsUUID: req.AssignRecordsUUID,
|
||||||
|
WorkUUID: resp.WorkUuid,
|
||||||
|
Title: req.Title,
|
||||||
|
ArtistUUID: req.ArtistUuid,
|
||||||
|
SubNum: infoResp.SubNum,
|
||||||
|
TelNum: infoResp.TelNum,
|
||||||
|
ArtistName: infoResp.Name,
|
||||||
|
OperationType: 3, // 3:完成任务
|
||||||
|
TaskType: 2, // 2:图片
|
||||||
|
TaskCount: 1,
|
||||||
|
OperatorName: userInfo.Name,
|
||||||
|
OperatorNum: userInfo.TelNum,
|
||||||
|
}
|
||||||
|
// 记录请求参数
|
||||||
|
zap.L().Info("CreateTaskWorkLog request", zap.Any("req", logReq))
|
||||||
|
logResp, err := service.BundleProvider.CreateTaskWorkLog(context.Background(), logReq)
|
||||||
|
if err != nil {
|
||||||
|
// 记录错误但不影响主流程
|
||||||
|
zap.L().Error("CreateTaskWorkLog failed", zap.Error(err), zap.Any("req", logReq))
|
||||||
|
} else {
|
||||||
|
zap.L().Info("CreateTaskWorkLog success", zap.Any("resp", logResp))
|
||||||
|
}
|
||||||
|
|
||||||
service.Success(ctx, resp)
|
service.Success(ctx, resp)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -449,6 +464,11 @@ func UpdateWorkVideoWithUUID(ctx *gin.Context) {
|
|||||||
service.Error(ctx, errors.New("任务已中止,不能上传视频"))
|
service.Error(ctx, errors.New("任务已中止,不能上传视频"))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
resp, err := castService.UpdateWorkVideoCore(ctx, req.UpdateWorkVideoReq)
|
||||||
|
if err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
if config.AppConfig.System.AppMode != "dev" {
|
if config.AppConfig.System.AppMode != "dev" {
|
||||||
artistId, _ := strconv.ParseUint(req.ArtistUuid, 10, 64)
|
artistId, _ := strconv.ParseUint(req.ArtistUuid, 10, 64)
|
||||||
infoResp, err = service.AccountFieeProvider.Info(context.Background(), &accountFiee.InfoRequest{
|
infoResp, err = service.AccountFieeProvider.Info(context.Background(), &accountFiee.InfoRequest{
|
||||||
@ -466,21 +486,6 @@ func UpdateWorkVideoWithUUID(ctx *gin.Context) {
|
|||||||
TelAreaCode: "86",
|
TelAreaCode: "86",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
artistID, _ := strconv.ParseUint(req.ArtistUuid, 10, 64)
|
|
||||||
if err = castService.CheckUserBundleBalance(int32(artistID), modelCast.BalanceTypeVideoValue); err != nil {
|
|
||||||
service.Error(ctx, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
req.ArtistName = infoResp.Name
|
|
||||||
req.ArtistPhone = infoResp.TelNum
|
|
||||||
req.ArtistPhoneAreaCode = infoResp.TelAreaCode
|
|
||||||
newCtx := castService.NewCtxWithUserInfo(ctx)
|
|
||||||
req.Source = 1
|
|
||||||
resp, err := service.CastProvider.UpdateWorkVideo(newCtx, req.UpdateWorkVideoReq)
|
|
||||||
if err != nil {
|
|
||||||
service.Error(ctx, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
// EmployeeName 和 EmployeeNum 从 toekn 里面拿
|
// EmployeeName 和 EmployeeNum 从 toekn 里面拿
|
||||||
userInfo := login.GetUserInfoFromC(ctx)
|
userInfo := login.GetUserInfoFromC(ctx)
|
||||||
// 调用员工实际任务状态更新
|
// 调用员工实际任务状态更新
|
||||||
@ -497,6 +502,32 @@ func UpdateWorkVideoWithUUID(ctx *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
zap.L().Info("UpdateTaskProgress", zap.Any("resp", resp1))
|
zap.L().Info("UpdateTaskProgress", zap.Any("resp", resp1))
|
||||||
|
|
||||||
|
// 记录任务工作日志,如果失败不影响主流程
|
||||||
|
logReq := &bundle.CreateTaskWorkLogRequest{
|
||||||
|
AssignRecordsUUID: req.AssignRecordsUUID,
|
||||||
|
WorkUUID: resp.WorkUuid,
|
||||||
|
Title: req.Title,
|
||||||
|
ArtistUUID: req.ArtistUuid,
|
||||||
|
SubNum: infoResp.SubNum,
|
||||||
|
TelNum: infoResp.TelNum,
|
||||||
|
ArtistName: infoResp.Name,
|
||||||
|
OperationType: 3, // 3:完成任务
|
||||||
|
TaskType: 1, // 1:视频
|
||||||
|
TaskCount: 1,
|
||||||
|
OperatorName: userInfo.Name,
|
||||||
|
OperatorNum: userInfo.TelNum,
|
||||||
|
}
|
||||||
|
// 记录请求参数
|
||||||
|
zap.L().Info("CreateTaskWorkLog request", zap.Any("req", logReq))
|
||||||
|
logResp, err := service.BundleProvider.CreateTaskWorkLog(context.Background(), logReq)
|
||||||
|
if err != nil {
|
||||||
|
// 记录错误但不影响主流程
|
||||||
|
zap.L().Error("CreateTaskWorkLog failed", zap.Error(err), zap.Any("req", logReq))
|
||||||
|
} else {
|
||||||
|
zap.L().Info("CreateTaskWorkLog success", zap.Any("resp", logResp))
|
||||||
|
}
|
||||||
|
|
||||||
service.Success(ctx, resp)
|
service.Success(ctx, resp)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -676,6 +707,32 @@ func UpdateVideoScriptWithUUID(ctx *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
zap.L().Info("UpdateTaskProgress", zap.Any("resp", resp1))
|
zap.L().Info("UpdateTaskProgress", zap.Any("resp", resp1))
|
||||||
|
|
||||||
|
// 记录任务工作日志,如果失败不影响主流程
|
||||||
|
logReq := &bundle.CreateTaskWorkLogRequest{
|
||||||
|
AssignRecordsUUID: req.AssignRecordsUUID,
|
||||||
|
WorkUUID: resp.Uuid,
|
||||||
|
Title: req.Title,
|
||||||
|
ArtistUUID: req.ArtistUuid,
|
||||||
|
SubNum: infoResp.SubNum,
|
||||||
|
TelNum: infoResp.TelNum,
|
||||||
|
ArtistName: infoResp.Name,
|
||||||
|
OperationType: 3, // 3:完成任务
|
||||||
|
TaskType: 1, // 1:视频(脚本属于视频类型)
|
||||||
|
TaskCount: 1,
|
||||||
|
OperatorName: userInfo.Name,
|
||||||
|
OperatorNum: userInfo.TelNum,
|
||||||
|
}
|
||||||
|
// 记录请求参数
|
||||||
|
zap.L().Info("CreateTaskWorkLog request", zap.Any("req", logReq))
|
||||||
|
logResp, err := service.BundleProvider.CreateTaskWorkLog(context.Background(), logReq)
|
||||||
|
if err != nil {
|
||||||
|
// 记录错误但不影响主流程
|
||||||
|
zap.L().Error("CreateTaskWorkLog failed", zap.Error(err), zap.Any("req", logReq))
|
||||||
|
} else {
|
||||||
|
zap.L().Info("CreateTaskWorkLog success", zap.Any("resp", logResp))
|
||||||
|
}
|
||||||
|
|
||||||
service.Success(ctx, resp)
|
service.Success(ctx, resp)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@ -39,6 +39,14 @@ func SaveUrlFileDisk(url string, path string, filename string) (fullPath string,
|
|||||||
bytes, err := io.ReadAll(resp.Body)
|
bytes, err := io.ReadAll(resp.Body)
|
||||||
fullPath = fmt.Sprintf("%s/%s", path, filename)
|
fullPath = fmt.Sprintf("%s/%s", path, filename)
|
||||||
// 写入数据
|
// 写入数据
|
||||||
err = os.WriteFile(fullPath, bytes, 0777)
|
err = os.WriteFile(fullPath, bytes, 0666)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// Linux系统下需要显式设置文件权限
|
||||||
|
if err = os.Chmod(fullPath, 0666); err != nil {
|
||||||
|
// 权限设置失败不影响主流程
|
||||||
|
err = nil
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@ -90,6 +90,7 @@ func GetBytes(url string, header map[string]interface{}) ([]byte, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func GetUrl(apiUrl string, headerData map[string]string, proxyURL ...string) (statusCode int, body []byte, err error) {
|
func GetUrl(apiUrl string, headerData map[string]string, proxyURL ...string) (statusCode int, body []byte, err error) {
|
||||||
|
zap.L().Info("Get", zap.Any("url", apiUrl), zap.Any("header", headerData))
|
||||||
req, err := http.NewRequest("GET", apiUrl, nil)
|
req, err := http.NewRequest("GET", apiUrl, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
zap.L().Error("Get", zap.Any("url", apiUrl), zap.Error(err))
|
zap.L().Error("Get", zap.Any("url", apiUrl), zap.Error(err))
|
||||||
|
|||||||
@ -7,3 +7,14 @@ func CleanString(s string) string {
|
|||||||
fields := strings.Fields(s)
|
fields := strings.Fields(s)
|
||||||
return strings.Join(fields, "")
|
return strings.Join(fields, "")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TruncateString(s string, maxLen int) string {
|
||||||
|
if maxLen <= 0 {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
runes := []rune(s)
|
||||||
|
if len(runes) <= maxLen {
|
||||||
|
return s
|
||||||
|
}
|
||||||
|
return string(runes[:maxLen])
|
||||||
|
}
|
||||||
|
|||||||
@ -80,6 +80,11 @@ func CheckDirPath(path string, create bool) (exists bool, err error) {
|
|||||||
if err = os.MkdirAll(path, os.ModePerm); err != nil {
|
if err = os.MkdirAll(path, os.ModePerm); err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
// Linux系统下需要显式设置目录权限,确保可读写
|
||||||
|
if err = os.Chmod(path, 0755); err != nil {
|
||||||
|
// 权限设置失败不影响主流程,只记录警告
|
||||||
|
err = nil
|
||||||
|
}
|
||||||
}
|
}
|
||||||
exists = true
|
exists = true
|
||||||
return
|
return
|
||||||
@ -137,6 +142,11 @@ func CreateDirPath(path string) (err error) {
|
|||||||
if err = os.MkdirAll(path, os.ModePerm); err != nil {
|
if err = os.MkdirAll(path, os.ModePerm); err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
// Linux系统下需要显式设置目录权限,确保可读写
|
||||||
|
if err = os.Chmod(path, 0755); err != nil {
|
||||||
|
// 权限设置失败不影响主流程,只记录警告
|
||||||
|
err = nil
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user