Merge branch 'main' into wwq

This commit is contained in:
bx1834938347-prog 2026-01-16 09:45:19 +08:00
commit d0ea217581
51 changed files with 21233 additions and 7443 deletions

File diff suppressed because it is too large Load Diff

View File

@ -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 {

View File

@ -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
} }

View File

@ -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

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
// Code generated by protoc-gen-go-triple. DO NOT EDIT. // Code generated by protoc-gen-go-triple. DO NOT EDIT.
// versions: // versions:
// - protoc-gen-go-triple v1.0.8 // - protoc-gen-go-triple v1.0.5
// - protoc v3.21.1 // - protoc v5.26.0
// source: pb/bundle.proto // source: pb/bundle.proto
package bundle package bundle

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -38,6 +38,7 @@ type CastClient interface {
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) 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)
WorkListPublished(ctx context.Context, in *WorkListPublishedReq, opts ...grpc_go.CallOption) (*WorkListPublishedResp, 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)
MediaAccounts(ctx context.Context, in *MediaAccountsReq, opts ...grpc_go.CallOption) (*MediaAccountsResp, common.ErrorWithAttachment) MediaAccounts(ctx context.Context, in *MediaAccountsReq, opts ...grpc_go.CallOption) (*MediaAccountsResp, common.ErrorWithAttachment)
@ -104,6 +105,7 @@ type CastClient interface {
CalculateMediaMetricsByWorks(ctx context.Context, in *CalculateMediaMetricsByWorksReq, opts ...grpc_go.CallOption) (*CalculateMediaMetricsByWorksResp, 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)
GetArtistAyrShareInfoByPlatformIDs(ctx context.Context, in *GetArtistAyrShareInfoByPlatformIDsReq, opts ...grpc_go.CallOption) (*GetArtistAyrShareInfoByPlatformIDsResp, common.ErrorWithAttachment)
// 作品平台信息相关接口 // 作品平台信息相关接口
ListWorkPlatformInfo(ctx context.Context, in *ListWorkPlatformInfoReq, opts ...grpc_go.CallOption) (*ListWorkPlatformInfoResp, common.ErrorWithAttachment) ListWorkPlatformInfo(ctx context.Context, in *ListWorkPlatformInfoReq, opts ...grpc_go.CallOption) (*ListWorkPlatformInfoResp, common.ErrorWithAttachment)
// 任务列表相关接口 // 任务列表相关接口
@ -111,6 +113,23 @@ type CastClient interface {
GetTaskList(ctx context.Context, in *GetTaskListReq, opts ...grpc_go.CallOption) (*GetTaskListResp, 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) 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) 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)
BatchUpdateCastTags(ctx context.Context, in *BatchUpdateCastTagsReq, opts ...grpc_go.CallOption) (*emptypb.Empty, 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)
// 竞品报告相关接口
CreateCompetitiveReport(ctx context.Context, in *CreateCompetitiveReportReq, opts ...grpc_go.CallOption) (*CreateCompetitiveReportResp, common.ErrorWithAttachment)
ImportCompetitiveReportBatch(ctx context.Context, in *ImportCompetitiveReportBatchReq, opts ...grpc_go.CallOption) (*ImportCompetitiveReportBatchResp, common.ErrorWithAttachment)
UpdateCompetitiveReportStatus(ctx context.Context, in *UpdateCompetitiveReportStatusReq, opts ...grpc_go.CallOption) (*emptypb.Empty, common.ErrorWithAttachment)
GetCompetitiveReport(ctx context.Context, in *GetCompetitiveReportDetailReq, opts ...grpc_go.CallOption) (*GetCompetitiveReportDetailResp, common.ErrorWithAttachment)
GetCompetitiveReportForApp(ctx context.Context, in *GetCompetitiveReportForAppReq, opts ...grpc_go.CallOption) (*GetCompetitiveReportForAppResp, common.ErrorWithAttachment)
ListCompetitiveReport(ctx context.Context, in *ListCompetitiveReportReq, opts ...grpc_go.CallOption) (*ListCompetitiveReportResp, common.ErrorWithAttachment)
DeleteCompetitiveReport(ctx context.Context, in *DeleteCompetitiveReportReq, opts ...grpc_go.CallOption) (*emptypb.Empty, common.ErrorWithAttachment)
UpdateCompetitiveReportApprovalID(ctx context.Context, in *UpdateCompetitiveReportApprovalIDReq, opts ...grpc_go.CallOption) (*emptypb.Empty, common.ErrorWithAttachment)
CountCompetitiveReportByWorkUuids(ctx context.Context, in *CountCompetitiveReportByWorkUuidsReq, opts ...grpc_go.CallOption) (*CountCompetitiveReportByWorkUuidsResp, common.ErrorWithAttachment)
} }
type castClient struct { type castClient struct {
@ -127,6 +146,7 @@ type CastClientImpl struct {
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) 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)
WorkListPublished func(ctx context.Context, in *WorkListPublishedReq) (*WorkListPublishedResp, 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)
MediaAccounts func(ctx context.Context, in *MediaAccountsReq) (*MediaAccountsResp, error) MediaAccounts func(ctx context.Context, in *MediaAccountsReq) (*MediaAccountsResp, error)
@ -182,11 +202,27 @@ type CastClientImpl struct {
ListWorkMetricsDaily func(ctx context.Context, in *ListWorkMetricsDailyReq) (*ListWorkMetricsDailyResp, error) ListWorkMetricsDaily func(ctx context.Context, in *ListWorkMetricsDailyReq) (*ListWorkMetricsDailyResp, error)
CalculateMediaMetricsByWorks func(ctx context.Context, in *CalculateMediaMetricsByWorksReq) (*CalculateMediaMetricsByWorksResp, 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)
GetArtistAyrShareInfoByPlatformIDs func(ctx context.Context, in *GetArtistAyrShareInfoByPlatformIDsReq) (*GetArtistAyrShareInfoByPlatformIDsResp, 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) UpsertTaskList func(ctx context.Context, in *UpsertTaskListReq) (*UpsertTaskListResp, error)
GetTaskList func(ctx context.Context, in *GetTaskListReq) (*GetTaskListResp, error) GetTaskList func(ctx context.Context, in *GetTaskListReq) (*GetTaskListResp, error)
ListTaskList func(ctx context.Context, in *ListTaskListReq) (*ListTaskListResp, error) ListTaskList func(ctx context.Context, in *ListTaskListReq) (*ListTaskListResp, error)
DeleteTaskList func(ctx context.Context, in *DeleteTaskListReq) (*emptypb.Empty, 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)
BatchUpdateCastTags func(ctx context.Context, in *BatchUpdateCastTagsReq) (*emptypb.Empty, error)
UpdateCastTagStatus func(ctx context.Context, in *UpdateCastTagStatusReq) (*emptypb.Empty, error)
RecalculateCastTagQuoteCount func(ctx context.Context, in *emptypb.Empty) (*RecalculateCastTagQuoteCountResp, error)
CreateCompetitiveReport func(ctx context.Context, in *CreateCompetitiveReportReq) (*CreateCompetitiveReportResp, error)
ImportCompetitiveReportBatch func(ctx context.Context, in *ImportCompetitiveReportBatchReq) (*ImportCompetitiveReportBatchResp, error)
UpdateCompetitiveReportStatus func(ctx context.Context, in *UpdateCompetitiveReportStatusReq) (*emptypb.Empty, error)
GetCompetitiveReport func(ctx context.Context, in *GetCompetitiveReportDetailReq) (*GetCompetitiveReportDetailResp, error)
GetCompetitiveReportForApp func(ctx context.Context, in *GetCompetitiveReportForAppReq) (*GetCompetitiveReportForAppResp, error)
ListCompetitiveReport func(ctx context.Context, in *ListCompetitiveReportReq) (*ListCompetitiveReportResp, error)
DeleteCompetitiveReport func(ctx context.Context, in *DeleteCompetitiveReportReq) (*emptypb.Empty, error)
UpdateCompetitiveReportApprovalID func(ctx context.Context, in *UpdateCompetitiveReportApprovalIDReq) (*emptypb.Empty, error)
CountCompetitiveReportByWorkUuids func(ctx context.Context, in *CountCompetitiveReportByWorkUuidsReq) (*CountCompetitiveReportByWorkUuidsResp, error)
} }
func (c *CastClientImpl) GetDubboStub(cc *triple.TripleConn) CastClient { func (c *CastClientImpl) GetDubboStub(cc *triple.TripleConn) CastClient {
@ -255,6 +291,12 @@ func (c *castClient) WorkList(ctx context.Context, in *WorkListReq, opts ...grpc
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/WorkList", in, out) return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/WorkList", in, out)
} }
func (c *castClient) WorkListPublished(ctx context.Context, in *WorkListPublishedReq, opts ...grpc_go.CallOption) (*WorkListPublishedResp, common.ErrorWithAttachment) {
out := new(WorkListPublishedResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/WorkListPublished", in, out)
}
func (c *castClient) WorkDetail(ctx context.Context, in *WorkDetailReq, opts ...grpc_go.CallOption) (*WorkDetailResp, common.ErrorWithAttachment) { func (c *castClient) WorkDetail(ctx context.Context, in *WorkDetailReq, opts ...grpc_go.CallOption) (*WorkDetailResp, common.ErrorWithAttachment) {
out := new(WorkDetailResp) out := new(WorkDetailResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string) interfaceKey := ctx.Value(constant.InterfaceKey).(string)
@ -585,6 +627,12 @@ func (c *castClient) GetArtistAyrShareInfo(ctx context.Context, in *GetArtistAyr
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetArtistAyrShareInfo", in, out) return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetArtistAyrShareInfo", in, out)
} }
func (c *castClient) GetArtistAyrShareInfoByPlatformIDs(ctx context.Context, in *GetArtistAyrShareInfoByPlatformIDsReq, opts ...grpc_go.CallOption) (*GetArtistAyrShareInfoByPlatformIDsResp, common.ErrorWithAttachment) {
out := new(GetArtistAyrShareInfoByPlatformIDsResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetArtistAyrShareInfoByPlatformIDs", in, out)
}
func (c *castClient) ListWorkPlatformInfo(ctx context.Context, in *ListWorkPlatformInfoReq, opts ...grpc_go.CallOption) (*ListWorkPlatformInfoResp, common.ErrorWithAttachment) { func (c *castClient) ListWorkPlatformInfo(ctx context.Context, in *ListWorkPlatformInfoReq, opts ...grpc_go.CallOption) (*ListWorkPlatformInfoResp, common.ErrorWithAttachment) {
out := new(ListWorkPlatformInfoResp) out := new(ListWorkPlatformInfoResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string) interfaceKey := ctx.Value(constant.InterfaceKey).(string)
@ -615,6 +663,96 @@ func (c *castClient) DeleteTaskList(ctx context.Context, in *DeleteTaskListReq,
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/DeleteTaskList", in, out) 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) BatchUpdateCastTags(ctx context.Context, in *BatchUpdateCastTagsReq, 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+"/BatchUpdateCastTags", 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)
}
func (c *castClient) CreateCompetitiveReport(ctx context.Context, in *CreateCompetitiveReportReq, opts ...grpc_go.CallOption) (*CreateCompetitiveReportResp, common.ErrorWithAttachment) {
out := new(CreateCompetitiveReportResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/CreateCompetitiveReport", in, out)
}
func (c *castClient) ImportCompetitiveReportBatch(ctx context.Context, in *ImportCompetitiveReportBatchReq, opts ...grpc_go.CallOption) (*ImportCompetitiveReportBatchResp, common.ErrorWithAttachment) {
out := new(ImportCompetitiveReportBatchResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/ImportCompetitiveReportBatch", in, out)
}
func (c *castClient) UpdateCompetitiveReportStatus(ctx context.Context, in *UpdateCompetitiveReportStatusReq, 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+"/UpdateCompetitiveReportStatus", in, out)
}
func (c *castClient) GetCompetitiveReport(ctx context.Context, in *GetCompetitiveReportDetailReq, opts ...grpc_go.CallOption) (*GetCompetitiveReportDetailResp, common.ErrorWithAttachment) {
out := new(GetCompetitiveReportDetailResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetCompetitiveReport", in, out)
}
func (c *castClient) GetCompetitiveReportForApp(ctx context.Context, in *GetCompetitiveReportForAppReq, opts ...grpc_go.CallOption) (*GetCompetitiveReportForAppResp, common.ErrorWithAttachment) {
out := new(GetCompetitiveReportForAppResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetCompetitiveReportForApp", in, out)
}
func (c *castClient) ListCompetitiveReport(ctx context.Context, in *ListCompetitiveReportReq, opts ...grpc_go.CallOption) (*ListCompetitiveReportResp, common.ErrorWithAttachment) {
out := new(ListCompetitiveReportResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/ListCompetitiveReport", in, out)
}
func (c *castClient) DeleteCompetitiveReport(ctx context.Context, in *DeleteCompetitiveReportReq, 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+"/DeleteCompetitiveReport", in, out)
}
func (c *castClient) UpdateCompetitiveReportApprovalID(ctx context.Context, in *UpdateCompetitiveReportApprovalIDReq, 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+"/UpdateCompetitiveReportApprovalID", in, out)
}
func (c *castClient) CountCompetitiveReportByWorkUuids(ctx context.Context, in *CountCompetitiveReportByWorkUuidsReq, opts ...grpc_go.CallOption) (*CountCompetitiveReportByWorkUuidsResp, common.ErrorWithAttachment) {
out := new(CountCompetitiveReportByWorkUuidsResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/CountCompetitiveReportByWorkUuids", 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
@ -628,6 +766,7 @@ type CastServer interface {
MediaInfo(context.Context, *MediaInfoReq) (*MediaInfoResp, error) MediaInfo(context.Context, *MediaInfoReq) (*MediaInfoResp, error)
MediaInfoByPlatform(context.Context, *MediaInfoByPlatformReq) (*MediaInfoByPlatformResp, error) MediaInfoByPlatform(context.Context, *MediaInfoByPlatformReq) (*MediaInfoByPlatformResp, error)
WorkList(context.Context, *WorkListReq) (*WorkListResp, error) WorkList(context.Context, *WorkListReq) (*WorkListResp, error)
WorkListPublished(context.Context, *WorkListPublishedReq) (*WorkListPublishedResp, 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)
MediaAccounts(context.Context, *MediaAccountsReq) (*MediaAccountsResp, error) MediaAccounts(context.Context, *MediaAccountsReq) (*MediaAccountsResp, error)
@ -694,6 +833,7 @@ type CastServer interface {
CalculateMediaMetricsByWorks(context.Context, *CalculateMediaMetricsByWorksReq) (*CalculateMediaMetricsByWorksResp, error) CalculateMediaMetricsByWorks(context.Context, *CalculateMediaMetricsByWorksReq) (*CalculateMediaMetricsByWorksResp, error)
// 艺人AyrShare信息相关接口 // 艺人AyrShare信息相关接口
GetArtistAyrShareInfo(context.Context, *GetArtistAyrShareInfoReq) (*GetArtistAyrShareInfoResp, error) GetArtistAyrShareInfo(context.Context, *GetArtistAyrShareInfoReq) (*GetArtistAyrShareInfoResp, error)
GetArtistAyrShareInfoByPlatformIDs(context.Context, *GetArtistAyrShareInfoByPlatformIDsReq) (*GetArtistAyrShareInfoByPlatformIDsResp, error)
// 作品平台信息相关接口 // 作品平台信息相关接口
ListWorkPlatformInfo(context.Context, *ListWorkPlatformInfoReq) (*ListWorkPlatformInfoResp, error) ListWorkPlatformInfo(context.Context, *ListWorkPlatformInfoReq) (*ListWorkPlatformInfoResp, error)
// 任务列表相关接口 // 任务列表相关接口
@ -701,6 +841,23 @@ type CastServer interface {
GetTaskList(context.Context, *GetTaskListReq) (*GetTaskListResp, error) GetTaskList(context.Context, *GetTaskListReq) (*GetTaskListResp, error)
ListTaskList(context.Context, *ListTaskListReq) (*ListTaskListResp, error) ListTaskList(context.Context, *ListTaskListReq) (*ListTaskListResp, error)
DeleteTaskList(context.Context, *DeleteTaskListReq) (*emptypb.Empty, 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)
BatchUpdateCastTags(context.Context, *BatchUpdateCastTagsReq) (*emptypb.Empty, error)
UpdateCastTagStatus(context.Context, *UpdateCastTagStatusReq) (*emptypb.Empty, error)
RecalculateCastTagQuoteCount(context.Context, *emptypb.Empty) (*RecalculateCastTagQuoteCountResp, error)
// 竞品报告相关接口
CreateCompetitiveReport(context.Context, *CreateCompetitiveReportReq) (*CreateCompetitiveReportResp, error)
ImportCompetitiveReportBatch(context.Context, *ImportCompetitiveReportBatchReq) (*ImportCompetitiveReportBatchResp, error)
UpdateCompetitiveReportStatus(context.Context, *UpdateCompetitiveReportStatusReq) (*emptypb.Empty, error)
GetCompetitiveReport(context.Context, *GetCompetitiveReportDetailReq) (*GetCompetitiveReportDetailResp, error)
GetCompetitiveReportForApp(context.Context, *GetCompetitiveReportForAppReq) (*GetCompetitiveReportForAppResp, error)
ListCompetitiveReport(context.Context, *ListCompetitiveReportReq) (*ListCompetitiveReportResp, error)
DeleteCompetitiveReport(context.Context, *DeleteCompetitiveReportReq) (*emptypb.Empty, error)
UpdateCompetitiveReportApprovalID(context.Context, *UpdateCompetitiveReportApprovalIDReq) (*emptypb.Empty, error)
CountCompetitiveReportByWorkUuids(context.Context, *CountCompetitiveReportByWorkUuidsReq) (*CountCompetitiveReportByWorkUuidsResp, error)
mustEmbedUnimplementedCastServer() mustEmbedUnimplementedCastServer()
} }
@ -736,6 +893,9 @@ func (UnimplementedCastServer) MediaInfoByPlatform(context.Context, *MediaInfoBy
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")
} }
func (UnimplementedCastServer) WorkListPublished(context.Context, *WorkListPublishedReq) (*WorkListPublishedResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method WorkListPublished not implemented")
}
func (UnimplementedCastServer) WorkDetail(context.Context, *WorkDetailReq) (*WorkDetailResp, error) { func (UnimplementedCastServer) WorkDetail(context.Context, *WorkDetailReq) (*WorkDetailResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method WorkDetail not implemented") return nil, status.Errorf(codes.Unimplemented, "method WorkDetail not implemented")
} }
@ -901,6 +1061,9 @@ func (UnimplementedCastServer) CalculateMediaMetricsByWorks(context.Context, *Ca
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) GetArtistAyrShareInfoByPlatformIDs(context.Context, *GetArtistAyrShareInfoByPlatformIDsReq) (*GetArtistAyrShareInfoByPlatformIDsResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetArtistAyrShareInfoByPlatformIDs 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")
} }
@ -916,6 +1079,51 @@ func (UnimplementedCastServer) ListTaskList(context.Context, *ListTaskListReq) (
func (UnimplementedCastServer) DeleteTaskList(context.Context, *DeleteTaskListReq) (*emptypb.Empty, error) { func (UnimplementedCastServer) DeleteTaskList(context.Context, *DeleteTaskListReq) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeleteTaskList not implemented") 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) BatchUpdateCastTags(context.Context, *BatchUpdateCastTagsReq) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method BatchUpdateCastTags 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 (UnimplementedCastServer) CreateCompetitiveReport(context.Context, *CreateCompetitiveReportReq) (*CreateCompetitiveReportResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateCompetitiveReport not implemented")
}
func (UnimplementedCastServer) ImportCompetitiveReportBatch(context.Context, *ImportCompetitiveReportBatchReq) (*ImportCompetitiveReportBatchResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method ImportCompetitiveReportBatch not implemented")
}
func (UnimplementedCastServer) UpdateCompetitiveReportStatus(context.Context, *UpdateCompetitiveReportStatusReq) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateCompetitiveReportStatus not implemented")
}
func (UnimplementedCastServer) GetCompetitiveReport(context.Context, *GetCompetitiveReportDetailReq) (*GetCompetitiveReportDetailResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetCompetitiveReport not implemented")
}
func (UnimplementedCastServer) GetCompetitiveReportForApp(context.Context, *GetCompetitiveReportForAppReq) (*GetCompetitiveReportForAppResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetCompetitiveReportForApp not implemented")
}
func (UnimplementedCastServer) ListCompetitiveReport(context.Context, *ListCompetitiveReportReq) (*ListCompetitiveReportResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListCompetitiveReport not implemented")
}
func (UnimplementedCastServer) DeleteCompetitiveReport(context.Context, *DeleteCompetitiveReportReq) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeleteCompetitiveReport not implemented")
}
func (UnimplementedCastServer) UpdateCompetitiveReportApprovalID(context.Context, *UpdateCompetitiveReportApprovalIDReq) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateCompetitiveReportApprovalID not implemented")
}
func (UnimplementedCastServer) CountCompetitiveReportByWorkUuids(context.Context, *CountCompetitiveReportByWorkUuidsReq) (*CountCompetitiveReportByWorkUuidsResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method CountCompetitiveReportByWorkUuids not implemented")
}
func (s *UnimplementedCastServer) XXX_SetProxyImpl(impl protocol.Invoker) { func (s *UnimplementedCastServer) XXX_SetProxyImpl(impl protocol.Invoker) {
s.proxyImpl = impl s.proxyImpl = impl
} }
@ -1205,6 +1413,35 @@ func _Cast_WorkList_Handler(srv interface{}, ctx context.Context, dec func(inter
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
func _Cast_WorkListPublished_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(WorkListPublishedReq)
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("WorkListPublished", 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_WorkDetail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) { func _Cast_WorkDetail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(WorkDetailReq) in := new(WorkDetailReq)
if err := dec(in); err != nil { if err := dec(in); err != nil {
@ -2800,6 +3037,35 @@ func _Cast_GetArtistAyrShareInfo_Handler(srv interface{}, ctx context.Context, d
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
func _Cast_GetArtistAyrShareInfoByPlatformIDs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(GetArtistAyrShareInfoByPlatformIDsReq)
if err := dec(in); err != nil {
return nil, err
}
base := srv.(dubbo3.Dubbo3GrpcService)
args := []interface{}{}
args = append(args, in)
md, _ := metadata.FromIncomingContext(ctx)
invAttachment := make(map[string]interface{}, len(md))
for k, v := range md {
invAttachment[k] = v
}
invo := invocation.NewRPCInvocation("GetArtistAyrShareInfoByPlatformIDs", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _Cast_ListWorkPlatformInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) { func _Cast_ListWorkPlatformInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(ListWorkPlatformInfoReq) in := new(ListWorkPlatformInfoReq)
if err := dec(in); err != nil { if err := dec(in); err != nil {
@ -2945,6 +3211,441 @@ func _Cast_DeleteTaskList_Handler(srv interface{}, ctx context.Context, dec func
return interceptor(ctx, in, info, handler) 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_BatchUpdateCastTags_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(BatchUpdateCastTagsReq)
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("BatchUpdateCastTags", 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)
}
func _Cast_CreateCompetitiveReport_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateCompetitiveReportReq)
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("CreateCompetitiveReport", 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_ImportCompetitiveReportBatch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(ImportCompetitiveReportBatchReq)
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("ImportCompetitiveReportBatch", 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_UpdateCompetitiveReportStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdateCompetitiveReportStatusReq)
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("UpdateCompetitiveReportStatus", 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_GetCompetitiveReport_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(GetCompetitiveReportDetailReq)
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("GetCompetitiveReport", 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_GetCompetitiveReportForApp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(GetCompetitiveReportForAppReq)
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("GetCompetitiveReportForApp", 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_ListCompetitiveReport_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(ListCompetitiveReportReq)
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("ListCompetitiveReport", 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_DeleteCompetitiveReport_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(DeleteCompetitiveReportReq)
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("DeleteCompetitiveReport", 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_UpdateCompetitiveReportApprovalID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdateCompetitiveReportApprovalIDReq)
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("UpdateCompetitiveReportApprovalID", 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_CountCompetitiveReportByWorkUuids_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(CountCompetitiveReportByWorkUuidsReq)
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("CountCompetitiveReportByWorkUuids", 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)
@ -2988,6 +3689,10 @@ var Cast_ServiceDesc = grpc_go.ServiceDesc{
MethodName: "WorkList", MethodName: "WorkList",
Handler: _Cast_WorkList_Handler, Handler: _Cast_WorkList_Handler,
}, },
{
MethodName: "WorkListPublished",
Handler: _Cast_WorkListPublished_Handler,
},
{ {
MethodName: "WorkDetail", MethodName: "WorkDetail",
Handler: _Cast_WorkDetail_Handler, Handler: _Cast_WorkDetail_Handler,
@ -3208,6 +3913,10 @@ var Cast_ServiceDesc = grpc_go.ServiceDesc{
MethodName: "GetArtistAyrShareInfo", MethodName: "GetArtistAyrShareInfo",
Handler: _Cast_GetArtistAyrShareInfo_Handler, Handler: _Cast_GetArtistAyrShareInfo_Handler,
}, },
{
MethodName: "GetArtistAyrShareInfoByPlatformIDs",
Handler: _Cast_GetArtistAyrShareInfoByPlatformIDs_Handler,
},
{ {
MethodName: "ListWorkPlatformInfo", MethodName: "ListWorkPlatformInfo",
Handler: _Cast_ListWorkPlatformInfo_Handler, Handler: _Cast_ListWorkPlatformInfo_Handler,
@ -3228,6 +3937,66 @@ var Cast_ServiceDesc = grpc_go.ServiceDesc{
MethodName: "DeleteTaskList", MethodName: "DeleteTaskList",
Handler: _Cast_DeleteTaskList_Handler, Handler: _Cast_DeleteTaskList_Handler,
}, },
{
MethodName: "UpdateCastTag",
Handler: _Cast_UpdateCastTag_Handler,
},
{
MethodName: "ListCastTags",
Handler: _Cast_ListCastTags_Handler,
},
{
MethodName: "UpdateCastTagBatch",
Handler: _Cast_UpdateCastTagBatch_Handler,
},
{
MethodName: "BatchUpdateCastTags",
Handler: _Cast_BatchUpdateCastTags_Handler,
},
{
MethodName: "UpdateCastTagStatus",
Handler: _Cast_UpdateCastTagStatus_Handler,
},
{
MethodName: "RecalculateCastTagQuoteCount",
Handler: _Cast_RecalculateCastTagQuoteCount_Handler,
},
{
MethodName: "CreateCompetitiveReport",
Handler: _Cast_CreateCompetitiveReport_Handler,
},
{
MethodName: "ImportCompetitiveReportBatch",
Handler: _Cast_ImportCompetitiveReportBatch_Handler,
},
{
MethodName: "UpdateCompetitiveReportStatus",
Handler: _Cast_UpdateCompetitiveReportStatus_Handler,
},
{
MethodName: "GetCompetitiveReport",
Handler: _Cast_GetCompetitiveReport_Handler,
},
{
MethodName: "GetCompetitiveReportForApp",
Handler: _Cast_GetCompetitiveReportForApp_Handler,
},
{
MethodName: "ListCompetitiveReport",
Handler: _Cast_ListCompetitiveReport_Handler,
},
{
MethodName: "DeleteCompetitiveReport",
Handler: _Cast_DeleteCompetitiveReport_Handler,
},
{
MethodName: "UpdateCompetitiveReportApprovalID",
Handler: _Cast_UpdateCompetitiveReportApprovalID_Handler,
},
{
MethodName: "CountCompetitiveReportByWorkUuids",
Handler: _Cast_CountCompetitiveReportByWorkUuids_Handler,
},
}, },
Streams: []grpc_go.StreamDesc{}, Streams: []grpc_go.StreamDesc{},
Metadata: "pb/fiee/cast.proto", Metadata: "pb/fiee/cast.proto",

2209
api/supplier/supplier.pb.go Normal file

File diff suppressed because it is too large Load Diff

208
api/supplier/supplier.proto Normal file
View File

@ -0,0 +1,208 @@
syntax = "proto3";
package supplier;
option go_package = "./;supplier";
// FiEE供应商微服务
service Supplier {
//curd
rpc GetSupplier(GetSupplierRequest) returns (UpdateSupplierRequest) {}
rpc CreateSupplier(CreateSupplierRequest) returns (CreateSupplierResponse) {}
rpc UpdateSupplier(UpdateSupplierRequest) returns (CreateSupplierResponse) {}
rpc GetSupplierList(GetSupplierListRequest) returns (GetSupplierListResponse) {}
//
rpc CreateOrganizeDictionary(CreateOrganizeDictionaryRequest) returns (CreateOrganizeDictionaryResponse) {}
rpc GetOrganizeDictionaryList(GetOrganizeDictionaryListRequest) returns (GetOrganizeDictionaryListResponse) {}
rpc GetOrganizeDictionaryInfo(CreateOrganizeDictionaryRequest) returns (OrganizeDictionary) {}
//
rpc GetCountryRegionList(GetCountryRegionListRequest) returns (GetCountryRegionListResponse) {}
rpc GetCountryRegionInfo(GetCountryRegionInfoRequest) returns (CountryRegion) {}
//
rpc CreateImportRecord(CreateImportRecordRequest) returns (CreateImportRecordResponse) {}
rpc GetImportRecordInfo(GetImportRecordRequest) returns (GetImportRecordResponse) {}
}
message GetImportRecordRequest{
string uuid = 1;
}
message GetImportRecordResponse{
uint64 successNum = 1;
uint64 failNum = 2;
string deriveUrl = 3;
}
message CreateImportRecordRequest{
repeated string supplierCodes = 1;
uint64 status = 2;
uint64 userId = 3;
string toLeadUrl = 4;
string deriveUrl = 5;
string uuid = 6;
uint64 successNum = 7;
uint64 failNum = 8;
}
message CreateImportRecordResponse{
uint64 id = 1;
}
message GetCountryRegionListResponse{
repeated CountryRegion data = 1;
uint64 page = 2;
uint64 pageSize = 3;
uint64 total = 4;
}
message CountryRegion{
uint64 id = 1;
string nameEN = 2;
string nameCN = 3;
string code = 4;
}
message GetCountryRegionInfoRequest{
string zhAndCode = 1;
}
message GetCountryRegionListRequest{
uint64 page = 1;
uint64 pageSize = 2;
string nameEN = 3;
string nameCN = 4;
string code = 5;
}
message OrganizeDictionary{
uint64 id = 1;
string name = 2;
}
message GetOrganizeDictionaryListResponse{
repeated OrganizeDictionary data = 1;
uint64 page = 2;
uint64 pageSize = 3;
uint64 total = 4;
}
message CreateOrganizeDictionaryRequest{
string name = 1;
}
message CreateOrganizeDictionaryResponse{
uint64 id = 1;
}
message GetOrganizeDictionaryListRequest{
uint64 page = 1;
uint64 pageSize = 2;
string name = 3;
}
message GetSupplierListRequest{
uint64 page = 1;
uint64 pageSize = 2;
uint64 owningEntityId = 3;
string supplierUniqueCode = 4;
string legalName =5;
string localName = 6;
string abbreviationName =7;
uint64 countryOrRegionId = 8;
string companyRegistrationNumber =9;
string supplierType =10;
string approvalStatus = 11;
string approvalDateStart = 12;
string approvalDateEnd = 13;
string lastReviewDateStart = 14;
string lastReviewDateEnd = 15;
string legalEntityType = 16;
string sanctionsCountryScreeningResult = 17;
string keyFinancial = 18;
string companyAddress = 19;
string primaryContact = 20;
string dataOwnerDepartment = 21;
string basicCompanyInformation = 22;
uint64 status = 23;
string updateStart = 24;
string updateEnd = 25;
}
message GetSupplierListResponse{
uint64 total = 1;
repeated SupplierInfo data = 2;
uint64 page = 3;
uint64 pageSize = 4;
}
message SupplierInfo{
uint64 id = 1;
uint64 owningEntityId = 2;
string legalName = 3;
string localName = 4;
string abbreviationName = 5;
uint64 countryOrRegionId = 6;
string companyRegistrationNumber = 7;
string supplierType = 8;
string approvalStatus = 9;
string approvalDate = 10;
string lastReviewDate = 11;
string legalEntityType = 12;
string sanctionsCountryScreeningResult = 13;
string keyFinancial = 14;
string companyAddress = 15;
string primaryContact = 16;
string dataOwnerDepartment = 17;
string basicCompanyInformation = 18;
string linkAddress = 19;
string supplementaryText = 20;
repeated attachment attachments = 21;
uint64 status = 22;
string createdAt = 23;
string updatedAt = 24;
string supplierUniqueCode = 25;
string owningEntityName = 26;
string countryOrRegionCode = 27;
}
message UpdateSupplierRequest{
uint64 id = 1;
uint64 owningEntityId = 2;
string legalName = 3;
string localName = 4;
string abbreviationName = 5;
uint64 countryOrRegionId = 6;
string companyRegistrationNumber = 7;
string supplierType = 8;
string approvalStatus = 9;
string approvalDate = 10;
string lastReviewDate = 11;
string legalEntityType = 12;
string sanctionsCountryScreeningResult = 13;
string keyFinancial = 14;
string companyAddress = 15;
string primaryContact = 16;
string dataOwnerDepartment = 17;
string basicCompanyInformation = 18;
string linkAddress = 19;
string supplementaryText = 20;
repeated attachment attachments = 21;
uint64 status = 22;
}
message CreateSupplierRequest{
uint64 owningEntityId = 1;
string legalName = 2;
string localName = 3;
string abbreviationName = 4;
uint64 countryOrRegionId = 5;
string companyRegistrationNumber = 6;
string supplierType = 7;
string approvalStatus = 8;
string approvalDate = 9;
string lastReviewDate = 10;
string legalEntityType = 11;
string sanctionsCountryScreeningResult = 12;
string keyFinancial = 13;
string companyAddress = 14;
string primaryContact = 15;
string dataOwnerDepartment = 16;
string basicCompanyInformation = 17;
string linkAddress = 18;
string supplementaryText = 19;
repeated attachment attachments = 20;
uint64 status = 21;
}
message attachment{
string url = 1;
string type = 2;
string name = 3;
}
message CreateSupplierResponse{
uint64 id = 1;
string supplierCode = 2;
}
message GetSupplierRequest{
uint64 id = 1;
}

View File

@ -0,0 +1,122 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: api/supplier/supplier.proto
package supplier
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 *GetImportRecordRequest) Validate() error {
return nil
}
func (this *GetImportRecordResponse) Validate() error {
return nil
}
func (this *CreateImportRecordRequest) Validate() error {
return nil
}
func (this *CreateImportRecordResponse) Validate() error {
return nil
}
func (this *GetCountryRegionListResponse) 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 *CountryRegion) Validate() error {
return nil
}
func (this *GetCountryRegionInfoRequest) Validate() error {
return nil
}
func (this *GetCountryRegionListRequest) Validate() error {
return nil
}
func (this *OrganizeDictionary) Validate() error {
return nil
}
func (this *GetOrganizeDictionaryListResponse) 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 *CreateOrganizeDictionaryRequest) Validate() error {
return nil
}
func (this *CreateOrganizeDictionaryResponse) Validate() error {
return nil
}
func (this *GetOrganizeDictionaryListRequest) Validate() error {
return nil
}
func (this *GetSupplierListRequest) Validate() error {
return nil
}
func (this *GetSupplierListResponse) 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 *SupplierInfo) Validate() error {
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)
}
}
}
return nil
}
func (this *UpdateSupplierRequest) Validate() error {
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)
}
}
}
return nil
}
func (this *CreateSupplierRequest) Validate() error {
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)
}
}
}
return nil
}
func (this *Attachment) Validate() error {
return nil
}
func (this *CreateSupplierResponse) Validate() error {
return nil
}
func (this *GetSupplierRequest) Validate() error {
return nil
}

View File

@ -0,0 +1,605 @@
// Code generated by protoc-gen-go-triple. DO NOT EDIT.
// versions:
// - protoc-gen-go-triple v1.0.5
// - protoc v6.32.0
// source: api/supplier/supplier.proto
package supplier
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"
)
// 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
// SupplierClient is the client API for Supplier 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 SupplierClient interface {
// 供应商curd
GetSupplier(ctx context.Context, in *GetSupplierRequest, opts ...grpc_go.CallOption) (*UpdateSupplierRequest, common.ErrorWithAttachment)
CreateSupplier(ctx context.Context, in *CreateSupplierRequest, opts ...grpc_go.CallOption) (*CreateSupplierResponse, common.ErrorWithAttachment)
UpdateSupplier(ctx context.Context, in *UpdateSupplierRequest, opts ...grpc_go.CallOption) (*CreateSupplierResponse, common.ErrorWithAttachment)
GetSupplierList(ctx context.Context, in *GetSupplierListRequest, opts ...grpc_go.CallOption) (*GetSupplierListResponse, common.ErrorWithAttachment)
// 组织字典
CreateOrganizeDictionary(ctx context.Context, in *CreateOrganizeDictionaryRequest, opts ...grpc_go.CallOption) (*CreateOrganizeDictionaryResponse, common.ErrorWithAttachment)
GetOrganizeDictionaryList(ctx context.Context, in *GetOrganizeDictionaryListRequest, opts ...grpc_go.CallOption) (*GetOrganizeDictionaryListResponse, common.ErrorWithAttachment)
GetOrganizeDictionaryInfo(ctx context.Context, in *CreateOrganizeDictionaryRequest, opts ...grpc_go.CallOption) (*OrganizeDictionary, common.ErrorWithAttachment)
// 国家组织
GetCountryRegionList(ctx context.Context, in *GetCountryRegionListRequest, opts ...grpc_go.CallOption) (*GetCountryRegionListResponse, common.ErrorWithAttachment)
GetCountryRegionInfo(ctx context.Context, in *GetCountryRegionInfoRequest, opts ...grpc_go.CallOption) (*CountryRegion, common.ErrorWithAttachment)
// 导入
CreateImportRecord(ctx context.Context, in *CreateImportRecordRequest, opts ...grpc_go.CallOption) (*CreateImportRecordResponse, common.ErrorWithAttachment)
GetImportRecordInfo(ctx context.Context, in *GetImportRecordRequest, opts ...grpc_go.CallOption) (*GetImportRecordResponse, common.ErrorWithAttachment)
}
type supplierClient struct {
cc *triple.TripleConn
}
type SupplierClientImpl struct {
GetSupplier func(ctx context.Context, in *GetSupplierRequest) (*UpdateSupplierRequest, error)
CreateSupplier func(ctx context.Context, in *CreateSupplierRequest) (*CreateSupplierResponse, error)
UpdateSupplier func(ctx context.Context, in *UpdateSupplierRequest) (*CreateSupplierResponse, error)
GetSupplierList func(ctx context.Context, in *GetSupplierListRequest) (*GetSupplierListResponse, error)
CreateOrganizeDictionary func(ctx context.Context, in *CreateOrganizeDictionaryRequest) (*CreateOrganizeDictionaryResponse, error)
GetOrganizeDictionaryList func(ctx context.Context, in *GetOrganizeDictionaryListRequest) (*GetOrganizeDictionaryListResponse, error)
GetOrganizeDictionaryInfo func(ctx context.Context, in *CreateOrganizeDictionaryRequest) (*OrganizeDictionary, error)
GetCountryRegionList func(ctx context.Context, in *GetCountryRegionListRequest) (*GetCountryRegionListResponse, error)
GetCountryRegionInfo func(ctx context.Context, in *GetCountryRegionInfoRequest) (*CountryRegion, error)
CreateImportRecord func(ctx context.Context, in *CreateImportRecordRequest) (*CreateImportRecordResponse, error)
GetImportRecordInfo func(ctx context.Context, in *GetImportRecordRequest) (*GetImportRecordResponse, error)
}
func (c *SupplierClientImpl) GetDubboStub(cc *triple.TripleConn) SupplierClient {
return NewSupplierClient(cc)
}
func (c *SupplierClientImpl) XXX_InterfaceName() string {
return "supplier.Supplier"
}
func NewSupplierClient(cc *triple.TripleConn) SupplierClient {
return &supplierClient{cc}
}
func (c *supplierClient) GetSupplier(ctx context.Context, in *GetSupplierRequest, opts ...grpc_go.CallOption) (*UpdateSupplierRequest, common.ErrorWithAttachment) {
out := new(UpdateSupplierRequest)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetSupplier", in, out)
}
func (c *supplierClient) CreateSupplier(ctx context.Context, in *CreateSupplierRequest, opts ...grpc_go.CallOption) (*CreateSupplierResponse, common.ErrorWithAttachment) {
out := new(CreateSupplierResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/CreateSupplier", in, out)
}
func (c *supplierClient) UpdateSupplier(ctx context.Context, in *UpdateSupplierRequest, opts ...grpc_go.CallOption) (*CreateSupplierResponse, common.ErrorWithAttachment) {
out := new(CreateSupplierResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/UpdateSupplier", in, out)
}
func (c *supplierClient) GetSupplierList(ctx context.Context, in *GetSupplierListRequest, opts ...grpc_go.CallOption) (*GetSupplierListResponse, common.ErrorWithAttachment) {
out := new(GetSupplierListResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetSupplierList", in, out)
}
func (c *supplierClient) CreateOrganizeDictionary(ctx context.Context, in *CreateOrganizeDictionaryRequest, opts ...grpc_go.CallOption) (*CreateOrganizeDictionaryResponse, common.ErrorWithAttachment) {
out := new(CreateOrganizeDictionaryResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/CreateOrganizeDictionary", in, out)
}
func (c *supplierClient) GetOrganizeDictionaryList(ctx context.Context, in *GetOrganizeDictionaryListRequest, opts ...grpc_go.CallOption) (*GetOrganizeDictionaryListResponse, common.ErrorWithAttachment) {
out := new(GetOrganizeDictionaryListResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetOrganizeDictionaryList", in, out)
}
func (c *supplierClient) GetOrganizeDictionaryInfo(ctx context.Context, in *CreateOrganizeDictionaryRequest, opts ...grpc_go.CallOption) (*OrganizeDictionary, common.ErrorWithAttachment) {
out := new(OrganizeDictionary)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetOrganizeDictionaryInfo", in, out)
}
func (c *supplierClient) GetCountryRegionList(ctx context.Context, in *GetCountryRegionListRequest, opts ...grpc_go.CallOption) (*GetCountryRegionListResponse, common.ErrorWithAttachment) {
out := new(GetCountryRegionListResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetCountryRegionList", in, out)
}
func (c *supplierClient) GetCountryRegionInfo(ctx context.Context, in *GetCountryRegionInfoRequest, opts ...grpc_go.CallOption) (*CountryRegion, common.ErrorWithAttachment) {
out := new(CountryRegion)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetCountryRegionInfo", in, out)
}
func (c *supplierClient) CreateImportRecord(ctx context.Context, in *CreateImportRecordRequest, opts ...grpc_go.CallOption) (*CreateImportRecordResponse, common.ErrorWithAttachment) {
out := new(CreateImportRecordResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/CreateImportRecord", in, out)
}
func (c *supplierClient) GetImportRecordInfo(ctx context.Context, in *GetImportRecordRequest, opts ...grpc_go.CallOption) (*GetImportRecordResponse, common.ErrorWithAttachment) {
out := new(GetImportRecordResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetImportRecordInfo", in, out)
}
// SupplierServer is the server API for Supplier service.
// All implementations must embed UnimplementedSupplierServer
// for forward compatibility
type SupplierServer interface {
// 供应商curd
GetSupplier(context.Context, *GetSupplierRequest) (*UpdateSupplierRequest, error)
CreateSupplier(context.Context, *CreateSupplierRequest) (*CreateSupplierResponse, error)
UpdateSupplier(context.Context, *UpdateSupplierRequest) (*CreateSupplierResponse, error)
GetSupplierList(context.Context, *GetSupplierListRequest) (*GetSupplierListResponse, error)
// 组织字典
CreateOrganizeDictionary(context.Context, *CreateOrganizeDictionaryRequest) (*CreateOrganizeDictionaryResponse, error)
GetOrganizeDictionaryList(context.Context, *GetOrganizeDictionaryListRequest) (*GetOrganizeDictionaryListResponse, error)
GetOrganizeDictionaryInfo(context.Context, *CreateOrganizeDictionaryRequest) (*OrganizeDictionary, error)
// 国家组织
GetCountryRegionList(context.Context, *GetCountryRegionListRequest) (*GetCountryRegionListResponse, error)
GetCountryRegionInfo(context.Context, *GetCountryRegionInfoRequest) (*CountryRegion, error)
// 导入
CreateImportRecord(context.Context, *CreateImportRecordRequest) (*CreateImportRecordResponse, error)
GetImportRecordInfo(context.Context, *GetImportRecordRequest) (*GetImportRecordResponse, error)
mustEmbedUnimplementedSupplierServer()
}
// UnimplementedSupplierServer must be embedded to have forward compatible implementations.
type UnimplementedSupplierServer struct {
proxyImpl protocol.Invoker
}
func (UnimplementedSupplierServer) GetSupplier(context.Context, *GetSupplierRequest) (*UpdateSupplierRequest, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetSupplier not implemented")
}
func (UnimplementedSupplierServer) CreateSupplier(context.Context, *CreateSupplierRequest) (*CreateSupplierResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateSupplier not implemented")
}
func (UnimplementedSupplierServer) UpdateSupplier(context.Context, *UpdateSupplierRequest) (*CreateSupplierResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateSupplier not implemented")
}
func (UnimplementedSupplierServer) GetSupplierList(context.Context, *GetSupplierListRequest) (*GetSupplierListResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetSupplierList not implemented")
}
func (UnimplementedSupplierServer) CreateOrganizeDictionary(context.Context, *CreateOrganizeDictionaryRequest) (*CreateOrganizeDictionaryResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateOrganizeDictionary not implemented")
}
func (UnimplementedSupplierServer) GetOrganizeDictionaryList(context.Context, *GetOrganizeDictionaryListRequest) (*GetOrganizeDictionaryListResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetOrganizeDictionaryList not implemented")
}
func (UnimplementedSupplierServer) GetOrganizeDictionaryInfo(context.Context, *CreateOrganizeDictionaryRequest) (*OrganizeDictionary, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetOrganizeDictionaryInfo not implemented")
}
func (UnimplementedSupplierServer) GetCountryRegionList(context.Context, *GetCountryRegionListRequest) (*GetCountryRegionListResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetCountryRegionList not implemented")
}
func (UnimplementedSupplierServer) GetCountryRegionInfo(context.Context, *GetCountryRegionInfoRequest) (*CountryRegion, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetCountryRegionInfo not implemented")
}
func (UnimplementedSupplierServer) CreateImportRecord(context.Context, *CreateImportRecordRequest) (*CreateImportRecordResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateImportRecord not implemented")
}
func (UnimplementedSupplierServer) GetImportRecordInfo(context.Context, *GetImportRecordRequest) (*GetImportRecordResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetImportRecordInfo not implemented")
}
func (s *UnimplementedSupplierServer) XXX_SetProxyImpl(impl protocol.Invoker) {
s.proxyImpl = impl
}
func (s *UnimplementedSupplierServer) XXX_GetProxyImpl() protocol.Invoker {
return s.proxyImpl
}
func (s *UnimplementedSupplierServer) XXX_ServiceDesc() *grpc_go.ServiceDesc {
return &Supplier_ServiceDesc
}
func (s *UnimplementedSupplierServer) XXX_InterfaceName() string {
return "supplier.Supplier"
}
func (UnimplementedSupplierServer) mustEmbedUnimplementedSupplierServer() {}
// UnsafeSupplierServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to SupplierServer will
// result in compilation errors.
type UnsafeSupplierServer interface {
mustEmbedUnimplementedSupplierServer()
}
func RegisterSupplierServer(s grpc_go.ServiceRegistrar, srv SupplierServer) {
s.RegisterService(&Supplier_ServiceDesc, srv)
}
func _Supplier_GetSupplier_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(GetSupplierRequest)
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("GetSupplier", 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 _Supplier_CreateSupplier_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateSupplierRequest)
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("CreateSupplier", 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 _Supplier_UpdateSupplier_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdateSupplierRequest)
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("UpdateSupplier", 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 _Supplier_GetSupplierList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(GetSupplierListRequest)
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("GetSupplierList", 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 _Supplier_CreateOrganizeDictionary_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateOrganizeDictionaryRequest)
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("CreateOrganizeDictionary", 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 _Supplier_GetOrganizeDictionaryList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(GetOrganizeDictionaryListRequest)
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("GetOrganizeDictionaryList", 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 _Supplier_GetOrganizeDictionaryInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateOrganizeDictionaryRequest)
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("GetOrganizeDictionaryInfo", 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 _Supplier_GetCountryRegionList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(GetCountryRegionListRequest)
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("GetCountryRegionList", 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 _Supplier_GetCountryRegionInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(GetCountryRegionInfoRequest)
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("GetCountryRegionInfo", 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 _Supplier_CreateImportRecord_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateImportRecordRequest)
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("CreateImportRecord", 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 _Supplier_GetImportRecordInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(GetImportRecordRequest)
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("GetImportRecordInfo", 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)
}
// Supplier_ServiceDesc is the grpc_go.ServiceDesc for Supplier service.
// It's only intended for direct use with grpc_go.RegisterService,
// and not to be introspected or modified (even as a copy)
var Supplier_ServiceDesc = grpc_go.ServiceDesc{
ServiceName: "supplier.Supplier",
HandlerType: (*SupplierServer)(nil),
Methods: []grpc_go.MethodDesc{
{
MethodName: "GetSupplier",
Handler: _Supplier_GetSupplier_Handler,
},
{
MethodName: "CreateSupplier",
Handler: _Supplier_CreateSupplier_Handler,
},
{
MethodName: "UpdateSupplier",
Handler: _Supplier_UpdateSupplier_Handler,
},
{
MethodName: "GetSupplierList",
Handler: _Supplier_GetSupplierList_Handler,
},
{
MethodName: "CreateOrganizeDictionary",
Handler: _Supplier_CreateOrganizeDictionary_Handler,
},
{
MethodName: "GetOrganizeDictionaryList",
Handler: _Supplier_GetOrganizeDictionaryList_Handler,
},
{
MethodName: "GetOrganizeDictionaryInfo",
Handler: _Supplier_GetOrganizeDictionaryInfo_Handler,
},
{
MethodName: "GetCountryRegionList",
Handler: _Supplier_GetCountryRegionList_Handler,
},
{
MethodName: "GetCountryRegionInfo",
Handler: _Supplier_GetCountryRegionInfo_Handler,
},
{
MethodName: "CreateImportRecord",
Handler: _Supplier_CreateImportRecord_Handler,
},
{
MethodName: "GetImportRecordInfo",
Handler: _Supplier_GetImportRecordInfo_Handler,
},
},
Streams: []grpc_go.StreamDesc{},
Metadata: "api/supplier/supplier.proto",
}

View File

@ -54,6 +54,9 @@ dubbo:
FieeCronClientImpl: FieeCronClientImpl:
protocol: tri protocol: tri
interface: com.fontree.microservices.fiee.cron interface: com.fontree.microservices.fiee.cron
SupplierClientImpl:
protocol: tri
interface: com.fontree.microservices.common.supplier
logger: logger:
zap-config: zap-config:
level: error # 日志级别 level: error # 日志级别

Binary file not shown.

View File

@ -61,6 +61,9 @@ dubbo:
methods: methods:
- name: SecurityScan - name: SecurityScan
timeout: 120000 timeout: 120000
SupplierClientImpl:
protocol: tri
interface: com.fontree.microservices.common.supplier
logger: logger:
zap-config: zap-config:
level: error # 日志级别 level: error # 日志级别

View File

@ -63,6 +63,9 @@ dubbo:
methods: methods:
- name: SecurityScan - name: SecurityScan
timeout: 120000 timeout: 120000
SupplierClientImpl:
protocol: tri
interface: com.fontree.microservices.common.supplier
logger: logger:
zap-config: zap-config:
level: error # 日志级别 level: error # 日志级别

View File

@ -61,6 +61,9 @@ dubbo:
methods: methods:
- name: SecurityScan - name: SecurityScan
timeout: 120000 timeout: 120000
SupplierClientImpl:
protocol: tri
interface: com.fontree.microservices.common.supplier
logger: logger:
zap-config: zap-config:
level: error # 日志级别 level: error # 日志级别

View File

@ -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"
@ -31,6 +32,7 @@ func InitTasks() error {
err = cm.AddTask("artistAutoConfirmAnalysis", "0 */1 * * * *", ArtistAutoConfirmAnalysisTask) err = cm.AddTask("artistAutoConfirmAnalysis", "0 */1 * * * *", ArtistAutoConfirmAnalysisTask)
err = cm.AddTask("refreshWorkAnalysisApprovalStatus", "0 */1 * * * *", RefreshWorkAnalysisApprovalStatusTask) err = cm.AddTask("refreshWorkAnalysisApprovalStatus", "0 */1 * * * *", RefreshWorkAnalysisApprovalStatusTask)
err = cm.AddTask("refreshArtistOrder", "0 */30 * * * *", RefreshArtistOrderTask)
// 每天 00:30 和 12:30 执行 Ayrshare 指标采集任务 // 每天 00:30 和 12:30 执行 Ayrshare 指标采集任务
// err = cm.AddTask("ayrshareMetricsCollector", "0 30 0,12 * * *", AyrshareMetricsCollectorTask) // err = cm.AddTask("ayrshareMetricsCollector", "0 30 0,12 * * *", AyrshareMetricsCollectorTask)
@ -137,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,
}) })
@ -491,3 +504,7 @@ func ArtistAutoConfirmAnalysisTask() {
func AyrshareMetricsCollectorTask() { func AyrshareMetricsCollectorTask() {
serverCast.ExecuteAyrshareMetricsCollector() serverCast.ExecuteAyrshareMetricsCollector()
} }
func RefreshArtistOrderTask() {
service.CastProvider.Tools(context.Background(), &cast.ToolsReq{Action: "refreshArtistOrder"})
}

View File

@ -24,7 +24,7 @@ func (w *Work) ExportExcelWorkList(data []*cast.WorkListResp_Info) (*excelize.Fi
// 表头 // 表头
headers := []interface{}{ headers := []interface{}{
"艺人", "手机号", "用户编号", "作品标题", "脚本", "作品类型", "类型", "Ins", "Tiktok", "DM", "作品状态", "验收确认类型", "艺人", "手机号", "用户编号", "作品标题", "脚本", "作品类型", "类型", "Ins", "Tiktok", "DM", "Youtube", "Bulesky", "作品状态", "验收确认类型",
"说明", "发布账号", "管理人", "上传时间", "待艺人确认时间", "验收确认通过时间", "发布成功时间", "说明", "发布账号", "管理人", "上传时间", "待艺人确认时间", "验收确认通过时间", "发布成功时间",
} }
if err := sw.SetRow("A1", headers); err != nil { if err := sw.SetRow("A1", headers); err != nil {
@ -72,12 +72,14 @@ func (w *Work) ExportExcelWorkList(data []*cast.WorkListResp_Info) (*excelize.Fi
modelCast.PlatformPublishStatusMM[cast.PublishStatusENUM(info.InsStatus)], modelCast.PlatformPublishStatusMM[cast.PublishStatusENUM(info.InsStatus)],
modelCast.PlatformPublishStatusMM[cast.PublishStatusENUM(info.TiktokStatus)], modelCast.PlatformPublishStatusMM[cast.PublishStatusENUM(info.TiktokStatus)],
modelCast.PlatformPublishStatusMM[cast.PublishStatusENUM(info.DmStatus)], 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)], modelCast.ConfirmTypeMM[int(info.ConfirmType)],
info.Remark, info.Remark,
mediaAccountNames, mediaAccountNames,
managerNames, managerNames,
info.Status1Time, info.SubmitTime,
info.Status4Time, info.Status4Time,
info.Status9Time, info.Status9Time,
info.Status6Time, info.Status6Time,

178
pkg/logic/supplier.go Normal file
View File

@ -0,0 +1,178 @@
package logic
import (
"crypto/sha256"
"errors"
"fmt"
"strconv"
"strings"
"time"
"github.com/tealeg/xlsx"
)
type SupplierLogic struct {
OwningEntityName string `json:"owningEntityName"`
LegalName string `json:"legalName"`
LocalName string `json:"localName"`
AbbreviationName string `json:"abbreviationName"`
CountryOrRegionName string `json:"countryOrRegionName"`
CompanyRegistrationNumber string `json:"companyRegistrationNumber"`
SupplierType string `json:"supplierType"`
ApprovalStatus string `json:"approvalStatus"`
ApprovalDate string `json:"approvalDate"`
LastReviewDate string `json:"lastReviewDate"`
LegalEntityType string `json:"legalEntityType"`
SanctionsCountryScreeningResult string `json:"sanctionsCountryScreeningResult"`
KeyFinancial string `json:"keyFinancial"`
CompanyAddress string `json:"companyAddress"`
PrimaryContact string `json:"primaryContact"`
DataOwnerDepartment string `json:"dataOwnerDepartment"`
BasicCompanyInformation string `json:"basicCompanyInformation"`
SupplementaryText string `json:"supplementaryText"`
}
type ErrSupplierRes struct {
ID int `json:"id"`
LegalName string `json:"legalName"`
Remark string `json:"remark"`
}
func ImportSupplier(filePath string) ([]*SupplierLogic, error) {
xlFile, err := xlsx.OpenFile(filePath)
if err != nil {
return nil, err
}
//开辟除表头外的行数的数组内存
//遍历sheet
for sheetIndex, sheet := range xlFile.Sheets {
var resourceArr []map[int]string
//遍历每一行
//for rowIndex, row := range sheet.Rows {
for _, row := range sheet.Rows {
//开辟除表头外的行数的数组内存
objMap := make(map[int]string)
//if len(row.Cells) <= 0 || row.Cells[0].String() == "" {
// continue
//}
for cellIndex, cell := range row.Cells {
text := cell.String()
//如果是每一行的第一个单元格
objMap[cellIndex] = text
}
resourceArr = append(resourceArr, objMap)
}
if len(resourceArr) >= 2 {
suppliers, err := getListFromRaw(resourceArr)
if err != nil {
return nil, errors.New(fmt.Sprintf("页码:%d文件读取错误信息%s", sheetIndex+1, err.Error()))
}
if len(suppliers) > 0 {
return suppliers, nil
}
}
break
}
return nil, nil
}
func getListFromRaw(list []map[int]string) ([]*SupplierLogic, error) {
var entrusts []*SupplierLogic
kkMap := map[string]string{
"*使用组织/Owning Entity": "owningEntityName",
"*供应商法定全称/Legal Name": "legalName",
"供应商本地名称(如有)/Local Name (if applicable)": "localName",
"供应商简称(如有)/Abbreviation/Trade Name (if applicable)": "abbreviationName",
"*所在国家或地区/Country or Region": "countryOrRegionName",
"*公司注册编号/Company Registration Number": "companyRegistrationNumber",
"*供应商类型/Supplier Type": "supplierType",
"*准入状态/Approval Status": "approvalStatus",
"准入日期/Approval Date": "approvalDate",
"法律实体形式/Legal Entity Type": "legalEntityType",
"制裁与高风险国家筛查结果/Sanctions & High-Risk Country Screening Result": "sanctionsCountryScreeningResult",
"关键财务与付款信息/Key Financial & Payment Information": "keyFinancial",
"公司地址/Company Address": "companyAddress",
"主要联系人、职位及联系方式/Primary Contact, Position&Details": "primaryContact",
"数据维护部门&人员/Data Owner Department/Personnel": "dataOwnerDepartment",
"公司信息概要/Summary of Basic Company Information": "basicCompanyInformation",
"其他补充信息/Other Supplementary Information": "supplementaryText",
}
keyMap := list[0]
for index, tt := range list {
if index == 0 {
continue
}
temp := &SupplierLogic{}
for i, r := range tt {
t := strings.TrimSpace(r)
if _, ok := keyMap[i]; !ok {
continue
}
keyString := strings.TrimSpace(keyMap[i])
if _, ok := kkMap[keyString]; !ok {
fmt.Println(fmt.Sprintf("行数:%d字段信息(%s)没有匹配,请以模版为准", i, keyString))
continue
}
switch kkMap[keyString] {
case "owningEntityName":
temp.OwningEntityName = t
case "legalName":
temp.LegalName = t
case "localName":
temp.LocalName = t
case "abbreviationName":
temp.AbbreviationName = t
case "countryOrRegionName":
temp.CountryOrRegionName = t
case "companyRegistrationNumber":
temp.CompanyRegistrationNumber = t
case "supplierType":
temp.SupplierType = t
case "approvalStatus":
temp.ApprovalStatus = t
case "approvalDate":
temp.ApprovalDate = ParseExcelDate(t)
//temp.ApprovalDate = t
case "legalEntityType":
temp.LegalEntityType = t
case "sanctionsCountryScreeningResult":
temp.SanctionsCountryScreeningResult = t
case "keyFinancial":
temp.KeyFinancial = t
case "companyAddress":
temp.CompanyAddress = t
case "primaryContact":
temp.PrimaryContact = t
case "dataOwnerDepartment":
temp.DataOwnerDepartment = t
case "basicCompanyInformation":
temp.BasicCompanyInformation = t
case "supplementaryText":
temp.SupplementaryText = t
}
}
entrusts = append(entrusts, temp)
}
sha256.New()
return entrusts, nil
}
func ParseExcelDate(v string) string {
if v == "" {
return ""
}
// 非数字,直接认为是 yyyy-mm-dd
if _, err := strconv.ParseFloat(v, 64); err != nil {
t, err := time.Parse("2006-01-02", v)
if err != nil {
return ""
}
return t.Format("2006-01-02")
}
// Excel 序列号
f, _ := strconv.ParseFloat(v, 64)
base := time.Date(1899, 12, 30, 0, 0, 0, 0, time.Local)
return base.AddDate(0, 0, int(f)).Format("2006-01-02")
}

View File

@ -70,6 +70,7 @@ func CheckLogin(provider *api.AccountFieeClientImpl) gin.HandlerFunc {
TelNum: jwt.Phone, TelNum: jwt.Phone,
SubscriberNumber: infoRes.SubscriberNumber, SubscriberNumber: infoRes.SubscriberNumber,
IdNumber: infoRes.IdNumber, IdNumber: infoRes.IdNumber,
InviterID: infoRes.InviterId,
} }
ctx.Set("jwtInfo", loginInfo) ctx.Set("jwtInfo", loginInfo)

View File

@ -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,
} }

View File

@ -29,6 +29,7 @@ type Info struct {
TelNum string `json:"telNum"` TelNum string `json:"telNum"`
SubscriberNumber string `json:"subscriberNumber"` SubscriberNumber string `json:"subscriberNumber"`
IdNumber string `json:"idNumber"` IdNumber string `json:"idNumber"`
InviterID uint64 `json:"inviterId"`
} }
func GetUserInfoFromC(c *gin.Context) Info { func GetUserInfoFromC(c *gin.Context) Info {

View File

@ -62,6 +62,7 @@ func MediaRouter(r *gin.RouterGroup) {
task := auth.Group("task") task := auth.Group("task")
{ {
task.POST("list", serviceCast.TaskList) task.POST("list", serviceCast.TaskList)
task.POST("delete", serviceCast.DeleteTasK)
} }
layout := auth.Group("layout") layout := auth.Group("layout")

View File

@ -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"
@ -57,6 +58,7 @@ func NewRouter() *gin.Engine {
SecFilingRouter(privateGroup) SecFilingRouter(privateGroup)
app.MediaAppRouter(privateGroup) app.MediaAppRouter(privateGroup)
cronRouter(privateGroup) cronRouter(privateGroup)
SupplierRouter(privateGroup)
{ {
v1.POST("version", version.Version) //版本号公共 v1.POST("version", version.Version) //版本号公共
} }
@ -69,6 +71,7 @@ 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))
{ {
@ -83,6 +86,7 @@ func NewRouter() *gin.Engine {
{ {
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下载 webAcRouter.POST("excel/download", account.UserExcelDownload) //excel下载
} }
} }
@ -215,6 +219,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) {

35
pkg/router/supplier.go Normal file
View File

@ -0,0 +1,35 @@
package router
import (
"fonchain-fiee/pkg/middleware"
"fonchain-fiee/pkg/service"
"fonchain-fiee/pkg/service/supplier"
"github.com/gin-gonic/gin"
)
func SupplierRouter(r *gin.RouterGroup) {
supplierRoute := r.Group("supplier/web")
supplierRoute.Use(middleware.CheckWebLogin(service.AccountProvider))
{
supplierRoute.POST("info", supplier.GetSupplier)
supplierRoute.POST("create", supplier.CreateSupplier)
supplierRoute.POST("update", supplier.UpdateSupplier)
supplierRoute.POST("list", supplier.GetSupplierList)
}
{
supplierRoute.POST("dictionary/create", supplier.CreateOrganizeDictionary)
supplierRoute.POST("dictionary/list", supplier.GetOrganizeDictionaryList)
}
{
supplierRoute.POST("country-region/list", supplier.GetCountryRegionList)
}
{
supplierRoute.POST("import/record", supplier.CreateImportRecord)
supplierRoute.POST("import/info", supplier.GetImportRecordInfo)
supplierRoute.POST("export/list", supplier.GetExportList)
}
}

View File

@ -130,6 +130,37 @@ func UserUpdate(c *gin.Context) {
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 {
service.Error(c, err)
return
}
service.Success(c, res)
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 { if err != nil {
service.Error(c, err) service.Error(c, err)
@ -409,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)
@ -428,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)

View File

@ -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
} }
@ -428,6 +452,7 @@ func writeToExcel(filename string, items []*bundle.BundleBalanceExportItem) erro
"所属月份", "用户编号", "姓名", "手机号", "购买套餐时间", "所属月份", "用户编号", "姓名", "手机号", "购买套餐时间",
"套餐金额", "增值服务金额", "支付金额", "币种", "手续费", "套餐金额", "增值服务金额", "支付金额", "币种", "手续费",
"套餐视频总数", "增值服务视频总数", "套餐视频单价", "增值视频单价", "套餐视频总数", "增值服务视频总数", "套餐视频单价", "增值视频单价",
"当月消耗套餐金额($)", "当月消耗增值金额($)",
"套餐账号总数", "增值账号总数", "套餐账号使用数", "增值账号使用数", "套餐账号总数", "增值账号总数", "套餐账号使用数", "增值账号使用数",
"当前可用套餐视频数", "当前可用增值视频数", "当前已用套餐视频数", "当前已用增值视频数", "当前作废套餐视频数", "当前作废增值视频数", "当月新增可用套餐视频数", "当月新增可用增值视频数", "当月使用套餐视频数", "当月使用增值视频数", "当月作废套餐视频数", "当月作废增值视频数", "当前可用套餐视频数", "当前可用增值视频数", "当前已用套餐视频数", "当前已用增值视频数", "当前作废套餐视频数", "当前作废增值视频数", "当月新增可用套餐视频数", "当月新增可用增值视频数", "当月使用套餐视频数", "当月使用增值视频数", "当月作废套餐视频数", "当月作废增值视频数",
"当前可用套餐图文数", "当前可用增值图文数", "当前已用套餐图文数", "当前已用增值图文数", "当前作废套餐图文数", "当前作废增值图文数", "当月新增可用套餐图文数", "当月新增可用增值图文数", "当月使用套餐图文数", "当月使用增值图文数", "当月作废套餐图文数", "当月作废增值图文数", "当前可用套餐图文数", "当前可用增值图文数", "当前已用套餐图文数", "当前已用增值图文数", "当前作废套餐图文数", "当前作废增值图文数", "当月新增可用套餐图文数", "当月新增可用增值图文数", "当月使用套餐图文数", "当月使用增值图文数", "当月作废套餐图文数", "当月作废增值图文数",
@ -470,64 +495,76 @@ func writeToExcel(filename string, items []*bundle.BundleBalanceExportItem) erro
_ = write(13, fmt.Sprintf("%.2f", it.BundleVideoUnitPrice)) _ = write(13, fmt.Sprintf("%.2f", it.BundleVideoUnitPrice))
_ = write(14, fmt.Sprintf("%.2f", it.IncreaseVideoUnitPrice)) _ = write(14, fmt.Sprintf("%.2f", it.IncreaseVideoUnitPrice))
// 当月视频消耗金额($)
monthlyBundleVideoConsumptionPrice, err := strconv.ParseFloat(it.MonthlyBundleVideoConsumptionPrice, 64)
if err != nil {
return err
}
monthlyIncreaseVideoConsumptionPrice, err := strconv.ParseFloat(it.MonthlyIncreaseVideoConsumptionPrice, 64)
if err != nil {
return err
}
_ = write(15, fmt.Sprintf("%.2f", monthlyBundleVideoConsumptionPrice))
_ = write(16, fmt.Sprintf("%.2f", monthlyIncreaseVideoConsumptionPrice))
// 账号类 // 账号类
_ = write(15, int(it.BundleAccountNumber)) _ = write(17, int(it.BundleAccountNumber))
_ = write(16, int(it.IncreaseAccountNumber)) _ = write(18, int(it.IncreaseAccountNumber))
_ = write(17, int(it.BundleAccountConsumptionNumber)) _ = write(19, int(it.BundleAccountConsumptionNumber))
_ = write(18, int(it.IncreaseAccountConsumptionNumber)) _ = write(20, int(it.IncreaseAccountConsumptionNumber))
// 视频类 // 视频类
_ = write(19, int(it.MonthlyBundleVideoNumber)) _ = write(21, int(it.MonthlyBundleVideoNumber))
_ = write(20, int(it.MonthlyIncreaseVideoNumber)) _ = write(22, int(it.MonthlyIncreaseVideoNumber))
_ = write(21, int(it.BundleVideoConsumptionNumber)) _ = write(23, int(it.BundleVideoConsumptionNumber))
_ = write(22, int(it.IncreaseVideoConsumptionNumber)) _ = write(24, int(it.IncreaseVideoConsumptionNumber))
_ = write(23, int(it.InvalidBundleVideoNumber)) _ = write(25, int(it.InvalidBundleVideoNumber))
_ = write(24, int(it.InvalidIncreaseVideoNumber)) _ = write(26, int(it.InvalidIncreaseVideoNumber))
_ = write(25, int(it.MonthlyNewBundleVideoNumber)) _ = write(27, int(it.MonthlyNewBundleVideoNumber))
_ = write(26, int(it.MonthlyNewIncreaseVideoNumber)) _ = write(28, int(it.MonthlyNewIncreaseVideoNumber))
_ = write(27, int(it.MonthlyBundleVideoConsumptionNumber)) _ = write(29, int(it.MonthlyBundleVideoConsumptionNumber))
_ = write(28, int(it.MonthlyIncreaseVideoConsumptionNumber)) _ = write(30, int(it.MonthlyIncreaseVideoConsumptionNumber))
_ = write(29, int(it.MonthlyInvalidBundleVideoNumber)) _ = write(31, int(it.MonthlyInvalidBundleVideoNumber))
_ = write(30, int(it.MonthlyInvalidIncreaseVideoNumber)) _ = write(32, int(it.MonthlyInvalidIncreaseVideoNumber))
// 图文类 // 图文类
_ = write(31, int(it.MonthlyBundleImageNumber)) _ = write(33, int(it.MonthlyBundleImageNumber))
_ = write(32, int(it.MonthlyIncreaseImageNumber)) _ = write(34, int(it.MonthlyIncreaseImageNumber))
_ = write(33, int(it.BundleImageConsumptionNumber)) _ = write(35, int(it.BundleImageConsumptionNumber))
_ = write(34, int(it.IncreaseImageConsumptionNumber)) _ = write(36, int(it.IncreaseImageConsumptionNumber))
_ = write(35, int(it.InvalidBundleImageNumber)) _ = write(37, int(it.InvalidBundleImageNumber))
_ = write(36, int(it.InvalidIncreaseImageNumber)) _ = write(38, int(it.InvalidIncreaseImageNumber))
_ = write(37, int(it.MonthlyNewBundleImageNumber)) _ = write(39, int(it.MonthlyNewBundleImageNumber))
_ = write(38, int(it.MonthlyNewIncreaseImageNumber)) _ = write(40, int(it.MonthlyNewIncreaseImageNumber))
_ = write(39, int(it.MonthlyBundleImageConsumptionNumber)) _ = write(41, int(it.MonthlyBundleImageConsumptionNumber))
_ = write(40, int(it.MonthlyIncreaseImageConsumptionNumber)) _ = write(42, int(it.MonthlyIncreaseImageConsumptionNumber))
_ = write(41, int(it.MonthlyInvalidBundleImageNumber)) _ = write(43, int(it.MonthlyInvalidBundleImageNumber))
_ = write(42, int(it.MonthlyInvalidIncreaseImageNumber)) _ = write(44, int(it.MonthlyInvalidIncreaseImageNumber))
// 数据分析类 // 数据分析类
_ = write(43, int(it.MonthlyBundleDataAnalysisNumber)) _ = write(45, int(it.MonthlyBundleDataAnalysisNumber))
_ = write(44, int(it.MonthlyIncreaseDataAnalysisNumber)) _ = write(46, int(it.MonthlyIncreaseDataAnalysisNumber))
_ = write(45, int(it.BundleDataAnalysisConsumptionNumber)) _ = write(47, int(it.BundleDataAnalysisConsumptionNumber))
_ = write(46, int(it.IncreaseDataAnalysisConsumptionNumber)) _ = write(48, int(it.IncreaseDataAnalysisConsumptionNumber))
_ = write(47, int(it.InvalidBundleDataAnalysisNumber)) _ = write(49, int(it.InvalidBundleDataAnalysisNumber))
_ = write(48, int(it.InvalidIncreaseDataAnalysisNumber)) _ = write(50, int(it.InvalidIncreaseDataAnalysisNumber))
_ = write(49, int(it.MonthlyNewBundleDataAnalysisNumber)) _ = write(51, int(it.MonthlyNewBundleDataAnalysisNumber))
_ = write(50, int(it.MonthlyNewIncreaseDataAnalysisNumber)) _ = write(52, int(it.MonthlyNewIncreaseDataAnalysisNumber))
_ = write(51, int(it.MonthlyBundleDataAnalysisConsumptionNumber)) _ = write(53, int(it.MonthlyBundleDataAnalysisConsumptionNumber))
_ = write(52, int(it.MonthlyIncreaseDataAnalysisConsumptionNumber)) _ = write(54, int(it.MonthlyIncreaseDataAnalysisConsumptionNumber))
_ = write(53, int(it.MonthlyInvalidBundleDataAnalysisNumber)) _ = write(55, int(it.MonthlyInvalidBundleDataAnalysisNumber))
_ = write(54, int(it.MonthlyInvalidIncreaseDataAnalysisNumber)) _ = write(56, int(it.MonthlyInvalidIncreaseDataAnalysisNumber))
// 手动扩展类 // 手动扩展类
_ = write(55, int(it.MonthlyNewManualAccountNumber)) _ = write(57, int(it.MonthlyNewManualAccountNumber))
_ = write(56, int(it.MonthlyNewManualVideoNumber)) _ = write(58, int(it.MonthlyNewManualVideoNumber))
_ = write(57, int(it.MonthlyNewManualImageNumber)) _ = write(59, int(it.MonthlyNewManualImageNumber))
_ = write(58, int(it.MonthlyNewManualDataAnalysisNumber)) _ = write(60, int(it.MonthlyNewManualDataAnalysisNumber))
_ = write(59, int(it.MonthlyNewDurationNumber)) _ = write(61, int(it.MonthlyNewDurationNumber))
_ = write(60, int(it.MonthlyManualAccountConsumptionNumber)) _ = write(62, int(it.MonthlyManualAccountConsumptionNumber))
_ = write(61, int(it.MonthlyManualVideoConsumptionNumber)) _ = write(63, int(it.MonthlyManualVideoConsumptionNumber))
_ = write(62, int(it.MonthlyManualImageConsumptionNumber)) _ = write(64, int(it.MonthlyManualImageConsumptionNumber))
_ = write(63, int(it.MonthlyManualDataAnalysisConsumptionNumber)) _ = write(65, int(it.MonthlyManualDataAnalysisConsumptionNumber))
} }
@ -547,7 +584,7 @@ func GetAccountBundleBalance(c *gin.Context) {
service.Error(c, err) service.Error(c, err)
return return
} }
req.Month = time.Now().Format("2006-01") req.Month = []string{time.Now().Format("2006-01")}
res, err := service.BundleProvider.GetBundleBalanceList(context.Background(), &req) res, err := service.BundleProvider.GetBundleBalanceList(context.Background(), &req)
if err != nil { if err != nil {
service.Error(c, errors.New(common.GetBundleBalanceListFailed)) service.Error(c, errors.New(common.GetBundleBalanceListFailed))

View File

@ -17,7 +17,6 @@ import (
"strings" "strings"
"time" "time"
"github.com/duke-git/lancet/v2/datetime"
"github.com/shopspring/decimal" "github.com/shopspring/decimal"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
@ -93,9 +92,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), "合计支付金额(美元)")
@ -171,7 +191,7 @@ func MetricsArtistAccountExport(ctx *gin.Context) {
utils.CheckDirPath("./runtime/"+fmt.Sprint(userInfo.ID), true) utils.CheckDirPath("./runtime/"+fmt.Sprint(userInfo.ID), true)
sheet := "Sheet1" sheet := "Sheet1"
f := excelize.NewFile() f := excelize.NewFile()
headers := []string{"序号", "艺人", "用户编号", "DM账号名", "DM账号状态", "Instagram账号名", "Instagram账号状态", "TikTok账号名", "TikTok账号状态"} headers := []string{"序号", "艺人", "用户编号", "DM账号名", "DM账号状态", "Instagram账号名", "Instagram账号状态", "TikTok账号名", "TikTok账号状态", "Bluesky账号名", "Bluesky账号状态", "Youtube账号名", "Youtube账号状态"}
for i, h := range headers { for i, h := range headers {
col, _ := excelize.ColumnNumberToName(i + 1) col, _ := excelize.ColumnNumberToName(i + 1)
cell := col + "1" cell := col + "1"
@ -206,6 +226,10 @@ func MetricsArtistAccountExport(ctx *gin.Context) {
_ = write(7, authStatus[it.InsAuthStatus]) _ = write(7, authStatus[it.InsAuthStatus])
_ = write(8, it.TiktokNickname) _ = write(8, it.TiktokNickname)
_ = write(9, authStatus[it.TiktokAuthStatus]) _ = write(9, authStatus[it.TiktokAuthStatus])
_ = write(10, it.BlueskyNickname)
_ = write(11, authStatus[it.BlueskyAuthStatus])
_ = write(12, it.YoutubeNickname)
_ = write(13, authStatus[it.YoutubeAuthStatus])
} }
// 可选:设置列宽,使表格更美观 // 可选:设置列宽,使表格更美观
_ = f.SetColWidth(sheet, "A", "AZ", 18) _ = f.SetColWidth(sheet, "A", "AZ", 18)
@ -232,11 +256,9 @@ func MetricsVideoSubmitExport(ctx *gin.Context) {
return return
} }
newCtx := serviceCast.NewCtxWithUserInfo(ctx) newCtx := serviceCast.NewCtxWithUserInfo(ctx)
t, err := time.Parse("2006-01", req.Month) if len(req.Month) > 0 {
if err == nil {
resp, err = service.CastProvider.WorkList(newCtx, &cast.WorkListReq{ resp, err = service.CastProvider.WorkList(newCtx, &cast.WorkListReq{
SubmitStartTime: datetime.BeginOfMonth(t).Format(time.DateTime), SubmitTimeMonths: req.Month,
SubmitEndTime: datetime.EndOfMonth(t).Format(time.DateTime),
Page: 1, Page: 1,
PageSize: 99999, PageSize: 99999,
}) })

View File

@ -246,10 +246,16 @@ func CreateBundleOrderSignature(c *gin.Context) {
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 {
@ -514,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",
@ -536,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
}
} }
} }
} }
@ -618,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
}
} }
} }
} }
@ -642,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)
@ -676,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 {

View File

@ -105,6 +105,8 @@ const (
GetWorkDetailFailed = "获取作品详情失败" GetWorkDetailFailed = "获取作品详情失败"
) )
//用户套餐状态
// 余量 // 余量
const ( const (
BundleExtendFailed = "套餐扩展失败" BundleExtendFailed = "套餐扩展失败"
@ -122,9 +124,10 @@ const (
InsufficientBalance = "余量不足" InsufficientBalance = "余量不足"
) )
//用户套餐状态
const ( const (
BundleExpired = 1 BundleExpired = 1 //已过期
BundleNotExpired = 0 BundleNotExpired = 0 //未过期
) )
// 数据指标 // 数据指标

View 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)
}

View File

@ -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{

View File

@ -366,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,
@ -418,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)

View File

@ -44,6 +44,7 @@ func MediaUserList(ctx *gin.Context) {
service.Error(ctx, err) service.Error(ctx, err)
return return
} }
if req.NeedStats {
var statResp *bundle.ArtistUploadStatsResponse var statResp *bundle.ArtistUploadStatsResponse
zap.L().Info("MediaUserList 1") zap.L().Info("MediaUserList 1")
//取出艺人num //取出艺人num
@ -65,7 +66,6 @@ func MediaUserList(ctx *gin.Context) {
service.Error(ctx, err) service.Error(ctx, err)
return return
} }
if req.NeedStats {
for _, v := range resp.Data { for _, v := range resp.Data {
for _, vv := range statResp.Items { for _, vv := range statResp.Items {
if v.ArtistSubNum == vv.SubNum { if v.ArtistSubNum == vv.SubNum {
@ -258,11 +258,10 @@ func OAuthAccount(ctx *gin.Context) {
service.Error(ctx, errors.New("未找到该账号")) service.Error(ctx, errors.New("未找到该账号"))
return return
} }
//FIXME if err = SyncAsAuth(mediaResp.Data[0].ArtistUuid); err != nil {
/*if err = SyncAsAuth(mediaResp.Data[0].ArtistUuid); err != nil {
service.Error(ctx, err) service.Error(ctx, err)
return return
}*/ }
if resp, err = service.CastProvider.OAuthAccountV2(ctx, req); err != nil { if resp, err = service.CastProvider.OAuthAccountV2(ctx, req); err != nil {
service.Error(ctx, err) service.Error(ctx, err)
return return
@ -410,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),
}) })
@ -609,7 +612,7 @@ func ImportMediaAccount(ctx *gin.Context) {
excelSetRemark(excelData, line, "艺人不存在") excelSetRemark(excelData, line, "艺人不存在")
continue continue
} }
var tiktokName, insName, dmName string var tiktokName, insName, dmName, youtubeName, blueskyName string
if len(row) >= 3 { if len(row) >= 3 {
tiktokName = strings.TrimSpace(row[2]) tiktokName = strings.TrimSpace(row[2])
} }
@ -619,7 +622,13 @@ func ImportMediaAccount(ctx *gin.Context) {
if len(row) >= 5 { if len(row) >= 5 {
dmName = strings.TrimSpace(row[4]) dmName = strings.TrimSpace(row[4])
} }
if tiktokName == "" && insName == "" && dmName == "" { 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, "请填写账号") excelSetRemark(excelData, line, "请填写账号")
continue continue
} }
@ -638,6 +647,17 @@ func ImportMediaAccount(ctx *gin.Context) {
excelSetRemark(excelData, line, fmt.Sprintf("%s:%s", dmName, err.Error())) 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文件到磁盘 // 保存Excel文件到磁盘
resultPath := fmt.Sprintf("./runtime/media/%s", fileName) resultPath := fmt.Sprintf("./runtime/media/%s", fileName)
@ -661,14 +681,14 @@ func ImportMediaAccount(ctx *gin.Context) {
// 记录需要删除的行(从后往前删除,避免行号变化) // 记录需要删除的行(从后往前删除,避免行号变化)
rowsToDelete := make([]int, 0) rowsToDelete := make([]int, 0)
for line := 1; line < len(rows); line++ { // 从第2行开始跳过表头 for line := 1; line < len(rows); line++ { // 从第2行开始跳过表头
remarkCell := fmt.Sprintf("F%d", line+1) remarkCell := fmt.Sprintf("H%d", line+1) // 备注列已移动到H列
remark, _ := excelData.GetCellValue("Sheet1", remarkCell) remark, _ := excelData.GetCellValue("Sheet1", remarkCell)
if remark == "" { if remark == "" {
// F列没有数据,表示成功 // H列没有数据,表示成功
successCount++ successCount++
rowsToDelete = append(rowsToDelete, line+1) rowsToDelete = append(rowsToDelete, line+1)
} else { } else {
// F列有值,表示失败 // H列有值,表示失败
failCount++ failCount++
} }
} }
@ -701,11 +721,11 @@ func ImportMediaAccount(ctx *gin.Context) {
func excelSetRemark(excelData *excelize.File, line int, remark string) { func excelSetRemark(excelData *excelize.File, line int, remark string) {
zap.L().Info("设置备注", zap.Int("line", line), zap.String("remark", remark)) zap.L().Info("设置备注", zap.Int("line", line), zap.String("remark", remark))
oldRemark, _ := excelData.GetCellValue("Sheet1", fmt.Sprintf("%s%d", "F", line+1)) oldRemark, _ := excelData.GetCellValue("Sheet1", fmt.Sprintf("%s%d", "H", line+1))
if oldRemark != "" { if oldRemark != "" {
remark = fmt.Sprintf("%s\n%s", oldRemark, remark) remark = fmt.Sprintf("%s\n%s", oldRemark, remark)
} }
excelData.SetCellValue("Sheet1", fmt.Sprintf("%s%d", "F", line+1), 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 { func updateMediaAccount(platformName string, platformId cast.PlatformIDENUM, subInfoResp *accountFiee.UserInfoResponse, loginInfo login.Info) error {

View File

@ -26,3 +26,21 @@ func TaskList(ctx *gin.Context) {
} }
service.Success(ctx, resp) 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
}

View File

@ -71,10 +71,10 @@ func Test(ctx *gin.Context) {
} }
if action == "" { if action == "" {
profileKey := ctx.PostForm("profileKey") resp, err := service.CastProvider.WorkList(context.Background(), &cast.WorkListReq{
resp, err := service.AyrshareProvider.GetUser(context.Background(), &aryshare.GetUserRequest{ Page: 1,
ProfileKey: profileKey, PageSize: 1000,
InstagramDetails: true, SubmitTimeMonths: []string{"2026-01", "2025-12"},
}) })
if err != nil { if err != nil {
service.Error(ctx, err) service.Error(ctx, err)
@ -156,6 +156,15 @@ func Test(ctx *gin.Context) {
} }
service.Success(ctx, "ok") 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

View File

@ -48,21 +48,16 @@ import (
"go.uber.org/zap" "go.uber.org/zap"
) )
func UpdateWorkImage(ctx *gin.Context) { // UpdateWorkImageCore 更新作品图片的核心逻辑,可以被其他函数复用
var req *cast.UpdateWorkImageReq func UpdateWorkImageCore(ctx *gin.Context, req *cast.UpdateWorkImageReq) (*cast.UpdateWorkImageResp, error) {
var infoResp *accountFiee.UserInfoResponse var infoResp *accountFiee.UserInfoResponse
var err error var err error
var ok bool var ok bool
if err = ctx.ShouldBind(&req); err != nil {
service.Error(ctx, err)
return
}
loginInfo := login.GetUserInfoFromC(ctx) loginInfo := login.GetUserInfoFromC(ctx)
lockKey := fmt.Sprintf("lock_update_work_image_%d", loginInfo.ID) lockKey := fmt.Sprintf("lock_update_work_image_%d", loginInfo.ID)
reply := cache.RedisClient.SetNX(lockKey, time.Now().Format("2006-01-02 15:04:05"), time.Second*5) reply := cache.RedisClient.SetNX(lockKey, time.Now().Format("2006-01-02 15:04:05"), time.Second*5)
if !reply.Val() { if !reply.Val() {
service.Error(ctx, errors.New("请勿重复提交")) return nil, errors.New("请勿重复提交")
return
} }
defer func() { defer func() {
cache.RedisClient.Del(lockKey) cache.RedisClient.Del(lockKey)
@ -72,37 +67,30 @@ func UpdateWorkImage(ctx *gin.Context) {
/*for _, v := range req.Images { /*for _, v := range req.Images {
ok, err = check.SecurityFile(v) ok, err = check.SecurityFile(v)
if err != nil { if err != nil {
service.Error(ctx, err) return nil, err
return
} }
if !ok { if !ok {
service.Error(ctx, errors.New("图片鉴定未通过")) return nil, errors.New("图片鉴定未通过")
return
} }
} }
ok, err = check.SecurityText(req.Title) ok, err = check.SecurityText(req.Title)
if err != nil { if err != nil {
service.Error(ctx, err) return nil, err
return
} }
if !ok { if !ok {
service.Error(ctx, errors.New("标题鉴定未通过")) return nil, errors.New("标题鉴定未通过")
return
} }
ok, err = check.SecurityText(req.Content) ok, err = check.SecurityText(req.Content)
if err != nil { if err != nil {
service.Error(ctx, err) return nil, err
return
} }
if !ok { if !ok {
service.Error(ctx, errors.New("内容鉴定未通过")) return nil, errors.New("内容鉴定未通过")
return
}*/ }*/
if req.From != "ai" { if req.From != "ai" {
for _, v := range req.Images { for _, v := range req.Images {
if filepath.Ext(v) != ".jpg" && filepath.Ext(v) != ".jpeg" { if filepath.Ext(v) != ".jpg" && filepath.Ext(v) != ".jpeg" {
service.Error(ctx, errors.New("图片格式只支持jpg")) return nil, errors.New("图片格式只支持jpg")
return
} }
} }
} }
@ -112,8 +100,7 @@ func UpdateWorkImage(ctx *gin.Context) {
for _, v := range images { for _, v := range images {
imageUrl, err = checkAndReuploadImage(v, "image") imageUrl, err = checkAndReuploadImage(v, "image")
if err != nil { if err != nil {
service.Error(ctx, errors.New("图片转换错误")) return nil, errors.New("图片转换错误")
return
} }
req.Images = append(req.Images, imageUrl) req.Images = append(req.Images, imageUrl)
} }
@ -124,8 +111,7 @@ func UpdateWorkImage(ctx *gin.Context) {
}) })
zap.L().Info("UpdateWorkImage infoResp", zap.Any("infoResp", infoResp)) zap.L().Info("UpdateWorkImage infoResp", zap.Any("infoResp", infoResp))
if err != nil { if err != nil {
service.Error(ctx, err) return nil, err
return
} }
req.ArtistName = infoResp.Name req.ArtistName = infoResp.Name
@ -134,13 +120,26 @@ func UpdateWorkImage(ctx *gin.Context) {
req.ArtistSubNum = infoResp.SubNum req.ArtistSubNum = infoResp.SubNum
//artistID, _ := strconv.ParseUint(req.ArtistUuid, 10, 64) //artistID, _ := strconv.ParseUint(req.ArtistUuid, 10, 64)
//if _, err = CheckUserBundleBalance(int32(artistID), modelCast.BalanceTypeImageValue); err != nil { //if _, err = CheckUserBundleBalance(int32(artistID), modelCast.BalanceTypeImageValue); err != nil {
// service.Error(ctx, err) // return nil, err
// return
//} //}
newCtx := NewCtxWithUserInfo(ctx) newCtx := NewCtxWithUserInfo(ctx)
req.Source = 1 req.Source = 1
resp, err := service.CastProvider.UpdateWorkImage(newCtx, req) resp, err := service.CastProvider.UpdateWorkImage(newCtx, req)
zap.L().Info("UpdateWorkImage resp", zap.Any("resp", resp)) zap.L().Info("UpdateWorkImage resp", zap.Any("resp", resp))
if err != nil {
return nil, err
}
return resp, nil
}
func UpdateWorkImage(ctx *gin.Context) {
var req *cast.UpdateWorkImageReq
var err error
if err = ctx.ShouldBind(&req); err != nil {
service.Error(ctx, err)
return
}
resp, err := UpdateWorkImageCore(ctx, req)
if err != nil { if err != nil {
service.Error(ctx, err) service.Error(ctx, err)
return return
@ -171,27 +170,21 @@ func UpdateWorkImage(ctx *gin.Context) {
return return
} }
func UpdateWorkVideo(ctx *gin.Context) { // UpdateWorkVideoCore 更新作品视频的核心逻辑,可以被其他函数复用
var req *cast.UpdateWorkVideoReq func UpdateWorkVideoCore(ctx *gin.Context, req *cast.UpdateWorkVideoReq) (*cast.UpdateWorkVideoResp, error) {
var infoResp *accountFiee.UserInfoResponse var infoResp *accountFiee.UserInfoResponse
var err error var err error
var ok bool var ok bool
if err = ctx.ShouldBind(&req); err != nil {
service.Error(ctx, err)
return
}
if req.CoverUrl != "" { if req.CoverUrl != "" {
if filepath.Ext(req.CoverUrl) != ".jpg" && filepath.Ext(req.CoverUrl) != ".jpeg" { if filepath.Ext(req.CoverUrl) != ".jpg" && filepath.Ext(req.CoverUrl) != ".jpeg" {
service.Error(ctx, errors.New("图片格式只支持jpg")) return nil, errors.New("图片格式只支持jpg")
return
} }
} }
loginInfo := login.GetUserInfoFromC(ctx) loginInfo := login.GetUserInfoFromC(ctx)
lockKey := fmt.Sprintf("lock_update_work_video_%d", loginInfo.ID) lockKey := fmt.Sprintf("lock_update_work_video_%d", loginInfo.ID)
reply := cache.RedisClient.SetNX(lockKey, time.Now().Format("2006-01-02 15:04:05"), time.Second*5) reply := cache.RedisClient.SetNX(lockKey, time.Now().Format("2006-01-02 15:04:05"), time.Second*5)
if !reply.Val() { if !reply.Val() {
service.Error(ctx, errors.New("请勿重复提交")) return nil, errors.New("请勿重复提交")
return
} }
defer func() { defer func() {
cache.RedisClient.Del(lockKey) cache.RedisClient.Del(lockKey)
@ -199,30 +192,24 @@ func UpdateWorkVideo(ctx *gin.Context) {
fmt.Println(ok) fmt.Println(ok)
/* ok, err = check.SecurityText(req.Title) /* ok, err = check.SecurityText(req.Title)
if err != nil { if err != nil {
service.Error(ctx, err) return nil, err
return
} }
if !ok { if !ok {
service.Error(ctx, errors.New("标题鉴定未通过")) return nil, errors.New("标题鉴定未通过")
return
} }
ok, err = check.SecurityText(req.Content) ok, err = check.SecurityText(req.Content)
if err != nil { if err != nil {
service.Error(ctx, err) return nil, err
return
} }
if !ok { if !ok {
service.Error(ctx, errors.New("内容鉴定未通过")) return nil, errors.New("内容鉴定未通过")
return
} }
ok, err = check.SecurityFile(req.CoverUrl) ok, err = check.SecurityFile(req.CoverUrl)
if err != nil { if err != nil {
service.Error(ctx, err) return nil, err
return
} }
if !ok { if !ok {
service.Error(ctx, errors.New("图片鉴定未通过")) return nil, errors.New("图片鉴定未通过")
return
}*/ }*/
if req.VideoUrl != "" && false { if req.VideoUrl != "" && false {
//请求接口判断 //请求接口判断
@ -231,12 +218,10 @@ func UpdateWorkVideo(ctx *gin.Context) {
FileName: "", FileName: "",
}) })
if errs != nil { if errs != nil {
service.Error(ctx, errs) return nil, errs
return
} }
if fileResp.SecurityStatus == "high" { if fileResp.SecurityStatus == "high" {
service.Error(ctx, errors.New("视频鉴定未通过")) return nil, errors.New("视频鉴定未通过")
return
} }
} }
if config.AppConfig.System.AppMode != "dev" { if config.AppConfig.System.AppMode != "dev" {
@ -247,8 +232,7 @@ func UpdateWorkVideo(ctx *gin.Context) {
}) })
zap.L().Info("UpdateWorkVideo", zap.Any("infoResp", infoResp)) zap.L().Info("UpdateWorkVideo", zap.Any("infoResp", infoResp))
if err != nil { if err != nil {
service.Error(ctx, err) return nil, err
return
} }
} else { } else {
infoResp = &accountFiee.UserInfoResponse{ infoResp = &accountFiee.UserInfoResponse{
@ -259,8 +243,7 @@ func UpdateWorkVideo(ctx *gin.Context) {
} }
//artistID, _ := strconv.ParseUint(req.ArtistUuid, 10, 64) //artistID, _ := strconv.ParseUint(req.ArtistUuid, 10, 64)
//if _, err = CheckUserBundleBalance(int32(artistID), modelCast.BalanceTypeVideoValue); err != nil { //if _, err = CheckUserBundleBalance(int32(artistID), modelCast.BalanceTypeVideoValue); err != nil {
// service.Error(ctx, err) // return nil, err
// return
//} //}
req.ArtistName = infoResp.Name req.ArtistName = infoResp.Name
req.ArtistPhone = infoResp.TelNum req.ArtistPhone = infoResp.TelNum
@ -270,6 +253,20 @@ func UpdateWorkVideo(ctx *gin.Context) {
req.Source = 1 req.Source = 1
resp, err := service.CastProvider.UpdateWorkVideo(newCtx, req) resp, err := service.CastProvider.UpdateWorkVideo(newCtx, req)
zap.L().Info("UpdateWorkVideo", zap.Any("resp", resp)) zap.L().Info("UpdateWorkVideo", zap.Any("resp", resp))
if err != nil {
return nil, err
}
return resp, nil
}
func UpdateWorkVideo(ctx *gin.Context) {
var req *cast.UpdateWorkVideoReq
var err error
if err = ctx.ShouldBind(&req); err != nil {
service.Error(ctx, err)
return
}
resp, err := UpdateWorkVideoCore(ctx, req)
if err != nil { if err != nil {
service.Error(ctx, err) service.Error(ctx, err)
return return
@ -623,6 +620,29 @@ func PostAS(workUuid string) error {
ThumbNail: "", ThumbNail: "",
Visibility: "", Visibility: "",
} }
case cast.PlatformIDENUM_YOUTUBE:
// YouTube 发布选项配置
postReq.YouTubeOptions = &aryshare.YouTubeOptions{
Title: workDetail.Title,
Visibility: "public", // 可见性设置public/unlisted/private
Tags: nil,
// CategoryId: 0, // YouTube 分类 ID例如24 = Entertainment
MadeForKids: false,
ThumbNail: coverUrl,
PlaylistId: "",
NotifySubscribers: true,
Shorts: false,
ContainsSyntheticMedia: false,
PublishAt: "",
SubTitleUrl: "",
SubTitleLanguage: "",
SubTitleName: "",
}
case cast.PlatformIDENUM_BULESKY: // BLUESKY
// Bluesky 发布选项配置
postReq.BlueskyOptions = &aryshare.BlueskyOptions{
AltText: nil, // 图片或视频的替代文本数组(用于屏幕阅读器的无障碍功能)
}
} }
zap.L().Info("post 6", zap.Any("workUuid", workUuid), zap.Any("platformID", platformID)) zap.L().Info("post 6", zap.Any("workUuid", workUuid), zap.Any("platformID", platformID))
zap.L().Info("Publish Ayrshare PostReq", zap.Any("workUuid", workDetail.WorkUuid), zap.Any("postReq", postReq), zap.Any("workDetail", workDetail)) zap.L().Info("Publish Ayrshare PostReq", zap.Any("workUuid", workDetail.WorkUuid), zap.Any("postReq", postReq), zap.Any("workDetail", workDetail))
@ -704,6 +724,10 @@ func PostAS(workUuid string) error {
pid = 1 pid = 1
case "instagram": case "instagram":
pid = 3 pid = 3
case "youtube":
pid = 2
case "bluesky":
pid = 5
} }
publishStatus := cast.PublishStatusENUM_PublishMediaStatus_NO publishStatus := cast.PublishStatusENUM_PublishMediaStatus_NO
if postInfo.Status == "success" { if postInfo.Status == "success" {
@ -1284,8 +1308,8 @@ func ImportWorkBatch(ctx *gin.Context) {
temp.ArtistPhone = subInfoResp.TelNum temp.ArtistPhone = subInfoResp.TelNum
temp.ArtistPhoneAreaCode = subInfoResp.TelAreaCode temp.ArtistPhoneAreaCode = subInfoResp.TelAreaCode
} }
if len(row) > 5 { if len(row) > 7 {
temp.Title = utils.CleanString(row[5]) temp.Title = utils.CleanString(row[7])
ok, _err := check.SecurityText(temp.Title) ok, _err := check.SecurityText(temp.Title)
if _err != nil { if _err != nil {
temp.Remark = _err.Error() temp.Remark = _err.Error()
@ -1298,8 +1322,8 @@ func ImportWorkBatch(ctx *gin.Context) {
break break
} }
} }
if len(row) > 6 { if len(row) > 8 {
temp.Content = utils.CleanString(row[6]) temp.Content = utils.CleanString(row[8])
if temp.Content != "" { if temp.Content != "" {
ok, _err := check.SecurityText(temp.Content) ok, _err := check.SecurityText(temp.Content)
if _err != nil { if _err != nil {
@ -1314,8 +1338,7 @@ func ImportWorkBatch(ctx *gin.Context) {
} }
} }
} }
// 图片 for i := 10; i <= 20; i++ {
for i := 8; i <= 18; i++ {
if len(row) > i { if len(row) > i {
if utils.CleanString(row[i]) != "" { if utils.CleanString(row[i]) != "" {
ok, _err := check.SecurityFile(row[i]) ok, _err := check.SecurityFile(row[i])
@ -1325,7 +1348,7 @@ func ImportWorkBatch(ctx *gin.Context) {
break break
} }
if !ok { if !ok {
temp.Remark = fmt.Sprintf("图片%d黄反审核未通过", i-7) temp.Remark = fmt.Sprintf("图片%d黄反审核未通过", i-9)
req.ImageWorks = append(req.ImageWorks, temp) req.ImageWorks = append(req.ImageWorks, temp)
break break
} }
@ -1416,6 +1439,60 @@ func ImportWorkBatch(ctx *gin.Context) {
temp.MediaAccountNames = append(temp.MediaAccountNames, utils.CleanString(row[4])) temp.MediaAccountNames = append(temp.MediaAccountNames, utils.CleanString(row[4]))
temp.MediaAccountUuids = append(temp.MediaAccountUuids, mediaInfoResp.Info.MediaAccountUuid)*/ temp.MediaAccountUuids = append(temp.MediaAccountUuids, mediaInfoResp.Info.MediaAccountUuid)*/
} }
// YouTube账号第F列row[5]
if len(row) > 5 && utils.CleanString(row[5]) != "" {
temp.Remark = fmt.Sprintf("Youtube不能发图文")
zap.L().Error("CastProvider.MediaInfo", zap.Error(err))
req.ImageWorks = append(req.ImageWorks, temp)
continue
// mediaInfoResp, err = service.CastProvider.MediaInfo(context.Background(), &cast.MediaInfoReq{
// ArtistUuid: temp.ArtistUuid,
// PlatformID: cast.PlatformIDENUM_YOUTUBE,
// PlatformUserName: utils.CleanString(row[5]),
// })
// if err != nil || mediaInfoResp.Info.MediaAccountUuid == "" {
// temp.Remark = fmt.Sprintf("YouTube账号名不存在")
// zap.L().Error("CastProvider.MediaInfo", zap.Error(err))
// req.ImageWorks = append(req.ImageWorks, temp)
// continue
// }
// temp.PublishConfig1 = &cast.PublishConfig{
// ForbidComment: 1,
// PublicType: 1,
// CanJoin: 1,
// CanQuote: 1,
// CanComment: 1,
// IsAI: 1,
// }
// temp.PlatformIDs = append(temp.PlatformIDs, cast.PlatformIDENUM_YOUTUBE)
// temp.MediaAccountNames = append(temp.MediaAccountNames, utils.CleanString(row[5]))
// temp.MediaAccountUuids = append(temp.MediaAccountUuids, mediaInfoResp.Info.MediaAccountUuid)
}
// Bluesky账号第G列row[6]
if len(row) > 6 && utils.CleanString(row[6]) != "" {
mediaInfoResp, err = service.CastProvider.MediaInfo(context.Background(), &cast.MediaInfoReq{
ArtistUuid: temp.ArtistUuid,
PlatformID: cast.PlatformIDENUM_BULESKY,
PlatformUserName: utils.CleanString(row[6]),
})
if err != nil || mediaInfoResp.Info.MediaAccountUuid == "" {
temp.Remark = fmt.Sprintf("Bluesky账号名不存在")
zap.L().Error("CastProvider.MediaInfo", zap.Error(err))
req.ImageWorks = append(req.ImageWorks, temp)
continue
}
temp.PublishConfig1 = &cast.PublishConfig{
ForbidComment: 1,
PublicType: 1,
CanJoin: 1,
CanQuote: 1,
CanComment: 1,
IsAI: 1,
}
temp.PlatformIDs = append(temp.PlatformIDs, cast.PlatformIDENUM_BULESKY)
temp.MediaAccountNames = append(temp.MediaAccountNames, utils.CleanString(row[6]))
temp.MediaAccountUuids = append(temp.MediaAccountUuids, mediaInfoResp.Info.MediaAccountUuid)
}
if artistNum == "" { if artistNum == "" {
temp.Remark = "艺人编号不能为空" temp.Remark = "艺人编号不能为空"
req.ImageWorks = append(req.ImageWorks, temp) req.ImageWorks = append(req.ImageWorks, temp)
@ -1446,6 +1523,12 @@ func ImportWorkBatch(ctx *gin.Context) {
req.ImageWorks = append(req.ImageWorks, temp) req.ImageWorks = append(req.ImageWorks, temp)
continue continue
} }
// 判断图片数量是否超过4
if len(temp.Images) > 4 {
temp.Remark = "Bluesky 图片数量不能超过4"
req.ImageWorks = append(req.ImageWorks, temp)
continue
}
req.ImageWorks = append(req.ImageWorks, temp) req.ImageWorks = append(req.ImageWorks, temp)
} }
if len(req.ImageWorks) == 0 { if len(req.ImageWorks) == 0 {
@ -1464,7 +1547,7 @@ func ImportWorkBatch(ctx *gin.Context) {
for _, v := range resp.ImageWorks { for _, v := range resp.ImageWorks {
if !v.Success { if !v.Success {
rowNum := int(v.LineNo) + 1 rowNum := int(v.LineNo) + 1
excelData.SetCellValue("Sheet1", fmt.Sprintf("H%d", rowNum), v.Remark) excelData.SetCellValue("Sheet1", fmt.Sprintf("J%d", rowNum), v.Remark)
hasValueRows[rowNum] = true hasValueRows[rowNum] = true
} }
} }

View File

@ -56,6 +56,7 @@ func ImageCheckByte(file *multipart.FileHeader) (bool, error) {
} }
func SecurityFile(textVal string) (bool, error) { func SecurityFile(textVal string) (bool, error) {
return true, nil
if textVal == "" { if textVal == "" {
return true, nil return true, nil
} }
@ -79,6 +80,7 @@ func SecurityFile(textVal string) (bool, error) {
return true, nil return true, nil
} }
func SecurityText(textVal string) (bool, error) { func SecurityText(textVal string) (bool, error) {
return true, nil
aliConfig, err := pkgSecurity.GetGlobalConfig("./data/alibabacloud.env") aliConfig, err := pkgSecurity.GetGlobalConfig("./data/alibabacloud.env")
if err != nil { if err != nil {
return false, err return false, err

View File

@ -14,6 +14,7 @@ import (
"fonchain-fiee/api/payment" "fonchain-fiee/api/payment"
"fonchain-fiee/api/pressreleases" "fonchain-fiee/api/pressreleases"
"fonchain-fiee/api/secFilings" "fonchain-fiee/api/secFilings"
"fonchain-fiee/api/supplier"
pkConfig "fonchain-fiee/pkg/config" pkConfig "fonchain-fiee/pkg/config"
"os" "os"
@ -35,6 +36,7 @@ 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) var CronProvider = new(cron.CronClientImpl)
var SupplierProvider = new(supplier.SupplierClientImpl)
func init() { func init() {
config.SetConsumerService(BundleProvider) config.SetConsumerService(BundleProvider)
@ -49,6 +51,7 @@ func init() {
config.SetConsumerService(SecFilingProvider) config.SetConsumerService(SecFilingProvider)
config.SetConsumerService(AyrshareProvider) config.SetConsumerService(AyrshareProvider)
config.SetConsumerService(CronProvider) config.SetConsumerService(CronProvider)
config.SetConsumerService(SupplierProvider)
if err := config.Load(); err != nil { if err := config.Load(); err != nil {
panic(err) panic(err)

View File

@ -0,0 +1,391 @@
package supplier
import (
"errors"
"fmt"
"fonchain-fiee/api/supplier"
"fonchain-fiee/pkg/logic"
"fonchain-fiee/pkg/model/login"
"fonchain-fiee/pkg/service"
"fonchain-fiee/pkg/service/upload"
"fonchain-fiee/pkg/utils"
"fonchain-fiee/pkg/utils/excel"
"os"
"time"
"github.com/gin-gonic/gin"
"github.com/gin-gonic/gin/binding"
"github.com/google/uuid"
)
func GetSupplier(c *gin.Context) {
req := &supplier.GetSupplierRequest{}
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
service.Error(c, err)
return
}
res, err := service.SupplierProvider.GetSupplier(c, req)
if err != nil {
service.Error(c, err)
return
}
service.Success(c, res)
return
}
func CreateSupplier(c *gin.Context) {
req := &supplier.CreateSupplierRequest{}
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
service.Error(c, err)
return
}
res, err := service.SupplierProvider.CreateSupplier(c, req)
if err != nil {
service.Error(c, err)
return
}
service.Success(c, res)
return
}
func UpdateSupplier(c *gin.Context) {
req := &supplier.UpdateSupplierRequest{}
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
service.Error(c, err)
return
}
info, err := service.SupplierProvider.GetSupplier(c, &supplier.GetSupplierRequest{Id: req.Id})
if err != nil {
service.Error(c, err)
return
}
if info.Status == 3 {
service.Error(c, errors.New("审核中不可修改")) //todo 修改:审核中并且存在审核人 不可修改
return
}
if req.Status != 1 && req.Status != 2 {
service.Error(c, errors.New("审批状态错误")) //todo 只允许前端暂存或提交审核申请
}
res, err := service.SupplierProvider.UpdateSupplier(c, req)
if err != nil {
service.Error(c, err)
return
}
service.Success(c, res)
return
}
func GetSupplierList(c *gin.Context) {
req := &supplier.GetSupplierListRequest{}
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
service.Error(c, err)
return
}
res, err := service.SupplierProvider.GetSupplierList(c, req)
if err != nil {
service.Error(c, err)
return
}
service.Success(c, res)
return
}
func CreateOrganizeDictionary(c *gin.Context) {
req := &supplier.CreateOrganizeDictionaryRequest{}
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
service.Error(c, err)
return
}
res, err := service.SupplierProvider.CreateOrganizeDictionary(c, req)
if err != nil {
service.Error(c, err)
return
}
service.Success(c, res)
return
}
func GetOrganizeDictionaryList(c *gin.Context) {
req := &supplier.GetOrganizeDictionaryListRequest{}
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
service.Error(c, err)
return
}
res, err := service.SupplierProvider.GetOrganizeDictionaryList(c, req)
if err != nil {
service.Error(c, err)
return
}
service.Success(c, res)
return
}
func GetCountryRegionList(c *gin.Context) {
req := &supplier.GetCountryRegionListRequest{}
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
service.Error(c, err)
return
}
res, err := service.SupplierProvider.GetCountryRegionList(c, req)
if err != nil {
service.Error(c, err)
return
}
service.Success(c, res)
return
}
func CreateImportRecord(c *gin.Context) {
file, err := c.FormFile("file")
if err != nil {
service.Error(c, err)
}
safeFilename := fmt.Sprintf("%d", time.Now().Unix()) + "_" + file.Filename
userInfo := login.GetUserInfoFromC(c)
fileDir := fmt.Sprintf("/fiee/supplier/%s/%s_%s", time.Now().Format("2006-01-02"), userInfo.Name, safeFilename)
// 保存上传的文件到本地
if err = c.SaveUploadedFile(file, safeFilename); err != nil {
service.Error(c, err)
return
}
defer func() {
if err := os.Remove(safeFilename); err != nil {
// 处理删除文件失败的情况
fmt.Println("Failed to delete file:", err)
}
}()
inputUrl, err := upload.PutBosWithName(safeFilename, false, fileDir)
if err != nil {
service.Error(c, err)
return
}
supplierList, err := logic.ImportSupplier(safeFilename)
if err != nil {
service.Error(c, err)
return
}
if len(supplierList) == 0 {
service.Error(c, errors.New("导入数据为空"))
return
}
uuid, _ := uuid.NewUUID()
var SuccessNum uint64
var SupplierCodes []string
var ErrSupplierRes []*logic.ErrSupplierRes
for idx, i := range supplierList {
rowNum := idx + 1
if i.OwningEntityName == "" || i.LegalName == "" || i.CountryOrRegionName == "" || i.CompanyRegistrationNumber == "" || i.SupplierType == "" || i.ApprovalStatus == "" {
ErrSupplierRes = append(ErrSupplierRes, &logic.ErrSupplierRes{
ID: rowNum,
LegalName: i.LegalName,
Remark: "必填项存在空值",
})
continue
}
OwningEntityRes, _ := service.SupplierProvider.GetOrganizeDictionaryInfo(c, &supplier.CreateOrganizeDictionaryRequest{Name: i.OwningEntityName})
if OwningEntityRes == nil || OwningEntityRes.Id == 0 {
ErrSupplierRes = append(ErrSupplierRes, &logic.ErrSupplierRes{
ID: rowNum,
LegalName: i.LegalName,
Remark: "所属组织不存在",
})
continue
}
countryRegionRes, _ := service.SupplierProvider.GetCountryRegionInfo(c, &supplier.GetCountryRegionInfoRequest{ZhAndCode: i.CountryOrRegionName})
if countryRegionRes == nil || countryRegionRes.Id == 0 {
ErrSupplierRes = append(ErrSupplierRes, &logic.ErrSupplierRes{
ID: rowNum,
LegalName: i.LegalName,
Remark: "所属国家或地区不存在",
})
continue
}
var LastReviewDate string
if i.ApprovalDate != "" {
t, err := time.Parse("2006-01-02", i.ApprovalDate)
if err != nil {
LastReviewDate = ""
i.ApprovalDate = ""
} else {
LastReviewDate = t.AddDate(1, 0, 0).Format("2006-01-02")
}
}
createRes, err := service.SupplierProvider.CreateSupplier(c, &supplier.CreateSupplierRequest{
OwningEntityId: OwningEntityRes.Id,
LegalName: i.LegalName,
LocalName: i.LocalName,
AbbreviationName: i.AbbreviationName,
CountryOrRegionId: countryRegionRes.Id,
CompanyRegistrationNumber: i.CompanyRegistrationNumber,
SupplierType: i.SupplierType,
ApprovalStatus: i.ApprovalStatus,
ApprovalDate: i.ApprovalDate,
LastReviewDate: LastReviewDate,
LegalEntityType: i.LegalEntityType,
SanctionsCountryScreeningResult: i.SanctionsCountryScreeningResult,
KeyFinancial: i.KeyFinancial,
CompanyAddress: i.CompanyAddress,
PrimaryContact: i.PrimaryContact,
DataOwnerDepartment: i.DataOwnerDepartment,
BasicCompanyInformation: i.BasicCompanyInformation,
SupplementaryText: i.SupplementaryText,
Status: 1,
})
if err != nil {
ErrSupplierRes = append(ErrSupplierRes, &logic.ErrSupplierRes{
ID: rowNum,
LegalName: i.LegalName,
Remark: err.Error(),
})
continue
} else {
SupplierCodes = append(SupplierCodes, createRes.SupplierCode)
SuccessNum++
}
}
status := 2
outUrl := ""
if len(ErrSupplierRes) == 0 {
status = 1
} else {
var sheet1Columns = []string{"行数", "供应商法定全称", "错误信息"}
var sheet1 = excel.NewSheet("Sheet1", ErrSupplierRes, sheet1Columns)
ex, err := excel.NewExcelCreatorFromTemplate("./mistake.xlsx", "./supplier/excel/", "", sheet1)
ex.UseOption(excel.OptionFileNameSuffixWithUnixTime)
path, _, err := ex.WriteToFile()
outUrl, err = upload.PutBos(path, "", false)
if err != nil {
service.Error(c, err)
return
}
defer func() {
os.RemoveAll("./supplier")
}()
}
req := &supplier.CreateImportRecordRequest{
SupplierCodes: SupplierCodes,
Status: uint64(status),
UserId: userInfo.ID,
ToLeadUrl: inputUrl,
DeriveUrl: outUrl,
Uuid: uuid.String(),
SuccessNum: SuccessNum,
FailNum: uint64(len(ErrSupplierRes)),
}
_, err = service.SupplierProvider.CreateImportRecord(c, req)
if err != nil {
service.Error(c, err)
return
}
service.Success(c, req)
return
}
func GetImportRecordInfo(c *gin.Context) {
req := &supplier.GetImportRecordRequest{}
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
service.Error(c, err)
return
}
res, err := service.SupplierProvider.GetImportRecordInfo(c, req)
if err != nil {
service.Error(c, err)
return
}
service.Success(c, res)
return
}
func GetExportList(c *gin.Context) {
req := &supplier.GetSupplierListRequest{}
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
service.Error(c, err)
return
}
infoRes, err := service.SupplierProvider.GetSupplierList(c, req)
if err != nil {
service.Error(c, err)
return
}
// 定义标题列表
titleList := []string{
"状态/State", "使用组织/Owning Entity", "供应商唯一编码/SupplierUnique Code", "供应商法定全称(英文)/LegalName (English)", "供应商本地名称(如有)/LocalName (if applicable)",
"所在国家或地区/Country or Region", "公司注册编号/Company RegistrationNumber", "供应商类型/Supplier Type", "准入状态/Approval Status", "准入日期/ApprovalDate",
"法律实体形式/Legal Entity Type", "制裁与高风险国家筛查结果/Sanctions & High-RiskCountry Screening Result", "关键财务与付款信息/Key Financial & Payment Information",
"公司地址/Company Address", "主要联系人、职位及联系方式/Primary Contact,Position&Details", "数据维护部门&人员/Data Owner Department/Personnel", "最后更新日期/Last Updated Date",
"公司信息概要/Summary of Basic Company Information",
}
// 定义数据结构
type DataInfo struct {
Status string
OwningEntity string
SupplierUniqueCode string
LegalName string
LocalName string
CountryOrRegion string
CompanyRegistrationNumber string
SupplierType string
ApprovalStatus string
ApprovalDate string
LegalEntityType string
SanctionsCountryScreeningResult string
KeyFinancial string
CompanyAddress string
PrimaryContact string
DataOwnerDepartment string
UpdatedAt string
BasicCompanyInformation string
}
// 创建员工ID到DataInfo的映射
dataMap := make(map[string]*DataInfo)
statusMap := map[uint64]string{
1: "草稿",
2: "审核中",
3: "已驳回",
4: "已成功",
}
for _, info := range infoRes.Data {
dataMap[info.SupplierUniqueCode] = &DataInfo{
Status: statusMap[info.Status],
OwningEntity: info.OwningEntityName,
SupplierUniqueCode: info.SupplierUniqueCode,
LegalName: info.LegalName,
LocalName: info.LocalName,
CountryOrRegion: info.CountryOrRegionCode,
CompanyRegistrationNumber: info.CompanyRegistrationNumber,
SupplierType: info.SupplierType,
ApprovalStatus: info.ApprovalStatus,
ApprovalDate: info.ApprovalDate,
LegalEntityType: info.LegalEntityType,
SanctionsCountryScreeningResult: info.SanctionsCountryScreeningResult,
KeyFinancial: info.KeyFinancial,
CompanyAddress: info.CompanyAddress,
PrimaryContact: info.PrimaryContact,
DataOwnerDepartment: info.DataOwnerDepartment,
UpdatedAt: info.UpdatedAt,
BasicCompanyInformation: info.BasicCompanyInformation,
}
}
// 生成最终数据列表
var dataList []interface{}
for _, data := range dataMap {
dataList = append(dataList, &[]any{
data.Status, data.OwningEntity, data.SupplierUniqueCode, data.LegalName, data.LocalName,
data.CountryOrRegion, data.CompanyRegistrationNumber, data.SupplierType, data.ApprovalStatus, data.ApprovalDate,
data.LegalEntityType, data.SanctionsCountryScreeningResult, data.KeyFinancial, data.CompanyAddress, data.PrimaryContact,
data.DataOwnerDepartment, data.UpdatedAt, data.BasicCompanyInformation,
})
}
// 生成Excel文件
content, err := utils.ToExcelByType(titleList, dataList, "slice", "")
if err != nil {
service.Error(c, err)
return
}
// 返回Excel文件
utils.ResponseXls(c, content, "供应商库")
return
}

View File

@ -376,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{
@ -393,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)
// 调用员工实际任务状态更新 // 调用员工实际任务状态更新
@ -474,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{
@ -491,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)
// 调用员工实际任务状态更新 // 调用员工实际任务状态更新

View File

@ -12,14 +12,15 @@ import (
"fonchain-fiee/pkg/model" "fonchain-fiee/pkg/model"
"fonchain-fiee/pkg/service" "fonchain-fiee/pkg/service"
"fonchain-fiee/pkg/utils" "fonchain-fiee/pkg/utils"
"io"
cmdConf "fonchain-fiee/cmd/config"
"github.com/disintegration/imaging" "github.com/disintegration/imaging"
"github.com/fonchain_enterprise/utils/objstorage" "github.com/fonchain_enterprise/utils/objstorage"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
uuid "github.com/satori/go.uuid" uuid "github.com/satori/go.uuid"
"io"
ffmpeg "github.com/u2takey/ffmpeg-go"
"go.uber.org/zap"
"io/ioutil" "io/ioutil"
"mime/multipart" "mime/multipart"
"net/url" "net/url"
@ -28,6 +29,9 @@ import (
"path/filepath" "path/filepath"
"strconv" "strconv"
"strings" "strings"
ffmpeg "github.com/u2takey/ffmpeg-go"
"go.uber.org/zap"
) )
const ( const (
@ -216,7 +220,7 @@ func quickBos(file *multipart.FileHeader, mediaType string, mask string, source
return return
} }
} }
var objectName string = fmt.Sprintf("%s/%s/%s", config.ConfigData.Oss.BaseDir, config.Env, filePath) var objectName string = fmt.Sprintf("%s/%s/%s", config.ConfigData.Oss.BaseDir, cmdConf.AppConfig.System.AppMode, filePath)
BOSClient, _ := objstorage.NewOSS(os.Getenv(config.ConfigData.Oss.AccessKeyId), os.Getenv(config.ConfigData.Oss.AccessKeySecret), os.Getenv(config.ConfigData.Oss.Endpoint)) BOSClient, _ := objstorage.NewOSS(os.Getenv(config.ConfigData.Oss.AccessKeyId), os.Getenv(config.ConfigData.Oss.AccessKeySecret), os.Getenv(config.ConfigData.Oss.Endpoint))
_, err = BOSClient.PutObjectFromBytes(os.Getenv(config.ConfigData.Oss.BucketName), objectName, fileBytes) _, err = BOSClient.PutObjectFromBytes(os.Getenv(config.ConfigData.Oss.BucketName), objectName, fileBytes)
if err != nil { if err != nil {
@ -290,7 +294,7 @@ func PutBos(filePath string, mediaType string, needRemove bool) (url string, err
} }
} }
filePath = strings.Replace(filePath, model.MediaPath, "", 1) filePath = strings.Replace(filePath, model.MediaPath, "", 1)
var objectName string = fmt.Sprintf("%s/%s%s", config.ConfigData.Oss.BaseDir, config.Env, filePath) var objectName string = fmt.Sprintf("%s/%s%s", config.ConfigData.Oss.BaseDir, cmdConf.AppConfig.System.AppMode, filePath)
_, err = BOSClient.PutObjectFromBytes(os.Getenv(config.ConfigData.Oss.BucketName), objectName, fileBytes) _, err = BOSClient.PutObjectFromBytes(os.Getenv(config.ConfigData.Oss.BucketName), objectName, fileBytes)
if err != nil { if err != nil {
fmt.Println("=== PutBos PutObject err ", err) fmt.Println("=== PutBos PutObject err ", err)
@ -347,3 +351,30 @@ func getEnvDir(cloudStoreSubPath string) (ep string) {
ep, _ = url.JoinPath("fiee", cloudStoreSubPath) ep, _ = url.JoinPath("fiee", cloudStoreSubPath)
return ep return ep
} }
func PutBosWithName(filePath string, needRemove bool, ossPath string) (url string, err error) {
BOSClient, err := objstorage.NewOSS(os.Getenv(config.ConfigData.Oss.AccessKeyId), os.Getenv(config.ConfigData.Oss.AccessKeySecret), os.Getenv(config.ConfigData.Oss.Endpoint))
//BOSClient, err := objstorage.NewOSS(config.ConfigData.Oss.AccessKeyId, config.ConfigData.Oss.AccessKeySecret, config.ConfigData.Oss.Endpoint)
if err != nil {
//logger.Errorf("PutBosWithName err1 ", err)
err = errors.New(e.GetMsg(e.ErrorUploadBos))
return
}
if ossPath == "" {
ossPath = filePath[1:]
}
var objectName string = fmt.Sprintf("%s/%s%s", config.ConfigData.Oss.BaseDir, cmdConf.AppConfig.System.AppMode, ossPath)
_, err = BOSClient.PutObject(os.Getenv(config.ConfigData.Oss.BucketName), objectName, filePath)
//_, err = BOSClient.PutObject(config.ConfigData.Oss.BucketName, objectName, filePath)
if err != nil {
//logger.Errorf("PutBosWithName err2 ", err)
err = errors.New(e.GetMsg(e.ErrorUploadBos))
return
}
//删除本地文件
if needRemove {
_ = os.Remove(filePath)
}
url = fmt.Sprintf("%s/%s", os.Getenv(config.ConfigData.Oss.CdnHost), objectName)
//url = fmt.Sprintf("%s/%s", config.ConfigData.Oss.CdnHost, objectName)
return
}

View File

@ -0,0 +1,381 @@
// Package excel -----------------------------
// @file : templateInter.go
// @author : JJXu
// @contact : wavingbear@163.com
// @time : 2022/7/23 15:34
// -------------------------------------------
package excel
import (
"bytes"
"errors"
"fmt"
"io"
"log"
"os"
"path/filepath"
"reflect"
"sync"
"github.com/tealeg/xlsx"
"github.com/xuri/excelize/v2"
)
var (
ErrSheetNotExist = errors.New("sheet does not exist")
ErrSheetDataFormatNotSupport = errors.New("sheet data format not support")
//ErrSheetNameNotInTemplate = errors.New("sheet name not in emailTemplate")
)
// ======================================================================================================================
//
// Sheet define
type HeaderRow struct {
RowNum int //行号
Values []string
}
// 抽象工作簿
type Sheet interface {
GetData() any //数据支持struct、[]struct、[]*struct三种类型
SheetName() string //表名称
SheetHeaders() []string //表头名称,没有则跳过插入表头的步骤
GetJsonFiledList() []string //指定字段的排列顺序,默认按照结构体中的顺序排列(表头与数据没有关联,使用这个指定字段插入顺序)
}
// 实例化工作簿,使用模板生成excel的话用这个
func NewTemplateSheet(sheetName string, datas any) Sheet {
return &newSheetDefine{
Datas: datas,
Name: sheetName,
}
}
// 实例化工作簿不通过模板生成excel的话用这个
func NewSheet(sheetName string, datas any, headers []string, jsonFiledList ...[]string) Sheet {
st := &newSheetDefine{
Datas: datas,
Name: sheetName,
Headers: headers,
}
if jsonFiledList != nil {
st.JsonFiledList = jsonFiledList[0]
}
return st
}
// 定义一个能够通用的工作簿结构此结构必须遵循Sheet接口规范
type newSheetDefine struct {
Datas any
Name string
Headers []string
JsonFiledList []string
}
func (s *newSheetDefine) GetData() any {
return s.Datas
}
func (s *newSheetDefine) SheetName() string {
return s.Name
}
func (s *newSheetDefine) SheetHeaders() []string {
return s.Headers
}
func (s *newSheetDefine) GetJsonFiledList() []string {
return s.JsonFiledList
}
//======================================================================================================================
// Sheet define
// WriteToExcel 通过模板文件写入数据并另存为
// param fileName : 文件名
// param filesSuffix : 文件后缀名生成函数
// param fileRoot : 导出目录
// param templatePath : 模板文件路径
// param sheets : Sheet类型的数据类型为[]Sheet
// return path : 文件路径
// return exfileName : 导出后的文件名
// return err
func WriteToExcel(fileName string, fileRoot string, templatePath string, sheets ...Sheet) (path string, exFileName string, err error) {
var exc *Excel
exc, err = NewExcelCreatorFromTemplate(fileName, fileRoot, templatePath, sheets...)
if err != nil {
return
}
exc.UseOption(OptionFileNameSuffixWithUnixTime)
return exc.WriteToFile()
}
// ReadDataFromExcel 从excel文件读取数据
func ReadDataFromExcel(filepath string, sheetName string, handler func(rowIndex int, rows []string)) error {
ex := Excel{OriginFilePath: filepath}
return ex.ReadSheetData(sheetName, handler)
}
// ReadDataFromBytes 从io口读取数据用户http上传的附件
func ReadDataFromBytes(file io.Reader, sheetName string, handler func(rowIndex int, row []string)) error {
exce, err := excelize.OpenReader(file)
if err != nil {
return err
}
var ex = Excel{ex: exce}
return ex.ReadSheetData(sheetName, handler)
}
// 读取模板并创建工作表生成器
func NewExcelCreatorFromTemplate(fileName string, fileRoot string, templatePath string, sheets ...Sheet) (exc *Excel, err error) {
exc = &Excel{
SaveRoot: fileRoot,
SaveName: fileName,
OriginFilePath: templatePath,
rwLock: sync.RWMutex{},
}
if sheets != nil {
err = exc.AddSheets(sheets...)
if err != nil {
return
}
}
return exc, nil
}
// 新建文件并创建工作表生成器
func NewExcelCreatorWithNewFile(fileName string, fileRoot string, sheets ...Sheet) (exc *Excel, err error) {
return NewExcelCreatorFromTemplate(fileName, fileRoot, "", sheets...)
}
type Excel struct {
ex *excelize.File
SaveRoot string
SaveName string
OriginFilePath string
Sheets map[string]Sheet
rwLock sync.RWMutex
Opts []Option
After []Option
}
// UseOption 使用可选项
func (s *Excel) UseOption(opts ...Option) {
if opts != nil {
s.Opts = append(s.Opts, opts...)
}
}
func (s *Excel) AfterAddData(after ...Option) {
if after != nil {
s.After = append(s.After, after...)
}
}
// 添加工作簿
// 注意如果添加相同的工作簿,之前的会被覆盖
func (s *Excel) AddSheets(sheets ...Sheet) (err error) {
if s.Sheets == nil {
s.Sheets = make(map[string]Sheet, 0)
}
for _, sheet := range sheets {
var sheetName = sheet.SheetName()
s.Sheets[sheetName] = sheet
}
return
}
// 删除工作簿
func (s *Excel) DeleteSheets(sheetName string) error {
if s.Sheets == nil {
return nil
} else if s.Sheets[sheetName] != nil {
delete(s.Sheets, sheetName)
} else {
return ErrSheetNotExist
}
return nil
}
// 读取工作簿
func (s *Excel) ReadSheetData(sheetName string, handler func(rowIndex int, row []string)) (err error) {
if s.ex == nil {
s.ex, err = excelize.OpenFile(s.OriginFilePath)
if err != nil {
return
}
}
datas, err := s.ex.GetRows(sheetName)
for i, row := range datas {
handler(i, row)
}
return nil
}
// 写入到文件
func (s *Excel) WriteToFile() (path string, fileName string, err error) {
if s.ex == nil {
if s.OriginFilePath == "" {
s.ex = excelize.NewFile()
} else {
s.ex, err = excelize.OpenFile(s.OriginFilePath)
if err != nil {
return
}
}
}
if s.Opts != nil {
for _, opt := range s.Opts {
opt(s)
}
}
//插入数据
for sheetName, st := range s.Sheets {
//添加表头,没有定义则不插入
if st.SheetHeaders() != nil {
for i, c := range st.SheetHeaders() {
err = s.ex.SetCellValue(sheetName, GetCellIndex(1, i+1), c)
if err != nil {
fmt.Println(err.Error())
return
}
}
headerStyleID, errs := s.ex.NewStyle(NewDefaultHeaderStyle())
if errs != nil {
fmt.Println(errs)
err = errs
return
}
//表头设置为默认样式,边框加粗、字体加粗
if err = s.ex.SetCellStyle(st.SheetName(), "A1", GetCellIndex(1, len(st.SheetHeaders())), headerStyleID); err != nil {
return
}
}
//添加数据
var firstRow = s.getFirstEmptyRowIndex(s.ex, sheetName)
var SheetData = reflect.ValueOf(st.GetData())
var SheetType = reflect.TypeOf(st.GetData())
writerFunc, exists := writerMap[SheetData.Kind()]
if exists {
err = writerFunc(s, st, SheetData, SheetType, firstRow)
} else {
return "", "", ErrSheetDataFormatNotSupport
}
}
if s.After != nil {
for _, after := range s.After {
after(s)
}
}
//检测并生成目录
_ = os.MkdirAll(s.SaveRoot, os.ModePerm)
//保存
path = filepath.ToSlash(filepath.Join(s.SaveRoot, s.SaveName))
fileName = s.SaveName
s.rwLock.Lock()
if err = s.ex.SaveAs(path); err != nil {
log.Println(fmt.Sprintf("save file error :%v", err))
s.rwLock.Unlock()
return
}
s.rwLock.Unlock()
return
}
// getJsonFieldList 获取json字段列表
func (s *Excel) getJsonFieldList(sheetType reflect.Type) (tagList []string) {
t := sheetType.Elem()
if t.Kind() == reflect.Ptr {
t = t.Elem()
if t.Kind() != reflect.Struct {
return
}
}
for i := 0; i < t.NumField(); i++ {
var tag = t.Field(i).Tag.Get("json")
if tag != "" {
tagList = append(tagList, tag)
}
}
return
}
// dataToMap 数据转字典
func (s *Excel) dataToMap(sheet reflect.Value, sheetType reflect.Type) (dataMap map[string]any) {
dataMap = make(map[string]any)
t := sheetType.Elem()
//指针类型结构体拿真实的对象
if t.Kind() == reflect.Ptr {
t = t.Elem()
sheet = sheet.Elem()
}
for i := 0; i < t.NumField(); i++ {
var tag = t.Field(i).Tag.Get("json")
if tag != "" {
dataMap[t.Field(i).Tag.Get("json")] = sheet.Field(i).Interface()
}
}
return dataMap
}
// getFirstEmptyRowIndex 获取首个空行的索引位置
func (s *Excel) getFirstEmptyRowIndex(ex *excelize.File, sheetName string) (index int) {
rows, err := ex.GetRows(sheetName)
if err != nil {
return 1
}
return len(rows)
}
func ToExcel(titleList []string, dataList []interface{}) (content io.ReadSeeker) {
// 生成一个新的文件
file := xlsx.NewFile()
// 添加sheet页
sheet, _ := file.AddSheet("Sheet1")
// 插入表头
titleRow := sheet.AddRow()
for _, v := range titleList {
cell := titleRow.AddCell()
cell.Value = v
}
// 插入内容
for _, v := range dataList {
row := sheet.AddRow()
row.WriteStruct(v, -1)
}
var buffer bytes.Buffer
_ = file.Write(&buffer)
file.Save("1.xlsx")
content = bytes.NewReader(buffer.Bytes())
return
}
// 自动设置单元格宽度
func (s *Excel) autoResetCellWidth(sheetObj Sheet) {
// 获取最大字符宽度
maxWidths := make(map[int]int)
var sheetData = reflect.ValueOf(sheetObj.GetData())
var rowLen = 1
var columnLen = len(sheetObj.GetJsonFiledList())
if sheetData.Kind() == reflect.Slice {
rowLen = sheetData.Len()
}
limitWidth := 90
for col := 1; col <= columnLen; col++ {
var maxWidth int
for row := 0; row < rowLen; row++ {
value, _ := s.ex.GetCellValue(sheetObj.SheetName(), GetCellIndex(row+1, col))
width := len(value)
if width > limitWidth {
width = limitWidth
}
if width > maxWidth {
maxWidth = width
}
}
maxWidths[col] = maxWidth
}
// 设置列宽度
for col, width := range maxWidths {
colChar := GetColumnIndex(col)
s.ex.SetColWidth(sheetObj.SheetName(), colChar, colChar, float64(width+2))
}
}

View File

@ -0,0 +1,52 @@
// Package excel -----------------------------
// @file : options.go
// @author : JJXu
// @contact : wavingBear@163.com
// @time : 2022/12/19 12:41:40
// -------------------------------------------
package excel
import (
"fmt"
"path/filepath"
"strings"
"time"
)
type Option func(excel *Excel)
// func AddSaveFileSuffixWithUnixTime(excel *Excel) {
// excel.SaveName
// fmt.Sprintf("%v", time.Now().Unix())
// }
//
// 时间戳作为文件后缀
func OptionFileNameSuffixWithUnixTime(excel *Excel) {
ext := filepath.Ext(excel.SaveName)
name := strings.Split(excel.SaveName, ext)[0]
excel.SaveName = fmt.Sprintf("%s_%v%s", name, time.Now().Unix(), ext)
}
// 为第一行添加表头
func AfterAddHeader1(sheet Sheet, text string) func(excel *Excel) {
return func(excel *Excel) {
err := excel.ex.InsertRows(sheet.SheetName(), 1, 1)
if err != nil {
panic(err)
}
err = excel.ex.SetCellValue(sheet.SheetName(), GetCellIndex(1, 1), text)
if err != nil {
panic(err)
}
headerStyleID, errs := excel.ex.NewStyle(NewHeaderOneStyle())
if errs != nil {
fmt.Println(errs)
err = errs
return
}
//表头设置为默认样式,边框加粗、字体加粗
_ = excel.ex.SetCellStyle(sheet.SheetName(), "A1", GetCellIndex(1, len(sheet.SheetHeaders())), headerStyleID)
_ = excel.ex.MergeCell(sheet.SheetName(), "A1", GetCellIndex(1, len(sheet.SheetHeaders())))
}
}

54
pkg/utils/excel/style.go Normal file
View File

@ -0,0 +1,54 @@
// Package excel -----------------------------
// @file : style.go
// @author : JJXu
// @contact : wavingbear@163.com
// @time : 2023/9/1 13:50
// -------------------------------------------
package excel
import (
"github.com/xuri/excelize/v2"
)
func NewDefaultHeaderStyle() *excelize.Style {
return &excelize.Style{
Border: []excelize.Border{
{Type: "left", Color: "000000", Style: 2},
{Type: "top", Color: "000000", Style: 2},
{Type: "bottom", Color: "000000", Style: 2},
{Type: "right", Color: "000000", Style: 2},
},
Font: &excelize.Font{Bold: true, Size: 12},
Alignment: &excelize.Alignment{
Horizontal: "center",
},
}
}
func NewDefaultDataStyle() *excelize.Style {
return &excelize.Style{
Border: []excelize.Border{
{Type: "left", Color: "000000", Style: 1},
{Type: "bottom", Color: "000000", Style: 1},
{Type: "right", Color: "000000", Style: 1},
},
Font: &excelize.Font{Size: 12},
Alignment: &excelize.Alignment{
Horizontal: "left",
},
}
}
func NewHeaderOneStyle() *excelize.Style {
return &excelize.Style{
Border: []excelize.Border{
{Type: "left", Color: "000000", Style: 2},
{Type: "top", Color: "000000", Style: 2},
{Type: "bottom", Color: "000000", Style: 2},
{Type: "right", Color: "000000", Style: 2},
},
Font: &excelize.Font{Bold: true, Size: 14},
Alignment: &excelize.Alignment{
Horizontal: "center",
},
}
}

41
pkg/utils/excel/utils.go Normal file
View File

@ -0,0 +1,41 @@
// Package utils -----------------------------
// @file : excelHelper.go
// @author : JJXu
// @contact : wavingbear@163.com
// @time : 2022/6/9 13:41
// -------------------------------------------
package excel
import (
"fmt"
"strconv"
)
// 行列坐标值转换为excel的坐标。注意row和columnCount的初始值都是1
func GetCellIndex(row int, columnCount int) string {
var column = GetColumnIndex(columnCount)
return fmt.Sprintf("%s%d", column, row)
}
// 获取excel的列索引
var columnIndices = []string{"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"}
func GetColumnIndex(num int) string {
num--
var column = columnIndices[num%26]
for num = num / 26; num > 0; num = num / 26 {
column = columnIndices[(num-1)%26] + column
num--
}
return column
}
func Int[T int | uint | uint8 | uint32 | uint64 | int32 | int64](value string) T {
v, _ := strconv.Atoi(value)
return T(v)
}
func Float[T float64 | float32](value string) T {
v, _ := strconv.ParseFloat(value, 64)
return T(v)
}

81
pkg/utils/excel/writer.go Normal file
View File

@ -0,0 +1,81 @@
// Package excel -----------------------------
// @file : writer.go
// @author : JJXu
// @contact : wavingbear@163.com
// @time : 2023/9/1 14:11
// -------------------------------------------
package excel
import (
"errors"
"fmt"
"reflect"
)
var writerMap = map[reflect.Kind]func(exc *Excel, sheetObj Sheet, SheetData reflect.Value, SheetType reflect.Type, firstRow int) error{
reflect.Slice: sliceWriter,
reflect.Struct: structWriter,
}
func RegisterWriter(dataKind reflect.Kind, function func(exc *Excel, sheetObj Sheet, SheetData reflect.Value, SheetType reflect.Type, firstRow int) error) error {
if _, exists := writerMap[dataKind]; exists {
return errors.New(fmt.Sprintf("dataKind: %v has existed", dataKind))
}
writerMap[dataKind] = function
return nil
}
func sliceWriter(exc *Excel, sheetObj Sheet, SheetData reflect.Value, SheetDataType reflect.Type, firstRow int) error {
var cellNameList = sheetObj.GetJsonFiledList()
if cellNameList == nil {
cellNameList = exc.getJsonFieldList(SheetDataType)
}
var rowLen = SheetData.Len()
for i := 0; i < rowLen; i++ {
var dataMap = exc.dataToMap(SheetData.Index(i), SheetDataType)
for column, v := range cellNameList {
var axis = GetCellIndex(i+firstRow+1, column+1)
err := exc.ex.SetCellValue(sheetObj.SheetName(), axis, dataMap[v])
if err != nil {
return err
}
}
}
//设置数据格式
dataStyleID, errs := exc.ex.NewStyle(NewDefaultDataStyle())
if errs != nil {
return errs
}
if err := exc.ex.SetCellStyle(sheetObj.SheetName(), GetCellIndex(firstRow+1, 1), GetCellIndex(rowLen+1, len(sheetObj.SheetHeaders())), dataStyleID); err != nil {
return err
}
//设置默认列宽
//exc.ex.SetColWidth(sheetObj.SheetName(), GetColumnIndex(1), GetColumnIndex(len(sheetObj.SheetHeaders())), 12.0)
exc.autoResetCellWidth(sheetObj)
return nil
}
func structWriter(exc *Excel, sheetObj Sheet, SheetData reflect.Value, SheetType reflect.Type, firstRow int) error {
var cellNameList = exc.getJsonFieldList(SheetType)
var dataMap = exc.dataToMap(SheetData, SheetType)
for column, v := range cellNameList {
var axis = GetCellIndex(firstRow+1, column+1)
err := exc.ex.SetCellValue(sheetObj.SheetName(), axis, dataMap[v])
if err != nil {
fmt.Println(err.Error())
return err
}
}
//设置数据格式
dataStyleID, err := exc.ex.NewStyle(NewDefaultDataStyle())
if err != nil {
return err
}
if err = exc.ex.SetCellStyle(sheetObj.SheetName(), GetCellIndex(firstRow, 1), GetCellIndex(firstRow+1, len(sheetObj.SheetHeaders())), dataStyleID); err != nil {
return err
}
//设置默认列宽
//exc.ex.SetColWidth(sheetObj.SheetName(), GetColumnIndex(1), GetColumnIndex(len(sheetObj.SheetHeaders())), 12.0)
exc.autoResetCellWidth(sheetObj)
return nil
}