Compare commits
370 Commits
feat-cjy-d
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fdf6a967bf | ||
| 8c18af01a8 | |||
| 248d8f50ef | |||
| 8e7a3643d2 | |||
| 61aa8af162 | |||
| df8fbfbc43 | |||
| 6619c99be7 | |||
| a5ffa3e8b5 | |||
| e59c4f5487 | |||
| df0df7b652 | |||
|
|
e4e2e303ea | ||
|
|
973c95c76d | ||
|
|
b05a300aa9 | ||
|
|
0e79282724 | ||
|
|
bc27434bed | ||
|
|
c0d8c07a90 | ||
| 254d85ced3 | |||
| 7564af8220 | |||
|
|
abcd4609c7 | ||
| 4ce735d4de | |||
| c6f4385991 | |||
| c0ea800511 | |||
| 6c7e27ce78 | |||
| 7ba69a3afd | |||
| e7f90a304b | |||
| d20a124e14 | |||
| cccee7f86e | |||
| adf3b5ee89 | |||
| ffdc047d15 | |||
| 89bf59d878 | |||
| 6845ea1736 | |||
| 351709d08e | |||
| 11c8d63789 | |||
| c8397bcfe9 | |||
| 91f7b54581 | |||
| 6381076912 | |||
| bd0722bd86 | |||
| 4d8e91822f | |||
| e9fa67ae00 | |||
| 4d82fb6f96 | |||
| 445eb6a751 | |||
|
|
f10c36d9fa | ||
|
|
6106253c98 | ||
| ee9bbde2a7 | |||
| 3180c3c476 | |||
| 3c11449f6d | |||
| 7eba8c6293 | |||
| 4f9a38693d | |||
| de4020fbbe | |||
| 050a82d732 | |||
| 354d71b53e | |||
| 151324b413 | |||
| 5081b26e25 | |||
| 302a5a40d0 | |||
| badb2eb240 | |||
| 773799e6e0 | |||
| 9a899613c3 | |||
| 60c8855993 | |||
| 9aefcc8f76 | |||
| cfdf82195c | |||
| dc677b4344 | |||
| 41a621ad1e | |||
| ca9ba548ec | |||
| 3380ba541f | |||
|
|
d0ea217581 | ||
|
|
f4a0117c04 | ||
| 9f12454100 | |||
| f7dbcfea06 | |||
| e6459e14a1 | |||
| d097e9a20e | |||
| 7b9f75f27e | |||
| 4f544673bb | |||
| 7ce6994bc4 | |||
| cecf48c37c | |||
| 3c57d024d0 | |||
| a2d46c4463 | |||
| 222b294101 | |||
| 9170c77e32 | |||
|
|
76a08f9ad8 | ||
|
|
8688bd6abd | ||
| e9cd6876c2 | |||
| a4bff4284a | |||
| d811235da5 | |||
| bdf3fa6144 | |||
| dfb2e5e037 | |||
| 6b52775913 | |||
| 81325137a9 | |||
|
|
8d36aeb751 | ||
| 0226b0af12 | |||
| ae76287088 | |||
| 2ba217c315 | |||
| 6b90728831 | |||
| 13fa87ec2b | |||
| a62549e503 | |||
|
|
5d3c21624c | ||
|
|
68f2de32ca | ||
| fbf24995b8 | |||
|
|
efe79ec250 | ||
| 145935ba04 | |||
| a3e617a87f | |||
| 8fa9f89db9 | |||
| d4bf96fef5 | |||
| f57532630c | |||
| 1b5461d005 | |||
| e6ca737fb1 | |||
| 49caaa73c6 | |||
| 0947f8533d | |||
|
|
b121c12f7c | ||
| 79f37993c1 | |||
| 0562f21c3b | |||
| b079b597c3 | |||
|
|
fcc838ff43 | ||
| f4a3d39df6 | |||
| 50f2c59c0b | |||
|
|
c5f7903c6c | ||
|
|
065db45cdc | ||
|
|
3d67be4e09 | ||
|
|
e75e6b7ce9 | ||
| 789af8f0db | |||
| 09f598a1f4 | |||
| e295a58a43 | |||
| 44dd68fd84 | |||
| 3286f12505 | |||
| a6e5d38a43 | |||
| cf99647d57 | |||
| 7798f19d2b | |||
| 84e8a6dfda | |||
| 26c59ee54c | |||
| 17215e758b | |||
| 7e1bf3ca60 | |||
| fac24b72ac | |||
| b220a4ea96 | |||
| bcee7cdaf3 | |||
| 312ecca943 | |||
| f8e8f4806b | |||
| a92526a399 | |||
|
|
cfdd16ca47 | ||
| 68de32f89d | |||
| 1bdd0eabb2 | |||
| 751e5c4900 | |||
|
|
d095fdedf4 | ||
| 6ea7c95804 | |||
| b378f85bbd | |||
| ae88e366ee | |||
|
|
a3d942135d | ||
| b2050626b7 | |||
|
|
300a3eaebc | ||
| dfc8ddb9b1 | |||
| a5fa884ebc | |||
| 317d50bad6 | |||
| df21fe78fa | |||
| 3ded74991c | |||
|
|
1d136ceb8f | ||
| 93c085fb94 | |||
| 411c1ccbb3 | |||
| 390d3ea35b | |||
| ab8bdde9d9 | |||
| 3b2a6d059e | |||
|
|
6dde482bb4 | ||
|
|
4f74232571 | ||
|
|
150452f067 | ||
|
|
13caea6d29 | ||
|
|
420d706035 | ||
| aed787f8ca | |||
| d5a81f5c74 | |||
| 5bee5bf5aa | |||
| d8b972be26 | |||
| c17028fbcf | |||
| 3318bd45fc | |||
| 70452455b9 | |||
| 8ba457d1b8 | |||
| 74bfc30e82 | |||
|
|
646b4c7f3f | ||
|
|
e7aae9247c | ||
| dea92bc15c | |||
| 8b63419bd5 | |||
| cb395d19c2 | |||
|
|
28e7e3beba | ||
| 7f583f1a21 | |||
| e8289367bb | |||
| d074c80af4 | |||
| b04fe6fd62 | |||
| a3817266a8 | |||
| c86327c561 | |||
| dd0c81f27c | |||
|
|
0b2f0da573 | ||
| 3776c237de | |||
| 4fa0798449 | |||
|
|
f60487123e | ||
| 2f99d7d64a | |||
|
|
d040842181 | ||
| 6c7a8eb654 | |||
| 026996c311 | |||
| a5ce6f9de3 | |||
|
|
a81a85998b | ||
| 3fa85d3c34 | |||
| d34261a2ea | |||
| 96d5c78b11 | |||
| 07f8953310 | |||
| 3fbf7a5e06 | |||
| d34cef19c3 | |||
|
|
4110717751 | ||
|
|
db25e1bd36 | ||
|
|
a73f208810 | ||
| 7b8e56c0b4 | |||
|
|
2d182775ea | ||
| d3945f920c | |||
| 3591e8bccf | |||
| d464de6210 | |||
| 8939e5d5f9 | |||
|
|
4abc02807b | ||
|
|
f624dd09a4 | ||
|
|
32247c775e | ||
| fc169f7a1f | |||
| 4069fe50c3 | |||
|
|
d1e96e4b2c | ||
|
|
da7d185455 | ||
| 4c1eb8f3db | |||
|
|
057e8e5d15 | ||
|
|
0f52c6d265 | ||
| 0b7cd36b26 | |||
|
|
acfe5f9d3c | ||
| a0f7998a13 | |||
| 658722fe43 | |||
| 1505d88b25 | |||
|
|
f00c818f63 | ||
|
|
df5434ce0c | ||
|
|
a1ee6d3610 | ||
|
|
be5be3c990 | ||
|
|
d43647d0f1 | ||
|
|
daad39d53c | ||
|
|
b52190f021 | ||
| 83e9d8266d | |||
| ddf474d98a | |||
| 2284adef8a | |||
| 70a7b0545c | |||
| 3d6094f816 | |||
| d7210e2877 | |||
| 4e9720e14d | |||
|
|
2a38ed44b0 | ||
| 817c38dffa | |||
| 81d99cbc91 | |||
| fb77d2560f | |||
| 127f030415 | |||
| 09dc29b966 | |||
| 3d2a70966e | |||
| 2cb1301cfa | |||
| 1f1b61e26f | |||
| 5a59be18db | |||
| 4bc97b1a7c | |||
| 79caa97771 | |||
| ad73d0daa2 | |||
| 68ef35a746 | |||
| 367ba4ec79 | |||
| 67dfa1adcc | |||
| 79ed00a421 | |||
| d6c09dcd02 | |||
| 7a016ea15a | |||
| 55828e2577 | |||
| 19fe2ecb49 | |||
| bd7e0e4169 | |||
| 48b3a022eb | |||
| 1233cd04cf | |||
| 32413251a8 | |||
| f02fbb8cbe | |||
| 2aecb54f20 | |||
| ea2c17bf92 | |||
| a956eaffda | |||
| 7bdc1f3dd6 | |||
| 869c1de9ca | |||
| 849c11e87c | |||
| 18e1cda6cc | |||
| 1cb188664f | |||
| 71b26f0839 | |||
| 2735ca3058 | |||
| f296f0e464 | |||
| 57f451de4f | |||
| 8af4ee47eb | |||
| 879b975ae5 | |||
| 7bd66bb589 | |||
| 2c7f66d87f | |||
| 7dfc65639b | |||
| 804b26c686 | |||
| 7022ed69a9 | |||
| 99faf708cb | |||
| b0e7f0bb59 | |||
| 23248725cb | |||
| d4144b8824 | |||
| 5dc3679c3e | |||
| 3faeddec26 | |||
| df569bfd4b | |||
| a11b5b2af5 | |||
| b76c69d235 | |||
| c601d36078 | |||
| 780e1761e1 | |||
|
|
057a8a4c93 | ||
|
|
33d006bbdc | ||
|
|
8f6ab0ae8a | ||
|
|
123f70d4e2 | ||
|
|
03d53a3a0c | ||
|
|
b89e4b1660 | ||
|
|
8fd0965714 | ||
| e5aaa6fc18 | |||
| f5dc00b76f | |||
|
|
6fdea5031e | ||
| 7f082d4889 | |||
| 77bdd47159 | |||
| f88e745ab7 | |||
|
|
0578f53f2f | ||
|
|
07ce962f9e | ||
| 4b48da5d08 | |||
| e8fb81bfe9 | |||
| 4acef959cb | |||
| 4f317ddaef | |||
| 6644880fc8 | |||
| 9219289db1 | |||
| a2967ed09b | |||
| c58fdff8e2 | |||
| 094de973d2 | |||
| 3aff9c3f87 | |||
| 3bedf23d15 | |||
| fda10744f1 | |||
| 0c1a9374b4 | |||
| 80ed35bf51 | |||
| 2e39896064 | |||
| 21322d0345 | |||
| 07eb527d99 | |||
| ef8604530d | |||
| 804fe0fd33 | |||
| 71bf24ae63 | |||
| f1372dfe5a | |||
| 30f2e200be | |||
| faed07145d | |||
| 33f4530d66 | |||
|
|
885dac4abc | ||
|
|
bd827102e0 | ||
| a5d87ba1fd | |||
| eac3bf47f1 | |||
| 13cdbebace | |||
| 3771c7531d | |||
| 21f82f112a | |||
| 30d56f84bf | |||
| d695950af9 | |||
| ab9c65d1d3 | |||
| 2143726f68 | |||
| 89f0ceaca0 | |||
| 55619e87d4 | |||
| 6ed699f096 | |||
| b4e94bd89b | |||
| f5f6a25594 | |||
| ef11b30ad9 | |||
| b0551a2647 | |||
|
|
a2a2ce79a9 | ||
| 3af03a530d | |||
| 0b7aaa6a22 | |||
|
|
f5126fecd9 | ||
| 06cff05621 | |||
| bdd78132a1 | |||
| 3c0457931c | |||
|
|
026da71a7e | ||
| 20c8025f62 | |||
| 0cad3a5400 | |||
| 21284e05a1 | |||
| aa4a6fb435 | |||
|
|
b5aa103a8f | ||
| 8b9a821a35 | |||
| 0270ff4ee8 | |||
| 8d9f8bdd49 | |||
|
|
77faa10fe8 | ||
|
|
560617806d |
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
17315042007 测试-陆嘉骅2 视频
|
13111111112 测试-陆嘉骅2 视频
|
||||||
|
|
||||||
13196788678 Aa.123456 脚本
|
13196788678 Aa.123456 脚本
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -66,6 +66,9 @@ 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 WriteOff (WriteOffRequest) returns (RemoveResponse) {} //用户注销
|
||||||
|
|
||||||
|
|
||||||
rpc CreateUserAndRealName (CreateUserAndRealNameRequest) returns (CreateUserAndRealNameResponse) {}// 创建用户并实名, 自动导入
|
rpc CreateUserAndRealName (CreateUserAndRealNameRequest) returns (CreateUserAndRealNameResponse) {}// 创建用户并实名, 自动导入
|
||||||
@ -101,7 +104,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 +200,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;
|
||||||
@ -198,6 +220,8 @@ message UserListRequest{
|
|||||||
repeated int64 ids = 11;
|
repeated int64 ids = 11;
|
||||||
string nationality = 12;
|
string nationality = 12;
|
||||||
string nameAndNumber = 13;
|
string nameAndNumber = 13;
|
||||||
|
string email = 14;
|
||||||
|
string abroadTel = 15;
|
||||||
}
|
}
|
||||||
message UserInfoResponse{
|
message UserInfoResponse{
|
||||||
uint64 id = 1;
|
uint64 id = 1;
|
||||||
@ -221,6 +245,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;
|
||||||
@ -500,20 +529,6 @@ message RemoveRequest {
|
|||||||
}
|
}
|
||||||
message WriteOffRequest{
|
message WriteOffRequest{
|
||||||
uint64 id = 1;
|
uint64 id = 1;
|
||||||
string domain = 2;
|
|
||||||
uint64 userId = 3;
|
|
||||||
string tel = 4;
|
|
||||||
string jonNum = 5;
|
|
||||||
string userName = 6;
|
|
||||||
string enterDate = 7;
|
|
||||||
string positionName =8;
|
|
||||||
uint64 positionId = 9;
|
|
||||||
string siteName = 10;
|
|
||||||
uint64 siteId =11;
|
|
||||||
string authUrl =12;
|
|
||||||
string type =13;
|
|
||||||
uint32 status =14;
|
|
||||||
string submitDate=15;
|
|
||||||
}
|
}
|
||||||
message WriteOffListRequest{
|
message WriteOffListRequest{
|
||||||
uint64 page = 1;
|
uint64 page = 1;
|
||||||
@ -541,6 +556,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 +650,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 {
|
||||||
@ -709,6 +729,7 @@ message AccountInfo {
|
|||||||
string updatedAt = 41;
|
string updatedAt = 41;
|
||||||
string SecurityCode = 42 [json_name = "securityCode"];
|
string SecurityCode = 42 [json_name = "securityCode"];
|
||||||
string BlockAddr = 43 [json_name = "blockAddr"];
|
string BlockAddr = 43 [json_name = "blockAddr"];
|
||||||
|
bool WriteOff = 44 [json_name = "writeOff"];
|
||||||
}
|
}
|
||||||
|
|
||||||
message UserInfoV2 {
|
message UserInfoV2 {
|
||||||
|
|||||||
@ -17,6 +17,25 @@ var _ = proto.Marshal
|
|||||||
var _ = fmt.Errorf
|
var _ = fmt.Errorf
|
||||||
var _ = math.Inf
|
var _ = math.Inf
|
||||||
|
|
||||||
|
func (this *InviterListRequest) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *InviterListResponse) Validate() error {
|
||||||
|
for _, item := range this.List {
|
||||||
|
if item != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("List", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *InviterInfoRequest) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *InviterInfoResponse) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
func (this *VerifySliderStatusRequest) Validate() error {
|
func (this *VerifySliderStatusRequest) Validate() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
@ -70,6 +70,9 @@ 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)
|
||||||
|
WriteOff(ctx context.Context, in *WriteOffRequest, opts ...grpc_go.CallOption) (*RemoveResponse, 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 +151,9 @@ 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)
|
||||||
|
WriteOff func(ctx context.Context, in *WriteOffRequest) (*RemoveResponse, 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 +442,24 @@ 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) WriteOff(ctx context.Context, in *WriteOffRequest, opts ...grpc_go.CallOption) (*RemoveResponse, common.ErrorWithAttachment) {
|
||||||
|
out := new(RemoveResponse)
|
||||||
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/WriteOff", 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 +674,9 @@ 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)
|
||||||
|
WriteOff(context.Context, *WriteOffRequest) (*RemoveResponse, 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 +838,15 @@ 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) WriteOff(context.Context, *WriteOffRequest) (*RemoveResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method WriteOff 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 +2148,93 @@ 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_WriteOff_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(WriteOffRequest)
|
||||||
|
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("WriteOff", 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 +3218,18 @@ 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: "WriteOff",
|
||||||
|
Handler: _AccountFiee_WriteOff_Handler,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
MethodName: "CreateUserAndRealName",
|
MethodName: "CreateUserAndRealName",
|
||||||
Handler: _AccountFiee_CreateUserAndRealName_Handler,
|
Handler: _AccountFiee_CreateUserAndRealName_Handler,
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -7,8 +7,8 @@ import (
|
|||||||
fmt "fmt"
|
fmt "fmt"
|
||||||
math "math"
|
math "math"
|
||||||
proto "github.com/golang/protobuf/proto"
|
proto "github.com/golang/protobuf/proto"
|
||||||
_ "github.com/mwitkow/go-proto-validators"
|
|
||||||
_ "google.golang.org/protobuf/types/descriptorpb"
|
_ "google.golang.org/protobuf/types/descriptorpb"
|
||||||
|
_ "github.com/mwitkow/go-proto-validators"
|
||||||
github_com_mwitkow_go_proto_validators "github.com/mwitkow/go-proto-validators"
|
github_com_mwitkow_go_proto_validators "github.com/mwitkow/go-proto-validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
10304
api/bundle/bundle.pb.go
10304
api/bundle/bundle.pb.go
File diff suppressed because it is too large
Load Diff
@ -7,8 +7,8 @@ import (
|
|||||||
fmt "fmt"
|
fmt "fmt"
|
||||||
math "math"
|
math "math"
|
||||||
proto "github.com/golang/protobuf/proto"
|
proto "github.com/golang/protobuf/proto"
|
||||||
_ "github.com/mwitkow/go-proto-validators"
|
|
||||||
_ "google.golang.org/protobuf/types/descriptorpb"
|
_ "google.golang.org/protobuf/types/descriptorpb"
|
||||||
|
_ "github.com/mwitkow/go-proto-validators"
|
||||||
github_com_mwitkow_go_proto_validators "github.com/mwitkow/go-proto-validators"
|
github_com_mwitkow_go_proto_validators "github.com/mwitkow/go-proto-validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -40,6 +40,9 @@ func (this *QueryTheOrderSnapshotInformationResp) Validate() error {
|
|||||||
func (this *ServiceInformation) Validate() error {
|
func (this *ServiceInformation) Validate() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
func (this *ReSignTheContractRequest) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
func (this *DeleteValueAddServiceRequest) Validate() error {
|
func (this *DeleteValueAddServiceRequest) Validate() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@ -737,6 +740,9 @@ func (this *SetPendingTaskLayoutReq) Validate() error {
|
|||||||
func (this *SetPendingTaskLayoutResp) Validate() error {
|
func (this *SetPendingTaskLayoutResp) Validate() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
func (this *CreateTaskWorkLogRequest) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
func (this *MetricsBusinessReq) Validate() error {
|
func (this *MetricsBusinessReq) Validate() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@ -806,3 +812,19 @@ func (this *MetricsVideoSubmitExportItem) Validate() error {
|
|||||||
func (this *MetricsBalanceDetailExportReq) Validate() error {
|
func (this *MetricsBalanceDetailExportReq) Validate() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
func (this *WorkCastInfo) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *ExportWorkCastInfoReq) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *ExportWorkCastInfoResp) 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
|
||||||
|
}
|
||||||
|
|||||||
@ -50,6 +50,7 @@ type BundleClient interface {
|
|||||||
OrderRecordsListV2(ctx context.Context, in *OrderRecordsRequestV2, opts ...grpc_go.CallOption) (*OrderRecordsResponseV2, common.ErrorWithAttachment)
|
OrderRecordsListV2(ctx context.Context, in *OrderRecordsRequestV2, opts ...grpc_go.CallOption) (*OrderRecordsResponseV2, common.ErrorWithAttachment)
|
||||||
OrderListByOrderNo(ctx context.Context, in *OrderInfoByOrderNoRequest, opts ...grpc_go.CallOption) (*OrderInfoByOrderNoResp, common.ErrorWithAttachment)
|
OrderListByOrderNo(ctx context.Context, in *OrderInfoByOrderNoRequest, opts ...grpc_go.CallOption) (*OrderInfoByOrderNoResp, common.ErrorWithAttachment)
|
||||||
OnlyAddValueListByOrderNo(ctx context.Context, in *OnlyAddValueListByOrderNoRequest, opts ...grpc_go.CallOption) (*OnlyAddValueListByOrderNoResp, common.ErrorWithAttachment)
|
OnlyAddValueListByOrderNo(ctx context.Context, in *OnlyAddValueListByOrderNoRequest, opts ...grpc_go.CallOption) (*OnlyAddValueListByOrderNoResp, common.ErrorWithAttachment)
|
||||||
|
ReSignTheContract(ctx context.Context, in *ReSignTheContractRequest, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment)
|
||||||
// 增值套餐
|
// 增值套餐
|
||||||
CreateValueAddBundle(ctx context.Context, in *CreateValueAddBundleRequest, opts ...grpc_go.CallOption) (*CreateValueAddBundleResponse, common.ErrorWithAttachment)
|
CreateValueAddBundle(ctx context.Context, in *CreateValueAddBundleRequest, opts ...grpc_go.CallOption) (*CreateValueAddBundleResponse, common.ErrorWithAttachment)
|
||||||
ValueAddBundleList(ctx context.Context, in *ValueAddBundleListRequest, opts ...grpc_go.CallOption) (*ValueAddBundleListResponse, common.ErrorWithAttachment)
|
ValueAddBundleList(ctx context.Context, in *ValueAddBundleListRequest, opts ...grpc_go.CallOption) (*ValueAddBundleListResponse, common.ErrorWithAttachment)
|
||||||
@ -103,6 +104,13 @@ type BundleClient interface {
|
|||||||
BatchAssignTask(ctx context.Context, in *BatchAssignTaskRequest, opts ...grpc_go.CallOption) (*ComResponse, common.ErrorWithAttachment)
|
BatchAssignTask(ctx context.Context, in *BatchAssignTaskRequest, opts ...grpc_go.CallOption) (*ComResponse, common.ErrorWithAttachment)
|
||||||
BatchTerminateTask(ctx context.Context, in *BatchTerminateTaskRequest, opts ...grpc_go.CallOption) (*ComResponse, common.ErrorWithAttachment)
|
BatchTerminateTask(ctx context.Context, in *BatchTerminateTaskRequest, opts ...grpc_go.CallOption) (*ComResponse, common.ErrorWithAttachment)
|
||||||
GetArtistUploadStatsList(ctx context.Context, in *TaskQueryRequest, opts ...grpc_go.CallOption) (*ArtistUploadStatsResponse, common.ErrorWithAttachment)
|
GetArtistUploadStatsList(ctx context.Context, in *TaskQueryRequest, opts ...grpc_go.CallOption) (*ArtistUploadStatsResponse, common.ErrorWithAttachment)
|
||||||
|
GetPendingTaskLayout(ctx context.Context, in *GetPendingTaskLayoutReq, opts ...grpc_go.CallOption) (*GetPendingTaskLayoutResp, common.ErrorWithAttachment)
|
||||||
|
SetPendingTaskLayout(ctx context.Context, in *SetPendingTaskLayoutReq, opts ...grpc_go.CallOption) (*SetPendingTaskLayoutResp, common.ErrorWithAttachment)
|
||||||
|
GetPendingUploadBreakdown(ctx context.Context, in *PendingUploadBreakdownRequest, opts ...grpc_go.CallOption) (*PendingUploadBreakdownResponse, common.ErrorWithAttachment)
|
||||||
|
GetPendingAssign(ctx context.Context, in *PendingAssignRequest, opts ...grpc_go.CallOption) (*PendingAssignResponse, common.ErrorWithAttachment)
|
||||||
|
RevertTaskCompletionByUUIDItem(ctx context.Context, in *RevertTaskCompletionByUUIDItemRequest, opts ...grpc_go.CallOption) (*ComResponse, common.ErrorWithAttachment)
|
||||||
|
AddHiddenTaskAssignee(ctx context.Context, in *AddHiddenTaskAssigneeRequest, opts ...grpc_go.CallOption) (*ComResponse, common.ErrorWithAttachment)
|
||||||
|
CreateTaskWorkLog(ctx context.Context, in *CreateTaskWorkLogRequest, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment)
|
||||||
// 数据指标
|
// 数据指标
|
||||||
MetricsBusiness(ctx context.Context, in *MetricsBusinessReq, opts ...grpc_go.CallOption) (*MetricsBusinessResp, common.ErrorWithAttachment)
|
MetricsBusiness(ctx context.Context, in *MetricsBusinessReq, opts ...grpc_go.CallOption) (*MetricsBusinessResp, common.ErrorWithAttachment)
|
||||||
MetricsOperatingCreate(ctx context.Context, in *MetricsOperatingCreateReq, opts ...grpc_go.CallOption) (*MetricsOperatingCreateResp, common.ErrorWithAttachment)
|
MetricsOperatingCreate(ctx context.Context, in *MetricsOperatingCreateReq, opts ...grpc_go.CallOption) (*MetricsOperatingCreateResp, common.ErrorWithAttachment)
|
||||||
@ -110,13 +118,9 @@ type BundleClient interface {
|
|||||||
MetricsBundlePurchaseExport(ctx context.Context, in *MetricsBundlePurchaseExportReq, opts ...grpc_go.CallOption) (*MetricsBundlePurchaseExportResp, common.ErrorWithAttachment)
|
MetricsBundlePurchaseExport(ctx context.Context, in *MetricsBundlePurchaseExportReq, opts ...grpc_go.CallOption) (*MetricsBundlePurchaseExportResp, common.ErrorWithAttachment)
|
||||||
MetricsArtistAccountExport(ctx context.Context, in *MetricsArtistAccountExportReq, opts ...grpc_go.CallOption) (*MetricsArtistAccountExportResp, common.ErrorWithAttachment)
|
MetricsArtistAccountExport(ctx context.Context, in *MetricsArtistAccountExportReq, opts ...grpc_go.CallOption) (*MetricsArtistAccountExportResp, common.ErrorWithAttachment)
|
||||||
MetricsVideoSubmitExport(ctx context.Context, in *MetricsVideoSubmitExportReq, opts ...grpc_go.CallOption) (*MetricsVideoSubmitExportResp, common.ErrorWithAttachment)
|
MetricsVideoSubmitExport(ctx context.Context, in *MetricsVideoSubmitExportReq, opts ...grpc_go.CallOption) (*MetricsVideoSubmitExportResp, common.ErrorWithAttachment)
|
||||||
GetPendingTaskLayout(ctx context.Context, in *GetPendingTaskLayoutReq, opts ...grpc_go.CallOption) (*GetPendingTaskLayoutResp, common.ErrorWithAttachment)
|
|
||||||
SetPendingTaskLayout(ctx context.Context, in *SetPendingTaskLayoutReq, opts ...grpc_go.CallOption) (*SetPendingTaskLayoutResp, common.ErrorWithAttachment)
|
|
||||||
GetPendingUploadBreakdown(ctx context.Context, in *PendingUploadBreakdownRequest, opts ...grpc_go.CallOption) (*PendingUploadBreakdownResponse, common.ErrorWithAttachment)
|
|
||||||
GetPendingAssign(ctx context.Context, in *PendingAssignRequest, opts ...grpc_go.CallOption) (*PendingAssignResponse, common.ErrorWithAttachment)
|
|
||||||
RevertTaskCompletionByUUIDItem(ctx context.Context, in *RevertTaskCompletionByUUIDItemRequest, opts ...grpc_go.CallOption) (*ComResponse, common.ErrorWithAttachment)
|
|
||||||
AddHiddenTaskAssignee(ctx context.Context, in *AddHiddenTaskAssigneeRequest, opts ...grpc_go.CallOption) (*ComResponse, common.ErrorWithAttachment)
|
|
||||||
QueryTheOrderSnapshotInformation(ctx context.Context, in *QueryTheOrderSnapshotInformationReq, opts ...grpc_go.CallOption) (*QueryTheOrderSnapshotInformationResp, common.ErrorWithAttachment)
|
QueryTheOrderSnapshotInformation(ctx context.Context, in *QueryTheOrderSnapshotInformationReq, opts ...grpc_go.CallOption) (*QueryTheOrderSnapshotInformationResp, common.ErrorWithAttachment)
|
||||||
|
// 临时接口
|
||||||
|
ExportWorkCastInfo(ctx context.Context, in *ExportWorkCastInfoReq, opts ...grpc_go.CallOption) (*ExportWorkCastInfoResp, common.ErrorWithAttachment)
|
||||||
}
|
}
|
||||||
|
|
||||||
type bundleClient struct {
|
type bundleClient struct {
|
||||||
@ -146,6 +150,7 @@ type BundleClientImpl struct {
|
|||||||
OrderRecordsListV2 func(ctx context.Context, in *OrderRecordsRequestV2) (*OrderRecordsResponseV2, error)
|
OrderRecordsListV2 func(ctx context.Context, in *OrderRecordsRequestV2) (*OrderRecordsResponseV2, error)
|
||||||
OrderListByOrderNo func(ctx context.Context, in *OrderInfoByOrderNoRequest) (*OrderInfoByOrderNoResp, error)
|
OrderListByOrderNo func(ctx context.Context, in *OrderInfoByOrderNoRequest) (*OrderInfoByOrderNoResp, error)
|
||||||
OnlyAddValueListByOrderNo func(ctx context.Context, in *OnlyAddValueListByOrderNoRequest) (*OnlyAddValueListByOrderNoResp, error)
|
OnlyAddValueListByOrderNo func(ctx context.Context, in *OnlyAddValueListByOrderNoRequest) (*OnlyAddValueListByOrderNoResp, error)
|
||||||
|
ReSignTheContract func(ctx context.Context, in *ReSignTheContractRequest) (*CommonResponse, error)
|
||||||
CreateValueAddBundle func(ctx context.Context, in *CreateValueAddBundleRequest) (*CreateValueAddBundleResponse, error)
|
CreateValueAddBundle func(ctx context.Context, in *CreateValueAddBundleRequest) (*CreateValueAddBundleResponse, error)
|
||||||
ValueAddBundleList func(ctx context.Context, in *ValueAddBundleListRequest) (*ValueAddBundleListResponse, error)
|
ValueAddBundleList func(ctx context.Context, in *ValueAddBundleListRequest) (*ValueAddBundleListResponse, error)
|
||||||
ValueAddBundleDetail func(ctx context.Context, in *ValueAddBundleDetailRequest) (*ValueAddBundleDetailResponse, error)
|
ValueAddBundleDetail func(ctx context.Context, in *ValueAddBundleDetailRequest) (*ValueAddBundleDetailResponse, error)
|
||||||
@ -192,19 +197,21 @@ type BundleClientImpl struct {
|
|||||||
BatchAssignTask func(ctx context.Context, in *BatchAssignTaskRequest) (*ComResponse, error)
|
BatchAssignTask func(ctx context.Context, in *BatchAssignTaskRequest) (*ComResponse, error)
|
||||||
BatchTerminateTask func(ctx context.Context, in *BatchTerminateTaskRequest) (*ComResponse, error)
|
BatchTerminateTask func(ctx context.Context, in *BatchTerminateTaskRequest) (*ComResponse, error)
|
||||||
GetArtistUploadStatsList func(ctx context.Context, in *TaskQueryRequest) (*ArtistUploadStatsResponse, error)
|
GetArtistUploadStatsList func(ctx context.Context, in *TaskQueryRequest) (*ArtistUploadStatsResponse, error)
|
||||||
MetricsBusiness func(ctx context.Context, in *MetricsBusinessReq) (*MetricsBusinessResp, error)
|
|
||||||
MetricsOperatingCreate func(ctx context.Context, in *MetricsOperatingCreateReq) (*MetricsOperatingCreateResp, error)
|
|
||||||
MetricsOperatingStatus func(ctx context.Context, in *MetricsOperatingStatusReq) (*MetricsOperatingStatusResp, error)
|
|
||||||
MetricsBundlePurchaseExport func(ctx context.Context, in *MetricsBundlePurchaseExportReq) (*MetricsBundlePurchaseExportResp, error)
|
|
||||||
MetricsArtistAccountExport func(ctx context.Context, in *MetricsArtistAccountExportReq) (*MetricsArtistAccountExportResp, error)
|
|
||||||
MetricsVideoSubmitExport func(ctx context.Context, in *MetricsVideoSubmitExportReq) (*MetricsVideoSubmitExportResp, error)
|
|
||||||
GetPendingTaskLayout func(ctx context.Context, in *GetPendingTaskLayoutReq) (*GetPendingTaskLayoutResp, error)
|
GetPendingTaskLayout func(ctx context.Context, in *GetPendingTaskLayoutReq) (*GetPendingTaskLayoutResp, error)
|
||||||
SetPendingTaskLayout func(ctx context.Context, in *SetPendingTaskLayoutReq) (*SetPendingTaskLayoutResp, error)
|
SetPendingTaskLayout func(ctx context.Context, in *SetPendingTaskLayoutReq) (*SetPendingTaskLayoutResp, error)
|
||||||
GetPendingUploadBreakdown func(ctx context.Context, in *PendingUploadBreakdownRequest) (*PendingUploadBreakdownResponse, error)
|
GetPendingUploadBreakdown func(ctx context.Context, in *PendingUploadBreakdownRequest) (*PendingUploadBreakdownResponse, error)
|
||||||
GetPendingAssign func(ctx context.Context, in *PendingAssignRequest) (*PendingAssignResponse, error)
|
GetPendingAssign func(ctx context.Context, in *PendingAssignRequest) (*PendingAssignResponse, error)
|
||||||
RevertTaskCompletionByUUIDItem func(ctx context.Context, in *RevertTaskCompletionByUUIDItemRequest) (*ComResponse, error)
|
RevertTaskCompletionByUUIDItem func(ctx context.Context, in *RevertTaskCompletionByUUIDItemRequest) (*ComResponse, error)
|
||||||
AddHiddenTaskAssignee func(ctx context.Context, in *AddHiddenTaskAssigneeRequest) (*ComResponse, error)
|
AddHiddenTaskAssignee func(ctx context.Context, in *AddHiddenTaskAssigneeRequest) (*ComResponse, error)
|
||||||
|
CreateTaskWorkLog func(ctx context.Context, in *CreateTaskWorkLogRequest) (*CommonResponse, error)
|
||||||
|
MetricsBusiness func(ctx context.Context, in *MetricsBusinessReq) (*MetricsBusinessResp, error)
|
||||||
|
MetricsOperatingCreate func(ctx context.Context, in *MetricsOperatingCreateReq) (*MetricsOperatingCreateResp, error)
|
||||||
|
MetricsOperatingStatus func(ctx context.Context, in *MetricsOperatingStatusReq) (*MetricsOperatingStatusResp, error)
|
||||||
|
MetricsBundlePurchaseExport func(ctx context.Context, in *MetricsBundlePurchaseExportReq) (*MetricsBundlePurchaseExportResp, error)
|
||||||
|
MetricsArtistAccountExport func(ctx context.Context, in *MetricsArtistAccountExportReq) (*MetricsArtistAccountExportResp, error)
|
||||||
|
MetricsVideoSubmitExport func(ctx context.Context, in *MetricsVideoSubmitExportReq) (*MetricsVideoSubmitExportResp, error)
|
||||||
QueryTheOrderSnapshotInformation func(ctx context.Context, in *QueryTheOrderSnapshotInformationReq) (*QueryTheOrderSnapshotInformationResp, error)
|
QueryTheOrderSnapshotInformation func(ctx context.Context, in *QueryTheOrderSnapshotInformationReq) (*QueryTheOrderSnapshotInformationResp, error)
|
||||||
|
ExportWorkCastInfo func(ctx context.Context, in *ExportWorkCastInfoReq) (*ExportWorkCastInfoResp, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *BundleClientImpl) GetDubboStub(cc *triple.TripleConn) BundleClient {
|
func (c *BundleClientImpl) GetDubboStub(cc *triple.TripleConn) BundleClient {
|
||||||
@ -351,6 +358,12 @@ func (c *bundleClient) OnlyAddValueListByOrderNo(ctx context.Context, in *OnlyAd
|
|||||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/OnlyAddValueListByOrderNo", in, out)
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/OnlyAddValueListByOrderNo", in, out)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *bundleClient) ReSignTheContract(ctx context.Context, in *ReSignTheContractRequest, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment) {
|
||||||
|
out := new(CommonResponse)
|
||||||
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/ReSignTheContract", in, out)
|
||||||
|
}
|
||||||
|
|
||||||
func (c *bundleClient) CreateValueAddBundle(ctx context.Context, in *CreateValueAddBundleRequest, opts ...grpc_go.CallOption) (*CreateValueAddBundleResponse, common.ErrorWithAttachment) {
|
func (c *bundleClient) CreateValueAddBundle(ctx context.Context, in *CreateValueAddBundleRequest, opts ...grpc_go.CallOption) (*CreateValueAddBundleResponse, common.ErrorWithAttachment) {
|
||||||
out := new(CreateValueAddBundleResponse)
|
out := new(CreateValueAddBundleResponse)
|
||||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
@ -627,42 +640,6 @@ func (c *bundleClient) GetArtistUploadStatsList(ctx context.Context, in *TaskQue
|
|||||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetArtistUploadStatsList", in, out)
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetArtistUploadStatsList", in, out)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *bundleClient) MetricsBusiness(ctx context.Context, in *MetricsBusinessReq, opts ...grpc_go.CallOption) (*MetricsBusinessResp, common.ErrorWithAttachment) {
|
|
||||||
out := new(MetricsBusinessResp)
|
|
||||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
|
||||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/MetricsBusiness", in, out)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *bundleClient) MetricsOperatingCreate(ctx context.Context, in *MetricsOperatingCreateReq, opts ...grpc_go.CallOption) (*MetricsOperatingCreateResp, common.ErrorWithAttachment) {
|
|
||||||
out := new(MetricsOperatingCreateResp)
|
|
||||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
|
||||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/MetricsOperatingCreate", in, out)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *bundleClient) MetricsOperatingStatus(ctx context.Context, in *MetricsOperatingStatusReq, opts ...grpc_go.CallOption) (*MetricsOperatingStatusResp, common.ErrorWithAttachment) {
|
|
||||||
out := new(MetricsOperatingStatusResp)
|
|
||||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
|
||||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/MetricsOperatingStatus", in, out)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *bundleClient) MetricsBundlePurchaseExport(ctx context.Context, in *MetricsBundlePurchaseExportReq, opts ...grpc_go.CallOption) (*MetricsBundlePurchaseExportResp, common.ErrorWithAttachment) {
|
|
||||||
out := new(MetricsBundlePurchaseExportResp)
|
|
||||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
|
||||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/MetricsBundlePurchaseExport", in, out)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *bundleClient) MetricsArtistAccountExport(ctx context.Context, in *MetricsArtistAccountExportReq, opts ...grpc_go.CallOption) (*MetricsArtistAccountExportResp, common.ErrorWithAttachment) {
|
|
||||||
out := new(MetricsArtistAccountExportResp)
|
|
||||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
|
||||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/MetricsArtistAccountExport", in, out)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *bundleClient) MetricsVideoSubmitExport(ctx context.Context, in *MetricsVideoSubmitExportReq, opts ...grpc_go.CallOption) (*MetricsVideoSubmitExportResp, common.ErrorWithAttachment) {
|
|
||||||
out := new(MetricsVideoSubmitExportResp)
|
|
||||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
|
||||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/MetricsVideoSubmitExport", in, out)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *bundleClient) GetPendingTaskLayout(ctx context.Context, in *GetPendingTaskLayoutReq, opts ...grpc_go.CallOption) (*GetPendingTaskLayoutResp, common.ErrorWithAttachment) {
|
func (c *bundleClient) GetPendingTaskLayout(ctx context.Context, in *GetPendingTaskLayoutReq, opts ...grpc_go.CallOption) (*GetPendingTaskLayoutResp, common.ErrorWithAttachment) {
|
||||||
out := new(GetPendingTaskLayoutResp)
|
out := new(GetPendingTaskLayoutResp)
|
||||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
@ -699,12 +676,60 @@ func (c *bundleClient) AddHiddenTaskAssignee(ctx context.Context, in *AddHiddenT
|
|||||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/AddHiddenTaskAssignee", in, out)
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/AddHiddenTaskAssignee", in, out)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *bundleClient) CreateTaskWorkLog(ctx context.Context, in *CreateTaskWorkLogRequest, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment) {
|
||||||
|
out := new(CommonResponse)
|
||||||
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/CreateTaskWorkLog", in, out)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *bundleClient) MetricsBusiness(ctx context.Context, in *MetricsBusinessReq, opts ...grpc_go.CallOption) (*MetricsBusinessResp, common.ErrorWithAttachment) {
|
||||||
|
out := new(MetricsBusinessResp)
|
||||||
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/MetricsBusiness", in, out)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *bundleClient) MetricsOperatingCreate(ctx context.Context, in *MetricsOperatingCreateReq, opts ...grpc_go.CallOption) (*MetricsOperatingCreateResp, common.ErrorWithAttachment) {
|
||||||
|
out := new(MetricsOperatingCreateResp)
|
||||||
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/MetricsOperatingCreate", in, out)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *bundleClient) MetricsOperatingStatus(ctx context.Context, in *MetricsOperatingStatusReq, opts ...grpc_go.CallOption) (*MetricsOperatingStatusResp, common.ErrorWithAttachment) {
|
||||||
|
out := new(MetricsOperatingStatusResp)
|
||||||
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/MetricsOperatingStatus", in, out)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *bundleClient) MetricsBundlePurchaseExport(ctx context.Context, in *MetricsBundlePurchaseExportReq, opts ...grpc_go.CallOption) (*MetricsBundlePurchaseExportResp, common.ErrorWithAttachment) {
|
||||||
|
out := new(MetricsBundlePurchaseExportResp)
|
||||||
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/MetricsBundlePurchaseExport", in, out)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *bundleClient) MetricsArtistAccountExport(ctx context.Context, in *MetricsArtistAccountExportReq, opts ...grpc_go.CallOption) (*MetricsArtistAccountExportResp, common.ErrorWithAttachment) {
|
||||||
|
out := new(MetricsArtistAccountExportResp)
|
||||||
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/MetricsArtistAccountExport", in, out)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *bundleClient) MetricsVideoSubmitExport(ctx context.Context, in *MetricsVideoSubmitExportReq, opts ...grpc_go.CallOption) (*MetricsVideoSubmitExportResp, common.ErrorWithAttachment) {
|
||||||
|
out := new(MetricsVideoSubmitExportResp)
|
||||||
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/MetricsVideoSubmitExport", in, out)
|
||||||
|
}
|
||||||
|
|
||||||
func (c *bundleClient) QueryTheOrderSnapshotInformation(ctx context.Context, in *QueryTheOrderSnapshotInformationReq, opts ...grpc_go.CallOption) (*QueryTheOrderSnapshotInformationResp, common.ErrorWithAttachment) {
|
func (c *bundleClient) QueryTheOrderSnapshotInformation(ctx context.Context, in *QueryTheOrderSnapshotInformationReq, opts ...grpc_go.CallOption) (*QueryTheOrderSnapshotInformationResp, common.ErrorWithAttachment) {
|
||||||
out := new(QueryTheOrderSnapshotInformationResp)
|
out := new(QueryTheOrderSnapshotInformationResp)
|
||||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/QueryTheOrderSnapshotInformation", in, out)
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/QueryTheOrderSnapshotInformation", in, out)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *bundleClient) ExportWorkCastInfo(ctx context.Context, in *ExportWorkCastInfoReq, opts ...grpc_go.CallOption) (*ExportWorkCastInfoResp, common.ErrorWithAttachment) {
|
||||||
|
out := new(ExportWorkCastInfoResp)
|
||||||
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/ExportWorkCastInfo", in, out)
|
||||||
|
}
|
||||||
|
|
||||||
// BundleServer is the server API for Bundle service.
|
// BundleServer is the server API for Bundle service.
|
||||||
// All implementations must embed UnimplementedBundleServer
|
// All implementations must embed UnimplementedBundleServer
|
||||||
// for forward compatibility
|
// for forward compatibility
|
||||||
@ -731,6 +756,7 @@ type BundleServer interface {
|
|||||||
OrderRecordsListV2(context.Context, *OrderRecordsRequestV2) (*OrderRecordsResponseV2, error)
|
OrderRecordsListV2(context.Context, *OrderRecordsRequestV2) (*OrderRecordsResponseV2, error)
|
||||||
OrderListByOrderNo(context.Context, *OrderInfoByOrderNoRequest) (*OrderInfoByOrderNoResp, error)
|
OrderListByOrderNo(context.Context, *OrderInfoByOrderNoRequest) (*OrderInfoByOrderNoResp, error)
|
||||||
OnlyAddValueListByOrderNo(context.Context, *OnlyAddValueListByOrderNoRequest) (*OnlyAddValueListByOrderNoResp, error)
|
OnlyAddValueListByOrderNo(context.Context, *OnlyAddValueListByOrderNoRequest) (*OnlyAddValueListByOrderNoResp, error)
|
||||||
|
ReSignTheContract(context.Context, *ReSignTheContractRequest) (*CommonResponse, error)
|
||||||
// 增值套餐
|
// 增值套餐
|
||||||
CreateValueAddBundle(context.Context, *CreateValueAddBundleRequest) (*CreateValueAddBundleResponse, error)
|
CreateValueAddBundle(context.Context, *CreateValueAddBundleRequest) (*CreateValueAddBundleResponse, error)
|
||||||
ValueAddBundleList(context.Context, *ValueAddBundleListRequest) (*ValueAddBundleListResponse, error)
|
ValueAddBundleList(context.Context, *ValueAddBundleListRequest) (*ValueAddBundleListResponse, error)
|
||||||
@ -784,6 +810,13 @@ type BundleServer interface {
|
|||||||
BatchAssignTask(context.Context, *BatchAssignTaskRequest) (*ComResponse, error)
|
BatchAssignTask(context.Context, *BatchAssignTaskRequest) (*ComResponse, error)
|
||||||
BatchTerminateTask(context.Context, *BatchTerminateTaskRequest) (*ComResponse, error)
|
BatchTerminateTask(context.Context, *BatchTerminateTaskRequest) (*ComResponse, error)
|
||||||
GetArtistUploadStatsList(context.Context, *TaskQueryRequest) (*ArtistUploadStatsResponse, error)
|
GetArtistUploadStatsList(context.Context, *TaskQueryRequest) (*ArtistUploadStatsResponse, error)
|
||||||
|
GetPendingTaskLayout(context.Context, *GetPendingTaskLayoutReq) (*GetPendingTaskLayoutResp, error)
|
||||||
|
SetPendingTaskLayout(context.Context, *SetPendingTaskLayoutReq) (*SetPendingTaskLayoutResp, error)
|
||||||
|
GetPendingUploadBreakdown(context.Context, *PendingUploadBreakdownRequest) (*PendingUploadBreakdownResponse, error)
|
||||||
|
GetPendingAssign(context.Context, *PendingAssignRequest) (*PendingAssignResponse, error)
|
||||||
|
RevertTaskCompletionByUUIDItem(context.Context, *RevertTaskCompletionByUUIDItemRequest) (*ComResponse, error)
|
||||||
|
AddHiddenTaskAssignee(context.Context, *AddHiddenTaskAssigneeRequest) (*ComResponse, error)
|
||||||
|
CreateTaskWorkLog(context.Context, *CreateTaskWorkLogRequest) (*CommonResponse, error)
|
||||||
// 数据指标
|
// 数据指标
|
||||||
MetricsBusiness(context.Context, *MetricsBusinessReq) (*MetricsBusinessResp, error)
|
MetricsBusiness(context.Context, *MetricsBusinessReq) (*MetricsBusinessResp, error)
|
||||||
MetricsOperatingCreate(context.Context, *MetricsOperatingCreateReq) (*MetricsOperatingCreateResp, error)
|
MetricsOperatingCreate(context.Context, *MetricsOperatingCreateReq) (*MetricsOperatingCreateResp, error)
|
||||||
@ -791,13 +824,9 @@ type BundleServer interface {
|
|||||||
MetricsBundlePurchaseExport(context.Context, *MetricsBundlePurchaseExportReq) (*MetricsBundlePurchaseExportResp, error)
|
MetricsBundlePurchaseExport(context.Context, *MetricsBundlePurchaseExportReq) (*MetricsBundlePurchaseExportResp, error)
|
||||||
MetricsArtistAccountExport(context.Context, *MetricsArtistAccountExportReq) (*MetricsArtistAccountExportResp, error)
|
MetricsArtistAccountExport(context.Context, *MetricsArtistAccountExportReq) (*MetricsArtistAccountExportResp, error)
|
||||||
MetricsVideoSubmitExport(context.Context, *MetricsVideoSubmitExportReq) (*MetricsVideoSubmitExportResp, error)
|
MetricsVideoSubmitExport(context.Context, *MetricsVideoSubmitExportReq) (*MetricsVideoSubmitExportResp, error)
|
||||||
GetPendingTaskLayout(context.Context, *GetPendingTaskLayoutReq) (*GetPendingTaskLayoutResp, error)
|
|
||||||
SetPendingTaskLayout(context.Context, *SetPendingTaskLayoutReq) (*SetPendingTaskLayoutResp, error)
|
|
||||||
GetPendingUploadBreakdown(context.Context, *PendingUploadBreakdownRequest) (*PendingUploadBreakdownResponse, error)
|
|
||||||
GetPendingAssign(context.Context, *PendingAssignRequest) (*PendingAssignResponse, error)
|
|
||||||
RevertTaskCompletionByUUIDItem(context.Context, *RevertTaskCompletionByUUIDItemRequest) (*ComResponse, error)
|
|
||||||
AddHiddenTaskAssignee(context.Context, *AddHiddenTaskAssigneeRequest) (*ComResponse, error)
|
|
||||||
QueryTheOrderSnapshotInformation(context.Context, *QueryTheOrderSnapshotInformationReq) (*QueryTheOrderSnapshotInformationResp, error)
|
QueryTheOrderSnapshotInformation(context.Context, *QueryTheOrderSnapshotInformationReq) (*QueryTheOrderSnapshotInformationResp, error)
|
||||||
|
// 临时接口
|
||||||
|
ExportWorkCastInfo(context.Context, *ExportWorkCastInfoReq) (*ExportWorkCastInfoResp, error)
|
||||||
mustEmbedUnimplementedBundleServer()
|
mustEmbedUnimplementedBundleServer()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -872,6 +901,9 @@ func (UnimplementedBundleServer) OrderListByOrderNo(context.Context, *OrderInfoB
|
|||||||
func (UnimplementedBundleServer) OnlyAddValueListByOrderNo(context.Context, *OnlyAddValueListByOrderNoRequest) (*OnlyAddValueListByOrderNoResp, error) {
|
func (UnimplementedBundleServer) OnlyAddValueListByOrderNo(context.Context, *OnlyAddValueListByOrderNoRequest) (*OnlyAddValueListByOrderNoResp, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method OnlyAddValueListByOrderNo not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method OnlyAddValueListByOrderNo not implemented")
|
||||||
}
|
}
|
||||||
|
func (UnimplementedBundleServer) ReSignTheContract(context.Context, *ReSignTheContractRequest) (*CommonResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method ReSignTheContract not implemented")
|
||||||
|
}
|
||||||
func (UnimplementedBundleServer) CreateValueAddBundle(context.Context, *CreateValueAddBundleRequest) (*CreateValueAddBundleResponse, error) {
|
func (UnimplementedBundleServer) CreateValueAddBundle(context.Context, *CreateValueAddBundleRequest) (*CreateValueAddBundleResponse, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method CreateValueAddBundle not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method CreateValueAddBundle not implemented")
|
||||||
}
|
}
|
||||||
@ -1010,24 +1042,6 @@ func (UnimplementedBundleServer) BatchTerminateTask(context.Context, *BatchTermi
|
|||||||
func (UnimplementedBundleServer) GetArtistUploadStatsList(context.Context, *TaskQueryRequest) (*ArtistUploadStatsResponse, error) {
|
func (UnimplementedBundleServer) GetArtistUploadStatsList(context.Context, *TaskQueryRequest) (*ArtistUploadStatsResponse, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method GetArtistUploadStatsList not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method GetArtistUploadStatsList not implemented")
|
||||||
}
|
}
|
||||||
func (UnimplementedBundleServer) MetricsBusiness(context.Context, *MetricsBusinessReq) (*MetricsBusinessResp, error) {
|
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method MetricsBusiness not implemented")
|
|
||||||
}
|
|
||||||
func (UnimplementedBundleServer) MetricsOperatingCreate(context.Context, *MetricsOperatingCreateReq) (*MetricsOperatingCreateResp, error) {
|
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method MetricsOperatingCreate not implemented")
|
|
||||||
}
|
|
||||||
func (UnimplementedBundleServer) MetricsOperatingStatus(context.Context, *MetricsOperatingStatusReq) (*MetricsOperatingStatusResp, error) {
|
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method MetricsOperatingStatus not implemented")
|
|
||||||
}
|
|
||||||
func (UnimplementedBundleServer) MetricsBundlePurchaseExport(context.Context, *MetricsBundlePurchaseExportReq) (*MetricsBundlePurchaseExportResp, error) {
|
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method MetricsBundlePurchaseExport not implemented")
|
|
||||||
}
|
|
||||||
func (UnimplementedBundleServer) MetricsArtistAccountExport(context.Context, *MetricsArtistAccountExportReq) (*MetricsArtistAccountExportResp, error) {
|
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method MetricsArtistAccountExport not implemented")
|
|
||||||
}
|
|
||||||
func (UnimplementedBundleServer) MetricsVideoSubmitExport(context.Context, *MetricsVideoSubmitExportReq) (*MetricsVideoSubmitExportResp, error) {
|
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method MetricsVideoSubmitExport not implemented")
|
|
||||||
}
|
|
||||||
func (UnimplementedBundleServer) GetPendingTaskLayout(context.Context, *GetPendingTaskLayoutReq) (*GetPendingTaskLayoutResp, error) {
|
func (UnimplementedBundleServer) GetPendingTaskLayout(context.Context, *GetPendingTaskLayoutReq) (*GetPendingTaskLayoutResp, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method GetPendingTaskLayout not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method GetPendingTaskLayout not implemented")
|
||||||
}
|
}
|
||||||
@ -1046,9 +1060,33 @@ func (UnimplementedBundleServer) RevertTaskCompletionByUUIDItem(context.Context,
|
|||||||
func (UnimplementedBundleServer) AddHiddenTaskAssignee(context.Context, *AddHiddenTaskAssigneeRequest) (*ComResponse, error) {
|
func (UnimplementedBundleServer) AddHiddenTaskAssignee(context.Context, *AddHiddenTaskAssigneeRequest) (*ComResponse, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method AddHiddenTaskAssignee not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method AddHiddenTaskAssignee not implemented")
|
||||||
}
|
}
|
||||||
|
func (UnimplementedBundleServer) CreateTaskWorkLog(context.Context, *CreateTaskWorkLogRequest) (*CommonResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method CreateTaskWorkLog not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedBundleServer) MetricsBusiness(context.Context, *MetricsBusinessReq) (*MetricsBusinessResp, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method MetricsBusiness not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedBundleServer) MetricsOperatingCreate(context.Context, *MetricsOperatingCreateReq) (*MetricsOperatingCreateResp, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method MetricsOperatingCreate not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedBundleServer) MetricsOperatingStatus(context.Context, *MetricsOperatingStatusReq) (*MetricsOperatingStatusResp, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method MetricsOperatingStatus not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedBundleServer) MetricsBundlePurchaseExport(context.Context, *MetricsBundlePurchaseExportReq) (*MetricsBundlePurchaseExportResp, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method MetricsBundlePurchaseExport not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedBundleServer) MetricsArtistAccountExport(context.Context, *MetricsArtistAccountExportReq) (*MetricsArtistAccountExportResp, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method MetricsArtistAccountExport not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedBundleServer) MetricsVideoSubmitExport(context.Context, *MetricsVideoSubmitExportReq) (*MetricsVideoSubmitExportResp, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method MetricsVideoSubmitExport not implemented")
|
||||||
|
}
|
||||||
func (UnimplementedBundleServer) QueryTheOrderSnapshotInformation(context.Context, *QueryTheOrderSnapshotInformationReq) (*QueryTheOrderSnapshotInformationResp, error) {
|
func (UnimplementedBundleServer) QueryTheOrderSnapshotInformation(context.Context, *QueryTheOrderSnapshotInformationReq) (*QueryTheOrderSnapshotInformationResp, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method QueryTheOrderSnapshotInformation not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method QueryTheOrderSnapshotInformation not implemented")
|
||||||
}
|
}
|
||||||
|
func (UnimplementedBundleServer) ExportWorkCastInfo(context.Context, *ExportWorkCastInfoReq) (*ExportWorkCastInfoResp, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method ExportWorkCastInfo not implemented")
|
||||||
|
}
|
||||||
func (s *UnimplementedBundleServer) XXX_SetProxyImpl(impl protocol.Invoker) {
|
func (s *UnimplementedBundleServer) XXX_SetProxyImpl(impl protocol.Invoker) {
|
||||||
s.proxyImpl = impl
|
s.proxyImpl = impl
|
||||||
}
|
}
|
||||||
@ -1715,6 +1753,35 @@ func _Bundle_OnlyAddValueListByOrderNo_Handler(srv interface{}, ctx context.Cont
|
|||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func _Bundle_ReSignTheContract_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(ReSignTheContractRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
base := srv.(dubbo3.Dubbo3GrpcService)
|
||||||
|
args := []interface{}{}
|
||||||
|
args = append(args, in)
|
||||||
|
md, _ := metadata.FromIncomingContext(ctx)
|
||||||
|
invAttachment := make(map[string]interface{}, len(md))
|
||||||
|
for k, v := range md {
|
||||||
|
invAttachment[k] = v
|
||||||
|
}
|
||||||
|
invo := invocation.NewRPCInvocation("ReSignTheContract", args, invAttachment)
|
||||||
|
if interceptor == nil {
|
||||||
|
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||||
|
return result, result.Error()
|
||||||
|
}
|
||||||
|
info := &grpc_go.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||||
|
return result, result.Error()
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
func _Bundle_CreateValueAddBundle_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
func _Bundle_CreateValueAddBundle_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
in := new(CreateValueAddBundleRequest)
|
in := new(CreateValueAddBundleRequest)
|
||||||
if err := dec(in); err != nil {
|
if err := dec(in); err != nil {
|
||||||
@ -3049,180 +3116,6 @@ func _Bundle_GetArtistUploadStatsList_Handler(srv interface{}, ctx context.Conte
|
|||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
func _Bundle_MetricsBusiness_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
|
||||||
in := new(MetricsBusinessReq)
|
|
||||||
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("MetricsBusiness", args, invAttachment)
|
|
||||||
if interceptor == nil {
|
|
||||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
|
||||||
return result, result.Error()
|
|
||||||
}
|
|
||||||
info := &grpc_go.UnaryServerInfo{
|
|
||||||
Server: srv,
|
|
||||||
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
|
|
||||||
}
|
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
||||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
|
||||||
return result, result.Error()
|
|
||||||
}
|
|
||||||
return interceptor(ctx, in, info, handler)
|
|
||||||
}
|
|
||||||
|
|
||||||
func _Bundle_MetricsOperatingCreate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
|
||||||
in := new(MetricsOperatingCreateReq)
|
|
||||||
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("MetricsOperatingCreate", args, invAttachment)
|
|
||||||
if interceptor == nil {
|
|
||||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
|
||||||
return result, result.Error()
|
|
||||||
}
|
|
||||||
info := &grpc_go.UnaryServerInfo{
|
|
||||||
Server: srv,
|
|
||||||
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
|
|
||||||
}
|
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
||||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
|
||||||
return result, result.Error()
|
|
||||||
}
|
|
||||||
return interceptor(ctx, in, info, handler)
|
|
||||||
}
|
|
||||||
|
|
||||||
func _Bundle_MetricsOperatingStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
|
||||||
in := new(MetricsOperatingStatusReq)
|
|
||||||
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("MetricsOperatingStatus", args, invAttachment)
|
|
||||||
if interceptor == nil {
|
|
||||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
|
||||||
return result, result.Error()
|
|
||||||
}
|
|
||||||
info := &grpc_go.UnaryServerInfo{
|
|
||||||
Server: srv,
|
|
||||||
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
|
|
||||||
}
|
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
||||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
|
||||||
return result, result.Error()
|
|
||||||
}
|
|
||||||
return interceptor(ctx, in, info, handler)
|
|
||||||
}
|
|
||||||
|
|
||||||
func _Bundle_MetricsBundlePurchaseExport_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
|
||||||
in := new(MetricsBundlePurchaseExportReq)
|
|
||||||
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("MetricsBundlePurchaseExport", args, invAttachment)
|
|
||||||
if interceptor == nil {
|
|
||||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
|
||||||
return result, result.Error()
|
|
||||||
}
|
|
||||||
info := &grpc_go.UnaryServerInfo{
|
|
||||||
Server: srv,
|
|
||||||
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
|
|
||||||
}
|
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
||||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
|
||||||
return result, result.Error()
|
|
||||||
}
|
|
||||||
return interceptor(ctx, in, info, handler)
|
|
||||||
}
|
|
||||||
|
|
||||||
func _Bundle_MetricsArtistAccountExport_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
|
||||||
in := new(MetricsArtistAccountExportReq)
|
|
||||||
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("MetricsArtistAccountExport", args, invAttachment)
|
|
||||||
if interceptor == nil {
|
|
||||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
|
||||||
return result, result.Error()
|
|
||||||
}
|
|
||||||
info := &grpc_go.UnaryServerInfo{
|
|
||||||
Server: srv,
|
|
||||||
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
|
|
||||||
}
|
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
||||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
|
||||||
return result, result.Error()
|
|
||||||
}
|
|
||||||
return interceptor(ctx, in, info, handler)
|
|
||||||
}
|
|
||||||
|
|
||||||
func _Bundle_MetricsVideoSubmitExport_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
|
||||||
in := new(MetricsVideoSubmitExportReq)
|
|
||||||
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("MetricsVideoSubmitExport", args, invAttachment)
|
|
||||||
if interceptor == nil {
|
|
||||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
|
||||||
return result, result.Error()
|
|
||||||
}
|
|
||||||
info := &grpc_go.UnaryServerInfo{
|
|
||||||
Server: srv,
|
|
||||||
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
|
|
||||||
}
|
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
||||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
|
||||||
return result, result.Error()
|
|
||||||
}
|
|
||||||
return interceptor(ctx, in, info, handler)
|
|
||||||
}
|
|
||||||
|
|
||||||
func _Bundle_GetPendingTaskLayout_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
func _Bundle_GetPendingTaskLayout_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
in := new(GetPendingTaskLayoutReq)
|
in := new(GetPendingTaskLayoutReq)
|
||||||
if err := dec(in); err != nil {
|
if err := dec(in); err != nil {
|
||||||
@ -3397,6 +3290,209 @@ func _Bundle_AddHiddenTaskAssignee_Handler(srv interface{}, ctx context.Context,
|
|||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func _Bundle_CreateTaskWorkLog_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(CreateTaskWorkLogRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
base := srv.(dubbo3.Dubbo3GrpcService)
|
||||||
|
args := []interface{}{}
|
||||||
|
args = append(args, in)
|
||||||
|
md, _ := metadata.FromIncomingContext(ctx)
|
||||||
|
invAttachment := make(map[string]interface{}, len(md))
|
||||||
|
for k, v := range md {
|
||||||
|
invAttachment[k] = v
|
||||||
|
}
|
||||||
|
invo := invocation.NewRPCInvocation("CreateTaskWorkLog", args, invAttachment)
|
||||||
|
if interceptor == nil {
|
||||||
|
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||||
|
return result, result.Error()
|
||||||
|
}
|
||||||
|
info := &grpc_go.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||||
|
return result, result.Error()
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Bundle_MetricsBusiness_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(MetricsBusinessReq)
|
||||||
|
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("MetricsBusiness", args, invAttachment)
|
||||||
|
if interceptor == nil {
|
||||||
|
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||||
|
return result, result.Error()
|
||||||
|
}
|
||||||
|
info := &grpc_go.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||||
|
return result, result.Error()
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Bundle_MetricsOperatingCreate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(MetricsOperatingCreateReq)
|
||||||
|
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("MetricsOperatingCreate", args, invAttachment)
|
||||||
|
if interceptor == nil {
|
||||||
|
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||||
|
return result, result.Error()
|
||||||
|
}
|
||||||
|
info := &grpc_go.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||||
|
return result, result.Error()
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Bundle_MetricsOperatingStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(MetricsOperatingStatusReq)
|
||||||
|
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("MetricsOperatingStatus", args, invAttachment)
|
||||||
|
if interceptor == nil {
|
||||||
|
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||||
|
return result, result.Error()
|
||||||
|
}
|
||||||
|
info := &grpc_go.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||||
|
return result, result.Error()
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Bundle_MetricsBundlePurchaseExport_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(MetricsBundlePurchaseExportReq)
|
||||||
|
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("MetricsBundlePurchaseExport", args, invAttachment)
|
||||||
|
if interceptor == nil {
|
||||||
|
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||||
|
return result, result.Error()
|
||||||
|
}
|
||||||
|
info := &grpc_go.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||||
|
return result, result.Error()
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Bundle_MetricsArtistAccountExport_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(MetricsArtistAccountExportReq)
|
||||||
|
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("MetricsArtistAccountExport", args, invAttachment)
|
||||||
|
if interceptor == nil {
|
||||||
|
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||||
|
return result, result.Error()
|
||||||
|
}
|
||||||
|
info := &grpc_go.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||||
|
return result, result.Error()
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Bundle_MetricsVideoSubmitExport_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(MetricsVideoSubmitExportReq)
|
||||||
|
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("MetricsVideoSubmitExport", args, invAttachment)
|
||||||
|
if interceptor == nil {
|
||||||
|
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||||
|
return result, result.Error()
|
||||||
|
}
|
||||||
|
info := &grpc_go.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||||
|
return result, result.Error()
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
func _Bundle_QueryTheOrderSnapshotInformation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
func _Bundle_QueryTheOrderSnapshotInformation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
in := new(QueryTheOrderSnapshotInformationReq)
|
in := new(QueryTheOrderSnapshotInformationReq)
|
||||||
if err := dec(in); err != nil {
|
if err := dec(in); err != nil {
|
||||||
@ -3426,6 +3522,35 @@ func _Bundle_QueryTheOrderSnapshotInformation_Handler(srv interface{}, ctx conte
|
|||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func _Bundle_ExportWorkCastInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(ExportWorkCastInfoReq)
|
||||||
|
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("ExportWorkCastInfo", args, invAttachment)
|
||||||
|
if interceptor == nil {
|
||||||
|
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||||
|
return result, result.Error()
|
||||||
|
}
|
||||||
|
info := &grpc_go.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||||
|
return result, result.Error()
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
// Bundle_ServiceDesc is the grpc_go.ServiceDesc for Bundle service.
|
// Bundle_ServiceDesc is the grpc_go.ServiceDesc for Bundle service.
|
||||||
// It's only intended for direct use with grpc_go.RegisterService,
|
// It's only intended for direct use with grpc_go.RegisterService,
|
||||||
// and not to be introspected or modified (even as a copy)
|
// and not to be introspected or modified (even as a copy)
|
||||||
@ -3521,6 +3646,10 @@ var Bundle_ServiceDesc = grpc_go.ServiceDesc{
|
|||||||
MethodName: "OnlyAddValueListByOrderNo",
|
MethodName: "OnlyAddValueListByOrderNo",
|
||||||
Handler: _Bundle_OnlyAddValueListByOrderNo_Handler,
|
Handler: _Bundle_OnlyAddValueListByOrderNo_Handler,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
MethodName: "ReSignTheContract",
|
||||||
|
Handler: _Bundle_ReSignTheContract_Handler,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
MethodName: "CreateValueAddBundle",
|
MethodName: "CreateValueAddBundle",
|
||||||
Handler: _Bundle_CreateValueAddBundle_Handler,
|
Handler: _Bundle_CreateValueAddBundle_Handler,
|
||||||
@ -3705,30 +3834,6 @@ var Bundle_ServiceDesc = grpc_go.ServiceDesc{
|
|||||||
MethodName: "GetArtistUploadStatsList",
|
MethodName: "GetArtistUploadStatsList",
|
||||||
Handler: _Bundle_GetArtistUploadStatsList_Handler,
|
Handler: _Bundle_GetArtistUploadStatsList_Handler,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
MethodName: "MetricsBusiness",
|
|
||||||
Handler: _Bundle_MetricsBusiness_Handler,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
MethodName: "MetricsOperatingCreate",
|
|
||||||
Handler: _Bundle_MetricsOperatingCreate_Handler,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
MethodName: "MetricsOperatingStatus",
|
|
||||||
Handler: _Bundle_MetricsOperatingStatus_Handler,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
MethodName: "MetricsBundlePurchaseExport",
|
|
||||||
Handler: _Bundle_MetricsBundlePurchaseExport_Handler,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
MethodName: "MetricsArtistAccountExport",
|
|
||||||
Handler: _Bundle_MetricsArtistAccountExport_Handler,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
MethodName: "MetricsVideoSubmitExport",
|
|
||||||
Handler: _Bundle_MetricsVideoSubmitExport_Handler,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
MethodName: "GetPendingTaskLayout",
|
MethodName: "GetPendingTaskLayout",
|
||||||
Handler: _Bundle_GetPendingTaskLayout_Handler,
|
Handler: _Bundle_GetPendingTaskLayout_Handler,
|
||||||
@ -3753,10 +3858,42 @@ var Bundle_ServiceDesc = grpc_go.ServiceDesc{
|
|||||||
MethodName: "AddHiddenTaskAssignee",
|
MethodName: "AddHiddenTaskAssignee",
|
||||||
Handler: _Bundle_AddHiddenTaskAssignee_Handler,
|
Handler: _Bundle_AddHiddenTaskAssignee_Handler,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
MethodName: "CreateTaskWorkLog",
|
||||||
|
Handler: _Bundle_CreateTaskWorkLog_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "MetricsBusiness",
|
||||||
|
Handler: _Bundle_MetricsBusiness_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "MetricsOperatingCreate",
|
||||||
|
Handler: _Bundle_MetricsOperatingCreate_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "MetricsOperatingStatus",
|
||||||
|
Handler: _Bundle_MetricsOperatingStatus_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "MetricsBundlePurchaseExport",
|
||||||
|
Handler: _Bundle_MetricsBundlePurchaseExport_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "MetricsArtistAccountExport",
|
||||||
|
Handler: _Bundle_MetricsArtistAccountExport_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "MetricsVideoSubmitExport",
|
||||||
|
Handler: _Bundle_MetricsVideoSubmitExport_Handler,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
MethodName: "QueryTheOrderSnapshotInformation",
|
MethodName: "QueryTheOrderSnapshotInformation",
|
||||||
Handler: _Bundle_QueryTheOrderSnapshotInformation_Handler,
|
Handler: _Bundle_QueryTheOrderSnapshotInformation_Handler,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
MethodName: "ExportWorkCastInfo",
|
||||||
|
Handler: _Bundle_ExportWorkCastInfo_Handler,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
Streams: []grpc_go.StreamDesc{},
|
Streams: []grpc_go.StreamDesc{},
|
||||||
Metadata: "pb/bundle.proto",
|
Metadata: "pb/bundle.proto",
|
||||||
|
|||||||
15744
api/cast/cast.pb.go
15744
api/cast/cast.pb.go
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -9,7 +9,6 @@ package cron
|
|||||||
import (
|
import (
|
||||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||||
_ "google.golang.org/protobuf/types/known/emptypb"
|
|
||||||
reflect "reflect"
|
reflect "reflect"
|
||||||
sync "sync"
|
sync "sync"
|
||||||
unsafe "unsafe"
|
unsafe "unsafe"
|
||||||
@ -641,6 +640,16 @@ type ExecutionResult struct {
|
|||||||
StatusDescription string `protobuf:"bytes,110,opt,name=status_description,json=statusDescription,proto3" json:"status_description"` // 执行状态描述
|
StatusDescription string `protobuf:"bytes,110,opt,name=status_description,json=statusDescription,proto3" json:"status_description"` // 执行状态描述
|
||||||
ResultDescription string `protobuf:"bytes,111,opt,name=result_description,json=resultDescription,proto3" json:"result_description"` // 执行结果描述
|
ResultDescription string `protobuf:"bytes,111,opt,name=result_description,json=resultDescription,proto3" json:"result_description"` // 执行结果描述
|
||||||
ContentTypeDescription string `protobuf:"bytes,115,opt,name=content_type_description,json=contentTypeDescription,proto3" json:"content_type_description"` // 内容类型描述
|
ContentTypeDescription string `protobuf:"bytes,115,opt,name=content_type_description,json=contentTypeDescription,proto3" json:"content_type_description"` // 内容类型描述
|
||||||
|
TIKTOKStatusDesc string `protobuf:"bytes,121,opt,name=TIKTOKStatusDesc,proto3" json:"TIKTOKStatusDesc"`
|
||||||
|
YOUTUBEStatusDesc string `protobuf:"bytes,122,opt,name=YOUTUBEStatusDesc,proto3" json:"YOUTUBEStatusDesc"`
|
||||||
|
INSStatusDesc string `protobuf:"bytes,123,opt,name=INSStatusDesc,proto3" json:"INSStatusDesc"`
|
||||||
|
DMStatusDesc string `protobuf:"bytes,124,opt,name=DMStatusDesc,proto3" json:"DMStatusDesc"`
|
||||||
|
BULESKYStatusDesc string `protobuf:"bytes,125,opt,name=BULESKYStatusDesc,proto3" json:"BULESKYStatusDesc"`
|
||||||
|
TIKTOKResult string `protobuf:"bytes,131,opt,name=TIKTOKResult,proto3" json:"TIKTOKResult"`
|
||||||
|
YOUTUBEResult string `protobuf:"bytes,132,opt,name=YOUTUBEResult,proto3" json:"YOUTUBEResult"`
|
||||||
|
INSResult string `protobuf:"bytes,133,opt,name=INSResult,proto3" json:"INSResult"`
|
||||||
|
DMResult string `protobuf:"bytes,134,opt,name=DMResult,proto3" json:"DMResult"`
|
||||||
|
BULESKYResult string `protobuf:"bytes,135,opt,name=BULESKYResult,proto3" json:"BULESKYResult"`
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
}
|
}
|
||||||
@ -794,6 +803,76 @@ func (x *ExecutionResult) GetContentTypeDescription() string {
|
|||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (x *ExecutionResult) GetTIKTOKStatusDesc() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.TIKTOKStatusDesc
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ExecutionResult) GetYOUTUBEStatusDesc() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.YOUTUBEStatusDesc
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ExecutionResult) GetINSStatusDesc() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.INSStatusDesc
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ExecutionResult) GetDMStatusDesc() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.DMStatusDesc
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ExecutionResult) GetBULESKYStatusDesc() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.BULESKYStatusDesc
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ExecutionResult) GetTIKTOKResult() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.TIKTOKResult
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ExecutionResult) GetYOUTUBEResult() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.YOUTUBEResult
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ExecutionResult) GetINSResult() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.INSResult
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ExecutionResult) GetDMResult() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.DMResult
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ExecutionResult) GetBULESKYResult() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.BULESKYResult
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
type CreateScheduleTaskRequest struct {
|
type CreateScheduleTaskRequest struct {
|
||||||
state protoimpl.MessageState `protogen:"open.v1"`
|
state protoimpl.MessageState `protogen:"open.v1"`
|
||||||
TaskTitle string `protobuf:"bytes,1,opt,name=task_title,json=taskTitle,proto3" json:"task_title"` // 任务标题
|
TaskTitle string `protobuf:"bytes,1,opt,name=task_title,json=taskTitle,proto3" json:"task_title"` // 任务标题
|
||||||
@ -1039,18 +1118,18 @@ func (x *CreateScheduleTaskResponse) GetData() *ScheduleTask {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type UpdateScheduleTaskRequest struct {
|
type UpdateScheduleTaskRequest struct {
|
||||||
state protoimpl.MessageState `protogen:"open.v1"`
|
state protoimpl.MessageState `protogen:"open.v1"`
|
||||||
TaskId uint64 `protobuf:"varint,1,opt,name=task_id,json=taskId,proto3" json:"task_id"` // 任务ID,用于标识需要更新的任务
|
TaskId uint64 `protobuf:"varint,1,opt,name=task_id,json=taskId,proto3" json:"task_id"` // 任务ID,用于标识需要更新的任务
|
||||||
TaskTitle string `protobuf:"bytes,2,opt,name=task_title,json=taskTitle,proto3" json:"task_title"` // 任务标题
|
TaskTitle string `protobuf:"bytes,2,opt,name=task_title,json=taskTitle,proto3" json:"task_title"` // 任务标题
|
||||||
Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description"` // 描述
|
Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description"` // 描述
|
||||||
PeriodType int32 `protobuf:"varint,4,opt,name=period_type,json=periodType,proto3" json:"period_type"` // 周期类型
|
PeriodType int32 `protobuf:"varint,4,opt,name=period_type,json=periodType,proto3" json:"period_type"` // 周期类型
|
||||||
Weekdays []int32 `protobuf:"varint,5,rep,packed,name=weekdays,proto3" json:"weekdays"` // 每周任务的星期几
|
Weekdays []int32 `protobuf:"varint,5,rep,packed,name=weekdays,proto3" json:"weekdays"` // 每周任务的星期几
|
||||||
CustomDays []string `protobuf:"bytes,6,rep,name=custom_days,json=customDays,proto3" json:"custom_days"` // 自定义日期
|
CustomDays []string `protobuf:"bytes,6,rep,name=custom_days,json=customDays,proto3" json:"custom_days"` // 自定义日期
|
||||||
StartDate string `protobuf:"bytes,7,opt,name=start_date,json=startDate,proto3" json:"start_date"` // 开始日期
|
StartDate string `protobuf:"bytes,7,opt,name=start_date,json=startDate,proto3" json:"start_date"` // 开始日期
|
||||||
ExecuteStartTime string `protobuf:"bytes,8,opt,name=execute_start_time,json=executeStartTime,proto3" json:"execute_start_time"` // 执行开始时间
|
ExecuteStartTime string `protobuf:"bytes,8,opt,name=execute_start_time,json=executeStartTime,proto3" json:"execute_start_time"` // 执行开始时间
|
||||||
ExecuteEndTime string `protobuf:"bytes,9,opt,name=execute_end_time,json=executeEndTime,proto3" json:"execute_end_time"` // 执行结束时间
|
ExecuteEndTime string `protobuf:"bytes,9,opt,name=execute_end_time,json=executeEndTime,proto3" json:"execute_end_time"` // 执行结束时间
|
||||||
Remark string `protobuf:"bytes,10,opt,name=remark,proto3" json:"remark"` // 备注
|
Remark string `protobuf:"bytes,10,opt,name=remark,proto3" json:"remark"` // 备注
|
||||||
TaskDetail *TaskDetailRequest `protobuf:"bytes,11,opt,name=task_detail,json=taskDetail,proto3" json:"task_detail"` // 任务详情
|
TaskDetail *UpdateScheduleTaskRequestTaskDetail `protobuf:"bytes,11,opt,name=task_detail,json=taskDetail,proto3" json:"task_detail"` // 任务详情
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
}
|
}
|
||||||
@ -1155,13 +1234,97 @@ func (x *UpdateScheduleTaskRequest) GetRemark() string {
|
|||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *UpdateScheduleTaskRequest) GetTaskDetail() *TaskDetailRequest {
|
func (x *UpdateScheduleTaskRequest) GetTaskDetail() *UpdateScheduleTaskRequestTaskDetail {
|
||||||
if x != nil {
|
if x != nil {
|
||||||
return x.TaskDetail
|
return x.TaskDetail
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type UpdateScheduleTaskRequestTaskDetail struct {
|
||||||
|
state protoimpl.MessageState `protogen:"open.v1"`
|
||||||
|
Id int32 `protobuf:"varint,5,opt,name=id,proto3" json:"id"`
|
||||||
|
TaskId int32 `protobuf:"varint,6,opt,name=task_id,json=taskId,proto3" json:"task_id"`
|
||||||
|
ArtistCount int32 `protobuf:"varint,1,opt,name=artist_count,json=artistCount,proto3" json:"artist_count"` // 艺人数量
|
||||||
|
Artists []*ArtistInfo `protobuf:"bytes,2,rep,name=artists,proto3" json:"artists"` // 艺人信息列表
|
||||||
|
Num int32 `protobuf:"varint,3,opt,name=num,proto3" json:"num"` // 任务数量
|
||||||
|
ContentType int32 `protobuf:"varint,4,opt,name=content_type,json=contentType,proto3" json:"content_type"` // 内容类型
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *UpdateScheduleTaskRequestTaskDetail) Reset() {
|
||||||
|
*x = UpdateScheduleTaskRequestTaskDetail{}
|
||||||
|
mi := &file_pb_cron_proto_msgTypes[11]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *UpdateScheduleTaskRequestTaskDetail) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*UpdateScheduleTaskRequestTaskDetail) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *UpdateScheduleTaskRequestTaskDetail) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_pb_cron_proto_msgTypes[11]
|
||||||
|
if x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use UpdateScheduleTaskRequestTaskDetail.ProtoReflect.Descriptor instead.
|
||||||
|
func (*UpdateScheduleTaskRequestTaskDetail) Descriptor() ([]byte, []int) {
|
||||||
|
return file_pb_cron_proto_rawDescGZIP(), []int{11}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *UpdateScheduleTaskRequestTaskDetail) GetId() int32 {
|
||||||
|
if x != nil {
|
||||||
|
return x.Id
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *UpdateScheduleTaskRequestTaskDetail) GetTaskId() int32 {
|
||||||
|
if x != nil {
|
||||||
|
return x.TaskId
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *UpdateScheduleTaskRequestTaskDetail) GetArtistCount() int32 {
|
||||||
|
if x != nil {
|
||||||
|
return x.ArtistCount
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *UpdateScheduleTaskRequestTaskDetail) GetArtists() []*ArtistInfo {
|
||||||
|
if x != nil {
|
||||||
|
return x.Artists
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *UpdateScheduleTaskRequestTaskDetail) GetNum() int32 {
|
||||||
|
if x != nil {
|
||||||
|
return x.Num
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *UpdateScheduleTaskRequestTaskDetail) GetContentType() int32 {
|
||||||
|
if x != nil {
|
||||||
|
return x.ContentType
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
type UpdateScheduleTaskResponse struct {
|
type UpdateScheduleTaskResponse struct {
|
||||||
state protoimpl.MessageState `protogen:"open.v1"`
|
state protoimpl.MessageState `protogen:"open.v1"`
|
||||||
Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code"` // 响应码
|
Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code"` // 响应码
|
||||||
@ -1173,7 +1336,7 @@ type UpdateScheduleTaskResponse struct {
|
|||||||
|
|
||||||
func (x *UpdateScheduleTaskResponse) Reset() {
|
func (x *UpdateScheduleTaskResponse) Reset() {
|
||||||
*x = UpdateScheduleTaskResponse{}
|
*x = UpdateScheduleTaskResponse{}
|
||||||
mi := &file_pb_cron_proto_msgTypes[11]
|
mi := &file_pb_cron_proto_msgTypes[12]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@ -1185,7 +1348,7 @@ func (x *UpdateScheduleTaskResponse) String() string {
|
|||||||
func (*UpdateScheduleTaskResponse) ProtoMessage() {}
|
func (*UpdateScheduleTaskResponse) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *UpdateScheduleTaskResponse) ProtoReflect() protoreflect.Message {
|
func (x *UpdateScheduleTaskResponse) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_pb_cron_proto_msgTypes[11]
|
mi := &file_pb_cron_proto_msgTypes[12]
|
||||||
if x != nil {
|
if x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@ -1198,7 +1361,7 @@ func (x *UpdateScheduleTaskResponse) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use UpdateScheduleTaskResponse.ProtoReflect.Descriptor instead.
|
// Deprecated: Use UpdateScheduleTaskResponse.ProtoReflect.Descriptor instead.
|
||||||
func (*UpdateScheduleTaskResponse) Descriptor() ([]byte, []int) {
|
func (*UpdateScheduleTaskResponse) Descriptor() ([]byte, []int) {
|
||||||
return file_pb_cron_proto_rawDescGZIP(), []int{11}
|
return file_pb_cron_proto_rawDescGZIP(), []int{12}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *UpdateScheduleTaskResponse) GetCode() int32 {
|
func (x *UpdateScheduleTaskResponse) GetCode() int32 {
|
||||||
@ -1232,13 +1395,14 @@ type GetListScheduleTaskRequest struct {
|
|||||||
EndTime string `protobuf:"bytes,6,opt,name=end_time,json=endTime,proto3" json:"end_time"` // 结束日期
|
EndTime string `protobuf:"bytes,6,opt,name=end_time,json=endTime,proto3" json:"end_time"` // 结束日期
|
||||||
Status int32 `protobuf:"varint,7,opt,name=Status,proto3" json:"Status"` // 任务状态
|
Status int32 `protobuf:"varint,7,opt,name=Status,proto3" json:"Status"` // 任务状态
|
||||||
ContentType int32 `protobuf:"varint,8,opt,name=content_type,json=contentType,proto3" json:"content_type"` // 内容类型
|
ContentType int32 `protobuf:"varint,8,opt,name=content_type,json=contentType,proto3" json:"content_type"` // 内容类型
|
||||||
|
Sorts map[string]string `protobuf:"bytes,9,rep,name=sorts,proto3" json:"sorts" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *GetListScheduleTaskRequest) Reset() {
|
func (x *GetListScheduleTaskRequest) Reset() {
|
||||||
*x = GetListScheduleTaskRequest{}
|
*x = GetListScheduleTaskRequest{}
|
||||||
mi := &file_pb_cron_proto_msgTypes[12]
|
mi := &file_pb_cron_proto_msgTypes[13]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@ -1250,7 +1414,7 @@ func (x *GetListScheduleTaskRequest) String() string {
|
|||||||
func (*GetListScheduleTaskRequest) ProtoMessage() {}
|
func (*GetListScheduleTaskRequest) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *GetListScheduleTaskRequest) ProtoReflect() protoreflect.Message {
|
func (x *GetListScheduleTaskRequest) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_pb_cron_proto_msgTypes[12]
|
mi := &file_pb_cron_proto_msgTypes[13]
|
||||||
if x != nil {
|
if x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@ -1263,7 +1427,7 @@ func (x *GetListScheduleTaskRequest) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use GetListScheduleTaskRequest.ProtoReflect.Descriptor instead.
|
// Deprecated: Use GetListScheduleTaskRequest.ProtoReflect.Descriptor instead.
|
||||||
func (*GetListScheduleTaskRequest) Descriptor() ([]byte, []int) {
|
func (*GetListScheduleTaskRequest) Descriptor() ([]byte, []int) {
|
||||||
return file_pb_cron_proto_rawDescGZIP(), []int{12}
|
return file_pb_cron_proto_rawDescGZIP(), []int{13}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *GetListScheduleTaskRequest) GetPage() int32 {
|
func (x *GetListScheduleTaskRequest) GetPage() int32 {
|
||||||
@ -1322,6 +1486,13 @@ func (x *GetListScheduleTaskRequest) GetContentType() int32 {
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (x *GetListScheduleTaskRequest) GetSorts() map[string]string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Sorts
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
type GetListScheduleTaskResponse struct {
|
type GetListScheduleTaskResponse struct {
|
||||||
state protoimpl.MessageState `protogen:"open.v1"`
|
state protoimpl.MessageState `protogen:"open.v1"`
|
||||||
Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code"` // 响应码
|
Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code"` // 响应码
|
||||||
@ -1336,7 +1507,7 @@ type GetListScheduleTaskResponse struct {
|
|||||||
|
|
||||||
func (x *GetListScheduleTaskResponse) Reset() {
|
func (x *GetListScheduleTaskResponse) Reset() {
|
||||||
*x = GetListScheduleTaskResponse{}
|
*x = GetListScheduleTaskResponse{}
|
||||||
mi := &file_pb_cron_proto_msgTypes[13]
|
mi := &file_pb_cron_proto_msgTypes[14]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@ -1348,7 +1519,7 @@ func (x *GetListScheduleTaskResponse) String() string {
|
|||||||
func (*GetListScheduleTaskResponse) ProtoMessage() {}
|
func (*GetListScheduleTaskResponse) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *GetListScheduleTaskResponse) ProtoReflect() protoreflect.Message {
|
func (x *GetListScheduleTaskResponse) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_pb_cron_proto_msgTypes[13]
|
mi := &file_pb_cron_proto_msgTypes[14]
|
||||||
if x != nil {
|
if x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@ -1361,7 +1532,7 @@ func (x *GetListScheduleTaskResponse) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use GetListScheduleTaskResponse.ProtoReflect.Descriptor instead.
|
// Deprecated: Use GetListScheduleTaskResponse.ProtoReflect.Descriptor instead.
|
||||||
func (*GetListScheduleTaskResponse) Descriptor() ([]byte, []int) {
|
func (*GetListScheduleTaskResponse) Descriptor() ([]byte, []int) {
|
||||||
return file_pb_cron_proto_rawDescGZIP(), []int{13}
|
return file_pb_cron_proto_rawDescGZIP(), []int{14}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *GetListScheduleTaskResponse) GetCode() int32 {
|
func (x *GetListScheduleTaskResponse) GetCode() int32 {
|
||||||
@ -1422,7 +1593,7 @@ type GetListExecutionRecordRequest struct {
|
|||||||
|
|
||||||
func (x *GetListExecutionRecordRequest) Reset() {
|
func (x *GetListExecutionRecordRequest) Reset() {
|
||||||
*x = GetListExecutionRecordRequest{}
|
*x = GetListExecutionRecordRequest{}
|
||||||
mi := &file_pb_cron_proto_msgTypes[14]
|
mi := &file_pb_cron_proto_msgTypes[15]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@ -1434,7 +1605,7 @@ func (x *GetListExecutionRecordRequest) String() string {
|
|||||||
func (*GetListExecutionRecordRequest) ProtoMessage() {}
|
func (*GetListExecutionRecordRequest) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *GetListExecutionRecordRequest) ProtoReflect() protoreflect.Message {
|
func (x *GetListExecutionRecordRequest) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_pb_cron_proto_msgTypes[14]
|
mi := &file_pb_cron_proto_msgTypes[15]
|
||||||
if x != nil {
|
if x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@ -1447,7 +1618,7 @@ func (x *GetListExecutionRecordRequest) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use GetListExecutionRecordRequest.ProtoReflect.Descriptor instead.
|
// Deprecated: Use GetListExecutionRecordRequest.ProtoReflect.Descriptor instead.
|
||||||
func (*GetListExecutionRecordRequest) Descriptor() ([]byte, []int) {
|
func (*GetListExecutionRecordRequest) Descriptor() ([]byte, []int) {
|
||||||
return file_pb_cron_proto_rawDescGZIP(), []int{14}
|
return file_pb_cron_proto_rawDescGZIP(), []int{15}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *GetListExecutionRecordRequest) GetPage() int32 {
|
func (x *GetListExecutionRecordRequest) GetPage() int32 {
|
||||||
@ -1520,7 +1691,7 @@ type GetListExecutionRecordResponse struct {
|
|||||||
|
|
||||||
func (x *GetListExecutionRecordResponse) Reset() {
|
func (x *GetListExecutionRecordResponse) Reset() {
|
||||||
*x = GetListExecutionRecordResponse{}
|
*x = GetListExecutionRecordResponse{}
|
||||||
mi := &file_pb_cron_proto_msgTypes[15]
|
mi := &file_pb_cron_proto_msgTypes[16]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@ -1532,7 +1703,7 @@ func (x *GetListExecutionRecordResponse) String() string {
|
|||||||
func (*GetListExecutionRecordResponse) ProtoMessage() {}
|
func (*GetListExecutionRecordResponse) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *GetListExecutionRecordResponse) ProtoReflect() protoreflect.Message {
|
func (x *GetListExecutionRecordResponse) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_pb_cron_proto_msgTypes[15]
|
mi := &file_pb_cron_proto_msgTypes[16]
|
||||||
if x != nil {
|
if x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@ -1545,7 +1716,7 @@ func (x *GetListExecutionRecordResponse) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use GetListExecutionRecordResponse.ProtoReflect.Descriptor instead.
|
// Deprecated: Use GetListExecutionRecordResponse.ProtoReflect.Descriptor instead.
|
||||||
func (*GetListExecutionRecordResponse) Descriptor() ([]byte, []int) {
|
func (*GetListExecutionRecordResponse) Descriptor() ([]byte, []int) {
|
||||||
return file_pb_cron_proto_rawDescGZIP(), []int{15}
|
return file_pb_cron_proto_rawDescGZIP(), []int{16}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *GetListExecutionRecordResponse) GetCode() int32 {
|
func (x *GetListExecutionRecordResponse) GetCode() int32 {
|
||||||
@ -1607,7 +1778,7 @@ type GetListExecutionResultRequest struct {
|
|||||||
|
|
||||||
func (x *GetListExecutionResultRequest) Reset() {
|
func (x *GetListExecutionResultRequest) Reset() {
|
||||||
*x = GetListExecutionResultRequest{}
|
*x = GetListExecutionResultRequest{}
|
||||||
mi := &file_pb_cron_proto_msgTypes[16]
|
mi := &file_pb_cron_proto_msgTypes[17]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@ -1619,7 +1790,7 @@ func (x *GetListExecutionResultRequest) String() string {
|
|||||||
func (*GetListExecutionResultRequest) ProtoMessage() {}
|
func (*GetListExecutionResultRequest) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *GetListExecutionResultRequest) ProtoReflect() protoreflect.Message {
|
func (x *GetListExecutionResultRequest) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_pb_cron_proto_msgTypes[16]
|
mi := &file_pb_cron_proto_msgTypes[17]
|
||||||
if x != nil {
|
if x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@ -1632,7 +1803,7 @@ func (x *GetListExecutionResultRequest) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use GetListExecutionResultRequest.ProtoReflect.Descriptor instead.
|
// Deprecated: Use GetListExecutionResultRequest.ProtoReflect.Descriptor instead.
|
||||||
func (*GetListExecutionResultRequest) Descriptor() ([]byte, []int) {
|
func (*GetListExecutionResultRequest) Descriptor() ([]byte, []int) {
|
||||||
return file_pb_cron_proto_rawDescGZIP(), []int{16}
|
return file_pb_cron_proto_rawDescGZIP(), []int{17}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *GetListExecutionResultRequest) GetPage() int32 {
|
func (x *GetListExecutionResultRequest) GetPage() int32 {
|
||||||
@ -1712,7 +1883,7 @@ type GetListExecutionResultResponse struct {
|
|||||||
|
|
||||||
func (x *GetListExecutionResultResponse) Reset() {
|
func (x *GetListExecutionResultResponse) Reset() {
|
||||||
*x = GetListExecutionResultResponse{}
|
*x = GetListExecutionResultResponse{}
|
||||||
mi := &file_pb_cron_proto_msgTypes[17]
|
mi := &file_pb_cron_proto_msgTypes[18]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@ -1724,7 +1895,7 @@ func (x *GetListExecutionResultResponse) String() string {
|
|||||||
func (*GetListExecutionResultResponse) ProtoMessage() {}
|
func (*GetListExecutionResultResponse) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *GetListExecutionResultResponse) ProtoReflect() protoreflect.Message {
|
func (x *GetListExecutionResultResponse) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_pb_cron_proto_msgTypes[17]
|
mi := &file_pb_cron_proto_msgTypes[18]
|
||||||
if x != nil {
|
if x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@ -1737,7 +1908,7 @@ func (x *GetListExecutionResultResponse) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use GetListExecutionResultResponse.ProtoReflect.Descriptor instead.
|
// Deprecated: Use GetListExecutionResultResponse.ProtoReflect.Descriptor instead.
|
||||||
func (*GetListExecutionResultResponse) Descriptor() ([]byte, []int) {
|
func (*GetListExecutionResultResponse) Descriptor() ([]byte, []int) {
|
||||||
return file_pb_cron_proto_rawDescGZIP(), []int{17}
|
return file_pb_cron_proto_rawDescGZIP(), []int{18}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *GetListExecutionResultResponse) GetCode() int32 {
|
func (x *GetListExecutionResultResponse) GetCode() int32 {
|
||||||
@ -1792,7 +1963,7 @@ type TaskStatus struct {
|
|||||||
|
|
||||||
func (x *TaskStatus) Reset() {
|
func (x *TaskStatus) Reset() {
|
||||||
*x = TaskStatus{}
|
*x = TaskStatus{}
|
||||||
mi := &file_pb_cron_proto_msgTypes[18]
|
mi := &file_pb_cron_proto_msgTypes[19]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@ -1804,7 +1975,7 @@ func (x *TaskStatus) String() string {
|
|||||||
func (*TaskStatus) ProtoMessage() {}
|
func (*TaskStatus) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *TaskStatus) ProtoReflect() protoreflect.Message {
|
func (x *TaskStatus) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_pb_cron_proto_msgTypes[18]
|
mi := &file_pb_cron_proto_msgTypes[19]
|
||||||
if x != nil {
|
if x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@ -1817,7 +1988,7 @@ func (x *TaskStatus) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use TaskStatus.ProtoReflect.Descriptor instead.
|
// Deprecated: Use TaskStatus.ProtoReflect.Descriptor instead.
|
||||||
func (*TaskStatus) Descriptor() ([]byte, []int) {
|
func (*TaskStatus) Descriptor() ([]byte, []int) {
|
||||||
return file_pb_cron_proto_rawDescGZIP(), []int{18}
|
return file_pb_cron_proto_rawDescGZIP(), []int{19}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *TaskStatus) GetKey() int32 {
|
func (x *TaskStatus) GetKey() int32 {
|
||||||
@ -1845,7 +2016,7 @@ type GetScheduleTaskStatusResponse struct {
|
|||||||
|
|
||||||
func (x *GetScheduleTaskStatusResponse) Reset() {
|
func (x *GetScheduleTaskStatusResponse) Reset() {
|
||||||
*x = GetScheduleTaskStatusResponse{}
|
*x = GetScheduleTaskStatusResponse{}
|
||||||
mi := &file_pb_cron_proto_msgTypes[19]
|
mi := &file_pb_cron_proto_msgTypes[20]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@ -1857,7 +2028,7 @@ func (x *GetScheduleTaskStatusResponse) String() string {
|
|||||||
func (*GetScheduleTaskStatusResponse) ProtoMessage() {}
|
func (*GetScheduleTaskStatusResponse) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *GetScheduleTaskStatusResponse) ProtoReflect() protoreflect.Message {
|
func (x *GetScheduleTaskStatusResponse) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_pb_cron_proto_msgTypes[19]
|
mi := &file_pb_cron_proto_msgTypes[20]
|
||||||
if x != nil {
|
if x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@ -1870,7 +2041,7 @@ func (x *GetScheduleTaskStatusResponse) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use GetScheduleTaskStatusResponse.ProtoReflect.Descriptor instead.
|
// Deprecated: Use GetScheduleTaskStatusResponse.ProtoReflect.Descriptor instead.
|
||||||
func (*GetScheduleTaskStatusResponse) Descriptor() ([]byte, []int) {
|
func (*GetScheduleTaskStatusResponse) Descriptor() ([]byte, []int) {
|
||||||
return file_pb_cron_proto_rawDescGZIP(), []int{19}
|
return file_pb_cron_proto_rawDescGZIP(), []int{20}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *GetScheduleTaskStatusResponse) GetCode() int32 {
|
func (x *GetScheduleTaskStatusResponse) GetCode() int32 {
|
||||||
@ -1898,7 +2069,7 @@ var File_pb_cron_proto protoreflect.FileDescriptor
|
|||||||
|
|
||||||
const file_pb_cron_proto_rawDesc = "" +
|
const file_pb_cron_proto_rawDesc = "" +
|
||||||
"\n" +
|
"\n" +
|
||||||
"\rpb/cron.proto\x12\x04cron\x1a\x1bgoogle/protobuf/empty.proto\"!\n" +
|
"\rpb/cron.proto\x12\x04cron\"!\n" +
|
||||||
"\x0fCommonIDRequest\x12\x0e\n" +
|
"\x0fCommonIDRequest\x12\x0e\n" +
|
||||||
"\x02id\x18\x01 \x01(\rR\x02id\">\n" +
|
"\x02id\x18\x01 \x01(\rR\x02id\">\n" +
|
||||||
"\x0eCommonResponse\x12\x12\n" +
|
"\x0eCommonResponse\x12\x12\n" +
|
||||||
@ -1968,7 +2139,7 @@ const file_pb_cron_proto_rawDesc = "" +
|
|||||||
"\n" +
|
"\n" +
|
||||||
"task_title\x18\x0e \x01(\tR\ttaskTitle\x12!\n" +
|
"task_title\x18\x0e \x01(\tR\ttaskTitle\x12!\n" +
|
||||||
"\fcontent_type\x18\x0f \x01(\x05R\vcontentType\x12\x0e\n" +
|
"\fcontent_type\x18\x0f \x01(\x05R\vcontentType\x12\x0e\n" +
|
||||||
"\x02id\x18\x10 \x01(\x04R\x02id\"\xc8\x04\n" +
|
"\x02id\x18\x10 \x01(\x04R\x02id\"\xc9\a\n" +
|
||||||
"\x0fExecutionResult\x12!\n" +
|
"\x0fExecutionResult\x12!\n" +
|
||||||
"\fexecution_id\x18\x01 \x01(\x05R\vexecutionId\x12\x17\n" +
|
"\fexecution_id\x18\x01 \x01(\x05R\vexecutionId\x12\x17\n" +
|
||||||
"\atask_id\x18\x02 \x01(\x05R\x06taskId\x12\x1b\n" +
|
"\atask_id\x18\x02 \x01(\x05R\x06taskId\x12\x1b\n" +
|
||||||
@ -1992,7 +2163,17 @@ const file_pb_cron_proto_rawDesc = "" +
|
|||||||
"work_title\x18\x10 \x01(\tR\tworkTitle\x12-\n" +
|
"work_title\x18\x10 \x01(\tR\tworkTitle\x12-\n" +
|
||||||
"\x12status_description\x18n \x01(\tR\x11statusDescription\x12-\n" +
|
"\x12status_description\x18n \x01(\tR\x11statusDescription\x12-\n" +
|
||||||
"\x12result_description\x18o \x01(\tR\x11resultDescription\x128\n" +
|
"\x12result_description\x18o \x01(\tR\x11resultDescription\x128\n" +
|
||||||
"\x18content_type_description\x18s \x01(\tR\x16contentTypeDescription\"\x83\x03\n" +
|
"\x18content_type_description\x18s \x01(\tR\x16contentTypeDescription\x12*\n" +
|
||||||
|
"\x10TIKTOKStatusDesc\x18y \x01(\tR\x10TIKTOKStatusDesc\x12,\n" +
|
||||||
|
"\x11YOUTUBEStatusDesc\x18z \x01(\tR\x11YOUTUBEStatusDesc\x12$\n" +
|
||||||
|
"\rINSStatusDesc\x18{ \x01(\tR\rINSStatusDesc\x12\"\n" +
|
||||||
|
"\fDMStatusDesc\x18| \x01(\tR\fDMStatusDesc\x12,\n" +
|
||||||
|
"\x11BULESKYStatusDesc\x18} \x01(\tR\x11BULESKYStatusDesc\x12#\n" +
|
||||||
|
"\fTIKTOKResult\x18\x83\x01 \x01(\tR\fTIKTOKResult\x12%\n" +
|
||||||
|
"\rYOUTUBEResult\x18\x84\x01 \x01(\tR\rYOUTUBEResult\x12\x1d\n" +
|
||||||
|
"\tINSResult\x18\x85\x01 \x01(\tR\tINSResult\x12\x1b\n" +
|
||||||
|
"\bDMResult\x18\x86\x01 \x01(\tR\bDMResult\x12%\n" +
|
||||||
|
"\rBULESKYResult\x18\x87\x01 \x01(\tR\rBULESKYResult\"\x83\x03\n" +
|
||||||
"\x19CreateScheduleTaskRequest\x12\x1d\n" +
|
"\x19CreateScheduleTaskRequest\x12\x1d\n" +
|
||||||
"\n" +
|
"\n" +
|
||||||
"task_title\x18\x01 \x01(\tR\ttaskTitle\x12 \n" +
|
"task_title\x18\x01 \x01(\tR\ttaskTitle\x12 \n" +
|
||||||
@ -2018,7 +2199,7 @@ const file_pb_cron_proto_rawDesc = "" +
|
|||||||
"\x1aCreateScheduleTaskResponse\x12\x12\n" +
|
"\x1aCreateScheduleTaskResponse\x12\x12\n" +
|
||||||
"\x04code\x18\x01 \x01(\x05R\x04code\x12\x18\n" +
|
"\x04code\x18\x01 \x01(\x05R\x04code\x12\x18\n" +
|
||||||
"\amessage\x18\x02 \x01(\tR\amessage\x12&\n" +
|
"\amessage\x18\x02 \x01(\tR\amessage\x12&\n" +
|
||||||
"\x04data\x18\x03 \x01(\v2\x12.cron.ScheduleTaskR\x04data\"\x9c\x03\n" +
|
"\x04data\x18\x03 \x01(\v2\x12.cron.ScheduleTaskR\x04data\"\xae\x03\n" +
|
||||||
"\x19UpdateScheduleTaskRequest\x12\x17\n" +
|
"\x19UpdateScheduleTaskRequest\x12\x17\n" +
|
||||||
"\atask_id\x18\x01 \x01(\x04R\x06taskId\x12\x1d\n" +
|
"\atask_id\x18\x01 \x01(\x04R\x06taskId\x12\x1d\n" +
|
||||||
"\n" +
|
"\n" +
|
||||||
@ -2034,13 +2215,20 @@ const file_pb_cron_proto_rawDesc = "" +
|
|||||||
"\x12execute_start_time\x18\b \x01(\tR\x10executeStartTime\x12(\n" +
|
"\x12execute_start_time\x18\b \x01(\tR\x10executeStartTime\x12(\n" +
|
||||||
"\x10execute_end_time\x18\t \x01(\tR\x0eexecuteEndTime\x12\x16\n" +
|
"\x10execute_end_time\x18\t \x01(\tR\x0eexecuteEndTime\x12\x16\n" +
|
||||||
"\x06remark\x18\n" +
|
"\x06remark\x18\n" +
|
||||||
" \x01(\tR\x06remark\x128\n" +
|
" \x01(\tR\x06remark\x12J\n" +
|
||||||
"\vtask_detail\x18\v \x01(\v2\x17.cron.TaskDetailRequestR\n" +
|
"\vtask_detail\x18\v \x01(\v2).cron.UpdateScheduleTaskRequestTaskDetailR\n" +
|
||||||
"taskDetail\"r\n" +
|
"taskDetail\"\xd2\x01\n" +
|
||||||
|
"#UpdateScheduleTaskRequestTaskDetail\x12\x0e\n" +
|
||||||
|
"\x02id\x18\x05 \x01(\x05R\x02id\x12\x17\n" +
|
||||||
|
"\atask_id\x18\x06 \x01(\x05R\x06taskId\x12!\n" +
|
||||||
|
"\fartist_count\x18\x01 \x01(\x05R\vartistCount\x12*\n" +
|
||||||
|
"\aartists\x18\x02 \x03(\v2\x10.cron.ArtistInfoR\aartists\x12\x10\n" +
|
||||||
|
"\x03num\x18\x03 \x01(\x05R\x03num\x12!\n" +
|
||||||
|
"\fcontent_type\x18\x04 \x01(\x05R\vcontentType\"r\n" +
|
||||||
"\x1aUpdateScheduleTaskResponse\x12\x12\n" +
|
"\x1aUpdateScheduleTaskResponse\x12\x12\n" +
|
||||||
"\x04code\x18\x01 \x01(\x05R\x04code\x12\x18\n" +
|
"\x04code\x18\x01 \x01(\x05R\x04code\x12\x18\n" +
|
||||||
"\amessage\x18\x02 \x01(\tR\amessage\x12&\n" +
|
"\amessage\x18\x02 \x01(\tR\amessage\x12&\n" +
|
||||||
"\x04data\x18\x03 \x01(\v2\x12.cron.ScheduleTaskR\x04data\"\x82\x02\n" +
|
"\x04data\x18\x03 \x01(\v2\x12.cron.ScheduleTaskR\x04data\"\xff\x02\n" +
|
||||||
"\x1aGetListScheduleTaskRequest\x12\x12\n" +
|
"\x1aGetListScheduleTaskRequest\x12\x12\n" +
|
||||||
"\x04page\x18\x01 \x01(\x05R\x04page\x12\x1b\n" +
|
"\x04page\x18\x01 \x01(\x05R\x04page\x12\x1b\n" +
|
||||||
"\tpage_size\x18\x02 \x01(\x05R\bpageSize\x12\x1d\n" +
|
"\tpage_size\x18\x02 \x01(\x05R\bpageSize\x12\x1d\n" +
|
||||||
@ -2052,7 +2240,12 @@ const file_pb_cron_proto_rawDesc = "" +
|
|||||||
"start_time\x18\x05 \x01(\tR\tstartTime\x12\x19\n" +
|
"start_time\x18\x05 \x01(\tR\tstartTime\x12\x19\n" +
|
||||||
"\bend_time\x18\x06 \x01(\tR\aendTime\x12\x16\n" +
|
"\bend_time\x18\x06 \x01(\tR\aendTime\x12\x16\n" +
|
||||||
"\x06Status\x18\a \x01(\x05R\x06Status\x12!\n" +
|
"\x06Status\x18\a \x01(\x05R\x06Status\x12!\n" +
|
||||||
"\fcontent_type\x18\b \x01(\x05R\vcontentType\"\xb1\x01\n" +
|
"\fcontent_type\x18\b \x01(\x05R\vcontentType\x12A\n" +
|
||||||
|
"\x05sorts\x18\t \x03(\v2+.cron.GetListScheduleTaskRequest.SortsEntryR\x05sorts\x1a8\n" +
|
||||||
|
"\n" +
|
||||||
|
"SortsEntry\x12\x10\n" +
|
||||||
|
"\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" +
|
||||||
|
"\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xb1\x01\n" +
|
||||||
"\x1bGetListScheduleTaskResponse\x12\x12\n" +
|
"\x1bGetListScheduleTaskResponse\x12\x12\n" +
|
||||||
"\x04code\x18\x01 \x01(\x05R\x04code\x12\x18\n" +
|
"\x04code\x18\x01 \x01(\x05R\x04code\x12\x18\n" +
|
||||||
"\amessage\x18\x02 \x01(\tR\amessage\x12\x14\n" +
|
"\amessage\x18\x02 \x01(\tR\amessage\x12\x14\n" +
|
||||||
@ -2120,28 +2313,30 @@ func file_pb_cron_proto_rawDescGZIP() []byte {
|
|||||||
return file_pb_cron_proto_rawDescData
|
return file_pb_cron_proto_rawDescData
|
||||||
}
|
}
|
||||||
|
|
||||||
var file_pb_cron_proto_msgTypes = make([]protoimpl.MessageInfo, 20)
|
var file_pb_cron_proto_msgTypes = make([]protoimpl.MessageInfo, 22)
|
||||||
var file_pb_cron_proto_goTypes = []any{
|
var file_pb_cron_proto_goTypes = []any{
|
||||||
(*CommonIDRequest)(nil), // 0: cron.CommonIDRequest
|
(*CommonIDRequest)(nil), // 0: cron.CommonIDRequest
|
||||||
(*CommonResponse)(nil), // 1: cron.CommonResponse
|
(*CommonResponse)(nil), // 1: cron.CommonResponse
|
||||||
(*ScheduleTask)(nil), // 2: cron.ScheduleTask
|
(*ScheduleTask)(nil), // 2: cron.ScheduleTask
|
||||||
(*TaskDetail)(nil), // 3: cron.TaskDetail
|
(*TaskDetail)(nil), // 3: cron.TaskDetail
|
||||||
(*ArtistInfo)(nil), // 4: cron.ArtistInfo
|
(*ArtistInfo)(nil), // 4: cron.ArtistInfo
|
||||||
(*ExecutionRecord)(nil), // 5: cron.ExecutionRecord
|
(*ExecutionRecord)(nil), // 5: cron.ExecutionRecord
|
||||||
(*ExecutionResult)(nil), // 6: cron.ExecutionResult
|
(*ExecutionResult)(nil), // 6: cron.ExecutionResult
|
||||||
(*CreateScheduleTaskRequest)(nil), // 7: cron.CreateScheduleTaskRequest
|
(*CreateScheduleTaskRequest)(nil), // 7: cron.CreateScheduleTaskRequest
|
||||||
(*TaskDetailRequest)(nil), // 8: cron.TaskDetailRequest
|
(*TaskDetailRequest)(nil), // 8: cron.TaskDetailRequest
|
||||||
(*CreateScheduleTaskResponse)(nil), // 9: cron.CreateScheduleTaskResponse
|
(*CreateScheduleTaskResponse)(nil), // 9: cron.CreateScheduleTaskResponse
|
||||||
(*UpdateScheduleTaskRequest)(nil), // 10: cron.UpdateScheduleTaskRequest
|
(*UpdateScheduleTaskRequest)(nil), // 10: cron.UpdateScheduleTaskRequest
|
||||||
(*UpdateScheduleTaskResponse)(nil), // 11: cron.UpdateScheduleTaskResponse
|
(*UpdateScheduleTaskRequestTaskDetail)(nil), // 11: cron.UpdateScheduleTaskRequestTaskDetail
|
||||||
(*GetListScheduleTaskRequest)(nil), // 12: cron.GetListScheduleTaskRequest
|
(*UpdateScheduleTaskResponse)(nil), // 12: cron.UpdateScheduleTaskResponse
|
||||||
(*GetListScheduleTaskResponse)(nil), // 13: cron.GetListScheduleTaskResponse
|
(*GetListScheduleTaskRequest)(nil), // 13: cron.GetListScheduleTaskRequest
|
||||||
(*GetListExecutionRecordRequest)(nil), // 14: cron.GetListExecutionRecordRequest
|
(*GetListScheduleTaskResponse)(nil), // 14: cron.GetListScheduleTaskResponse
|
||||||
(*GetListExecutionRecordResponse)(nil), // 15: cron.GetListExecutionRecordResponse
|
(*GetListExecutionRecordRequest)(nil), // 15: cron.GetListExecutionRecordRequest
|
||||||
(*GetListExecutionResultRequest)(nil), // 16: cron.GetListExecutionResultRequest
|
(*GetListExecutionRecordResponse)(nil), // 16: cron.GetListExecutionRecordResponse
|
||||||
(*GetListExecutionResultResponse)(nil), // 17: cron.GetListExecutionResultResponse
|
(*GetListExecutionResultRequest)(nil), // 17: cron.GetListExecutionResultRequest
|
||||||
(*TaskStatus)(nil), // 18: cron.TaskStatus
|
(*GetListExecutionResultResponse)(nil), // 18: cron.GetListExecutionResultResponse
|
||||||
(*GetScheduleTaskStatusResponse)(nil), // 19: cron.GetScheduleTaskStatusResponse
|
(*TaskStatus)(nil), // 19: cron.TaskStatus
|
||||||
|
(*GetScheduleTaskStatusResponse)(nil), // 20: cron.GetScheduleTaskStatusResponse
|
||||||
|
nil, // 21: cron.GetListScheduleTaskRequest.SortsEntry
|
||||||
}
|
}
|
||||||
var file_pb_cron_proto_depIdxs = []int32{
|
var file_pb_cron_proto_depIdxs = []int32{
|
||||||
3, // 0: cron.ScheduleTask.task_detail:type_name -> cron.TaskDetail
|
3, // 0: cron.ScheduleTask.task_detail:type_name -> cron.TaskDetail
|
||||||
@ -2151,17 +2346,19 @@ var file_pb_cron_proto_depIdxs = []int32{
|
|||||||
8, // 4: cron.CreateScheduleTaskRequest.task_detail:type_name -> cron.TaskDetailRequest
|
8, // 4: cron.CreateScheduleTaskRequest.task_detail:type_name -> cron.TaskDetailRequest
|
||||||
4, // 5: cron.TaskDetailRequest.artists:type_name -> cron.ArtistInfo
|
4, // 5: cron.TaskDetailRequest.artists:type_name -> cron.ArtistInfo
|
||||||
2, // 6: cron.CreateScheduleTaskResponse.data:type_name -> cron.ScheduleTask
|
2, // 6: cron.CreateScheduleTaskResponse.data:type_name -> cron.ScheduleTask
|
||||||
8, // 7: cron.UpdateScheduleTaskRequest.task_detail:type_name -> cron.TaskDetailRequest
|
11, // 7: cron.UpdateScheduleTaskRequest.task_detail:type_name -> cron.UpdateScheduleTaskRequestTaskDetail
|
||||||
2, // 8: cron.UpdateScheduleTaskResponse.data:type_name -> cron.ScheduleTask
|
4, // 8: cron.UpdateScheduleTaskRequestTaskDetail.artists:type_name -> cron.ArtistInfo
|
||||||
2, // 9: cron.GetListScheduleTaskResponse.data:type_name -> cron.ScheduleTask
|
2, // 9: cron.UpdateScheduleTaskResponse.data:type_name -> cron.ScheduleTask
|
||||||
5, // 10: cron.GetListExecutionRecordResponse.data:type_name -> cron.ExecutionRecord
|
21, // 10: cron.GetListScheduleTaskRequest.sorts:type_name -> cron.GetListScheduleTaskRequest.SortsEntry
|
||||||
6, // 11: cron.GetListExecutionResultResponse.data:type_name -> cron.ExecutionResult
|
2, // 11: cron.GetListScheduleTaskResponse.data:type_name -> cron.ScheduleTask
|
||||||
18, // 12: cron.GetScheduleTaskStatusResponse.data:type_name -> cron.TaskStatus
|
5, // 12: cron.GetListExecutionRecordResponse.data:type_name -> cron.ExecutionRecord
|
||||||
13, // [13:13] is the sub-list for method output_type
|
6, // 13: cron.GetListExecutionResultResponse.data:type_name -> cron.ExecutionResult
|
||||||
13, // [13:13] is the sub-list for method input_type
|
19, // 14: cron.GetScheduleTaskStatusResponse.data:type_name -> cron.TaskStatus
|
||||||
13, // [13:13] is the sub-list for extension type_name
|
15, // [15:15] is the sub-list for method output_type
|
||||||
13, // [13:13] is the sub-list for extension extendee
|
15, // [15:15] is the sub-list for method input_type
|
||||||
0, // [0:13] is the sub-list for field type_name
|
15, // [15:15] is the sub-list for extension type_name
|
||||||
|
15, // [15:15] is the sub-list for extension extendee
|
||||||
|
0, // [0:15] is the sub-list for field type_name
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() { file_pb_cron_proto_init() }
|
func init() { file_pb_cron_proto_init() }
|
||||||
@ -2175,7 +2372,7 @@ func file_pb_cron_proto_init() {
|
|||||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_pb_cron_proto_rawDesc), len(file_pb_cron_proto_rawDesc)),
|
RawDescriptor: unsafe.Slice(unsafe.StringData(file_pb_cron_proto_rawDesc), len(file_pb_cron_proto_rawDesc)),
|
||||||
NumEnums: 0,
|
NumEnums: 0,
|
||||||
NumMessages: 20,
|
NumMessages: 22,
|
||||||
NumExtensions: 0,
|
NumExtensions: 0,
|
||||||
NumServices: 0,
|
NumServices: 0,
|
||||||
},
|
},
|
||||||
|
|||||||
@ -7,7 +7,6 @@ import (
|
|||||||
fmt "fmt"
|
fmt "fmt"
|
||||||
math "math"
|
math "math"
|
||||||
proto "github.com/golang/protobuf/proto"
|
proto "github.com/golang/protobuf/proto"
|
||||||
_ "google.golang.org/protobuf/types/known/emptypb"
|
|
||||||
github_com_mwitkow_go_proto_validators "github.com/mwitkow/go-proto-validators"
|
github_com_mwitkow_go_proto_validators "github.com/mwitkow/go-proto-validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -97,6 +96,16 @@ func (this *UpdateScheduleTaskRequest) Validate() error {
|
|||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
func (this *UpdateScheduleTaskRequestTaskDetail) Validate() error {
|
||||||
|
for _, item := range this.Artists {
|
||||||
|
if item != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Artists", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
func (this *UpdateScheduleTaskResponse) Validate() error {
|
func (this *UpdateScheduleTaskResponse) Validate() error {
|
||||||
if this.Data != nil {
|
if this.Data != nil {
|
||||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Data); err != nil {
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Data); err != nil {
|
||||||
@ -106,6 +115,7 @@ func (this *UpdateScheduleTaskResponse) Validate() error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
func (this *GetListScheduleTaskRequest) Validate() error {
|
func (this *GetListScheduleTaskRequest) Validate() error {
|
||||||
|
// Validation of proto3 map<> fields is unsupported.
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
func (this *GetListScheduleTaskResponse) Validate() error {
|
func (this *GetListScheduleTaskResponse) Validate() error {
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -9,20 +9,53 @@ service Governance{
|
|||||||
rpc List(ListReq) returns (ListResp) {}
|
rpc List(ListReq) returns (ListResp) {}
|
||||||
rpc Delete(DeleteReq) returns (DeleteResp) {}
|
rpc Delete(DeleteReq) returns (DeleteResp) {}
|
||||||
rpc Edit(EditReq) returns (EditResp) {}
|
rpc Edit(EditReq) returns (EditResp) {}
|
||||||
|
rpc UpdataStatus(UpdataStatusReq) returns (UpdataStatusResp) {}
|
||||||
|
rpc GetGovernanceInfo(GetGovernanceInfoReq) returns (GetGovernanceInfoResp) {}
|
||||||
rpc Create(CreateReq) returns (CreateResp) {}
|
rpc Create(CreateReq) returns (CreateResp) {}
|
||||||
rpc Display(DisplayReq) returns (DisplayResp) {}
|
rpc Display(DisplayReq) returns (DisplayResp) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
message LangSetting {
|
||||||
|
string langType = 1;//语言类型
|
||||||
|
int32 isSetting = 2;//是否设置
|
||||||
|
}
|
||||||
|
|
||||||
|
message GovernanceLangData{
|
||||||
|
string title = 1;//标题
|
||||||
|
string attachment = 2;//附件
|
||||||
|
string attachmentName = 3;//附件名称
|
||||||
|
int32 isSetting = 4;//是否设置
|
||||||
|
}
|
||||||
|
|
||||||
|
message GovernanceLang{
|
||||||
|
string langType = 1;//语言类型
|
||||||
|
GovernanceLangData data = 2;//语言数据
|
||||||
|
}
|
||||||
|
|
||||||
|
message GovernanceInfo{
|
||||||
|
string uuid = 1;
|
||||||
|
repeated GovernanceLang dataByLang = 2;//语言数据
|
||||||
|
int32 sort = 3;//排序
|
||||||
|
int32 status = 4;//状态
|
||||||
|
}
|
||||||
|
|
||||||
message Item{
|
message Item{
|
||||||
int32 id = 1;
|
string uuid = 1;
|
||||||
string title = 2;
|
string title = 2;
|
||||||
string attachment = 3;
|
string attachment = 3;
|
||||||
string attachmentName = 4;
|
string attachmentName = 4;
|
||||||
int32 sort = 5;
|
repeated LangSetting langSetting = 5;//语言设置
|
||||||
int32 status = 6;
|
int32 sort = 6;
|
||||||
int64 updatedAt = 7;
|
int32 status = 7;
|
||||||
string operator = 8;
|
int64 updatedAt = 8;
|
||||||
int32 operatorId = 9;
|
string operator = 9;
|
||||||
|
int32 operatorId = 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
message DisplayItem{
|
||||||
|
string title = 1;
|
||||||
|
string attachment = 2;
|
||||||
|
string attachmentName = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
message ListReq{
|
message ListReq{
|
||||||
@ -38,34 +71,48 @@ message ListResp{
|
|||||||
}
|
}
|
||||||
|
|
||||||
message DeleteReq{
|
message DeleteReq{
|
||||||
int32 id = 1;
|
string uuid = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message DeleteResp{
|
message DeleteResp{
|
||||||
}
|
}
|
||||||
|
|
||||||
message EditReq{
|
message EditReq{
|
||||||
uint32 id = 1;
|
string uuid = 1;
|
||||||
string title = 2;
|
repeated GovernanceLang dataByLang = 2;
|
||||||
string attachment = 3;
|
int32 sort = 3;
|
||||||
string attachmentName = 4;
|
string operator = 4;
|
||||||
int32 sort = 5;
|
int32 operatorId = 5;
|
||||||
int32 status = 6;
|
|
||||||
string operator = 7;
|
|
||||||
int32 operatorId = 8;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
message EditResp{
|
message EditResp{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
message UpdataStatusReq{
|
||||||
|
string uuid = 1;
|
||||||
|
int32 status = 2;
|
||||||
|
string operator = 3;
|
||||||
|
int32 operatorId = 4;
|
||||||
|
}
|
||||||
|
message UpdataStatusResp{
|
||||||
|
string msg = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message GetGovernanceInfoReq{
|
||||||
|
string uuid = 1;
|
||||||
|
}
|
||||||
|
message GetGovernanceInfoResp{
|
||||||
|
string msg = 1;
|
||||||
|
GovernanceInfo data = 2;
|
||||||
|
}
|
||||||
|
|
||||||
message CreateReq{
|
message CreateReq{
|
||||||
string title = 1;
|
string uuid = 1;
|
||||||
uint32 sort = 2;
|
repeated GovernanceLang dataByLang = 2;
|
||||||
string attachment = 3;
|
uint32 sort = 3;
|
||||||
string attachmentName = 4;
|
int32 status = 4;
|
||||||
int32 status = 5;
|
string operator = 5;
|
||||||
string operator = 6;
|
int32 operatorId = 6;
|
||||||
int32 operatorId = 7;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
message CreateResp{
|
message CreateResp{
|
||||||
@ -73,9 +120,9 @@ message CreateResp{
|
|||||||
}
|
}
|
||||||
|
|
||||||
message DisplayReq{
|
message DisplayReq{
|
||||||
|
string langType = 1;//语言类型
|
||||||
}
|
}
|
||||||
|
|
||||||
message DisplayResp{
|
message DisplayResp{
|
||||||
repeated Item data = 1;
|
repeated DisplayItem data = 1;
|
||||||
}
|
}
|
||||||
@ -1,5 +1,5 @@
|
|||||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||||
// source: governance.proto
|
// source: api/governance/governance.proto
|
||||||
|
|
||||||
package governance
|
package governance
|
||||||
|
|
||||||
@ -15,7 +15,41 @@ var _ = proto.Marshal
|
|||||||
var _ = fmt.Errorf
|
var _ = fmt.Errorf
|
||||||
var _ = math.Inf
|
var _ = math.Inf
|
||||||
|
|
||||||
|
func (this *LangSetting) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *GovernanceLangData) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *GovernanceLang) Validate() error {
|
||||||
|
if this.Data != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Data); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Data", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *GovernanceInfo) Validate() error {
|
||||||
|
for _, item := range this.DataByLang {
|
||||||
|
if item != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("DataByLang", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
func (this *Item) Validate() error {
|
func (this *Item) Validate() error {
|
||||||
|
for _, item := range this.LangSetting {
|
||||||
|
if item != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("LangSetting", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *DisplayItem) Validate() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
func (this *ListReq) Validate() error {
|
func (this *ListReq) Validate() error {
|
||||||
@ -38,12 +72,43 @@ func (this *DeleteResp) Validate() error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
func (this *EditReq) Validate() error {
|
func (this *EditReq) Validate() error {
|
||||||
|
for _, item := range this.DataByLang {
|
||||||
|
if item != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("DataByLang", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
func (this *EditResp) Validate() error {
|
func (this *EditResp) Validate() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
func (this *UpdataStatusReq) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *UpdataStatusResp) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *GetGovernanceInfoReq) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *GetGovernanceInfoResp) Validate() error {
|
||||||
|
if this.Data != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Data); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Data", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
func (this *CreateReq) Validate() error {
|
func (this *CreateReq) Validate() error {
|
||||||
|
for _, item := range this.DataByLang {
|
||||||
|
if item != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("DataByLang", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
func (this *CreateResp) Validate() error {
|
func (this *CreateResp) Validate() error {
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
// 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.20.3
|
// - protoc v5.26.0
|
||||||
// source: governance.proto
|
// source: api/governance/governance.proto
|
||||||
|
|
||||||
package governance
|
package governance
|
||||||
|
|
||||||
@ -31,6 +31,8 @@ type GovernanceClient interface {
|
|||||||
List(ctx context.Context, in *ListReq, opts ...grpc_go.CallOption) (*ListResp, common.ErrorWithAttachment)
|
List(ctx context.Context, in *ListReq, opts ...grpc_go.CallOption) (*ListResp, common.ErrorWithAttachment)
|
||||||
Delete(ctx context.Context, in *DeleteReq, opts ...grpc_go.CallOption) (*DeleteResp, common.ErrorWithAttachment)
|
Delete(ctx context.Context, in *DeleteReq, opts ...grpc_go.CallOption) (*DeleteResp, common.ErrorWithAttachment)
|
||||||
Edit(ctx context.Context, in *EditReq, opts ...grpc_go.CallOption) (*EditResp, common.ErrorWithAttachment)
|
Edit(ctx context.Context, in *EditReq, opts ...grpc_go.CallOption) (*EditResp, common.ErrorWithAttachment)
|
||||||
|
UpdataStatus(ctx context.Context, in *UpdataStatusReq, opts ...grpc_go.CallOption) (*UpdataStatusResp, common.ErrorWithAttachment)
|
||||||
|
GetGovernanceInfo(ctx context.Context, in *GetGovernanceInfoReq, opts ...grpc_go.CallOption) (*GetGovernanceInfoResp, common.ErrorWithAttachment)
|
||||||
Create(ctx context.Context, in *CreateReq, opts ...grpc_go.CallOption) (*CreateResp, common.ErrorWithAttachment)
|
Create(ctx context.Context, in *CreateReq, opts ...grpc_go.CallOption) (*CreateResp, common.ErrorWithAttachment)
|
||||||
Display(ctx context.Context, in *DisplayReq, opts ...grpc_go.CallOption) (*DisplayResp, common.ErrorWithAttachment)
|
Display(ctx context.Context, in *DisplayReq, opts ...grpc_go.CallOption) (*DisplayResp, common.ErrorWithAttachment)
|
||||||
}
|
}
|
||||||
@ -40,11 +42,13 @@ type governanceClient struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type GovernanceClientImpl struct {
|
type GovernanceClientImpl struct {
|
||||||
List func(ctx context.Context, in *ListReq) (*ListResp, error)
|
List func(ctx context.Context, in *ListReq) (*ListResp, error)
|
||||||
Delete func(ctx context.Context, in *DeleteReq) (*DeleteResp, error)
|
Delete func(ctx context.Context, in *DeleteReq) (*DeleteResp, error)
|
||||||
Edit func(ctx context.Context, in *EditReq) (*EditResp, error)
|
Edit func(ctx context.Context, in *EditReq) (*EditResp, error)
|
||||||
Create func(ctx context.Context, in *CreateReq) (*CreateResp, error)
|
UpdataStatus func(ctx context.Context, in *UpdataStatusReq) (*UpdataStatusResp, error)
|
||||||
Display func(ctx context.Context, in *DisplayReq) (*DisplayResp, error)
|
GetGovernanceInfo func(ctx context.Context, in *GetGovernanceInfoReq) (*GetGovernanceInfoResp, error)
|
||||||
|
Create func(ctx context.Context, in *CreateReq) (*CreateResp, error)
|
||||||
|
Display func(ctx context.Context, in *DisplayReq) (*DisplayResp, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *GovernanceClientImpl) GetDubboStub(cc *triple.TripleConn) GovernanceClient {
|
func (c *GovernanceClientImpl) GetDubboStub(cc *triple.TripleConn) GovernanceClient {
|
||||||
@ -77,6 +81,18 @@ func (c *governanceClient) Edit(ctx context.Context, in *EditReq, opts ...grpc_g
|
|||||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/Edit", in, out)
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/Edit", in, out)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *governanceClient) UpdataStatus(ctx context.Context, in *UpdataStatusReq, opts ...grpc_go.CallOption) (*UpdataStatusResp, common.ErrorWithAttachment) {
|
||||||
|
out := new(UpdataStatusResp)
|
||||||
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/UpdataStatus", in, out)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *governanceClient) GetGovernanceInfo(ctx context.Context, in *GetGovernanceInfoReq, opts ...grpc_go.CallOption) (*GetGovernanceInfoResp, common.ErrorWithAttachment) {
|
||||||
|
out := new(GetGovernanceInfoResp)
|
||||||
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetGovernanceInfo", in, out)
|
||||||
|
}
|
||||||
|
|
||||||
func (c *governanceClient) Create(ctx context.Context, in *CreateReq, opts ...grpc_go.CallOption) (*CreateResp, common.ErrorWithAttachment) {
|
func (c *governanceClient) Create(ctx context.Context, in *CreateReq, opts ...grpc_go.CallOption) (*CreateResp, common.ErrorWithAttachment) {
|
||||||
out := new(CreateResp)
|
out := new(CreateResp)
|
||||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
@ -96,6 +112,8 @@ type GovernanceServer interface {
|
|||||||
List(context.Context, *ListReq) (*ListResp, error)
|
List(context.Context, *ListReq) (*ListResp, error)
|
||||||
Delete(context.Context, *DeleteReq) (*DeleteResp, error)
|
Delete(context.Context, *DeleteReq) (*DeleteResp, error)
|
||||||
Edit(context.Context, *EditReq) (*EditResp, error)
|
Edit(context.Context, *EditReq) (*EditResp, error)
|
||||||
|
UpdataStatus(context.Context, *UpdataStatusReq) (*UpdataStatusResp, error)
|
||||||
|
GetGovernanceInfo(context.Context, *GetGovernanceInfoReq) (*GetGovernanceInfoResp, error)
|
||||||
Create(context.Context, *CreateReq) (*CreateResp, error)
|
Create(context.Context, *CreateReq) (*CreateResp, error)
|
||||||
Display(context.Context, *DisplayReq) (*DisplayResp, error)
|
Display(context.Context, *DisplayReq) (*DisplayResp, error)
|
||||||
mustEmbedUnimplementedGovernanceServer()
|
mustEmbedUnimplementedGovernanceServer()
|
||||||
@ -115,6 +133,12 @@ func (UnimplementedGovernanceServer) Delete(context.Context, *DeleteReq) (*Delet
|
|||||||
func (UnimplementedGovernanceServer) Edit(context.Context, *EditReq) (*EditResp, error) {
|
func (UnimplementedGovernanceServer) Edit(context.Context, *EditReq) (*EditResp, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method Edit not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method Edit not implemented")
|
||||||
}
|
}
|
||||||
|
func (UnimplementedGovernanceServer) UpdataStatus(context.Context, *UpdataStatusReq) (*UpdataStatusResp, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method UpdataStatus not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedGovernanceServer) GetGovernanceInfo(context.Context, *GetGovernanceInfoReq) (*GetGovernanceInfoResp, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method GetGovernanceInfo not implemented")
|
||||||
|
}
|
||||||
func (UnimplementedGovernanceServer) Create(context.Context, *CreateReq) (*CreateResp, error) {
|
func (UnimplementedGovernanceServer) Create(context.Context, *CreateReq) (*CreateResp, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method Create not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method Create not implemented")
|
||||||
}
|
}
|
||||||
@ -236,6 +260,64 @@ func _Governance_Edit_Handler(srv interface{}, ctx context.Context, dec func(int
|
|||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func _Governance_UpdataStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(UpdataStatusReq)
|
||||||
|
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("UpdataStatus", 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 _Governance_GetGovernanceInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(GetGovernanceInfoReq)
|
||||||
|
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("GetGovernanceInfo", 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 _Governance_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
func _Governance_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
in := new(CreateReq)
|
in := new(CreateReq)
|
||||||
if err := dec(in); err != nil {
|
if err := dec(in); err != nil {
|
||||||
@ -313,6 +395,14 @@ var Governance_ServiceDesc = grpc_go.ServiceDesc{
|
|||||||
MethodName: "Edit",
|
MethodName: "Edit",
|
||||||
Handler: _Governance_Edit_Handler,
|
Handler: _Governance_Edit_Handler,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
MethodName: "UpdataStatus",
|
||||||
|
Handler: _Governance_UpdataStatus_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "GetGovernanceInfo",
|
||||||
|
Handler: _Governance_GetGovernanceInfo_Handler,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
MethodName: "Create",
|
MethodName: "Create",
|
||||||
Handler: _Governance_Create_Handler,
|
Handler: _Governance_Create_Handler,
|
||||||
@ -323,5 +413,5 @@ var Governance_ServiceDesc = grpc_go.ServiceDesc{
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
Streams: []grpc_go.StreamDesc{},
|
Streams: []grpc_go.StreamDesc{},
|
||||||
Metadata: "governance.proto",
|
Metadata: "api/governance/governance.proto",
|
||||||
}
|
}
|
||||||
|
|||||||
@ -190,9 +190,9 @@ type IsSecFilingExistReq struct {
|
|||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
FilingDate string `protobuf:"bytes,1,opt,name=filingDate,proto3" json:"filingDate"`
|
FilingDate string `protobuf:"bytes,1,opt,name=filingDate,proto3" json:"filingDate,omitempty"`
|
||||||
Form string `protobuf:"bytes,2,opt,name=form,proto3" json:"form"`
|
Form string `protobuf:"bytes,2,opt,name=form,proto3" json:"form,omitempty"`
|
||||||
FinalLink string `protobuf:"bytes,3,opt,name=finalLink,proto3" json:"finalLink"`
|
FinalLink string `protobuf:"bytes,3,opt,name=finalLink,proto3" json:"finalLink,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *IsSecFilingExistReq) Reset() {
|
func (x *IsSecFilingExistReq) Reset() {
|
||||||
@ -253,7 +253,7 @@ type IsSecFilingExistResp struct {
|
|||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
Exist bool `protobuf:"varint,1,opt,name=exist,proto3" json:"exist"`
|
Exist bool `protobuf:"varint,1,opt,name=exist,proto3" json:"exist,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *IsSecFilingExistResp) Reset() {
|
func (x *IsSecFilingExistResp) Reset() {
|
||||||
@ -300,8 +300,8 @@ type CommonResp struct {
|
|||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
Msg string `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg"`
|
Msg string `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg,omitempty"`
|
||||||
FilingKey string `protobuf:"bytes,2,opt,name=filingKey,json=filing_key,proto3" json:"filingKey"`
|
FilingKey string `protobuf:"bytes,2,opt,name=filingKey,json=filing_key,proto3" json:"filingKey,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *CommonResp) Reset() {
|
func (x *CommonResp) Reset() {
|
||||||
@ -355,22 +355,22 @@ type SecFiling struct {
|
|||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
Idx int32 `protobuf:"varint,1,opt,name=idx,proto3" json:"idx"`
|
Idx int32 `protobuf:"varint,1,opt,name=idx,proto3" json:"idx,omitempty"`
|
||||||
FilingKey string `protobuf:"bytes,2,opt,name=filingKey,json=filing_key,proto3" json:"filingKey"`
|
FilingKey string `protobuf:"bytes,2,opt,name=filingKey,json=filing_key,proto3" json:"filingKey,omitempty"`
|
||||||
FilingDate string `protobuf:"bytes,3,opt,name=filingDate,json=filing_date,proto3" json:"filingDate"`
|
FilingDate string `protobuf:"bytes,3,opt,name=filingDate,json=filing_date,proto3" json:"filingDate,omitempty"`
|
||||||
Form string `protobuf:"bytes,4,opt,name=form,proto3" json:"form"`
|
Form string `protobuf:"bytes,4,opt,name=form,proto3" json:"form,omitempty"`
|
||||||
Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description"`
|
Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"`
|
||||||
FormDescription string `protobuf:"bytes,6,opt,name=formDescription,json=form_description,proto3" json:"formDescription"`
|
FormDescription string `protobuf:"bytes,6,opt,name=formDescription,json=form_description,proto3" json:"formDescription,omitempty"`
|
||||||
FileLink string `protobuf:"bytes,7,opt,name=fileLink,json=file_link,proto3" json:"fileLink"`
|
FileLink string `protobuf:"bytes,7,opt,name=fileLink,json=file_link,proto3" json:"fileLink,omitempty"`
|
||||||
DataFiles []*DataFiles `protobuf:"bytes,8,rep,name=dataFiles,json=data_files,proto3" json:"dataFiles"`
|
DataFiles []*DataFiles `protobuf:"bytes,8,rep,name=dataFiles,json=data_files,proto3" json:"dataFiles,omitempty"`
|
||||||
PdfFile string `protobuf:"bytes,9,opt,name=pdfFile,json=pdf_file,proto3" json:"pdfFile"`
|
PdfFile string `protobuf:"bytes,9,opt,name=pdfFile,json=pdf_file,proto3" json:"pdfFile,omitempty"`
|
||||||
WordFile string `protobuf:"bytes,10,opt,name=wordFile,json=word_file,proto3" json:"wordFile"`
|
WordFile string `protobuf:"bytes,10,opt,name=wordFile,json=word_file,proto3" json:"wordFile,omitempty"`
|
||||||
ExcelFile string `protobuf:"bytes,11,opt,name=excelFile,json=excel_file,proto3" json:"excelFile"`
|
ExcelFile string `protobuf:"bytes,11,opt,name=excelFile,json=excel_file,proto3" json:"excelFile,omitempty"`
|
||||||
Status int32 `protobuf:"varint,12,opt,name=status,proto3" json:"status"`
|
Status int32 `protobuf:"varint,12,opt,name=status,proto3" json:"status,omitempty"`
|
||||||
Operator string `protobuf:"bytes,13,opt,name=operator,proto3" json:"operator"`
|
Operator string `protobuf:"bytes,13,opt,name=operator,proto3" json:"operator,omitempty"`
|
||||||
OperatorId int32 `protobuf:"varint,14,opt,name=operatorId,json=operator_id,proto3" json:"operatorId"`
|
OperatorId int32 `protobuf:"varint,14,opt,name=operatorId,json=operator_id,proto3" json:"operatorId,omitempty"`
|
||||||
CreatedAt string `protobuf:"bytes,15,opt,name=createdAt,json=created_at,proto3" json:"createdAt"`
|
CreatedAt string `protobuf:"bytes,15,opt,name=createdAt,json=created_at,proto3" json:"createdAt,omitempty"`
|
||||||
UpdatedAt string `protobuf:"bytes,16,opt,name=updatedAt,json=updated_at,proto3" json:"updatedAt"`
|
UpdatedAt string `protobuf:"bytes,16,opt,name=updatedAt,json=updated_at,proto3" json:"updatedAt,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *SecFiling) Reset() {
|
func (x *SecFiling) Reset() {
|
||||||
@ -522,8 +522,8 @@ type DataFiles struct {
|
|||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
Description string `protobuf:"bytes,1,opt,name=description,proto3" json:"description"`
|
Description string `protobuf:"bytes,1,opt,name=description,proto3" json:"description,omitempty"`
|
||||||
FileUrl string `protobuf:"bytes,2,opt,name=fileUrl,json=file_url,proto3" json:"fileUrl"`
|
FileUrl string `protobuf:"bytes,2,opt,name=fileUrl,json=file_url,proto3" json:"fileUrl,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *DataFiles) Reset() {
|
func (x *DataFiles) Reset() {
|
||||||
@ -577,17 +577,17 @@ type CreateSecFilingReq struct {
|
|||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
FilingDate string `protobuf:"bytes,1,opt,name=filingDate,proto3" json:"filingDate"`
|
FilingDate string `protobuf:"bytes,1,opt,name=filingDate,proto3" json:"filingDate,omitempty"`
|
||||||
Form string `protobuf:"bytes,2,opt,name=form,proto3" json:"form"`
|
Form string `protobuf:"bytes,2,opt,name=form,proto3" json:"form,omitempty"`
|
||||||
Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description"`
|
Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
|
||||||
FormDescription string `protobuf:"bytes,4,opt,name=formDescription,proto3" json:"formDescription"`
|
FormDescription string `protobuf:"bytes,4,opt,name=formDescription,proto3" json:"formDescription,omitempty"`
|
||||||
FileLink string `protobuf:"bytes,5,opt,name=fileLink,proto3" json:"fileLink"`
|
FileLink string `protobuf:"bytes,5,opt,name=fileLink,proto3" json:"fileLink,omitempty"`
|
||||||
DataFiles []*DataFiles `protobuf:"bytes,6,rep,name=dataFiles,proto3" json:"dataFiles"`
|
DataFiles []*DataFiles `protobuf:"bytes,6,rep,name=dataFiles,proto3" json:"dataFiles,omitempty"`
|
||||||
PdfFile string `protobuf:"bytes,7,opt,name=pdfFile,proto3" json:"pdfFile"`
|
PdfFile string `protobuf:"bytes,7,opt,name=pdfFile,proto3" json:"pdfFile,omitempty"`
|
||||||
WordFile string `protobuf:"bytes,8,opt,name=wordFile,proto3" json:"wordFile"`
|
WordFile string `protobuf:"bytes,8,opt,name=wordFile,proto3" json:"wordFile,omitempty"`
|
||||||
ExcelFile string `protobuf:"bytes,9,opt,name=excelFile,proto3" json:"excelFile"`
|
ExcelFile string `protobuf:"bytes,9,opt,name=excelFile,proto3" json:"excelFile,omitempty"`
|
||||||
Operator string `protobuf:"bytes,10,opt,name=operator,proto3" json:"operator"`
|
Operator string `protobuf:"bytes,10,opt,name=operator,proto3" json:"operator,omitempty"`
|
||||||
OperatorId int32 `protobuf:"varint,11,opt,name=operatorId,proto3" json:"operatorId"`
|
OperatorId int32 `protobuf:"varint,11,opt,name=operatorId,proto3" json:"operatorId,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *CreateSecFilingReq) Reset() {
|
func (x *CreateSecFilingReq) Reset() {
|
||||||
@ -704,18 +704,18 @@ type UpdateSecFilingReq struct {
|
|||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
FilingKey string `protobuf:"bytes,1,opt,name=filingKey,proto3" json:"filingKey"`
|
FilingKey string `protobuf:"bytes,1,opt,name=filingKey,proto3" json:"filingKey,omitempty"`
|
||||||
Form string `protobuf:"bytes,2,opt,name=form,proto3" json:"form"`
|
Form string `protobuf:"bytes,2,opt,name=form,proto3" json:"form,omitempty"`
|
||||||
Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description"`
|
Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
|
||||||
FormDescription string `protobuf:"bytes,4,opt,name=formDescription,proto3" json:"formDescription"`
|
FormDescription string `protobuf:"bytes,4,opt,name=formDescription,proto3" json:"formDescription,omitempty"`
|
||||||
FileLink string `protobuf:"bytes,5,opt,name=fileLink,proto3" json:"fileLink"`
|
FileLink string `protobuf:"bytes,5,opt,name=fileLink,proto3" json:"fileLink,omitempty"`
|
||||||
DataFiles []*DataFiles `protobuf:"bytes,6,rep,name=dataFiles,proto3" json:"dataFiles"`
|
DataFiles []*DataFiles `protobuf:"bytes,6,rep,name=dataFiles,proto3" json:"dataFiles,omitempty"`
|
||||||
PdfFile string `protobuf:"bytes,7,opt,name=pdfFile,proto3" json:"pdfFile"`
|
PdfFile string `protobuf:"bytes,7,opt,name=pdfFile,proto3" json:"pdfFile,omitempty"`
|
||||||
WordFile string `protobuf:"bytes,8,opt,name=wordFile,proto3" json:"wordFile"`
|
WordFile string `protobuf:"bytes,8,opt,name=wordFile,proto3" json:"wordFile,omitempty"`
|
||||||
ExcelFile string `protobuf:"bytes,9,opt,name=excelFile,proto3" json:"excelFile"`
|
ExcelFile string `protobuf:"bytes,9,opt,name=excelFile,proto3" json:"excelFile,omitempty"`
|
||||||
Operator string `protobuf:"bytes,10,opt,name=operator,proto3" json:"operator"`
|
Operator string `protobuf:"bytes,10,opt,name=operator,proto3" json:"operator,omitempty"`
|
||||||
OperatorId int32 `protobuf:"varint,11,opt,name=operatorId,proto3" json:"operatorId"`
|
OperatorId int32 `protobuf:"varint,11,opt,name=operatorId,proto3" json:"operatorId,omitempty"`
|
||||||
FilingDate string `protobuf:"bytes,12,opt,name=filingDate,proto3" json:"filingDate"`
|
FilingDate string `protobuf:"bytes,12,opt,name=filingDate,proto3" json:"filingDate,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *UpdateSecFilingReq) Reset() {
|
func (x *UpdateSecFilingReq) Reset() {
|
||||||
@ -839,7 +839,7 @@ type DetailSecFilingReq struct {
|
|||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
FilingKey string `protobuf:"bytes,1,opt,name=filingKey,proto3" json:"filingKey"`
|
FilingKey string `protobuf:"bytes,1,opt,name=filingKey,proto3" json:"filingKey,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *DetailSecFilingReq) Reset() {
|
func (x *DetailSecFilingReq) Reset() {
|
||||||
@ -886,8 +886,8 @@ type SecFilingDetailResp struct {
|
|||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
Msg string `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg"`
|
Msg string `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg,omitempty"`
|
||||||
Data *SecFiling `protobuf:"bytes,2,opt,name=data,proto3" json:"data"`
|
Data *SecFiling `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *SecFilingDetailResp) Reset() {
|
func (x *SecFilingDetailResp) Reset() {
|
||||||
@ -941,12 +941,12 @@ type ListSecFilingReq struct {
|
|||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
Page uint32 `protobuf:"varint,1,opt,name=page,proto3" json:"page"`
|
Page uint32 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"`
|
||||||
PageSize uint32 `protobuf:"varint,2,opt,name=pageSize,proto3" json:"pageSize"`
|
PageSize uint32 `protobuf:"varint,2,opt,name=pageSize,proto3" json:"pageSize,omitempty"`
|
||||||
Form string `protobuf:"bytes,3,opt,name=form,proto3" json:"form"`
|
Form string `protobuf:"bytes,3,opt,name=form,proto3" json:"form,omitempty"`
|
||||||
FilingDateBegin string `protobuf:"bytes,4,opt,name=filingDateBegin,proto3" json:"filingDateBegin"`
|
FilingDateBegin string `protobuf:"bytes,4,opt,name=filingDateBegin,proto3" json:"filingDateBegin,omitempty"`
|
||||||
FilingDateEnd string `protobuf:"bytes,5,opt,name=filingDateEnd,proto3" json:"filingDateEnd"`
|
FilingDateEnd string `protobuf:"bytes,5,opt,name=filingDateEnd,proto3" json:"filingDateEnd,omitempty"`
|
||||||
Status int32 `protobuf:"varint,6,opt,name=status,proto3" json:"status"`
|
Status int32 `protobuf:"varint,6,opt,name=status,proto3" json:"status,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *ListSecFilingReq) Reset() {
|
func (x *ListSecFilingReq) Reset() {
|
||||||
@ -1028,9 +1028,9 @@ type SecFilingListResp struct {
|
|||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
Msg string `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg"`
|
Msg string `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg,omitempty"`
|
||||||
Total uint32 `protobuf:"varint,2,opt,name=total,proto3" json:"total"`
|
Total uint32 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"`
|
||||||
Data []*SecFiling `protobuf:"bytes,3,rep,name=data,proto3" json:"data"`
|
Data []*SecFiling `protobuf:"bytes,3,rep,name=data,proto3" json:"data,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *SecFilingListResp) Reset() {
|
func (x *SecFilingListResp) Reset() {
|
||||||
@ -1233,9 +1233,9 @@ type DeleteSecFilingReq struct {
|
|||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
FilingKey string `protobuf:"bytes,1,opt,name=filingKey,proto3" json:"filingKey"`
|
FilingKey string `protobuf:"bytes,1,opt,name=filingKey,proto3" json:"filingKey,omitempty"`
|
||||||
Operator string `protobuf:"bytes,2,opt,name=operator,proto3" json:"operator"`
|
Operator string `protobuf:"bytes,2,opt,name=operator,proto3" json:"operator,omitempty"`
|
||||||
OperatorId int32 `protobuf:"varint,3,opt,name=operatorId,proto3" json:"operatorId"`
|
OperatorId int32 `protobuf:"varint,3,opt,name=operatorId,proto3" json:"operatorId,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *DeleteSecFilingReq) Reset() {
|
func (x *DeleteSecFilingReq) Reset() {
|
||||||
@ -1296,10 +1296,10 @@ type UpdateSecFilingStatusReq struct {
|
|||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
FilingKey string `protobuf:"bytes,1,opt,name=filingKey,proto3" json:"filingKey"`
|
FilingKey string `protobuf:"bytes,1,opt,name=filingKey,proto3" json:"filingKey,omitempty"`
|
||||||
Status int32 `protobuf:"varint,2,opt,name=status,proto3" json:"status"`
|
Status int32 `protobuf:"varint,2,opt,name=status,proto3" json:"status,omitempty"`
|
||||||
Operator string `protobuf:"bytes,3,opt,name=operator,proto3" json:"operator"`
|
Operator string `protobuf:"bytes,3,opt,name=operator,proto3" json:"operator,omitempty"`
|
||||||
OperatorId int32 `protobuf:"varint,4,opt,name=operatorId,proto3" json:"operatorId"`
|
OperatorId int32 `protobuf:"varint,4,opt,name=operatorId,proto3" json:"operatorId,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *UpdateSecFilingStatusReq) Reset() {
|
func (x *UpdateSecFilingStatusReq) Reset() {
|
||||||
|
|||||||
2245
api/supplier/supplier.pb.go
Normal file
2245
api/supplier/supplier.pb.go
Normal file
File diff suppressed because it is too large
Load Diff
212
api/supplier/supplier.proto
Normal file
212
api/supplier/supplier.proto
Normal file
@ -0,0 +1,212 @@
|
|||||||
|
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;
|
||||||
|
string connectedParty = 26;
|
||||||
|
}
|
||||||
|
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;
|
||||||
|
string connectedParty = 28;
|
||||||
|
}
|
||||||
|
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;
|
||||||
|
string connectedParty = 23;
|
||||||
|
}
|
||||||
|
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;
|
||||||
|
string connectedParty = 22;
|
||||||
|
}
|
||||||
|
message attachment{
|
||||||
|
string url = 1;
|
||||||
|
string type = 2;
|
||||||
|
string name = 3;
|
||||||
|
}
|
||||||
|
message CreateSupplierResponse{
|
||||||
|
uint64 id = 1;
|
||||||
|
string supplierCode = 2;
|
||||||
|
}
|
||||||
|
message GetSupplierRequest{
|
||||||
|
uint64 id = 1;
|
||||||
|
}
|
||||||
122
api/supplier/supplier.validator.pb.go
Normal file
122
api/supplier/supplier.validator.pb.go
Normal 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
|
||||||
|
}
|
||||||
605
api/supplier/supplier_triple.pb.go
Normal file
605
api/supplier/supplier_triple.pb.go
Normal 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",
|
||||||
|
}
|
||||||
@ -8,7 +8,7 @@ ErpHost = "http://erpapi.test.fontree.cn:8081"
|
|||||||
FieeHost = "http://erpapi.test.fontree.cn:8081"
|
FieeHost = "http://erpapi.test.fontree.cn:8081"
|
||||||
AuthRedirectUrl = "http://saas-erp.test.fontree.cn:8081/media_account"
|
AuthRedirectUrl = "http://saas-erp.test.fontree.cn:8081/media_account"
|
||||||
AuthCallback = "https://saas-test.szjixun.cn/api/fiee/media/as-oauth2callback"
|
AuthCallback = "https://saas-test.szjixun.cn/api/fiee/media/as-oauth2callback"
|
||||||
CronOpen = true
|
CronOpen = false
|
||||||
proxyUrl = "http://47.84.75.255:6785"
|
proxyUrl = "http://47.84.75.255:6785"
|
||||||
[bos]
|
[bos]
|
||||||
Ak = "ALTAKxrqOQHnAN525Tb2GX4Bhe"
|
Ak = "ALTAKxrqOQHnAN525Tb2GX4Bhe"
|
||||||
|
|||||||
@ -49,7 +49,14 @@ dubbo:
|
|||||||
interface: com.fontree.microservices.fiee.SecFiling
|
interface: com.fontree.microservices.fiee.SecFiling
|
||||||
AyrshareClientImpl:
|
AyrshareClientImpl:
|
||||||
protocol: tri
|
protocol: tri
|
||||||
|
request-timeout: 1800s
|
||||||
interface: com.fontree.microservices.fiee.ayrshare
|
interface: com.fontree.microservices.fiee.ayrshare
|
||||||
|
FieeCronClientImpl:
|
||||||
|
protocol: tri
|
||||||
|
interface: com.fontree.microservices.fiee.cron
|
||||||
|
SupplierClientImpl:
|
||||||
|
protocol: tri
|
||||||
|
interface: com.fontree.microservices.common.supplier
|
||||||
logger:
|
logger:
|
||||||
zap-config:
|
zap-config:
|
||||||
level: error # 日志级别
|
level: error # 日志级别
|
||||||
|
|||||||
BIN
data/图文导入模板.xlsx
BIN
data/图文导入模板.xlsx
Binary file not shown.
BIN
data/竞品报告导入模板.xlsx
Normal file
BIN
data/竞品报告导入模板.xlsx
Normal file
Binary file not shown.
BIN
data/话题标签导入模板.xlsx
Normal file
BIN
data/话题标签导入模板.xlsx
Normal file
Binary file not shown.
@ -47,6 +47,13 @@ dubbo:
|
|||||||
protocol: tri
|
protocol: tri
|
||||||
retries: 0
|
retries: 0
|
||||||
interface: com.fontree.microservices.fiee.SecFiling
|
interface: com.fontree.microservices.fiee.SecFiling
|
||||||
|
AyrshareClientImpl:
|
||||||
|
request-timeout: 1800s
|
||||||
|
protocol: tri
|
||||||
|
interface: com.fontree.microservices.fiee.ayrshare
|
||||||
|
FieeCronClientImpl:
|
||||||
|
protocol: tri
|
||||||
|
interface: com.fontree.microservices.fiee.cron
|
||||||
FileClientImpl:
|
FileClientImpl:
|
||||||
protocol: tri
|
protocol: tri
|
||||||
retries: 0
|
retries: 0
|
||||||
@ -54,12 +61,9 @@ dubbo:
|
|||||||
methods:
|
methods:
|
||||||
- name: SecurityScan
|
- name: SecurityScan
|
||||||
timeout: 120000
|
timeout: 120000
|
||||||
AyrshareClientImpl:
|
SupplierClientImpl:
|
||||||
protocol: tri
|
protocol: tri
|
||||||
interface: com.fontree.microservices.fiee.ayrshare
|
interface: com.fontree.microservices.common.supplier
|
||||||
FieeCronClientImpl:
|
|
||||||
protocol: tri
|
|
||||||
interface: com.fontree.microservices.fiee.cron
|
|
||||||
logger:
|
logger:
|
||||||
zap-config:
|
zap-config:
|
||||||
level: error # 日志级别
|
level: error # 日志级别
|
||||||
|
|||||||
@ -49,6 +49,13 @@ dubbo:
|
|||||||
protocol: tri
|
protocol: tri
|
||||||
retries: 0
|
retries: 0
|
||||||
interface: com.fontree.microservices.fiee.SecFiling
|
interface: com.fontree.microservices.fiee.SecFiling
|
||||||
|
AyrshareClientImpl:
|
||||||
|
request-timeout: 1800s
|
||||||
|
protocol: tri
|
||||||
|
interface: com.fontree.microservices.fiee.ayrshare
|
||||||
|
FieeCronClientImpl:
|
||||||
|
protocol: tri
|
||||||
|
interface: com.fontree.microservices.fiee.cron
|
||||||
FileClientImpl:
|
FileClientImpl:
|
||||||
protocol: tri
|
protocol: tri
|
||||||
retries: 0
|
retries: 0
|
||||||
@ -56,12 +63,9 @@ dubbo:
|
|||||||
methods:
|
methods:
|
||||||
- name: SecurityScan
|
- name: SecurityScan
|
||||||
timeout: 120000
|
timeout: 120000
|
||||||
AyrshareClientImpl:
|
SupplierClientImpl:
|
||||||
protocol: tri
|
protocol: tri
|
||||||
interface: com.fontree.microservices.fiee.ayrshare
|
interface: com.fontree.microservices.common.supplier
|
||||||
FieeCronClientImpl:
|
|
||||||
protocol: tri
|
|
||||||
interface: com.fontree.microservices.fiee.cron
|
|
||||||
logger:
|
logger:
|
||||||
zap-config:
|
zap-config:
|
||||||
level: error # 日志级别
|
level: error # 日志级别
|
||||||
|
|||||||
@ -19,7 +19,6 @@ BosUrl = ".bj.bcebos.com"
|
|||||||
BosBaseDir = "fiee"
|
BosBaseDir = "fiee"
|
||||||
BosHttp = "https://"
|
BosHttp = "https://"
|
||||||
BosDomain = "cdns.fontree.cn"
|
BosDomain = "cdns.fontree.cn"
|
||||||
|
|
||||||
[oss]
|
[oss]
|
||||||
AccessKeyId = "OSS_AK"
|
AccessKeyId = "OSS_AK"
|
||||||
AccessKeySecret = "OSS_SK"
|
AccessKeySecret = "OSS_SK"
|
||||||
@ -30,7 +29,7 @@ CdnHost = "OSS_CDN"
|
|||||||
|
|
||||||
[redis]
|
[redis]
|
||||||
RedisDB = "2"
|
RedisDB = "2"
|
||||||
RedisAddr = "svc-fontree-redis-service:6379"
|
RedisAddr = "172.16.100.114:6379"
|
||||||
RedisPW = "kP6tW4tS3qB2dW4aE6uI5cX2"
|
RedisPW = "kP6tW4tS3qB2dW4aE6uI5cX2"
|
||||||
RedisDBNAme = "2"
|
RedisDBNAme = "2"
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,7 @@ dubbo:
|
|||||||
protocol: zookeeper
|
protocol: zookeeper
|
||||||
timeout: 3s
|
timeout: 3s
|
||||||
# address: 121.229.45.214:9004
|
# address: 121.229.45.214:9004
|
||||||
address: zookeeper:2181
|
address: 172.16.100.93:2181
|
||||||
# address: 127.0.0.1:2181
|
# address: 127.0.0.1:2181
|
||||||
# address: 114.218.158.24:2181
|
# address: 114.218.158.24:2181
|
||||||
consumer:
|
consumer:
|
||||||
@ -47,6 +47,13 @@ dubbo:
|
|||||||
protocol: tri
|
protocol: tri
|
||||||
retries: 0
|
retries: 0
|
||||||
interface: com.fontree.microservices.fiee.SecFiling
|
interface: com.fontree.microservices.fiee.SecFiling
|
||||||
|
AyrshareClientImpl:
|
||||||
|
request-timeout: 1800s
|
||||||
|
protocol: tri
|
||||||
|
interface: com.fontree.microservices.fiee.ayrshare
|
||||||
|
FieeCronClientImpl:
|
||||||
|
protocol: tri
|
||||||
|
interface: com.fontree.microservices.fiee.cron
|
||||||
FileClientImpl:
|
FileClientImpl:
|
||||||
protocol: tri
|
protocol: tri
|
||||||
retries: 0
|
retries: 0
|
||||||
@ -54,12 +61,9 @@ dubbo:
|
|||||||
methods:
|
methods:
|
||||||
- name: SecurityScan
|
- name: SecurityScan
|
||||||
timeout: 120000
|
timeout: 120000
|
||||||
AyrshareClientImpl:
|
SupplierClientImpl:
|
||||||
protocol: tri
|
protocol: tri
|
||||||
interface: com.fontree.microservices.fiee.ayrshare
|
interface: com.fontree.microservices.common.supplier
|
||||||
FieeCronClientImpl:
|
|
||||||
protocol: tri
|
|
||||||
interface: com.fontree.microservices.fiee.cron
|
|
||||||
logger:
|
logger:
|
||||||
zap-config:
|
zap-config:
|
||||||
level: error # 日志级别
|
level: error # 日志级别
|
||||||
|
|||||||
5
go.mod
5
go.mod
@ -114,8 +114,10 @@ require (
|
|||||||
github.com/fonchain_enterprise/utils/objstorage v0.0.0-00010101000000-000000000000
|
github.com/fonchain_enterprise/utils/objstorage v0.0.0-00010101000000-000000000000
|
||||||
github.com/gin-contrib/pprof v1.4.0
|
github.com/gin-contrib/pprof v1.4.0
|
||||||
github.com/go-redis/redis v6.15.9+incompatible
|
github.com/go-redis/redis v6.15.9+incompatible
|
||||||
|
github.com/google/uuid v1.6.0
|
||||||
github.com/mholt/archiver v3.1.1+incompatible
|
github.com/mholt/archiver v3.1.1+incompatible
|
||||||
github.com/natefinch/lumberjack v2.0.0+incompatible
|
github.com/natefinch/lumberjack v2.0.0+incompatible
|
||||||
|
github.com/phpdave11/gofpdf v1.4.3
|
||||||
github.com/rwcarlsen/goexif v0.0.0-20190401172101-9e8deecbddbd
|
github.com/rwcarlsen/goexif v0.0.0-20190401172101-9e8deecbddbd
|
||||||
github.com/samber/lo v1.52.0
|
github.com/samber/lo v1.52.0
|
||||||
github.com/shopspring/decimal v1.4.0
|
github.com/shopspring/decimal v1.4.0
|
||||||
@ -165,7 +167,6 @@ require (
|
|||||||
github.com/go-logr/stdr v1.2.2 // indirect
|
github.com/go-logr/stdr v1.2.2 // indirect
|
||||||
github.com/go-resty/resty/v2 v2.7.0 // indirect
|
github.com/go-resty/resty/v2 v2.7.0 // indirect
|
||||||
github.com/golang/mock v1.5.0 // indirect
|
github.com/golang/mock v1.5.0 // indirect
|
||||||
github.com/google/uuid v1.6.0 // indirect
|
|
||||||
github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645 // indirect
|
github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645 // indirect
|
||||||
github.com/hashicorp/errwrap v1.1.0 // indirect
|
github.com/hashicorp/errwrap v1.1.0 // indirect
|
||||||
github.com/hashicorp/go-multierror v1.1.1 // indirect
|
github.com/hashicorp/go-multierror v1.1.1 // indirect
|
||||||
@ -180,7 +181,7 @@ require (
|
|||||||
github.com/nxadm/tail v1.4.11 // indirect
|
github.com/nxadm/tail v1.4.11 // indirect
|
||||||
github.com/onsi/ginkgo v1.16.5 // indirect
|
github.com/onsi/ginkgo v1.16.5 // indirect
|
||||||
github.com/onsi/gomega v1.18.1 // indirect
|
github.com/onsi/gomega v1.18.1 // indirect
|
||||||
github.com/phpdave11/gofpdi v1.0.14-0.20211212211723-1f10f9844311 // indirect
|
github.com/phpdave11/gofpdi v1.0.15 // indirect
|
||||||
github.com/pierrec/lz4 v2.5.2+incompatible // indirect
|
github.com/pierrec/lz4 v2.5.2+incompatible // indirect
|
||||||
github.com/polarismesh/polaris-go v1.1.0 // indirect
|
github.com/polarismesh/polaris-go v1.1.0 // indirect
|
||||||
github.com/richardlehane/mscfb v1.0.4 // indirect
|
github.com/richardlehane/mscfb v1.0.4 // indirect
|
||||||
|
|||||||
9
go.sum
9
go.sum
@ -168,6 +168,7 @@ github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kB
|
|||||||
github.com/bits-and-blooms/bitset v1.2.0 h1:Kn4yilvwNtMACtf1eYDlG8H77R07mZSPbMjLyS07ChA=
|
github.com/bits-and-blooms/bitset v1.2.0 h1:Kn4yilvwNtMACtf1eYDlG8H77R07mZSPbMjLyS07ChA=
|
||||||
github.com/bits-and-blooms/bitset v1.2.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA=
|
github.com/bits-and-blooms/bitset v1.2.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA=
|
||||||
github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84=
|
github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84=
|
||||||
|
github.com/boombuler/barcode v1.0.0/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8=
|
||||||
github.com/buger/jsonparser v0.0.0-20181115193947-bf1c66bbce23/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s=
|
github.com/buger/jsonparser v0.0.0-20181115193947-bf1c66bbce23/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s=
|
||||||
github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs=
|
github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs=
|
||||||
github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0=
|
github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0=
|
||||||
@ -583,6 +584,7 @@ github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7
|
|||||||
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
|
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
|
||||||
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
|
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
|
||||||
github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
|
github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
|
||||||
|
github.com/jung-kurt/gofpdf v1.0.0/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes=
|
||||||
github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes=
|
github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes=
|
||||||
github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88 h1:uC1QfSlInpQF+M0ao65imhwqKnz3Q2z/d8PWZRMQvDM=
|
github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88 h1:uC1QfSlInpQF+M0ao65imhwqKnz3Q2z/d8PWZRMQvDM=
|
||||||
github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k=
|
github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k=
|
||||||
@ -747,8 +749,11 @@ github.com/pelletier/go-toml/v2 v2.0.1/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZO
|
|||||||
github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ=
|
github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ=
|
||||||
github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4=
|
github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4=
|
||||||
github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac=
|
github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac=
|
||||||
github.com/phpdave11/gofpdi v1.0.14-0.20211212211723-1f10f9844311 h1:zyWXQ6vu27ETMpYsEMAsisQ+GqJ4e1TPvSNfdOPF0no=
|
github.com/phpdave11/gofpdf v1.4.3 h1:M/zHvS8FO3zh9tUd2RCOPEjyuVcs281FCyF22Qlz/IA=
|
||||||
|
github.com/phpdave11/gofpdf v1.4.3/go.mod h1:MAwzoUIgD3J55u0rxIG2eu37c+XWhBtXSpPAhnQXf/o=
|
||||||
github.com/phpdave11/gofpdi v1.0.14-0.20211212211723-1f10f9844311/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI=
|
github.com/phpdave11/gofpdi v1.0.14-0.20211212211723-1f10f9844311/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI=
|
||||||
|
github.com/phpdave11/gofpdi v1.0.15 h1:iJazY1BQ07I9s7N5EWjBO1YbhmKfHGxNligUv/Rw4Lc=
|
||||||
|
github.com/phpdave11/gofpdi v1.0.15/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI=
|
||||||
github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc=
|
github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc=
|
||||||
github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
|
github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
|
||||||
github.com/pierrec/lz4 v2.5.2+incompatible h1:WCjObylUIOlKy/+7Abdn34TLIkXiA4UWUMhxq9m9ZXI=
|
github.com/pierrec/lz4 v2.5.2+incompatible h1:WCjObylUIOlKy/+7Abdn34TLIkXiA4UWUMhxq9m9ZXI=
|
||||||
@ -827,6 +832,7 @@ github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTE
|
|||||||
github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8=
|
github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8=
|
||||||
github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE=
|
github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE=
|
||||||
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
||||||
|
github.com/ruudk/golang-pdf417 v0.0.0-20181029194003-1af4ab5afa58/go.mod h1:6lfFZQK844Gfx8o5WFuvpxWRwnSoipWe/p622j1v06w=
|
||||||
github.com/rwcarlsen/goexif v0.0.0-20190401172101-9e8deecbddbd h1:CmH9+J6ZSsIjUK3dcGsnCnO41eRBOnY12zwkn5qVwgc=
|
github.com/rwcarlsen/goexif v0.0.0-20190401172101-9e8deecbddbd h1:CmH9+J6ZSsIjUK3dcGsnCnO41eRBOnY12zwkn5qVwgc=
|
||||||
github.com/rwcarlsen/goexif v0.0.0-20190401172101-9e8deecbddbd/go.mod h1:hPqNNc0+uJM6H+SuU8sEs5K5IQeKccPqeSjfgcKGgPk=
|
github.com/rwcarlsen/goexif v0.0.0-20190401172101-9e8deecbddbd/go.mod h1:hPqNNc0+uJM6H+SuU8sEs5K5IQeKccPqeSjfgcKGgPk=
|
||||||
github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
|
github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
|
||||||
@ -1081,6 +1087,7 @@ golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8H
|
|||||||
golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs=
|
golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs=
|
||||||
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
|
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
|
||||||
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
|
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
|
||||||
|
golang.org/x/image v0.0.0-20190910094157-69e4b8554b2a/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
|
||||||
golang.org/x/image v0.0.0-20191009234506-e7c1f5e7dbb8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
|
golang.org/x/image v0.0.0-20191009234506-e7c1f5e7dbb8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
|
||||||
golang.org/x/image v0.25.0 h1:Y6uW6rH1y5y/LK1J8BPWZtr6yZ7hrsy6hFrXjgsc2fQ=
|
golang.org/x/image v0.25.0 h1:Y6uW6rH1y5y/LK1J8BPWZtr6yZ7hrsy6hFrXjgsc2fQ=
|
||||||
golang.org/x/image v0.25.0/go.mod h1:tCAmOEGthTtkalusGp1g3xa2gke8J6c2N565dTyl9Rs=
|
golang.org/x/image v0.25.0/go.mod h1:tCAmOEGthTtkalusGp1g3xa2gke8J6c2N565dTyl9Rs=
|
||||||
|
|||||||
@ -244,7 +244,63 @@ var DeDEMessages = map[string]string{
|
|||||||
"系统提示:已经发送过,验证码尚可用": "Systemnachricht: Bereits gesendet, Verifizierungscode ist noch verfügbar",
|
"系统提示:已经发送过,验证码尚可用": "Systemnachricht: Bereits gesendet, Verifizierungscode ist noch verfügbar",
|
||||||
"您的手机号当天发送次数过多,请联系管理员通过密码登录": "Ihre Telefonnummer wurde an diesem Tag zu oft gesendet. Bitte wenden Sie sich an den Administrator, um sich über das Passwort anzumelden",
|
"您的手机号当天发送次数过多,请联系管理员通过密码登录": "Ihre Telefonnummer wurde an diesem Tag zu oft gesendet. Bitte wenden Sie sich an den Administrator, um sich über das Passwort anzumelden",
|
||||||
"您的手机号验证码错误,请确认之后注册": "Ihre Telefonnummer Verifizierungscode ist falsch, bitte bestätigen und registrieren",
|
"您的手机号验证码错误,请确认之后注册": "Ihre Telefonnummer Verifizierungscode ist falsch, bitte bestätigen und registrieren",
|
||||||
|
"手机号不合法": "Telefonnummer ungültig",
|
||||||
|
"手机号未更改": "Telefonnummer wurde nicht geändert",
|
||||||
|
"新手机号过期": "Neue Telefonnummer abgelaufen",
|
||||||
|
"验证码错误": "Verifizierungscode falsch",
|
||||||
|
"验证码未发送": "Der Verifizierungscode wurde nicht gesendet",
|
||||||
|
"账号不存在": "Konto existiert nicht",
|
||||||
|
"已实名": "In echt",
|
||||||
|
"实名审核中,请勿重复提交": "Während der Echtheitsprüfung bitte nicht wiederholen",
|
||||||
|
"用户状态异常,无法进行审核": "Der Benutzer ist abnorm und kann nicht geprüft werden. Verfahren",
|
||||||
|
"验证码已失效": "Der Verifizierungscode ist ungültig",
|
||||||
|
"服务器错误": "Serverfehler",
|
||||||
|
"验证失败,请控制拼图对齐缺口": "Überprüfung fehlgeschlagen, bitte Steuerung Puzzle-Ausrichtungslücke",
|
||||||
|
"滑块验证状态不存在,请退出重试": "Die krümmbestätigung existiert nicht. Bitte beenden sie den vorgang",
|
||||||
|
"语言不能为空": "Sprache darf nicht leer sein",
|
||||||
|
"排序参数需为正整数": "Sortierparameter muss eine positive ganze Zahl sein",
|
||||||
|
"请先创建中文版本套餐": "Bitte erstelle das Chinese Version-Paket",
|
||||||
|
"增值服务不存在": "Der Werbeangebot existiert nicht",
|
||||||
|
"所选增值服务币种与套餐币种不一致": "Die ausgewählte Währung des Werbeangebots stimmt nicht mit der Währung des Pakets überein",
|
||||||
|
"文件转换失败": "Datei-Umwandlung fehlgeschlagen",
|
||||||
|
"每种增值服务类型只可选择一个": "Jeder Werbeangebotstyp kann nur einmal ausgewählt werden",
|
||||||
|
"保存套餐与增值服务关联失败": "Fehler beim Speichern des Pakets mit Werbeangebot",
|
||||||
|
"删除套餐与增值服务关联失败": "Fehler beim Löschen des Pakets mit Werbeangebot",
|
||||||
|
"查询套餐与增值服务关联失败": "Fehler beim Abrufen des Pakets mit Werbeangebot",
|
||||||
|
"更新套餐与增值服务关联失败": "Fehler beim Aktualisieren des Pakets mit Werbeangebot",
|
||||||
|
"查询增值服务失败": "Fehler beim Abrufen des Werbeangebots",
|
||||||
|
"更新套餐状态失败": "Fehler beim Aktualisieren des Paketstatus",
|
||||||
|
"查询增值服务详情失败": "Fehler beim Abrufen der Werbeangebotsdetails",
|
||||||
|
"序列化转换失败": "Fehler beim Serialisieren",
|
||||||
|
"保存套餐历史记录失败": "Fehler beim Speichern des Pakethistorie",
|
||||||
|
"原价不能为空": "Der reguläre Preis darf nicht leer sein",
|
||||||
|
"原价格式转换失败": "Fehler beim Umwandeln des regulären Preises",
|
||||||
|
"数量参数需为0-99": "Die Anzahlsmusterparameter muss eine positive ganze Zahl sein",
|
||||||
|
"优惠单价需小于等于原价": "Der Rabattpreis muss kleiner oder gleich dem regulären Preis sein",
|
||||||
|
"请先创建中文版本增值服务": "Bitte erstelle das Chinese Version-Werbeangebot",
|
||||||
|
"保存增值服务失败": "Fehler beim Speichern des Werbeangebots",
|
||||||
|
"保存增值服务历史记录失败": "Fehler beim Speichern des Werbeangebots-Historie",
|
||||||
|
"更新增值服务失败": "Fehler beim Aktualisieren des Werbeangebots",
|
||||||
|
"查询增值服务列表失败": "Fehler beim Abrufen der Werbeangebotsliste",
|
||||||
|
"计算价格失败": "Fehler beim Berechnen des Preises",
|
||||||
|
"更新成功": "Aktualisierung erfolgreich",
|
||||||
|
"保存成功": "Speichern erfolgreich",
|
||||||
|
"优惠单价转换失败": "Rabatt-Einzelpreisumrechnung fehlgeschlagen",
|
||||||
|
"符号错误": "Symbolfehler",
|
||||||
|
"条件存在冲突,请重新设置": "Bedingungskonflikt vorhanden, bitte neu konfigurieren",
|
||||||
|
"币种已修改,已取消关联部分增值服务": "Währung wurde geändert, einige Mehrwertdienste wurden getrennt",
|
||||||
|
"币种已修改,已取消关联部分套餐": "Währung wurde geändert, einige Pakete wurden getrennt",
|
||||||
|
"新增增值服务成功": "Mehrwertdienst erfolgreich hinzugefügt",
|
||||||
|
"状态值无效": "Ungültiger Statuswert",
|
||||||
|
"套餐已上架,请勿重复操作": "Paket ist bereits veröffentlicht, bitte nicht wiederholen",
|
||||||
|
"套餐已下架,请勿重复操作": "Paket ist bereits zurückgezogen, bitte nicht wiederholen",
|
||||||
|
"请先实名": "Bitte, nur der name",
|
||||||
|
"实名审核中": "Contest läuft",
|
||||||
|
"实名审核失败": "Die confirmation hat versagt",
|
||||||
|
"未知实名状态": "Noch nicht registriert",
|
||||||
|
|
||||||
|
// Bundle related messages
|
||||||
|
"创建增值套餐失败": "Fehler beim Erstellen des Mehrwert-Bundles",
|
||||||
"增值套餐列表查询失败": "Fehler beim Abfragen der Mehrwert-Bundle-Liste",
|
"增值套餐列表查询失败": "Fehler beim Abfragen der Mehrwert-Bundle-Liste",
|
||||||
"增值套餐详情查询失败": "Fehler beim Abfragen der Mehrwert-Bundle-Details",
|
"增值套餐详情查询失败": "Fehler beim Abfragen der Mehrwert-Bundle-Details",
|
||||||
"保存增值套餐失败": "Fehler beim Speichern des Mehrwert-Bundles",
|
"保存增值套餐失败": "Fehler beim Speichern des Mehrwert-Bundles",
|
||||||
@ -327,61 +383,6 @@ var DeDEMessages = map[string]string{
|
|||||||
"套餐未绑定增值服务": "Bundle nicht an Mehrwertdienst gebunden",
|
"套餐未绑定增值服务": "Bundle nicht an Mehrwertdienst gebunden",
|
||||||
"网络错误": "Netzwerkfehler",
|
"网络错误": "Netzwerkfehler",
|
||||||
|
|
||||||
"手机号不合法": "Telefonnummer ungültig",
|
|
||||||
"手机号未更改": "Telefonnummer wurde nicht geändert",
|
|
||||||
"新手机号过期": "Neue Telefonnummer abgelaufen",
|
|
||||||
"验证码错误": "Verifizierungscode falsch",
|
|
||||||
"验证码未发送": "Der Verifizierungscode wurde nicht gesendet",
|
|
||||||
"账号不存在": "Konto existiert nicht",
|
|
||||||
"已实名": "In echt",
|
|
||||||
"实名审核中,请勿重复提交": "Während der Echtheitsprüfung bitte nicht wiederholen",
|
|
||||||
"用户状态异常,无法进行审核": "Der Benutzer ist abnorm und kann nicht geprüft werden. Verfahren",
|
|
||||||
"验证码已失效": "Der Verifizierungscode ist ungültig",
|
|
||||||
"服务器错误": "Serverfehler",
|
|
||||||
"验证失败,请控制拼图对齐缺口": "Überprüfung fehlgeschlagen, bitte Steuerung Puzzle-Ausrichtungslücke",
|
|
||||||
"滑块验证状态不存在,请退出重试": "Die krümmbestätigung existiert nicht. Bitte beenden sie den vorgang",
|
|
||||||
"语言不能为空": "Sprache darf nicht leer sein",
|
|
||||||
"排序参数需为正整数": "Sortierparameter muss eine positive ganze Zahl sein",
|
|
||||||
"请先创建中文版本套餐": "Bitte erstelle das Chinese Version-Paket",
|
|
||||||
"增值服务不存在": "Der Werbeangebot existiert nicht",
|
|
||||||
"所选增值服务币种与套餐币种不一致": "Die ausgewählte Währung des Werbeangebots stimmt nicht mit der Währung des Pakets überein",
|
|
||||||
"文件转换失败": "Datei-Umwandlung fehlgeschlagen",
|
|
||||||
"每种增值服务类型只可选择一个": "Jeder Werbeangebotstyp kann nur einmal ausgewählt werden",
|
|
||||||
"保存套餐与增值服务关联失败": "Fehler beim Speichern des Pakets mit Werbeangebot",
|
|
||||||
"删除套餐与增值服务关联失败": "Fehler beim Löschen des Pakets mit Werbeangebot",
|
|
||||||
"查询套餐与增值服务关联失败": "Fehler beim Abrufen des Pakets mit Werbeangebot",
|
|
||||||
"更新套餐与增值服务关联失败": "Fehler beim Aktualisieren des Pakets mit Werbeangebot",
|
|
||||||
"查询增值服务失败": "Fehler beim Abrufen des Werbeangebots",
|
|
||||||
"更新套餐状态失败": "Fehler beim Aktualisieren des Paketstatus",
|
|
||||||
"查询增值服务详情失败": "Fehler beim Abrufen der Werbeangebotsdetails",
|
|
||||||
"序列化转换失败": "Fehler beim Serialisieren",
|
|
||||||
"保存套餐历史记录失败": "Fehler beim Speichern des Pakethistorie",
|
|
||||||
"原价不能为空": "Der reguläre Preis darf nicht leer sein",
|
|
||||||
"原价格式转换失败": "Fehler beim Umwandeln des regulären Preises",
|
|
||||||
"数量参数需为0-99": "Die Anzahlsmusterparameter muss eine positive ganze Zahl sein",
|
|
||||||
"优惠单价需小于等于原价": "Der Rabattpreis muss kleiner oder gleich dem regulären Preis sein",
|
|
||||||
"请先创建中文版本增值服务": "Bitte erstelle das Chinese Version-Werbeangebot",
|
|
||||||
"保存增值服务失败": "Fehler beim Speichern des Werbeangebots",
|
|
||||||
"保存增值服务历史记录失败": "Fehler beim Speichern des Werbeangebots-Historie",
|
|
||||||
"更新增值服务失败": "Fehler beim Aktualisieren des Werbeangebots",
|
|
||||||
"查询增值服务列表失败": "Fehler beim Abrufen der Werbeangebotsliste",
|
|
||||||
"计算价格失败": "Fehler beim Berechnen des Preises",
|
|
||||||
"更新成功": "Aktualisierung erfolgreich",
|
|
||||||
"保存成功": "Speichern erfolgreich",
|
|
||||||
"优惠单价转换失败": "Rabatt-Einzelpreisumrechnung fehlgeschlagen",
|
|
||||||
"符号错误": "Symbolfehler",
|
|
||||||
"条件存在冲突,请重新设置": "Bedingungskonflikt vorhanden, bitte neu konfigurieren",
|
|
||||||
"币种已修改,已取消关联部分增值服务": "Währung wurde geändert, einige Mehrwertdienste wurden getrennt",
|
|
||||||
"币种已修改,已取消关联部分套餐": "Währung wurde geändert, einige Pakete wurden getrennt",
|
|
||||||
"新增增值服务成功": "Mehrwertdienst erfolgreich hinzugefügt",
|
|
||||||
"状态值无效": "Ungültiger Statuswert",
|
|
||||||
"套餐已上架,请勿重复操作": "Paket ist bereits veröffentlicht, bitte nicht wiederholen",
|
|
||||||
"套餐已下架,请勿重复操作": "Paket ist bereits zurückgezogen, bitte nicht wiederholen",
|
|
||||||
"请先实名": "Bitte, nur der name",
|
|
||||||
"实名审核中": "Contest läuft",
|
|
||||||
"实名审核失败": "Die confirmation hat versagt",
|
|
||||||
"未知实名状态": "Noch nicht registriert",
|
|
||||||
|
|
||||||
// Website report related messages
|
// Website report related messages
|
||||||
"创建官网报告失败": "Fehler beim Erstellen des Website-Berichts",
|
"创建官网报告失败": "Fehler beim Erstellen des Website-Berichts",
|
||||||
"删除官网报告失败": "Fehler beim Löschen des Website-Berichts",
|
"删除官网报告失败": "Fehler beim Löschen des Website-Berichts",
|
||||||
@ -462,6 +463,7 @@ var JaJPMessages = map[string]string{
|
|||||||
"请先创建中文版本套餐": "最初に中国語バージョンのパッケージを作成してください",
|
"请先创建中文版本套餐": "最初に中国語バージョンのパッケージを作成してください",
|
||||||
"增值服务不存在": "付加サービスは存在しません",
|
"增值服务不存在": "付加サービスは存在しません",
|
||||||
"所选增值服务币种与套餐币种不一致": "選択した付加サービスの通貨とパッケージの通貨が一致しません",
|
"所选增值服务币种与套餐币种不一致": "選択した付加サービスの通貨とパッケージの通貨が一致しません",
|
||||||
|
"文件转换失败": "ファイル変換に失敗しました",
|
||||||
"每种增值服务类型只可选择一个": "各種付加サービスタイプは一つしか選択できません",
|
"每种增值服务类型只可选择一个": "各種付加サービスタイプは一つしか選択できません",
|
||||||
"保存套餐与增值服务关联失败": "パッケージと付加サービスの関連付けの保存に失敗しました",
|
"保存套餐与增值服务关联失败": "パッケージと付加サービスの関連付けの保存に失敗しました",
|
||||||
"删除套餐与增值服务关联失败": "パッケージと付加サービスの関連付けの削除に失敗しました",
|
"删除套餐与增值服务关联失败": "パッケージと付加サービスの関連付けの削除に失敗しました",
|
||||||
@ -616,6 +618,17 @@ var ZhTWMessages = map[string]string{
|
|||||||
"删除套餐信息失败": "刪除套餐信息失敗",
|
"删除套餐信息失败": "刪除套餐信息失敗",
|
||||||
"删除套餐信息成功": "刪除套餐信息成功",
|
"删除套餐信息成功": "刪除套餐信息成功",
|
||||||
"获取套餐信息失败": "獲取套餐信息失敗",
|
"获取套餐信息失败": "獲取套餐信息失敗",
|
||||||
|
"创建订单信息失败": "創建訂單信息失敗",
|
||||||
|
"创建订单信息成功": "創建訂單信息成功",
|
||||||
|
"更新订单信息失败": "更新訂單信息失敗",
|
||||||
|
"更新订单信息成功": "更新訂單信息成功",
|
||||||
|
"获取订单信息失败": "獲取訂單信息失敗",
|
||||||
|
"获取订单列表失败": "獲取訂單列表失敗",
|
||||||
|
"缺少套餐UUID": "缺少套餐UUID",
|
||||||
|
"缺少客户签名信息": "缺少客戶簽名信息",
|
||||||
|
"插入签名失败": "插入簽名失敗",
|
||||||
|
"缺少订单号": "缺少訂單號",
|
||||||
|
"缺少订单信息": "缺少訂單信息",
|
||||||
"非当前用户订单信息不可操作": "非當前用戶訂單信息不可操作",
|
"非当前用户订单信息不可操作": "非當前用戶訂單信息不可操作",
|
||||||
"订单已支付": "訂單已支付",
|
"订单已支付": "訂單已支付",
|
||||||
"您已购买过套餐,无法再次购买": "您已購買過套餐,無法再次購買",
|
"您已购买过套餐,无法再次购买": "您已購買過套餐,無法再次購買",
|
||||||
@ -709,6 +722,7 @@ var ZhTWMessages = map[string]string{
|
|||||||
"创建套餐失败": "創建套餐失敗",
|
"创建套餐失败": "創建套餐失敗",
|
||||||
"更新套餐失败": "更新套餐失敗",
|
"更新套餐失败": "更新套餐失敗",
|
||||||
"删除套餐失败": "刪除套餐失敗",
|
"删除套餐失败": "刪除套餐失敗",
|
||||||
|
"套餐列表查询失败": "套餐列表查詢失敗",
|
||||||
"套餐详情查询失败": "套餐詳情查詢失敗",
|
"套餐详情查询失败": "套餐詳情查詢失敗",
|
||||||
"更新套餐上下架失败": "更新套餐上下架失敗",
|
"更新套餐上下架失败": "更新套餐上下架失敗",
|
||||||
"根据订单号查询增值套餐失败": "根據訂單號查詢增值套餐失敗",
|
"根据订单号查询增值套餐失败": "根據訂單號查詢增值套餐失敗",
|
||||||
@ -780,6 +794,7 @@ var ZhTWMessages = map[string]string{
|
|||||||
"未知增值服务": "未知增值服務",
|
"未知增值服务": "未知增值服務",
|
||||||
"套餐未绑定增值服务": "套餐未綁定增值服務",
|
"套餐未绑定增值服务": "套餐未綁定增值服務",
|
||||||
"网络错误": "網絡錯誤",
|
"网络错误": "網絡錯誤",
|
||||||
|
|
||||||
// Website report related messages
|
// Website report related messages
|
||||||
"创建官网报告失败": "創建官網報告失敗",
|
"创建官网报告失败": "創建官網報告失敗",
|
||||||
"删除官网报告失败": "刪除官網報告失敗",
|
"删除官网报告失败": "刪除官網報告失敗",
|
||||||
|
|||||||
109
pkg/common/qwen/qwen_vl.go
Normal file
109
pkg/common/qwen/qwen_vl.go
Normal file
@ -0,0 +1,109 @@
|
|||||||
|
package qwen
|
||||||
|
|
||||||
|
import (
|
||||||
|
"encoding/json"
|
||||||
|
"errors"
|
||||||
|
"fmt"
|
||||||
|
modelQwen "fonchain-fiee/pkg/model/qwen"
|
||||||
|
"fonchain-fiee/pkg/utils"
|
||||||
|
|
||||||
|
"go.uber.org/zap"
|
||||||
|
)
|
||||||
|
|
||||||
|
// VL 调用通义千问视觉多模态API,支持多个视频、多张图片和文本
|
||||||
|
func VL(videoURLs []string, imageURLs []string, text string, model string) (resp *modelQwen.VLResponse, err error) {
|
||||||
|
// 设置默认模型
|
||||||
|
if model == "" {
|
||||||
|
model = "qwen3-vl-plus"
|
||||||
|
}
|
||||||
|
|
||||||
|
// 构建内容列表
|
||||||
|
content := make([]modelQwen.VLContent, 0)
|
||||||
|
|
||||||
|
// 添加视频内容,支持自定义fps
|
||||||
|
for _, videoURL := range videoURLs {
|
||||||
|
fps := 2 // 默认fps为2
|
||||||
|
content = append(content, modelQwen.VLContent{
|
||||||
|
Type: "video_url",
|
||||||
|
VideoURL: &modelQwen.VideoURL{
|
||||||
|
URL: videoURL,
|
||||||
|
},
|
||||||
|
FPS: fps,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 添加图片内容
|
||||||
|
for _, imageURL := range imageURLs {
|
||||||
|
content = append(content, modelQwen.VLContent{
|
||||||
|
Type: "image_url",
|
||||||
|
ImageURL: &modelQwen.ImageURL{
|
||||||
|
URL: imageURL,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 添加文本内容
|
||||||
|
if text != "" {
|
||||||
|
content = append(content, modelQwen.VLContent{
|
||||||
|
Type: "text",
|
||||||
|
Text: text,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 构建请求
|
||||||
|
req := modelQwen.VLRequest{
|
||||||
|
Model: model,
|
||||||
|
Messages: []modelQwen.VLMessage{
|
||||||
|
{
|
||||||
|
Role: "user",
|
||||||
|
Content: content,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
// 序列化请求
|
||||||
|
jsonData, err := json.Marshal(req)
|
||||||
|
if err != nil {
|
||||||
|
zap.L().Error("VL Marshal failed", zap.Error(err))
|
||||||
|
return nil, errors.New("序列化请求失败")
|
||||||
|
}
|
||||||
|
|
||||||
|
// 发送请求,使用PostBytesHeader获取状态码和响应体
|
||||||
|
statusCode, body, err := utils.PostBytesHeader(modelQwen.DashscopeVLURL, map[string]interface{}{
|
||||||
|
"Authorization": "Bearer " + modelQwen.DashscopeAPIKey,
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
// "X-DashScope-OssResourceResolve": "enable", // 启用OSS资源解析
|
||||||
|
}, jsonData)
|
||||||
|
if err != nil {
|
||||||
|
zap.L().Error("VL Post failed", zap.Error(err))
|
||||||
|
return nil, errors.New("请求视觉AI失败")
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查状态码,如果不是200,尝试解析错误响应
|
||||||
|
if statusCode != 200 {
|
||||||
|
// 尝试解析错误响应
|
||||||
|
var errorResp struct {
|
||||||
|
Error struct {
|
||||||
|
Message string `json:"message"`
|
||||||
|
Type string `json:"type"`
|
||||||
|
Code string `json:"code"`
|
||||||
|
} `json:"error"`
|
||||||
|
}
|
||||||
|
if err := json.Unmarshal(body, &errorResp); err == nil && errorResp.Error.Message != "" {
|
||||||
|
zap.L().Error("VL API error", zap.Int("status", statusCode), zap.String("message", errorResp.Error.Message))
|
||||||
|
return nil, fmt.Errorf("%s", errorResp.Error.Message)
|
||||||
|
}
|
||||||
|
// 如果无法解析错误响应,返回通用错误
|
||||||
|
zap.L().Error("VL API error", zap.Int("status", statusCode), zap.String("body", string(body)))
|
||||||
|
return nil, fmt.Errorf("接口返回错误")
|
||||||
|
}
|
||||||
|
|
||||||
|
// 解析响应
|
||||||
|
var result modelQwen.VLResponse
|
||||||
|
if err = json.Unmarshal(body, &result); err != nil {
|
||||||
|
zap.L().Error("VL Unmarshal failed", zap.Error(err), zap.String("body", string(body)))
|
||||||
|
return nil, fmt.Errorf("解析响应失败: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
return &result, nil
|
||||||
|
}
|
||||||
625
pkg/cron/task.go
625
pkg/cron/task.go
@ -5,6 +5,7 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"fonchain-fiee/api/aryshare"
|
||||||
"fonchain-fiee/api/bundle"
|
"fonchain-fiee/api/bundle"
|
||||||
"fonchain-fiee/api/cast"
|
"fonchain-fiee/api/cast"
|
||||||
"fonchain-fiee/pkg/cache"
|
"fonchain-fiee/pkg/cache"
|
||||||
@ -16,6 +17,7 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
"math/rand"
|
"math/rand"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/go-redis/redis"
|
"github.com/go-redis/redis"
|
||||||
@ -27,21 +29,28 @@ func InitTasks() error {
|
|||||||
cm := GetCronManager()
|
cm := GetCronManager()
|
||||||
err := cm.AddTask("refreshWorkApprovalStatus", "0 */1 * * * *", RefreshWorkApprovalStatusTask)
|
err := cm.AddTask("refreshWorkApprovalStatus", "0 */1 * * * *", RefreshWorkApprovalStatusTask)
|
||||||
err = cm.AddTask("artistAutoConfirm", "0 */1 * * * *", ArtistAutoConfirmTask)
|
err = cm.AddTask("artistAutoConfirm", "0 */1 * * * *", ArtistAutoConfirmTask)
|
||||||
err = cm.AddTask("refreshPublishStatus", "0 */1 * * * *", RefreshPublishStatusTask)
|
err = cm.AddTask("refreshPublishStatus", "0 */1 * * * *", PublishTask)
|
||||||
|
err = cm.AddTask("scheduledPublish", "0 */10 * * * *", ScheduledPublishTask)
|
||||||
|
|
||||||
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("scheduledPublish", "0 */1 * * * *", ScheduledPublishTask)
|
err = cm.AddTask("artistAutoConfirmReport", "0 */1 * * * *", ArtistAutoConfirmReportTask)
|
||||||
|
err = cm.AddTask("refreshCompetitiveReportApprovalStatus", "0 */1 * * * *", RefreshCompetitiveReportApprovalStatusTask)
|
||||||
|
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)
|
||||||
|
err = cm.AddTask("ayrshareMetricsCollector", "0 30 0 * * *", AyrshareMetricsCollectorTask)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("添加定时任务失败: %v", err)
|
log.Printf("添加定时任务失败: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 每2分钟执行一次标签观看次数更新任务
|
||||||
|
// err = cm.AddTask("updateCastTagWatchCount", "0 */1 * * * *", UpdateCastTagWatchCountTask)
|
||||||
cm.Start()
|
cm.Start()
|
||||||
|
|
||||||
// 启动队列消费者
|
// 启动队列消费者
|
||||||
go WorkPublishQueueConsumer()
|
//go WorkPublishQueueConsumer()
|
||||||
|
|
||||||
// 启动随机间隔的自动确认任务
|
// 启动随机间隔的自动确认任务
|
||||||
go AutoManuallyConfirmWorkTaskWithRandomInterval()
|
go AutoManuallyConfirmWorkTaskWithRandomInterval()
|
||||||
@ -65,32 +74,33 @@ func RefreshWorkApprovalStatusTask() {
|
|||||||
serverCast.RefreshWorkApproval(nil, resp.Data)
|
serverCast.RefreshWorkApproval(nil, resp.Data)
|
||||||
}
|
}
|
||||||
|
|
||||||
func RefreshWorkAnalysisApprovalStatusTask() {
|
|
||||||
resp, err := service.CastProvider.ListWorkAnalysis(context.Background(), &cast.ListWorkAnalysisReq{
|
|
||||||
Page: 1,
|
|
||||||
StatusList: []uint32{2}, // 状态为2表示待审批
|
|
||||||
PageSize: 999999,
|
|
||||||
})
|
|
||||||
if err != nil {
|
|
||||||
log.Printf("获取数据分析列表失败: %v", err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if resp.Data == nil || len(resp.Data) == 0 {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
serverCast.RefreshWorkAnalysisApproval(nil, resp.Data)
|
|
||||||
}
|
|
||||||
|
|
||||||
// AutoManuallyConfirmWorkTaskWithRandomInterval 以随机间隔(3-7分钟)执行自动确认任务
|
// AutoManuallyConfirmWorkTaskWithRandomInterval 以随机间隔(3-7分钟)执行自动确认任务
|
||||||
func AutoManuallyConfirmWorkTaskWithRandomInterval() {
|
func AutoManuallyConfirmWorkTaskWithRandomInterval() {
|
||||||
|
|
||||||
for {
|
for {
|
||||||
// 执行任务
|
// 添加 panic 恢复机制
|
||||||
AutoManuallyConfirmWorkTask()
|
func() {
|
||||||
|
defer func() {
|
||||||
|
if r := recover(); r != nil {
|
||||||
|
zap.L().Error("自动确认任务执行panic",
|
||||||
|
zap.Any("panic", r),
|
||||||
|
zap.Stack("stack"))
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
|
// 执行任务
|
||||||
|
zap.L().Debug("开始执行自动确认任务")
|
||||||
|
AutoManuallyConfirmWorkTask()
|
||||||
|
zap.L().Debug("自动确认任务执行完成")
|
||||||
|
}()
|
||||||
|
|
||||||
// 生成3-7分钟之间的随机间隔(单位:分钟)
|
// 生成3-7分钟之间的随机间隔(单位:分钟)
|
||||||
randomMinutes := rand.Intn(5) + 3 // 3-7分钟
|
randomMinutes := rand.Intn(5) + 3 // 3-7分钟
|
||||||
randomDuration := time.Duration(randomMinutes) * time.Minute
|
randomDuration := time.Duration(randomMinutes) * time.Minute
|
||||||
|
log.Printf("自动确认任务等待下次执行,间隔:%d分钟,时长:%s", randomMinutes, randomDuration)
|
||||||
|
zap.L().Info("自动确认任务等待下次执行",
|
||||||
|
zap.Int("minutes", randomMinutes),
|
||||||
|
zap.Duration("duration", randomDuration))
|
||||||
|
|
||||||
// 等待随机时间
|
// 等待随机时间
|
||||||
time.Sleep(randomDuration)
|
time.Sleep(randomDuration)
|
||||||
@ -113,7 +123,7 @@ func AutoManuallyConfirmWorkTask() {
|
|||||||
artistId, err := strconv.ParseInt(work.ArtistUuid, 10, 64)
|
artistId, err := strconv.ParseInt(work.ArtistUuid, 10, 64)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
zap.L().Error("解析艺术家ID失败", zap.Error(err))
|
zap.L().Error("解析艺术家ID失败", zap.Error(err))
|
||||||
return
|
continue
|
||||||
}
|
}
|
||||||
if req.ConfirmStatus == 2 { // 驳回完直接结束
|
if req.ConfirmStatus == 2 { // 驳回完直接结束
|
||||||
_, err := service.CastProvider.UpdateStatus(context.Background(), &cast.UpdateStatusReq{
|
_, err := service.CastProvider.UpdateStatus(context.Background(), &cast.UpdateStatusReq{
|
||||||
@ -208,11 +218,27 @@ func AutoManuallyConfirmWorkTask() {
|
|||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("更新作品状态失败,作品uuid:"+req.WorkUuid, zap.Error(err))
|
log.Printf("更新作品状态失败,作品uuid:"+req.WorkUuid, zap.Error(err))
|
||||||
return
|
continue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func RefreshWorkAnalysisApprovalStatusTask() {
|
||||||
|
resp, err := service.CastProvider.ListWorkAnalysis(context.Background(), &cast.ListWorkAnalysisReq{
|
||||||
|
Page: 1,
|
||||||
|
StatusList: []uint32{2}, // 状态为2表示待审批
|
||||||
|
PageSize: 999999,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
log.Printf("获取数据分析列表失败: %v", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if resp.Data == nil || len(resp.Data) == 0 {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
serverCast.RefreshWorkAnalysisApproval(nil, resp.Data)
|
||||||
|
}
|
||||||
|
|
||||||
func ArtistAutoConfirmTask() {
|
func ArtistAutoConfirmTask() {
|
||||||
now := float64(time.Now().Unix())
|
now := float64(time.Now().Unix())
|
||||||
opt := redis.ZRangeBy{
|
opt := redis.ZRangeBy{
|
||||||
@ -225,7 +251,7 @@ func ArtistAutoConfirmTask() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if len(workUuids) == 0 {
|
if len(workUuids) == 0 {
|
||||||
zap.L().Debug("没有到期的任务")
|
zap.L().Info("没有到期的任务")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
zap.L().Info("发现到期任务", zap.Int("count", len(workUuids)))
|
zap.L().Info("发现到期任务", zap.Int("count", len(workUuids)))
|
||||||
@ -253,6 +279,278 @@ func RefreshPublishStatusTask() {
|
|||||||
//zap.L().Info("刷新发布状态成功")
|
//zap.L().Info("刷新发布状态成功")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// PublishTask 定时发布任务,从Redis Sorted Set中获取所有workUuid并根据score判断处理
|
||||||
|
func PublishTask() {
|
||||||
|
go RefreshPublishStatusTask() // 刷新发布状态
|
||||||
|
go TaskStatus() // 异步任务状态
|
||||||
|
}
|
||||||
|
func ScheduledPublishTask() {
|
||||||
|
// 加上锁
|
||||||
|
lockKey := "scheduled_publish:lock"
|
||||||
|
reply := cache.RedisClient.SetNX(lockKey, time.Now().Format("2006-01-02 15:04:05"), 2*time.Hour)
|
||||||
|
if !reply.Val() {
|
||||||
|
zap.L().Warn("定时发布任务正在被其他实例处理")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
defer func() {
|
||||||
|
cache.RedisClient.Del(lockKey)
|
||||||
|
}()
|
||||||
|
|
||||||
|
// 获取所有数据(不限制score范围)
|
||||||
|
opt := redis.ZRangeBy{
|
||||||
|
Min: "-inf",
|
||||||
|
Max: "+inf",
|
||||||
|
}
|
||||||
|
// 从Redis Sorted Set中获取所有workUuid及其score
|
||||||
|
workList, err := cache.RedisClient.ZRangeByScoreWithScores(modelCast.ScheduledPublishQueueKey, opt).Result()
|
||||||
|
if err != nil {
|
||||||
|
zap.L().Error("获取定时发布任务失败", zap.Error(err))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if len(workList) == 0 {
|
||||||
|
zap.L().Info("没有定时发布任务")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
publishCount := 0
|
||||||
|
expiredCount := 0
|
||||||
|
const batchSize = 8 // 每批发布8个,与PublishWork的workerCount保持一致
|
||||||
|
|
||||||
|
zap.L().Info("发现定时发布任务", zap.Int("total_count", len(workList)))
|
||||||
|
zap.L().Info("发现定时发布任务 列表", zap.Any("workList", workList))
|
||||||
|
|
||||||
|
now := float64(time.Now().Unix())
|
||||||
|
publishBatch := make([]string, 0, batchSize)
|
||||||
|
// 使用 map 进行去重,防止同一个 work_uuid 被多次添加
|
||||||
|
publishedUuids := make(map[string]bool)
|
||||||
|
|
||||||
|
// 遍历所有数据,根据score判断处理
|
||||||
|
for _, item := range workList {
|
||||||
|
workUuid := item.Member.(string)
|
||||||
|
score := item.Score
|
||||||
|
|
||||||
|
// 如果score小于当前时间,删除但不消费(不发布)
|
||||||
|
if score < now {
|
||||||
|
zap.L().Info("发现过期的定时发布任务,直接删除不发布",
|
||||||
|
zap.String("work_uuid", workUuid),
|
||||||
|
zap.Float64("score", score),
|
||||||
|
zap.Float64("now", now))
|
||||||
|
removed, delErr := cache.RedisClient.ZRem(modelCast.ScheduledPublishQueueKey, workUuid).Result()
|
||||||
|
if delErr != nil {
|
||||||
|
zap.L().Error("删除过期定时发布任务失败", zap.Error(delErr), zap.String("work_uuid", workUuid))
|
||||||
|
} else if removed > 0 {
|
||||||
|
expiredCount++
|
||||||
|
zap.L().Info("已删除过期定时发布任务", zap.String("work_uuid", workUuid))
|
||||||
|
}
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
// 先从 Redis 中删除,采用"先删后处理"的策略,防止重复处理
|
||||||
|
removed, delErr := cache.RedisClient.ZRem(modelCast.ScheduledPublishQueueKey, workUuid).Result()
|
||||||
|
if delErr != nil {
|
||||||
|
zap.L().Error("删除定时发布任务失败", zap.Error(delErr), zap.String("work_uuid", workUuid))
|
||||||
|
continue // 删除失败则跳过,避免重复处理
|
||||||
|
}
|
||||||
|
if removed == 0 {
|
||||||
|
zap.L().Warn("定时发布任务已被删除,跳过",
|
||||||
|
zap.String("work_uuid", workUuid))
|
||||||
|
continue // 已被其他实例删除,跳过
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查是否已经在当前批次中(去重)
|
||||||
|
if publishedUuids[workUuid] {
|
||||||
|
zap.L().Warn("发现重复的定时发布任务,跳过",
|
||||||
|
zap.String("work_uuid", workUuid))
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
// score大于等于当前时间,添加到待发布批次
|
||||||
|
zap.L().Info("添加到发布批次",
|
||||||
|
zap.String("work_uuid", workUuid),
|
||||||
|
zap.Float64("score", score))
|
||||||
|
publishBatch = append(publishBatch, workUuid)
|
||||||
|
publishedUuids[workUuid] = true
|
||||||
|
publishCount++
|
||||||
|
|
||||||
|
// 当批次达到指定大小时,批量发布
|
||||||
|
if len(publishBatch) >= batchSize {
|
||||||
|
zap.L().Info("批量发布作品", zap.Int("batch_size", len(publishBatch)), zap.Strings("work_uuids", publishBatch))
|
||||||
|
_ = serverCast.PublishWork(context.Background(), &cast.PublishReq{
|
||||||
|
WorkUuids: publishBatch,
|
||||||
|
})
|
||||||
|
zap.L().Info("批次发布完成", zap.Int("published", len(publishBatch)))
|
||||||
|
// 清空批次,准备下一批
|
||||||
|
publishBatch = make([]string, 0, batchSize)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理剩余的作品(不足一批的)
|
||||||
|
if len(publishBatch) > 0 {
|
||||||
|
zap.L().Info("批量发布剩余作品", zap.Int("batch_size", len(publishBatch)), zap.Strings("work_uuids", publishBatch))
|
||||||
|
_ = serverCast.PublishWork(context.Background(), &cast.PublishReq{
|
||||||
|
WorkUuids: publishBatch,
|
||||||
|
})
|
||||||
|
zap.L().Info("剩余批次发布完成", zap.Int("published", len(publishBatch)))
|
||||||
|
}
|
||||||
|
|
||||||
|
zap.L().Info("定时发布任务处理完成",
|
||||||
|
zap.Int("published_count", publishCount),
|
||||||
|
zap.Int("expired_count", expiredCount),
|
||||||
|
zap.Int("total_count", len(workList)))
|
||||||
|
}
|
||||||
|
|
||||||
|
func TaskStatus() {
|
||||||
|
var actions []string = []string{"publishBatch1", "publishBatch2"}
|
||||||
|
for _, action := range actions {
|
||||||
|
resp, err := service.CastProvider.ListTaskList(context.Background(), &cast.ListTaskListReq{
|
||||||
|
Action: action,
|
||||||
|
Status: 1,
|
||||||
|
Page: 1,
|
||||||
|
PageSize: 100,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
zap.L().Error("获取任务列表失败", zap.Error(err))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
for _, v := range resp.Data {
|
||||||
|
var extraData modelCast.PublishTaskDto
|
||||||
|
if v.ExtraData == "" {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
_ = json.Unmarshal([]byte(v.ExtraData), &extraData)
|
||||||
|
var allDone = true
|
||||||
|
for _, workUuid := range extraData.WorkUuids {
|
||||||
|
infoResp, _err := service.CastProvider.WorkInfo(context.Background(), &cast.WorkInfoReq{WorkUuid: workUuid})
|
||||||
|
if _err != nil {
|
||||||
|
zap.L().Error("获取作品信息失败", zap.Error(_err))
|
||||||
|
allDone = false
|
||||||
|
break
|
||||||
|
}
|
||||||
|
if infoResp.PublishStatus != cast.PublishStatusENUM_PublishMediaStatus_DONE {
|
||||||
|
allDone = false
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var excelUrl string
|
||||||
|
if allDone {
|
||||||
|
excelUrl, err = serverCast.PublishTaskExcel(extraData.WorkUuids, true, v.Action)
|
||||||
|
if err != nil {
|
||||||
|
zap.L().Error("生成发布任务Excel失败", zap.Error(err))
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
_, err = service.CastProvider.UpsertTaskList(context.Background(), &cast.UpsertTaskListReq{
|
||||||
|
Uuid: v.Uuid,
|
||||||
|
Action: v.Action,
|
||||||
|
Url: excelUrl,
|
||||||
|
Status: 3,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
zap.L().Error("更新任务状态失败", zap.Error(err))
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
zap.L().Info("任务已完成,更新状态为完成", zap.String("task_uuid", v.Uuid), zap.String("excel_url", excelUrl))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// WorkPublishQueueConsumer 监听work:publish:queue队列的消费者
|
||||||
|
func WorkPublishQueueConsumer() {
|
||||||
|
zap.L().Info("开始监听work:publish:queue队列(批量处理模式)")
|
||||||
|
const batchSize = 10
|
||||||
|
|
||||||
|
for {
|
||||||
|
batch := make([]string, 0, batchSize)
|
||||||
|
|
||||||
|
result, err := cache.RedisClient.BRPop(0*time.Second, modelCast.WorkPublishQueueKey).Result()
|
||||||
|
if err != nil {
|
||||||
|
zap.L().Error("监听work:publish:queue队列失败", zap.Error(err))
|
||||||
|
time.Sleep(5 * time.Second) // 出错后等待5秒再重试
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(result) < 2 {
|
||||||
|
zap.L().Warn("队列返回数据格式异常", zap.Any("result", result))
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
workData := result[1] // BRPOP返回[key, value],value在第二个元素
|
||||||
|
zap.L().Info("从work:publish:queue队列收到第一条数据", zap.String("data", workData))
|
||||||
|
|
||||||
|
batch = append(batch, workData)
|
||||||
|
for len(batch) < batchSize {
|
||||||
|
// 使用RPOP非阻塞获取,如果没有数据立即返回
|
||||||
|
data, err := cache.RedisClient.RPop(modelCast.WorkPublishQueueKey).Result()
|
||||||
|
if err == redis.Nil {
|
||||||
|
// 队列为空,跳出循环
|
||||||
|
zap.L().Info("队列暂时为空,开始处理当前批次", zap.Int("batch_size", len(batch)))
|
||||||
|
break
|
||||||
|
} else if err != nil {
|
||||||
|
zap.L().Error("从队列获取数据失败", zap.Error(err))
|
||||||
|
break
|
||||||
|
}
|
||||||
|
batch = append(batch, data)
|
||||||
|
}
|
||||||
|
zap.L().Info("收集到批次数据,准备批量处理", zap.Int("batch_size", len(batch)))
|
||||||
|
// 批量处理数据
|
||||||
|
if err = processBatchWorkPublishQueueData(batch); err != nil {
|
||||||
|
zap.L().Error("批量处理work:publish:queue队列数据失败",
|
||||||
|
zap.Error(err),
|
||||||
|
zap.Int("batch_size", len(batch)))
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
zap.L().Info("成功批量处理work:publish:queue队列数据", zap.Int("batch_size", len(batch)))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// processBatchWorkPublishQueueData 批量处理从work:publish:queue队列中取出的数据
|
||||||
|
func processBatchWorkPublishQueueData(batchData []string) error {
|
||||||
|
// 延时1秒消费
|
||||||
|
time.Sleep(time.Second * 1)
|
||||||
|
workUuids := make([]string, 0, len(batchData))
|
||||||
|
// 解析所有数据,提取workUuid
|
||||||
|
for _, data := range batchData {
|
||||||
|
var workData map[string]string
|
||||||
|
if err := json.Unmarshal([]byte(data), &workData); err != nil {
|
||||||
|
zap.L().Error("解析队列数据失败", zap.String("raw_data", data), zap.Error(err))
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
workUuid := workData["workUuid"]
|
||||||
|
if workUuid == "" {
|
||||||
|
zap.L().Error("队列数据中workUuid为空", zap.String("raw_data", data))
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
workUuids = append(workUuids, workUuid)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(workUuids) == 0 {
|
||||||
|
zap.L().Warn("批次中没有有效的workUuid")
|
||||||
|
return errors.New("批次中没有有效的workUuid")
|
||||||
|
}
|
||||||
|
|
||||||
|
zap.L().Info("批量处理发布工作队列数据",
|
||||||
|
zap.Strings("work_uuids", workUuids),
|
||||||
|
zap.Int("count", len(workUuids)))
|
||||||
|
|
||||||
|
// 批量调用发布工作逻辑
|
||||||
|
err := serverCast.PublishWork(context.Background(), &cast.PublishReq{
|
||||||
|
WorkUuids: workUuids,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
zap.L().Error("批量发布工作失败",
|
||||||
|
zap.Strings("work_uuids", workUuids),
|
||||||
|
zap.Error(err))
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
zap.L().Info("批量发布工作成功",
|
||||||
|
zap.Strings("work_uuids", workUuids),
|
||||||
|
zap.Int("count", len(workUuids)))
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
func ArtistAutoConfirmAnalysisTask() {
|
func ArtistAutoConfirmAnalysisTask() {
|
||||||
now := float64(time.Now().Unix())
|
now := float64(time.Now().Unix())
|
||||||
opt := redis.ZRangeBy{
|
opt := redis.ZRangeBy{
|
||||||
@ -274,137 +572,176 @@ func ArtistAutoConfirmAnalysisTask() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// WorkPublishQueueConsumer 监听work:publish:queue队列的消费者
|
func ArtistAutoConfirmReportTask() {
|
||||||
func WorkPublishQueueConsumer() {
|
now := float64(time.Now().Unix())
|
||||||
zap.L().Info("开始监听work:publish:queue队列")
|
opt := redis.ZRangeBy{
|
||||||
for {
|
Min: fmt.Sprintf("%d", 0),
|
||||||
result, err := cache.RedisClient.BRPop(0*time.Second, modelCast.WorkPublishQueueKey).Result()
|
Max: fmt.Sprintf("%f", now),
|
||||||
if err != nil {
|
}
|
||||||
zap.L().Error("监听work:publish:queue队列失败", zap.Error(err))
|
reportUuids, err := cache.RedisClient.ZRangeByScore(modelCast.AutoConfirmReportQueueKey, opt).Result()
|
||||||
time.Sleep(5 * time.Second) // 出错后等待5秒再重试
|
if err != nil {
|
||||||
continue
|
zap.L().Error("获取到期竞品报告任务失败", zap.Error(err))
|
||||||
}
|
return
|
||||||
|
}
|
||||||
if len(result) < 2 {
|
if len(reportUuids) == 0 {
|
||||||
zap.L().Warn("队列返回数据格式异常", zap.Any("result", result))
|
zap.L().Debug("没有到期的竞品报告任务")
|
||||||
continue
|
return
|
||||||
}
|
}
|
||||||
|
zap.L().Info("发现到期竞品报告任务", zap.Int("count", len(reportUuids)))
|
||||||
workData := result[1] // BRPOP返回[key, value],value在第二个元素
|
for _, reportUuid := range reportUuids {
|
||||||
zap.L().Info("从work:publish:queue队列收到数据", zap.String("data", workData))
|
serverCast.ProcessReportTask(context.Background(), reportUuid)
|
||||||
|
|
||||||
// 处理队列数据
|
|
||||||
if err = processWorkPublishQueueData(workData); err != nil {
|
|
||||||
zap.L().Error("处理work:publish:queue队列数据失败", zap.Error(err), zap.String("data", workData))
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
zap.L().Info("成功处理work:publish:queue队列数据", zap.String("data", workData))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// processWorkPublishQueueData 处理从work:publish:queue队列中取出的数据
|
func RefreshCompetitiveReportApprovalStatusTask() {
|
||||||
func processWorkPublishQueueData(data string) error {
|
resp, err := service.CastProvider.ListCompetitiveReport(context.Background(), &cast.ListCompetitiveReportReq{
|
||||||
// 延时1秒消费
|
Page: 1,
|
||||||
time.Sleep(time.Second * 1)
|
StatusList: []uint32{2}, // 状态为2表示待审批
|
||||||
var workData map[string]string
|
PageSize: 999999,
|
||||||
_ = json.Unmarshal([]byte(data), &workData)
|
|
||||||
workUuid := workData["workUuid"]
|
|
||||||
if workUuid == "" {
|
|
||||||
zap.L().Error("队列数据为空", zap.String("raw_data", data))
|
|
||||||
return errors.New("队列数据为空")
|
|
||||||
}
|
|
||||||
zap.L().Info("处理发布工作队列数据", zap.String("work_uuid", workUuid))
|
|
||||||
// 调用发布工作逻辑
|
|
||||||
err := serverCast.PublishWork(context.Background(), &cast.PublishReq{
|
|
||||||
WorkUuids: []string{workUuid},
|
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
zap.L().Error("发布工作失败",
|
log.Printf("获取竞品报告列表失败: %v", err)
|
||||||
zap.String("work_uuid", workUuid),
|
|
||||||
zap.Error(err))
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
zap.L().Info("发布工作成功", zap.String("work_uuid", workUuid))
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// ScheduledPublishTask 定时发布任务,从Redis Sorted Set中获取所有workUuid并根据score判断处理
|
|
||||||
func ScheduledPublishTask() {
|
|
||||||
// 加上锁
|
|
||||||
lockKey := "scheduled_publish:lock"
|
|
||||||
reply := cache.RedisClient.SetNX(lockKey, time.Now().Format("2006-01-02 15:04:05"), 1*time.Hour)
|
|
||||||
if !reply.Val() {
|
|
||||||
zap.L().Warn("定时发布任务正在被其他实例处理")
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
defer func() {
|
if resp.Data == nil || len(resp.Data) == 0 {
|
||||||
cache.RedisClient.Del(lockKey)
|
|
||||||
}()
|
|
||||||
|
|
||||||
// 获取所有数据(不限制score范围)
|
|
||||||
opt := redis.ZRangeBy{
|
|
||||||
Min: "-inf",
|
|
||||||
Max: "+inf",
|
|
||||||
}
|
|
||||||
// 从Redis Sorted Set中获取所有workUuid及其score
|
|
||||||
workList, err := cache.RedisClient.ZRangeByScoreWithScores(modelCast.ScheduledPublishQueueKey, opt).Result()
|
|
||||||
if err != nil {
|
|
||||||
zap.L().Error("获取定时发布任务失败", zap.Error(err))
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if len(workList) == 0 {
|
serverCast.RefreshCompetitiveReportApproval(nil, resp.Data)
|
||||||
zap.L().Debug("没有定时发布任务")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
publishCount := 0
|
|
||||||
expiredCount := 0
|
|
||||||
|
|
||||||
zap.L().Info("发现定时发布任务", zap.Int("total_count", len(workList)))
|
|
||||||
|
|
||||||
// 遍历所有数据,根据score判断处理
|
|
||||||
for _, item := range workList {
|
|
||||||
workUuid := item.Member.(string)
|
|
||||||
score := item.Score
|
|
||||||
now := float64(time.Now().Unix())
|
|
||||||
// 如果score小于当前时间,删除但不消费(不发布)
|
|
||||||
if score < now {
|
|
||||||
zap.L().Info("发现过期的定时发布任务,直接删除不发布",
|
|
||||||
zap.String("work_uuid", workUuid),
|
|
||||||
zap.Float64("score", score),
|
|
||||||
zap.Float64("now", now))
|
|
||||||
removed, delErr := cache.RedisClient.ZRem(modelCast.ScheduledPublishQueueKey, workUuid).Result()
|
|
||||||
if delErr != nil {
|
|
||||||
zap.L().Error("删除过期定时发布任务失败", zap.Error(delErr), zap.String("work_uuid", workUuid))
|
|
||||||
} else if removed > 0 {
|
|
||||||
expiredCount++
|
|
||||||
zap.L().Info("已删除过期定时发布任务", zap.String("work_uuid", workUuid))
|
|
||||||
}
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
// score大于等于当前时间,正常发布
|
|
||||||
zap.L().Info("处理定时发布任务",
|
|
||||||
zap.String("work_uuid", workUuid),
|
|
||||||
zap.Float64("score", score))
|
|
||||||
_ = serverCast.PublishWork(context.Background(), &cast.PublishReq{
|
|
||||||
WorkUuids: []string{workUuid},
|
|
||||||
})
|
|
||||||
removed, delErr := cache.RedisClient.ZRem(modelCast.ScheduledPublishQueueKey, workUuid).Result()
|
|
||||||
if delErr != nil {
|
|
||||||
zap.L().Error("删除定时发布任务失败", zap.Error(delErr), zap.String("work_uuid", workUuid))
|
|
||||||
} else if removed > 0 {
|
|
||||||
publishCount++
|
|
||||||
zap.L().Info("已发布并删除定时发布任务", zap.String("work_uuid", workUuid))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
zap.L().Info("定时发布任务处理完成",
|
|
||||||
zap.Int("published_count", publishCount),
|
|
||||||
zap.Int("expired_count", expiredCount),
|
|
||||||
zap.Int("total_count", len(workList)))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// AyrshareMetricsCollectorTask Ayrshare 指标采集定时任务(每天 00:30 和 12:30 执行)
|
// AyrshareMetricsCollectorTask Ayrshare 指标采集定时任务(每天 00:30 和 12:30 执行)
|
||||||
func AyrshareMetricsCollectorTask() {
|
func AyrshareMetricsCollectorTask() {
|
||||||
serverCast.ExecuteAyrshareMetricsCollector()
|
serverCast.ExecuteAyrshareMetricsCollector()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func RefreshArtistOrderTask() {
|
||||||
|
_, _ = service.CastProvider.Tools(context.Background(), &cast.ToolsReq{Action: "artistOrderInfo"})
|
||||||
|
}
|
||||||
|
|
||||||
|
// UpdateCastTagWatchCountTask 更新标签观看次数的定时任务(每5分钟执行一次)
|
||||||
|
func UpdateCastTagWatchCountTask() {
|
||||||
|
ctx := context.Background()
|
||||||
|
|
||||||
|
// 计算两天前的00:00:00
|
||||||
|
now := time.Now()
|
||||||
|
twoDaysAgo := now.AddDate(0, 0, -2)
|
||||||
|
createdAtStart := time.Date(twoDaysAgo.Year(), twoDaysAgo.Month(), twoDaysAgo.Day(), 0, 0, 0, 0, twoDaysAgo.Location())
|
||||||
|
createdAtEnd := now
|
||||||
|
|
||||||
|
// 格式化时间字符串:2026-01-01 00:00:00
|
||||||
|
createdAtStartStr := createdAtStart.Format("2006-01-02 15:04:05")
|
||||||
|
createdAtEndStr := createdAtEnd.Format("2006-01-02 15:04:05")
|
||||||
|
|
||||||
|
// 调用 ListCastTags 接口,筛选 IsWatchCountCalled = 2 的数据
|
||||||
|
listReq := &cast.ListCastTagsReq{
|
||||||
|
CreatedAtStart: createdAtStartStr,
|
||||||
|
CreatedAtEnd: createdAtEndStr,
|
||||||
|
IsWatchCountCalled: 2, // 2表示未调用
|
||||||
|
Page: 1,
|
||||||
|
PageSize: 10,
|
||||||
|
}
|
||||||
|
|
||||||
|
listResp, err := service.CastProvider.ListCastTags(ctx, listReq)
|
||||||
|
if err != nil {
|
||||||
|
zap.L().Error("获取标签列表失败", zap.Error(err))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if listResp.Data == nil || len(listResp.Data) == 0 {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
zap.L().Info("获取到需要更新的标签", zap.Int("count", len(listResp.Data)))
|
||||||
|
|
||||||
|
// 获取有效的 profileKey
|
||||||
|
profileKey, err := serverCast.GetValidProfileKey(ctx, []uint32{1})
|
||||||
|
if err != nil {
|
||||||
|
zap.L().Error("获取有效profileKey失败", zap.Error(err))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 准备批量更新的数据
|
||||||
|
updateData := make([]*cast.CastTagInfo, 0, len(listResp.Data))
|
||||||
|
|
||||||
|
// 遍历每个标签,调用 RecommendHashtags 接口
|
||||||
|
for _, tag := range listResp.Data {
|
||||||
|
if tag.HashTag == "" {
|
||||||
|
zap.L().Warn("标签HashTag为空,跳过", zap.String("uuid", tag.Uuid))
|
||||||
|
// 即使HashTag为空,也要更新IsWatchCountCalled为1
|
||||||
|
updateData = append(updateData, &cast.CastTagInfo{
|
||||||
|
Uuid: tag.Uuid,
|
||||||
|
WatchCount: 1,
|
||||||
|
IsWatchCountCalled: 1,
|
||||||
|
})
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
// 调用 RecommendHashtags 接口
|
||||||
|
recommendReq := &aryshare.RecommendHashtagsRequest{
|
||||||
|
Keyword: tag.HashTag,
|
||||||
|
ProfileKey: profileKey,
|
||||||
|
}
|
||||||
|
|
||||||
|
recommendResp, err := service.AyrshareProvider.RecommendHashtags(ctx, recommendReq)
|
||||||
|
if err != nil {
|
||||||
|
zap.L().Error("调用RecommendHashtags接口失败",
|
||||||
|
zap.String("hashTag", tag.HashTag),
|
||||||
|
zap.String("uuid", tag.Uuid),
|
||||||
|
zap.Error(err))
|
||||||
|
// 调用失败时,将WatchCount更新为1,IsWatchCountCalled更新为1
|
||||||
|
updateData = append(updateData, &cast.CastTagInfo{
|
||||||
|
Uuid: tag.Uuid,
|
||||||
|
WatchCount: 1,
|
||||||
|
IsWatchCountCalled: 1,
|
||||||
|
})
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
// 对比返回结果,查找完全一致的标签
|
||||||
|
var matchedViewCount int64 = 0
|
||||||
|
if recommendResp.Recommendations != nil {
|
||||||
|
for _, recommendation := range recommendResp.Recommendations {
|
||||||
|
// 完全一致匹配(不区分大小写)
|
||||||
|
if strings.EqualFold(recommendation.Name, tag.HashTag) {
|
||||||
|
matchedViewCount = recommendation.ViewCount
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 根据匹配结果更新WatchCount
|
||||||
|
var watchCount int32 = 1
|
||||||
|
if matchedViewCount > 0 {
|
||||||
|
watchCount = int32(matchedViewCount)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 添加到更新列表
|
||||||
|
updateData = append(updateData, &cast.CastTagInfo{
|
||||||
|
Uuid: tag.Uuid,
|
||||||
|
WatchCount: watchCount,
|
||||||
|
IsWatchCountCalled: 1,
|
||||||
|
})
|
||||||
|
|
||||||
|
zap.L().Debug("处理标签完成",
|
||||||
|
zap.String("hashTag", tag.HashTag),
|
||||||
|
zap.String("uuid", tag.Uuid),
|
||||||
|
zap.Int64("matchedViewCount", matchedViewCount),
|
||||||
|
zap.Int32("watchCount", watchCount))
|
||||||
|
}
|
||||||
|
|
||||||
|
// 如果没有需要更新的数据,直接返回
|
||||||
|
if len(updateData) == 0 {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 批量更新标签
|
||||||
|
batchUpdateReq := &cast.BatchUpdateCastTagsReq{
|
||||||
|
Data: updateData,
|
||||||
|
}
|
||||||
|
|
||||||
|
_, err = service.CastProvider.BatchUpdateCastTags(ctx, batchUpdateReq)
|
||||||
|
if err != nil {
|
||||||
|
zap.L().Error("批量更新标签失败", zap.Error(err), zap.Int("count", len(updateData)))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@ -79,7 +79,7 @@ func (w *Work) ExportExcelWorkList(data []*cast.WorkListResp_Info) (*excelize.Fi
|
|||||||
info.Remark,
|
info.Remark,
|
||||||
mediaAccountNames,
|
mediaAccountNames,
|
||||||
managerNames,
|
managerNames,
|
||||||
info.Status1Time,
|
info.SubmitTime,
|
||||||
info.Status4Time,
|
info.Status4Time,
|
||||||
info.Status9Time,
|
info.Status9Time,
|
||||||
info.Status6Time,
|
info.Status6Time,
|
||||||
|
|||||||
182
pkg/logic/supplier.go
Normal file
182
pkg/logic/supplier.go
Normal file
@ -0,0 +1,182 @@
|
|||||||
|
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"`
|
||||||
|
ConnectedParty string `json:"connectedParty"`
|
||||||
|
}
|
||||||
|
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",
|
||||||
|
"*是否关联方/Connected party": "connectedParty",
|
||||||
|
}
|
||||||
|
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
|
||||||
|
case "connectedParty":
|
||||||
|
temp.ConnectedParty = 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")
|
||||||
|
}
|
||||||
@ -69,6 +69,8 @@ func CheckLogin(provider *api.AccountFieeClientImpl) gin.HandlerFunc {
|
|||||||
Domain: infoRes.Domain,
|
Domain: infoRes.Domain,
|
||||||
TelNum: jwt.Phone,
|
TelNum: jwt.Phone,
|
||||||
SubscriberNumber: infoRes.SubscriberNumber,
|
SubscriberNumber: infoRes.SubscriberNumber,
|
||||||
|
IdNumber: infoRes.IdNumber,
|
||||||
|
InviterID: infoRes.InviterId,
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx.Set("jwtInfo", loginInfo)
|
ctx.Set("jwtInfo", loginInfo)
|
||||||
@ -161,6 +163,7 @@ func CheckWebLogin(provider *account.AccountClientImpl) gin.HandlerFunc {
|
|||||||
Domain: info.Domain,
|
Domain: info.Domain,
|
||||||
ID: info.ID,
|
ID: info.ID,
|
||||||
Name: info.NickName,
|
Name: info.NickName,
|
||||||
|
//Account: info.Account,
|
||||||
//NickName: info.NickName,
|
//NickName: info.NickName,
|
||||||
//PositionUsers: qres.PositionUsers,
|
//PositionUsers: qres.PositionUsers,
|
||||||
//Extend: infoRes.Info.Extend,
|
//Extend: infoRes.Info.Extend,
|
||||||
|
|||||||
@ -13,7 +13,6 @@ type UserWorkAnalysisConfirmReq struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type GetBundleBalanceListResp struct {
|
type GetBundleBalanceListResp struct {
|
||||||
|
|
||||||
Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total"`
|
Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total"`
|
||||||
Data []*BundleBalanceItem `protobuf:"bytes,2,rep,name=data,proto3" json:"data"`
|
Data []*BundleBalanceItem `protobuf:"bytes,2,rep,name=data,proto3" json:"data"`
|
||||||
}
|
}
|
||||||
@ -33,6 +32,8 @@ type BundleBalanceItem struct {
|
|||||||
ImageConsumptionNumber int32 `protobuf:"varint,12,opt,name=imageConsumptionNumber,proto3" json:"imageConsumptionNumber"`
|
ImageConsumptionNumber int32 `protobuf:"varint,12,opt,name=imageConsumptionNumber,proto3" json:"imageConsumptionNumber"`
|
||||||
DataAnalysisNumber int32 `protobuf:"varint,13,opt,name=dataAnalysisNumber,proto3" json:"dataAnalysisNumber"`
|
DataAnalysisNumber int32 `protobuf:"varint,13,opt,name=dataAnalysisNumber,proto3" json:"dataAnalysisNumber"`
|
||||||
DataAnalysisConsumptionNumber int32 `protobuf:"varint,14,opt,name=dataAnalysisConsumptionNumber,proto3" json:"dataAnalysisConsumptionNumber"`
|
DataAnalysisConsumptionNumber int32 `protobuf:"varint,14,opt,name=dataAnalysisConsumptionNumber,proto3" json:"dataAnalysisConsumptionNumber"`
|
||||||
ExpansionPacksNumber int32 `protobuf:"varint,15,opt,name=expansionPacksNumber,proto3" json:"expansionPacksNumber"`
|
CompetitiveNumber int32 `protobuf:"varint,15,opt,name=competitiveNumber,proto3" json:"competitiveNumber"`
|
||||||
Bought int32 `protobuf:"varint,16,opt,name=bought,proto3" json:"bought"`
|
CompetitiveConsumptionNumber int32 `protobuf:"varint,16,opt,name=competitiveConsumptionNumber,proto3" json:"competitiveConsumptionNumber"`
|
||||||
|
ExpansionPacksNumber int32 `protobuf:"varint,17,opt,name=expansionPacksNumber,proto3" json:"expansionPacksNumber"`
|
||||||
|
Bought int32 `protobuf:"varint,18,opt,name=bought,proto3" json:"bought"`
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,8 +1,10 @@
|
|||||||
package cast
|
package cast
|
||||||
|
|
||||||
type SendMessageReq struct {
|
type SendMessageReq struct {
|
||||||
MediaUserID string `json:"mediaUserId"`
|
MediaAccountUuid string `json:"mediaAccountUuid"`
|
||||||
Message string `json:"message"`
|
Message string `json:"message"`
|
||||||
|
RecipientId string `json:"recipientId"`
|
||||||
|
PlatformID uint32 `json:"platformID"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type PostCommentReq struct {
|
type PostCommentReq struct {
|
||||||
|
|||||||
@ -8,10 +8,11 @@ type SyncAsProfileReq struct {
|
|||||||
|
|
||||||
// 定义枚举值
|
// 定义枚举值
|
||||||
const (
|
const (
|
||||||
BalanceTypeAccountValue BalanceTypeEnum = 1
|
BalanceTypeAccountValue BalanceTypeEnum = 1 //账号
|
||||||
BalanceTypeImageValue BalanceTypeEnum = 2
|
BalanceTypeImageValue BalanceTypeEnum = 2 //图文
|
||||||
BalanceTypeVideoValue BalanceTypeEnum = 3
|
BalanceTypeVideoValue BalanceTypeEnum = 3 //视频
|
||||||
BalanceTypeDataValue BalanceTypeEnum = 4
|
BalanceTypeDataValue BalanceTypeEnum = 4 //数据分析
|
||||||
|
BalanceTypeCompetitiveValue BalanceTypeEnum = 5 //竞品数
|
||||||
)
|
)
|
||||||
|
|
||||||
var PlatformNameKv = map[uint32]string{
|
var PlatformNameKv = map[uint32]string{
|
||||||
|
|||||||
13
pkg/model/cast/task.go
Normal file
13
pkg/model/cast/task.go
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
package cast
|
||||||
|
|
||||||
|
type PublishTaskDto struct {
|
||||||
|
WorkUuids []string
|
||||||
|
MediaAccountUuids []string
|
||||||
|
PlatformIds []string
|
||||||
|
}
|
||||||
|
|
||||||
|
var TaskActionName = map[string]string{
|
||||||
|
"importWorkBatch": "批量导入图文",
|
||||||
|
"publishBatch1": "批量发布",
|
||||||
|
"publishBatch2": "多账号同步",
|
||||||
|
}
|
||||||
@ -13,12 +13,19 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
AutoConfirmQueueKey = "auto_confirm:queue"
|
||||||
|
AutoConfirmLockKey = "auto_confirm:lock:%s"
|
||||||
|
WorkPublishQueueKey = "work:publish:queue"
|
||||||
|
ScheduledPublishQueueKey = "scheduled:publish:queue" // 定时发布队列
|
||||||
|
|
||||||
AutoConfirmAnalysisQueueKey = "auto_confirm:analysis:queue"
|
AutoConfirmAnalysisQueueKey = "auto_confirm:analysis:queue"
|
||||||
AutoConfirmAnalysisLockKey = "auto_confirm:analysis:lock:%s"
|
AutoConfirmAnalysisLockKey = "auto_confirm:analysis:lock:%s"
|
||||||
AutoConfirmQueueKey = "auto_confirm:queue"
|
|
||||||
AutoConfirmLockKey = "auto_confirm:lock:%s"
|
AutoConfirmReportQueueKey = "auto_confirm:report:queue"
|
||||||
WorkPublishQueueKey = "work:publish:queue"
|
AutoConfirmReportLockKey = "auto_confirm:report:lock:%s"
|
||||||
ScheduledPublishQueueKey = "scheduled:publish:queue" // 定时发布队列
|
|
||||||
|
// AyrshareMetricsCollectorLockKey Ayrshare 指标采集任务锁
|
||||||
|
AyrshareMetricsCollectorLockKey = "ayrshare:metrics:collector:lock"
|
||||||
)
|
)
|
||||||
|
|
||||||
var WorkCategoryMM = map[int]string{
|
var WorkCategoryMM = map[int]string{
|
||||||
@ -55,7 +62,7 @@ var WorkStatusMM = map[int]string{
|
|||||||
6: "发布成功",
|
6: "发布成功",
|
||||||
7: "发布失败",
|
7: "发布失败",
|
||||||
8: "未知",
|
8: "未知",
|
||||||
9: "验证确认",
|
9: "验收确认",
|
||||||
}
|
}
|
||||||
var ConfirmTypeMM = map[int]string{
|
var ConfirmTypeMM = map[int]string{
|
||||||
1: "艺人确认",
|
1: "艺人确认",
|
||||||
|
|||||||
@ -2,6 +2,7 @@ package login
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -27,6 +28,8 @@ type Info struct {
|
|||||||
Domain string `json:"domain"`
|
Domain string `json:"domain"`
|
||||||
TelNum string `json:"telNum"`
|
TelNum string `json:"telNum"`
|
||||||
SubscriberNumber string `json:"subscriberNumber"`
|
SubscriberNumber string `json:"subscriberNumber"`
|
||||||
|
IdNumber string `json:"idNumber"`
|
||||||
|
InviterID uint64 `json:"inviterId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetUserInfoFromC(c *gin.Context) Info {
|
func GetUserInfoFromC(c *gin.Context) Info {
|
||||||
|
|||||||
@ -4,6 +4,7 @@ const (
|
|||||||
DashscopeAPIKey string = "sk-5ae9df5d3bcf4755ad5d12012058a2e7"
|
DashscopeAPIKey string = "sk-5ae9df5d3bcf4755ad5d12012058a2e7"
|
||||||
DashscopeText2ImageURL string = "https://dashscope.aliyuncs.com/api/v1/services/aigc/text2image/image-synthesis"
|
DashscopeText2ImageURL string = "https://dashscope.aliyuncs.com/api/v1/services/aigc/text2image/image-synthesis"
|
||||||
DashscopeEditImageURL string = "https://dashscope.aliyuncs.com/api/v1/services/aigc/image2image/image-synthesis"
|
DashscopeEditImageURL string = "https://dashscope.aliyuncs.com/api/v1/services/aigc/image2image/image-synthesis"
|
||||||
|
DashscopeVLURL string = "https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions"
|
||||||
)
|
)
|
||||||
|
|
||||||
// QwenImageRequest 通义千问文生图请求
|
// QwenImageRequest 通义千问文生图请求
|
||||||
|
|||||||
47
pkg/model/qwen/qwen_vl.go
Normal file
47
pkg/model/qwen/qwen_vl.go
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
package qwen
|
||||||
|
|
||||||
|
// VLContent 视觉多模态内容结构,支持文本、图片和视频
|
||||||
|
type VLContent struct {
|
||||||
|
Type string `json:"type"` // text, image_url, video_url
|
||||||
|
Text string `json:"text,omitempty"` // type=text 时使用
|
||||||
|
ImageURL *ImageURL `json:"image_url,omitempty"` // type=image_url 时使用
|
||||||
|
VideoURL *VideoURL `json:"video_url,omitempty"` // type=video_url 时使用
|
||||||
|
FPS int `json:"fps,omitempty"` // type=video_url 时可选,视频帧率
|
||||||
|
}
|
||||||
|
|
||||||
|
// VideoURL 视频URL结构
|
||||||
|
type VideoURL struct {
|
||||||
|
URL string `json:"url"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// VLRequest 视觉多模态请求结构
|
||||||
|
type VLRequest struct {
|
||||||
|
Model string `json:"model"` // 模型名称,如 qwen3-vl-plus
|
||||||
|
Messages []VLMessage `json:"messages"` // 消息列表
|
||||||
|
Seed int64 `json:"seed,omitempty"` // 随机种子
|
||||||
|
EnableSearch bool `json:"enable_search,omitempty"` // 是否启用搜索
|
||||||
|
}
|
||||||
|
|
||||||
|
// VLMessage 视觉多模态消息结构
|
||||||
|
type VLMessage struct {
|
||||||
|
Role string `json:"role"` // user, assistant, system
|
||||||
|
Content []VLContent `json:"content"` // 内容列表,可包含文本、图片、视频
|
||||||
|
}
|
||||||
|
|
||||||
|
// VLResponse 视觉多模态响应结构
|
||||||
|
type VLResponse struct {
|
||||||
|
Choices []VLChoice `json:"choices"`
|
||||||
|
Model string `json:"model,omitempty"`
|
||||||
|
ID string `json:"id,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// VLChoice 视觉多模态选择结果
|
||||||
|
type VLChoice struct {
|
||||||
|
Message struct {
|
||||||
|
Content string `json:"content"`
|
||||||
|
ReasoningContent string `json:"reasoning_content"`
|
||||||
|
Role string `json:"role"`
|
||||||
|
} `json:"message"`
|
||||||
|
FinishReason string `json:"finish_reason"`
|
||||||
|
Index int `json:"index,omitempty"`
|
||||||
|
}
|
||||||
@ -10,7 +10,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func AnalysisRouter(r *gin.RouterGroup) {
|
func AnalysisRouter(r *gin.RouterGroup) {
|
||||||
r.POST("analysis/trigger-ayrshare-metrics", serviceCast.TriggerAyrshareMetricsCollector)
|
// r.POST("analysis/trigger-ayrshare-metrics", serviceCast.TriggerAyrshareMetricsCollector)
|
||||||
|
|
||||||
analysis := r.Group("analysis")
|
analysis := r.Group("analysis")
|
||||||
analysis.Use(middleware.CheckWebLogin(service.AccountProvider))
|
analysis.Use(middleware.CheckWebLogin(service.AccountProvider))
|
||||||
@ -31,19 +31,43 @@ func AnalysisRouter(r *gin.RouterGroup) {
|
|||||||
analysis.POST("artist-metrics-single", serviceCast.ArtistMetricsDailyWindow) // 艺人指标日窗口
|
analysis.POST("artist-metrics-single", serviceCast.ArtistMetricsDailyWindow) // 艺人指标日窗口
|
||||||
analysis.POST("tobe-confirmed-list", serviceCast.TobeConfirmedList) // 待确认数据列表
|
analysis.POST("tobe-confirmed-list", serviceCast.TobeConfirmedList) // 待确认数据列表
|
||||||
analysis.POST("update-approval-id", serviceCast.UpdateWorkAnalysisApprovalID) // 更新作品分析审批ID
|
analysis.POST("update-approval-id", serviceCast.UpdateWorkAnalysisApprovalID) // 更新作品分析审批ID
|
||||||
// analysis.POST("trigger-ayrshare-metrics", serviceCast.TriggerAyrshareMetricsCollector) // 手动触发 Ayrshare 指标采集任务
|
|
||||||
|
|
||||||
|
analysis.POST("trigger-ayrshare-metrics", serviceCast.TriggerAyrshareMetricsCollector) // 手动触发 Ayrshare 指标采集任务
|
||||||
|
}
|
||||||
|
|
||||||
|
competitiveReport := r.Group("report")
|
||||||
|
competitiveReport.Use(middleware.CheckWebLogin(service.AccountProvider))
|
||||||
|
{
|
||||||
|
competitiveReport.POST("create", serviceCast.CreateCompetitiveReport) // 创建竞品报告
|
||||||
|
competitiveReport.POST("import-batch", serviceCast.ImportCompetitiveReportBatch) // 批量导入竞品报告
|
||||||
|
competitiveReport.POST("update-status", serviceCast.UpdateCompetitiveReportStatus) // 更新竞品报告状态
|
||||||
|
competitiveReport.POST("detail", serviceCast.GetCompetitiveReport) // 获取竞品报告详情
|
||||||
|
competitiveReport.POST("list", serviceCast.ListCompetitiveReport) // 获取竞品报告列表
|
||||||
|
competitiveReport.POST("single-list", serviceCast.ListCompetitiveReportByArtistUuid) // 根据艺人UUID获取竞品报告列表
|
||||||
|
competitiveReport.POST("delete", serviceCast.DeleteCompetitiveReport) // 删除竞品报告
|
||||||
|
competitiveReport.POST("update-approval-id", serviceCast.UpdateCompetitiveReportApprovalID) // 更新竞品报告审批ID
|
||||||
|
competitiveReport.POST("count-by-work-uuids", serviceCast.CountCompetitiveReportByWorkUuids) // 根据作品UUID统计竞品报告数量
|
||||||
|
competitiveReport.POST("export-list", serviceCast.ListCompetitiveReportExport) // 竞品报告列表导出
|
||||||
|
competitiveReport.POST("export-single-list", serviceCast.ListCompetitiveReportSingleExport) // 竞品报告单个列表导出
|
||||||
}
|
}
|
||||||
|
|
||||||
// 员工任务相关路由(需要App登录验证
|
// 员工任务相关路由(需要App登录验证
|
||||||
analysisAppRoute := r.Group("app/analysis")
|
analysisAppRoute := r.Group("app/analysis")
|
||||||
analysisAppRoute.Use(middleware.CheckLogin(service.AccountFieeProvider))
|
analysisAppRoute.Use(middleware.CheckLogin(service.AccountFieeProvider))
|
||||||
{
|
{
|
||||||
analysisAppRoute.POST("list", serviceCast.ListWorkAnalysis) // 作品列表
|
analysisAppRoute.POST("list", serviceCast.ListWorkAnalysisForApp) // 作品列表
|
||||||
analysisAppRoute.POST("detail", serviceCast.GetWorkAnalysis) // 作品分析详情
|
analysisAppRoute.POST("detail", serviceCast.GetWorkAnalysis) // 作品分析详情
|
||||||
analysisAppRoute.POST("update-status", serviceCast.UpdateWorkAnalysisStatus) // 用户确认
|
analysisAppRoute.POST("update-status", serviceCast.UpdateWorkAnalysisStatus) // 用户确认
|
||||||
analysisAppRoute.POST("check-balance", serviceCast.CheckBundleBalance) // 检查套餐余量
|
analysisAppRoute.POST("check-balance", serviceCast.CheckBundleBalance) // 检查套餐余量
|
||||||
analysisAppRoute.POST("tobe-confirmed-list", serviceCast.TobeConfirmedList) // 待确认数据列表
|
analysisAppRoute.POST("tobe-confirmed-list", serviceCast.TobeConfirmedList) // 待确认数据列表
|
||||||
analysisAppRoute.POST("work-analysis-confirm", bundle.WorkAnalysisConfirm)
|
analysisAppRoute.POST("work-analysis-confirm", bundle.WorkAnalysisConfirm)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
competitiveReportAppRoute := r.Group("app/report")
|
||||||
|
competitiveReportAppRoute.Use(middleware.CheckLogin(service.AccountFieeProvider))
|
||||||
|
{
|
||||||
|
competitiveReportAppRoute.POST("detail", serviceCast.GetCompetitiveReportForApp) // 获取竞品报告详情(App端)
|
||||||
|
competitiveReportAppRoute.POST("list", serviceCast.ListReportByArtistUuidForApp) // 根据艺人UUID获取竞品报告列表(App端)
|
||||||
|
competitiveReportAppRoute.POST("update-status", serviceCast.UpdateCompetitiveReportStatus) // 更新竞品报告状态(App端)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,8 +14,13 @@ func BundleRouter(r *gin.RouterGroup) {
|
|||||||
bundleAppRoute := r.Group("bundle")
|
bundleAppRoute := r.Group("bundle")
|
||||||
bundleAppNoAuthRoute := r.Group("bundle")
|
bundleAppNoAuthRoute := r.Group("bundle")
|
||||||
bundleAppRoute.Use(middleware.CheckLogin(service.AccountFieeProvider))
|
bundleAppRoute.Use(middleware.CheckLogin(service.AccountFieeProvider))
|
||||||
|
bundleClientNoAuthRoute := r.Group("bundle/no-auth")
|
||||||
// 套餐
|
// 套餐
|
||||||
{
|
{
|
||||||
|
{
|
||||||
|
bundleClientNoAuthRoute.POST("export/work-cast-info", bundle.ExportWorkCastInfo)
|
||||||
|
bundleClientNoAuthRoute.POST("export/bundle-price-info", bundle.ExportBundlePriceInfo)
|
||||||
|
}
|
||||||
bundleClientRoute := bundleRoute.Group("system")
|
bundleClientRoute := bundleRoute.Group("system")
|
||||||
{
|
{
|
||||||
bundleClientRoute.POST("create", bundle.CreateBundle)
|
bundleClientRoute.POST("create", bundle.CreateBundle)
|
||||||
@ -50,6 +55,7 @@ func BundleRouter(r *gin.RouterGroup) {
|
|||||||
metrics.POST("export/balance-detail", bundle.MetricsBalanceDetailExport)
|
metrics.POST("export/balance-detail", bundle.MetricsBalanceDetailExport)
|
||||||
metrics.POST("export/balance-metrics", bundle.BalanceMetricsExport)
|
metrics.POST("export/balance-metrics", bundle.BalanceMetricsExport)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
bundleClientRouteV2 := bundleRoute.Group("system/v2")
|
bundleClientRouteV2 := bundleRoute.Group("system/v2")
|
||||||
{
|
{
|
||||||
|
|||||||
@ -16,10 +16,12 @@ func BundleOrderRouter(r *gin.RouterGroup) {
|
|||||||
bundleOrderRoute := r.Group("bundle-order")
|
bundleOrderRoute := r.Group("bundle-order")
|
||||||
bundleOrderRoute.Use(middleware.CheckLogin(service.AccountFieeProvider))
|
bundleOrderRoute.Use(middleware.CheckLogin(service.AccountFieeProvider))
|
||||||
bundleOrderWebRoute := r.Group("bundle-order")
|
bundleOrderWebRoute := r.Group("bundle-order")
|
||||||
|
bundleOrderWebRoute.POST("password-free/bundle-order-list-download", bundle.OrderRecordsListPasswordFreeDownload)
|
||||||
bundleOrderWebRoute.Use(middleware.CheckWebLogin(service.AccountProvider))
|
bundleOrderWebRoute.Use(middleware.CheckWebLogin(service.AccountProvider))
|
||||||
|
bundleOrderNoAuthRoute := r.Group("bundle-order")
|
||||||
// 套餐
|
// 套餐
|
||||||
{
|
{
|
||||||
|
bundleOrderNoAuthRoute.POST("common/web/no-auth/reconciliation-list-download", bundle.GetReconciliationListDownload)
|
||||||
bundleOrderClientWebRoute := bundleOrderWebRoute.Group("common/web")
|
bundleOrderClientWebRoute := bundleOrderWebRoute.Group("common/web")
|
||||||
{
|
{
|
||||||
bundleOrderClientWebRoute.POST("bundle-order-list", bundle.OrderRecordsList)
|
bundleOrderClientWebRoute.POST("bundle-order-list", bundle.OrderRecordsList)
|
||||||
@ -45,6 +47,8 @@ func BundleOrderRouter(r *gin.RouterGroup) {
|
|||||||
bundleOrderAppRoute := bundleOrderRoute.Group("app")
|
bundleOrderAppRoute := bundleOrderRoute.Group("app")
|
||||||
{
|
{
|
||||||
bundleOrderAppRoute.POST("order-signature", bundle.CreateBundleOrderSignature)
|
bundleOrderAppRoute.POST("order-signature", bundle.CreateBundleOrderSignature)
|
||||||
|
bundleOrderAppRoute.POST("verification-signature", bundle.VerificationSignature) //校验签署
|
||||||
|
bundleOrderAppRoute.POST("restart-signature", bundle.RestartSignature) //重新签署
|
||||||
//bundleOrderAppRoute.POST("order-add-signature", bundle.CreateBundleOrderAddSignature)
|
//bundleOrderAppRoute.POST("order-add-signature", bundle.CreateBundleOrderAddSignature)
|
||||||
bundleOrderAppRoute.POST("order-del", bundle.DeleteBundleOrder)
|
bundleOrderAppRoute.POST("order-del", bundle.DeleteBundleOrder)
|
||||||
bundleOrderAppRoute.POST("update-pay", bundle.UpdateBundleOrderStatusPaid)
|
bundleOrderAppRoute.POST("update-pay", bundle.UpdateBundleOrderStatusPaid)
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
package router
|
package router
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fonchain-fiee/pkg/middleware"
|
||||||
|
"fonchain-fiee/pkg/service"
|
||||||
cronService "fonchain-fiee/pkg/service/cron"
|
cronService "fonchain-fiee/pkg/service/cron"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
@ -8,7 +10,7 @@ import (
|
|||||||
|
|
||||||
func cronRouter(r *gin.RouterGroup) {
|
func cronRouter(r *gin.RouterGroup) {
|
||||||
auth := r.Group("")
|
auth := r.Group("")
|
||||||
//auth.Use(middleware.CheckWebLogin(service.AccountProvider))
|
auth.Use(middleware.CheckWebLogin(service.AccountProvider))
|
||||||
cron := auth.Group("cron")
|
cron := auth.Group("cron")
|
||||||
{
|
{
|
||||||
cron.POST("createScheduleTask", cronService.CreateScheduleTask)
|
cron.POST("createScheduleTask", cronService.CreateScheduleTask)
|
||||||
@ -21,6 +23,7 @@ func cronRouter(r *gin.RouterGroup) {
|
|||||||
cron.POST("exportExcelExecutionResult", cronService.ExportExcelExecutionResult)
|
cron.POST("exportExcelExecutionResult", cronService.ExportExcelExecutionResult)
|
||||||
cron.POST("getListExecutionRecord", cronService.GetListExecutionRecord)
|
cron.POST("getListExecutionRecord", cronService.GetListExecutionRecord)
|
||||||
cron.POST("getScheduleTaskStatus", cronService.GetScheduleTaskStatus)
|
cron.POST("getScheduleTaskStatus", cronService.GetScheduleTaskStatus)
|
||||||
|
cron.POST("getImportData", cronService.GetImportData)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -47,6 +47,7 @@ func MediaRouter(r *gin.RouterGroup) {
|
|||||||
work.POST("remind", serviceCast.Remind)
|
work.POST("remind", serviceCast.Remind)
|
||||||
work.POST("publish-info", serviceCast.PublishInfo)
|
work.POST("publish-info", serviceCast.PublishInfo)
|
||||||
work.POST("import-batch", serviceCast.ImportWorkBatch)
|
work.POST("import-batch", serviceCast.ImportWorkBatch)
|
||||||
|
work.POST("list-published", serviceCast.WorkListPublished)
|
||||||
}
|
}
|
||||||
|
|
||||||
script := auth.Group("script")
|
script := auth.Group("script")
|
||||||
@ -62,6 +63,8 @@ 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)
|
||||||
|
task.POST("download", serviceCast.DownloadTaskFile)
|
||||||
}
|
}
|
||||||
|
|
||||||
layout := auth.Group("layout")
|
layout := auth.Group("layout")
|
||||||
@ -79,16 +82,30 @@ func MediaRouter(r *gin.RouterGroup) {
|
|||||||
prompt.POST("delete", serviceCast.DeletePrompt)
|
prompt.POST("delete", serviceCast.DeletePrompt)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tag := auth.Group("tag")
|
||||||
|
{
|
||||||
|
tag.POST("update", serviceCast.UpdateCastTag)
|
||||||
|
tag.POST("list", serviceCast.ListCastTags)
|
||||||
|
tag.POST("import-batch", serviceCast.ImportTagBatch)
|
||||||
|
tag.POST("recalculate-quote-count", serviceCast.RecalculateCastTagQuoteCount)
|
||||||
|
// tag.POST("auto-hashtags", serviceCast.AutoHashtags)
|
||||||
|
// 这两个接口需要关闭ins,通过facebook授权
|
||||||
|
// tag.POST("recommend-hashtags", serviceCast.RecommendHashtags)
|
||||||
|
// tag.POST("search-hashtags", serviceCast.SearchHashtags)
|
||||||
|
}
|
||||||
|
|
||||||
//AI 生图
|
//AI 生图
|
||||||
aiNoAuth := noAuth.Group("ai")
|
aiNoAuth := noAuth.Group("ai")
|
||||||
{
|
{
|
||||||
aiNoAuth.POST("image-generate", serviceAI.AIImageGenerate)
|
aiNoAuth.POST("image-generate", serviceAI.AIImageGenerate)
|
||||||
aiNoAuth.POST("text-generate", serviceAI.AIChat)
|
aiNoAuth.POST("text-generate", serviceAI.AIChat)
|
||||||
|
aiNoAuth.POST("video-vl", serviceAI.AIVideoVL)
|
||||||
}
|
}
|
||||||
aiAuth := auth.Group("ai")
|
aiAuth := auth.Group("ai")
|
||||||
{
|
{
|
||||||
aiAuth.POST("one-text", serviceAI.OneText)
|
aiAuth.POST("one-text", serviceAI.OneText)
|
||||||
aiAuth.POST("more-text", serviceAI.MoreText)
|
aiAuth.POST("more-text", serviceAI.MoreText)
|
||||||
|
aiAuth.POST("generate-report", serviceAI.AICompetitorReport)
|
||||||
}
|
}
|
||||||
|
|
||||||
social := noAuth.Group("social")
|
social := noAuth.Group("social")
|
||||||
|
|||||||
@ -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"
|
||||||
emailAlert "fonchain-fiee/pkg/service/emailAlerts"
|
emailAlert "fonchain-fiee/pkg/service/emailAlerts"
|
||||||
"fonchain-fiee/pkg/service/file"
|
"fonchain-fiee/pkg/service/file"
|
||||||
"fonchain-fiee/pkg/service/governance"
|
"fonchain-fiee/pkg/service/governance"
|
||||||
@ -60,6 +61,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) //版本号公共
|
||||||
}
|
}
|
||||||
@ -72,6 +74,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))
|
||||||
{
|
{
|
||||||
@ -79,6 +82,7 @@ func NewRouter() *gin.Engine {
|
|||||||
acRoute.POST("info", account.UserInfo) //用户详情
|
acRoute.POST("info", account.UserInfo) //用户详情
|
||||||
acRoute.POST("update", account.UserUpdate) //用户更新
|
acRoute.POST("update", account.UserUpdate) //用户更新
|
||||||
acRoute.POST("ocr", account.CheckIdOcr) //
|
acRoute.POST("ocr", account.CheckIdOcr) //
|
||||||
|
acRoute.POST("write/off", account.WriteOff) //
|
||||||
}
|
}
|
||||||
webAcRouter := privateGroup.Group("/user")
|
webAcRouter := privateGroup.Group("/user")
|
||||||
//webAcRouter.Use(middleware.CheckWebLogin(service.AccountProvider))
|
//webAcRouter.Use(middleware.CheckWebLogin(service.AccountProvider))
|
||||||
@ -86,6 +90,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下载
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -180,11 +185,13 @@ func NewRouter() *gin.Engine {
|
|||||||
governanceRoute := v1.Group("/governance")
|
governanceRoute := v1.Group("/governance")
|
||||||
governanceRouteLogin := governanceRoute.Group("", middleware.CheckWebLogin(service.AccountProvider))
|
governanceRouteLogin := governanceRoute.Group("", middleware.CheckWebLogin(service.AccountProvider))
|
||||||
|
|
||||||
governanceRoute.GET("/display", middleware.Cors(), governance.Display)
|
governanceRoute.POST("/display", middleware.Cors(), governance.Display)
|
||||||
governanceRouteLogin.POST("/list", governance.List)
|
governanceRouteLogin.POST("/list", governance.List)
|
||||||
governanceRouteLogin.POST("", governance.Create)
|
governanceRouteLogin.POST("", governance.Create)
|
||||||
governanceRouteLogin.POST("/edit", governance.Edit)
|
governanceRouteLogin.POST("/edit", governance.Edit)
|
||||||
governanceRouteLogin.POST("/delete", governance.Delete)
|
governanceRouteLogin.POST("/delete", governance.Delete)
|
||||||
|
governanceRouteLogin.POST("/updataStatus", governance.UpdataStatus)
|
||||||
|
governanceRouteLogin.POST("/getGovernanceInfo", governance.GetGovernanceInfo)
|
||||||
|
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
@ -278,6 +285,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
35
pkg/router/supplier.go
Normal 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)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -16,28 +16,22 @@ func TaskBenchRouter(r *gin.RouterGroup) {
|
|||||||
taskBenchRoute.Use(middleware.CheckWebLogin(service.AccountProvider))
|
taskBenchRoute.Use(middleware.CheckWebLogin(service.AccountProvider))
|
||||||
// 任务台管理
|
// 任务台管理
|
||||||
{
|
{
|
||||||
// 查询待指派任务记录
|
|
||||||
taskBenchRoute.POST("pending-task-list", taskbench.GetPendingTaskList)
|
|
||||||
|
|
||||||
// 待指派任务布局
|
// 待指派任务布局
|
||||||
taskBenchRoute.POST("pending-task-layout", taskbench.GetPendingTaskLayout)
|
taskBenchRoute.POST("pending-task-layout", taskbench.GetPendingTaskLayout)
|
||||||
taskBenchRoute.POST("set-pending-task-layout", taskbench.SetPendingTaskLayout)
|
taskBenchRoute.POST("set-pending-task-layout", taskbench.SetPendingTaskLayout)
|
||||||
|
|
||||||
// 指派某位员工完成某个艺人的任务
|
// 指派
|
||||||
taskBenchRoute.POST("assign-task", taskbench.AssignTask)
|
taskBenchRoute.POST("assign-task", taskbench.AssignTask)
|
||||||
|
|
||||||
// 批量指派任务
|
// 批量指派
|
||||||
taskBenchRoute.POST("batch-assign-task", taskbench.BatchAssignTask)
|
taskBenchRoute.POST("batch-assign-task", taskbench.BatchAssignTask)
|
||||||
|
|
||||||
// 中止指派任务(根据任务指派记录UUID)
|
// 中止指派
|
||||||
taskBenchRoute.POST("terminate-task-by-uuid", taskbench.TerminateTaskByUUID)
|
taskBenchRoute.POST("terminate-task-by-uuid", taskbench.TerminateTaskByUUID)
|
||||||
|
|
||||||
// 批量中止指派任务(根据多个任务指派记录UUID)
|
// 批量中止指派
|
||||||
taskBenchRoute.POST("batch-terminate-task", taskbench.BatchTerminateTask)
|
taskBenchRoute.POST("batch-terminate-task", taskbench.BatchTerminateTask)
|
||||||
|
|
||||||
// 修改待发数量
|
|
||||||
taskBenchRoute.POST("update-pending-count", taskbench.UpdatePendingCount)
|
|
||||||
|
|
||||||
// 查询最近被指派记录
|
// 查询最近被指派记录
|
||||||
taskBenchRoute.POST("recent-assign-records", taskbench.GetRecentAssignRecords)
|
taskBenchRoute.POST("recent-assign-records", taskbench.GetRecentAssignRecords)
|
||||||
|
|
||||||
@ -62,12 +56,6 @@ func TaskBenchRouter(r *gin.RouterGroup) {
|
|||||||
// 员工手动点击完成任务
|
// 员工手动点击完成任务
|
||||||
taskBenchRoute.POST("complete-manually", taskbench.CompleteTaskManually)
|
taskBenchRoute.POST("complete-manually", taskbench.CompleteTaskManually)
|
||||||
|
|
||||||
// 查询艺人套餐剩余数量
|
|
||||||
taskBenchRoute.POST("artist-bundle-balance", taskbench.GetArtistBundleBalance)
|
|
||||||
|
|
||||||
// 批量查询艺人待上传数量
|
|
||||||
taskBenchRoute.POST("batch-get-pending-upload", taskbench.GetPendingUploadBreakdown)
|
|
||||||
|
|
||||||
// 查询艺人待上传列表
|
// 查询艺人待上传列表
|
||||||
taskBenchRoute.POST("pending-upload-list", taskbench.GetArtistUploadStatsList)
|
taskBenchRoute.POST("pending-upload-list", taskbench.GetArtistUploadStatsList)
|
||||||
|
|
||||||
@ -81,12 +69,4 @@ func TaskBenchRouter(r *gin.RouterGroup) {
|
|||||||
taskBenchRoute.POST("pending-data-list", taskbench.GetPendingAssign)
|
taskBenchRoute.POST("pending-data-list", taskbench.GetPendingAssign)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 员工任务相关路由(需要App登录验证)
|
|
||||||
taskBenchAppRoute := r.Group("task-bench")
|
|
||||||
taskBenchAppRoute.Use(middleware.CheckLogin(service.AccountFieeProvider))
|
|
||||||
|
|
||||||
{
|
|
||||||
// 员工实际完成任务状态更新
|
|
||||||
taskBenchAppRoute.POST("update-progress", taskbench.UpdateTaskProgress)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -36,7 +36,7 @@ func UserExcelDownload(c *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
titleList := []string{
|
titleList := []string{
|
||||||
"用户编号", "姓名", "性别", "国籍", "手机号", "证件类型", "有效期至", "证件号码", "出生日期", "年龄", "现所在地", "注册时间", "审核时间", "审核状态", "不通过备注",
|
"用户编号", "姓名", "性别", "国籍", "手机号", "证件类型", "有效期至", "证件号码", "出生日期", "年龄", "现所在地", "注册时间", "审核时间", "审核状态", "不通过备注", "非大陆手机号", "邮箱",
|
||||||
}
|
}
|
||||||
var dataList []interface{}
|
var dataList []interface{}
|
||||||
|
|
||||||
@ -59,6 +59,8 @@ func UserExcelDownload(c *gin.Context) {
|
|||||||
i.AuditTime,
|
i.AuditTime,
|
||||||
Status,
|
Status,
|
||||||
i.NotPassRemarks,
|
i.NotPassRemarks,
|
||||||
|
i.AbroadTelAreaCode + i.AbroadTel,
|
||||||
|
i.Email,
|
||||||
}
|
}
|
||||||
dataList = append(dataList, &data)
|
dataList = append(dataList, &data)
|
||||||
}
|
}
|
||||||
@ -126,10 +128,41 @@ func UserUpdate(c *gin.Context) {
|
|||||||
req.ID = user.ID
|
req.ID = user.ID
|
||||||
req.Domain = user.Domain
|
req.Domain = user.Domain
|
||||||
res, err := service.AccountFieeProvider.Update(c, &account.UpdateRequest{
|
res, err := service.AccountFieeProvider.Update(c, &account.UpdateRequest{
|
||||||
ID: req.ID,
|
ID: req.ID,
|
||||||
Domain: req.Domain,
|
Domain: req.Domain,
|
||||||
Language: req.Language,
|
Language: req.Language,
|
||||||
NickName: req.NickName,
|
NickName: req.NickName,
|
||||||
|
Email: req.Email,
|
||||||
|
AbroadTel: req.AbroadTel,
|
||||||
|
AbroadTelAreaCode: req.AbroadTelAreaCode,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
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)
|
||||||
@ -157,6 +190,26 @@ func CheckIdOcr(c *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func WriteOff(c *gin.Context) {
|
||||||
|
|
||||||
|
var req account.WriteOffRequest
|
||||||
|
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
|
||||||
|
service.Error(c, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
user := login.GetUserInfoFromC(c)
|
||||||
|
|
||||||
|
res, err := service.AccountFieeProvider.WriteOff(c, &account.WriteOffRequest{
|
||||||
|
Id: user.ID,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
service.Error(c, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
service.Success(c, res)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取身份证OCR识别结果
|
* 获取身份证OCR识别结果
|
||||||
* @param realIDImgA string - 身份证图片的URL地址
|
* @param realIDImgA string - 身份证图片的URL地址
|
||||||
@ -241,6 +294,11 @@ func SendMsg(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
req.Project = "fiee"
|
req.Project = "fiee"
|
||||||
req.TelNum = req.Zone + req.TelNum
|
req.TelNum = req.Zone + req.TelNum
|
||||||
|
//todo 审核使用账号
|
||||||
|
if req.TelNum == "8618888888888" {
|
||||||
|
service.Success1(c, "发送成功", &account.SendMsgStatusResponse{})
|
||||||
|
return
|
||||||
|
}
|
||||||
if req.Zone != e.ZoneCn && req.Zone != "" {
|
if req.Zone != e.ZoneCn && req.Zone != "" {
|
||||||
// ============================== redis检查ip开始
|
// ============================== redis检查ip开始
|
||||||
ip := c.ClientIP()
|
ip := c.ClientIP()
|
||||||
@ -285,7 +343,6 @@ func SendMsg(c *gin.Context) {
|
|||||||
//cache.RedisClient.Incr(daykey)
|
//cache.RedisClient.Incr(daykey)
|
||||||
//cache.RedisClient.Incr(minutekey)
|
//cache.RedisClient.Incr(minutekey)
|
||||||
// ============================== redis检查ip结束
|
// ============================== redis检查ip结束
|
||||||
|
|
||||||
tempReq := &account.SendNationMsgRequest{
|
tempReq := &account.SendNationMsgRequest{
|
||||||
Domain: req.Domain,
|
Domain: req.Domain,
|
||||||
TelNum: req.TelNum,
|
TelNum: req.TelNum,
|
||||||
@ -409,6 +466,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 +510,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)
|
||||||
@ -443,6 +535,10 @@ func UserRegister(c *gin.Context) {
|
|||||||
service.Error(c, err)
|
service.Error(c, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if tokenInfo.AccountInfo.WriteOff == true {
|
||||||
|
service.Error(c, errors.New("此账号已注销,无法登录"))
|
||||||
|
return
|
||||||
|
}
|
||||||
res.Token = tokenInfo.Token
|
res.Token = tokenInfo.Token
|
||||||
service.Success(c, res)
|
service.Success(c, res)
|
||||||
return
|
return
|
||||||
|
|||||||
277
pkg/service/ai/video_vl.go
Normal file
277
pkg/service/ai/video_vl.go
Normal file
@ -0,0 +1,277 @@
|
|||||||
|
package ai
|
||||||
|
|
||||||
|
import (
|
||||||
|
"errors"
|
||||||
|
"fmt"
|
||||||
|
"fonchain-fiee/pkg/common/qwen"
|
||||||
|
"fonchain-fiee/pkg/service"
|
||||||
|
"strings"
|
||||||
|
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
|
)
|
||||||
|
|
||||||
|
// VideoVLRequest 视频/图片理解请求参数
|
||||||
|
type VideoVLRequest struct {
|
||||||
|
Videos []string `json:"videos"` // 视频URL列表
|
||||||
|
Images []string `json:"images"` // 图片URL列表
|
||||||
|
Text string `json:"text"` // 可选的文本提示
|
||||||
|
Model string `json:"model"` // 可选的模型名称,默认使用 qwen3-vl-plus
|
||||||
|
}
|
||||||
|
|
||||||
|
// AIVideoVL AI理解视频/图片接口
|
||||||
|
func AIVideoVL(ctx *gin.Context) {
|
||||||
|
var req VideoVLRequest
|
||||||
|
if err := ctx.ShouldBindJSON(&req); err != nil {
|
||||||
|
service.Error(ctx, errors.New("参数错误"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查是否至少提供了视频或图片
|
||||||
|
if len(req.Videos) == 0 && len(req.Images) == 0 {
|
||||||
|
service.Error(ctx, errors.New("至少需要提供一个视频或图片"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(req.Videos) > 1 {
|
||||||
|
service.Error(ctx, errors.New("当前只能选一个视频"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
Prompt := "请你详细描述视频和图片中的内容分别是什么"
|
||||||
|
|
||||||
|
// 调用VL函数进行AI理解
|
||||||
|
result, err := qwen.VL(req.Videos, req.Images, Prompt, req.Model)
|
||||||
|
if err != nil {
|
||||||
|
// 检查是否是文件下载超时错误(内容过大)
|
||||||
|
errMsg := err.Error()
|
||||||
|
if contains(errMsg, "Download multimodal file timed out") || contains(errMsg, "timed out") {
|
||||||
|
service.Error(ctx, errors.New("内容过大,请重新选择"))
|
||||||
|
} else {
|
||||||
|
service.Error(ctx, errors.New("ai分析帖子内容失败"))
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 返回AI返回的数据
|
||||||
|
service.Success(ctx, result)
|
||||||
|
}
|
||||||
|
|
||||||
|
// contains 检查字符串是否包含子字符串(不区分大小写)
|
||||||
|
func contains(s, substr string) bool {
|
||||||
|
return strings.Contains(strings.ToLower(s), strings.ToLower(substr))
|
||||||
|
}
|
||||||
|
|
||||||
|
// CompetitorReportRequest 竞品报告请求参数
|
||||||
|
type CompetitorReportRequest struct {
|
||||||
|
Videos []string `json:"videos"` // 视频URL列表
|
||||||
|
Images []string `json:"images"` // 图片URL列表
|
||||||
|
TextPrompt string `json:"textPrompt"` // 竞品报告要求文本
|
||||||
|
ImagePrompt string `json:"imagePrompt"` // 图片URL
|
||||||
|
Model string `json:"model"` // 可选的模型名称,默认使用 qwen3-vl-plus
|
||||||
|
}
|
||||||
|
|
||||||
|
// CompetitorReportResponse 竞品报告响应数据
|
||||||
|
type CompetitorReportResponse struct {
|
||||||
|
ImageURL string `json:"image_url,omitempty"` // 生成的图片URL(1024*1024),非必须返回
|
||||||
|
Text string `json:"text,omitempty"` // 竞品报告文本内容,非必须返回
|
||||||
|
}
|
||||||
|
|
||||||
|
// AICompetitorReport 生成竞品报告接口
|
||||||
|
func AICompetitorReport(ctx *gin.Context) {
|
||||||
|
var req CompetitorReportRequest
|
||||||
|
if err := ctx.ShouldBindJSON(&req); err != nil {
|
||||||
|
service.Error(ctx, errors.New("参数错误"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if req.TextPrompt == "" && req.ImagePrompt == "" {
|
||||||
|
service.Error(ctx, errors.New("文本和图片提示词不能同时为空"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查是否至少提供了视频或图片
|
||||||
|
if len(req.Videos) == 0 && len(req.Images) == 0 {
|
||||||
|
service.Error(ctx, errors.New("至少需要提供一个视频或图片"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(req.Videos) > 1 {
|
||||||
|
service.Error(ctx, errors.New("当前只能选一个视频"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 第一步:调用AI理解视频/图片内容
|
||||||
|
vlPrompt := "请你详细描述这些视频或者这些图片中的内容分别是什么,请详细描述,不要遗漏任何细节"
|
||||||
|
vlResult, err := qwen.VL(req.Videos, req.Images, vlPrompt, req.Model)
|
||||||
|
if err != nil {
|
||||||
|
// 检查是否是文件下载超时错误(内容过大)
|
||||||
|
errMsg := err.Error()
|
||||||
|
if contains(errMsg, "Download multimodal file timed out") || contains(errMsg, "timed out") {
|
||||||
|
service.Error(ctx, errors.New("内容过大,请重新选择"))
|
||||||
|
} else {
|
||||||
|
service.Error(ctx, fmt.Errorf("AI理解视频图片失败: %v", err))
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取理解后的内容
|
||||||
|
if len(vlResult.Choices) == 0 {
|
||||||
|
service.Error(ctx, errors.New("AI理解返回结果为空"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
vlContent := vlResult.Choices[0].Message.Content
|
||||||
|
|
||||||
|
// 定义协程结果结构
|
||||||
|
type textResult struct {
|
||||||
|
text string
|
||||||
|
err error
|
||||||
|
}
|
||||||
|
|
||||||
|
type imageResult struct {
|
||||||
|
imageURL string
|
||||||
|
err error
|
||||||
|
}
|
||||||
|
|
||||||
|
// 根据 TextPrompt 和 ImagePrompt 是否为空决定启动哪些协程
|
||||||
|
needText := req.TextPrompt != ""
|
||||||
|
needImage := req.ImagePrompt != ""
|
||||||
|
|
||||||
|
var textChan chan textResult
|
||||||
|
var imageChan chan imageResult
|
||||||
|
|
||||||
|
// 如果需要生成文本,启动文本生成协程
|
||||||
|
if needText {
|
||||||
|
textChan = make(chan textResult, 1)
|
||||||
|
go func() {
|
||||||
|
// 构建文本生成提示词:理解内容 + 用户要求
|
||||||
|
textPrompt := fmt.Sprintf("基于以下视频和图片的内容描述:\n%s\n\n请根据以下要求生成竞品报告:注意不要输出markdown格式来进行排版,请直接输出纯文本。只需要回复竞品报告的内容,其他无关的内容不要输出,输出的内容第一行不要标题,直接输出竞品报告的正文即可\n我的要求是:\n%s", vlContent, req.TextPrompt)
|
||||||
|
|
||||||
|
chatReq, err := buildChatRequest(textPrompt, nil)
|
||||||
|
if err != nil {
|
||||||
|
textChan <- textResult{err: err}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
chatResp, err := qwen.Chat(*chatReq)
|
||||||
|
if err != nil {
|
||||||
|
textChan <- textResult{err: err}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(chatResp.Choices) == 0 {
|
||||||
|
textChan <- textResult{err: errors.New("文本生成返回结果为空")}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
textChan <- textResult{text: chatResp.Choices[0].Message.Content}
|
||||||
|
}()
|
||||||
|
}
|
||||||
|
|
||||||
|
// 如果需要生成图片,启动图片生成协程
|
||||||
|
if needImage {
|
||||||
|
imageChan = make(chan imageResult, 1)
|
||||||
|
go func() {
|
||||||
|
// 先请求聊天获取图片提示词
|
||||||
|
imagePromptText := fmt.Sprintf("基于以下视频和图片的内容描述:\n%s\n\n请根据以下要求生成竞品报告图片的提示词:\n%s", vlContent, req.ImagePrompt)
|
||||||
|
|
||||||
|
chatReq, err := buildChatRequest(imagePromptText, nil)
|
||||||
|
if err != nil {
|
||||||
|
imageChan <- imageResult{err: err}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
chatResp, err := qwen.Chat(*chatReq)
|
||||||
|
if err != nil {
|
||||||
|
imageChan <- imageResult{err: err}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(chatResp.Choices) == 0 {
|
||||||
|
imageChan <- imageResult{err: errors.New("图片提示词生成返回结果为空")}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
imagePrompt := chatResp.Choices[0].Message.Content
|
||||||
|
|
||||||
|
// 生成图片(1024*1024),基于理解后的内容使用文生图
|
||||||
|
size := "1024*1024"
|
||||||
|
resultTask, err := qwen.GenerateTextImage(imagePrompt, size)
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
imageChan <- imageResult{err: err}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if resultTask.Code != "" {
|
||||||
|
imageChan <- imageResult{err: errors.New("文生图失败: " + resultTask.Message)}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 等待图片生成完成
|
||||||
|
result, err := qwen.ImgTaskResult(resultTask.Output.TaskID)
|
||||||
|
if err != nil {
|
||||||
|
imageChan <- imageResult{err: err}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if result == nil || len(result.Output.Results) == 0 {
|
||||||
|
imageChan <- imageResult{err: errors.New("图片生成失败")}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 返回第一张图片的URL
|
||||||
|
imageChan <- imageResult{imageURL: result.Output.Results[0].URL}
|
||||||
|
}()
|
||||||
|
}
|
||||||
|
|
||||||
|
// 等待所有启动的协程完成
|
||||||
|
var textRes textResult
|
||||||
|
var imageRes imageResult
|
||||||
|
|
||||||
|
// 根据实际启动的协程数量等待结果
|
||||||
|
if needText && needImage {
|
||||||
|
// 两个协程都启动了,使用循环等待两个都完成
|
||||||
|
completed := 0
|
||||||
|
for completed < 2 {
|
||||||
|
select {
|
||||||
|
case textRes = <-textChan:
|
||||||
|
completed++
|
||||||
|
case imageRes = <-imageChan:
|
||||||
|
completed++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if needText {
|
||||||
|
// 只启动文本生成协程
|
||||||
|
textRes = <-textChan
|
||||||
|
} else if needImage {
|
||||||
|
// 只启动图片生成协程
|
||||||
|
imageRes = <-imageChan
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理文本结果(如果生成了文本)
|
||||||
|
if needText {
|
||||||
|
if textRes.err != nil {
|
||||||
|
service.Error(ctx, fmt.Errorf("生成竞品报告文本失败: %v", textRes.err))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理图片结果(如果生成了图片)
|
||||||
|
if needImage {
|
||||||
|
if imageRes.err != nil {
|
||||||
|
service.Error(ctx, fmt.Errorf("生成竞品报告图片失败: %v", imageRes.err))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 返回结果(只返回实际生成的内容)
|
||||||
|
result := CompetitorReportResponse{}
|
||||||
|
if needText {
|
||||||
|
result.Text = textRes.text
|
||||||
|
}
|
||||||
|
if needImage {
|
||||||
|
result.ImageURL = imageRes.imageURL
|
||||||
|
}
|
||||||
|
|
||||||
|
service.Success(ctx, result)
|
||||||
|
}
|
||||||
@ -134,9 +134,6 @@ func (cr ChatHandler) NewMessage(c *gin.Context) {
|
|||||||
service.ErrWithCode(c, code)
|
service.ErrWithCode(c, code)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if request.LocalStamp == 0 {
|
|
||||||
request.LocalStamp = time.Now().Unix()
|
|
||||||
}
|
|
||||||
err := logic.NewMessage(c, &cr.cache, chatUser, request)
|
err := logic.NewMessage(c, &cr.cache, chatUser, request)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
service.Error(c, err)
|
service.Error(c, err)
|
||||||
@ -263,9 +260,8 @@ func (cr ChatHandler) MessageList(c *gin.Context) {
|
|||||||
// return
|
// return
|
||||||
// }
|
// }
|
||||||
//}
|
//}
|
||||||
// 启用或禁用缓存
|
messages := cr.cache.GetChatRecord(request.SessionId)
|
||||||
//messages := cr.cache.GetChatRecord(request.SessionId)
|
//messages := []*accountFiee.ChatRecordData{}
|
||||||
messages := []*accountFiee.ChatRecordData{}
|
|
||||||
var returnDataIdList = make([]int64, 0)
|
var returnDataIdList = make([]int64, 0)
|
||||||
defer func() {
|
defer func() {
|
||||||
//获取最新数据时,重置新消息数量统计
|
//获取最新数据时,重置新消息数量统计
|
||||||
@ -281,7 +277,6 @@ func (cr ChatHandler) MessageList(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fmt.Println("defer CoverChatRecord , message len:", len(messages))
|
|
||||||
err := cr.cache.CoverChatRecord(request.SessionId, messages)
|
err := cr.cache.CoverChatRecord(request.SessionId, messages)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Print("设置消息已读失败", zap.Error(err))
|
log.Print("设置消息已读失败", zap.Error(err))
|
||||||
@ -307,7 +302,6 @@ func (cr ChatHandler) MessageList(c *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
messages = recordResp.List
|
messages = recordResp.List
|
||||||
fmt.Println("GetChatRecordList len:", len(messages))
|
|
||||||
err = cr.cache.CoverChatRecord(request.SessionId, messages)
|
err = cr.cache.CoverChatRecord(request.SessionId, messages)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Print("覆盖聊天记录失败", zap.Error(err))
|
log.Print("覆盖聊天记录失败", zap.Error(err))
|
||||||
@ -338,7 +332,7 @@ func (cr ChatHandler) MessageList(c *gin.Context) {
|
|||||||
return messages[i].ID > messages[j].ID
|
return messages[i].ID > messages[j].ID
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
//fmt.Printf("data is %+v\n", messages)
|
fmt.Printf("data is %+v\n", messages)
|
||||||
total := 0
|
total := 0
|
||||||
for i, message := range messages {
|
for i, message := range messages {
|
||||||
switch request.Direction {
|
switch request.Direction {
|
||||||
@ -373,6 +367,8 @@ func (cr ChatHandler) MessageList(c *gin.Context) {
|
|||||||
resp[i].Message.Media = []dto.MessageMedia{}
|
resp[i].Message.Media = []dto.MessageMedia{}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if accessUser.Role == 1 {
|
||||||
|
}
|
||||||
service.Success(c, resp)
|
service.Success(c, resp)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -42,7 +42,6 @@ func NewMessage(ctx context.Context, cache *chatCache.ChatCache, sender *account
|
|||||||
fmt.Println(request.LocalStamp - msgRecord.LocalStamp)
|
fmt.Println(request.LocalStamp - msgRecord.LocalStamp)
|
||||||
if msgRecord.Message.Text == request.Message.Text && request.LocalStamp-msgRecord.LocalStamp < 1 { //秒级
|
if msgRecord.Message.Text == request.Message.Text && request.LocalStamp-msgRecord.LocalStamp < 1 { //秒级
|
||||||
cacheMap[request.AtUserId] = request
|
cacheMap[request.AtUserId] = request
|
||||||
fmt.Println("\n\n跳过消息发送\n\t跳过消息发送\n\t\t跳过消息发送\n\n")
|
|
||||||
return nil
|
return nil
|
||||||
} else {
|
} else {
|
||||||
cacheMap[request.AtUserId] = request
|
cacheMap[request.AtUserId] = request
|
||||||
|
|||||||
@ -177,12 +177,10 @@ func (r *Robot) Run() {
|
|||||||
if hit {
|
if hit {
|
||||||
hasHit = true
|
hasHit = true
|
||||||
if rule.RunTime().IsZero() {
|
if rule.RunTime().IsZero() {
|
||||||
go func() {
|
err := rule.Run(r.cache)
|
||||||
err := rule.Run(r.cache)
|
if err != nil {
|
||||||
if err != nil {
|
log.Printf("robot 执行任务失败:%v\n", err)
|
||||||
log.Printf("robot 执行任务失败:%v\n", err)
|
}
|
||||||
}
|
|
||||||
}()
|
|
||||||
} else {
|
} else {
|
||||||
r.RegisterDelayTask(rule)
|
r.RegisterDelayTask(rule)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -27,12 +27,6 @@ func NewReplyWhenHitKeywords(title string, keywords []string) IRobotTask {
|
|||||||
return &RobotTaskWithKeyworkds{title: title, keywords: keywords}
|
return &RobotTaskWithKeyworkds{title: title, keywords: keywords}
|
||||||
}
|
}
|
||||||
func (r *RobotTaskWithKeyworkds) Hit(event ws.ListenEventData, sender *accountFiee.ChatUserData) (hit bool) {
|
func (r *RobotTaskWithKeyworkds) Hit(event ws.ListenEventData, sender *accountFiee.ChatUserData) (hit bool) {
|
||||||
//fmt.Printf("event.EventType != ws.EventChatMessage:%v\n", event.EventType != ws.EventChatMessage)
|
|
||||||
//fmt.Printf("event.Msg: %v\n", event.Msg == "")
|
|
||||||
//fmt.Printf("event.Client == nil: %v\n", event.Client == nil)
|
|
||||||
//fmt.Printf("event.ChatUser == nil: %v\n", event.ChatUser == nil)
|
|
||||||
//fmt.Printf("event.ChatUser.Role != 1: %v\n", event.ChatUser.Role != 1)
|
|
||||||
//fmt.Printf("r.keywords: %+v\n", r.keywords)
|
|
||||||
if event.EventType != ws.EventChatMessage || event.Msg == "" || event.Client == nil || event.ChatUser == nil {
|
if event.EventType != ws.EventChatMessage || event.Msg == "" || event.Client == nil || event.ChatUser == nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,7 +11,6 @@ import (
|
|||||||
"fonchain-fiee/pkg/service/bundle/common"
|
"fonchain-fiee/pkg/service/bundle/common"
|
||||||
"fonchain-fiee/pkg/utils"
|
"fonchain-fiee/pkg/utils"
|
||||||
"io"
|
"io"
|
||||||
"log"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
@ -167,7 +166,7 @@ func WorkConfirm(c *gin.Context) { // 确认作品并扣除余量
|
|||||||
service.Error(c, err)
|
service.Error(c, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
log.Print("req.ConfirmRemark:", req.ConfirmRemark)
|
|
||||||
if req.ConfirmStatus == 2 { // 驳回完直接结束
|
if req.ConfirmStatus == 2 { // 驳回完直接结束
|
||||||
res, err := service.CastProvider.UpdateStatus(c, &cast.UpdateStatusReq{
|
res, err := service.CastProvider.UpdateStatus(c, &cast.UpdateStatusReq{
|
||||||
WorkAction: cast.WorkActionENUM_CONFIRM,
|
WorkAction: cast.WorkActionENUM_CONFIRM,
|
||||||
@ -190,22 +189,6 @@ func WorkConfirm(c *gin.Context) { // 确认作品并扣除余量
|
|||||||
service.Error(c, errors.New(common.GetUserBalanceFailed))
|
service.Error(c, errors.New(common.GetUserBalanceFailed))
|
||||||
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,
|
|
||||||
ConfirmFailType: cast.ConfirmFailENUM_ConfirmFailENUM_EXPIRED,
|
|
||||||
})
|
|
||||||
if err != nil {
|
|
||||||
service.Error(c, errors.New(common.UpdateWorkStatusFailed))
|
|
||||||
return
|
|
||||||
}
|
|
||||||
service.Error(c, errors.New("套餐已过期"))
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
wordInfoRes, err := service.CastProvider.WorkDetail(c, &cast.WorkDetailReq{
|
wordInfoRes, err := service.CastProvider.WorkDetail(c, &cast.WorkDetailReq{
|
||||||
WorkUuid: req.WorkUuid,
|
WorkUuid: req.WorkUuid,
|
||||||
@ -214,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
|
||||||
@ -226,17 +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(context.Background(), &cast.UpdateStatusReq{
|
_, err = service.CastProvider.UpdateStatus(c, &cast.UpdateStatusReq{
|
||||||
WorkAction: cast.WorkActionENUM_CONFIRM,
|
WorkAction: cast.WorkActionENUM_CONFIRM,
|
||||||
WorkUuid: req.WorkUuid,
|
WorkUuid: req.WorkUuid,
|
||||||
ConfirmRemark: req.ConfirmRemark,
|
ConfirmRemark: req.ConfirmRemark,
|
||||||
ConfirmStatus: 3,
|
ConfirmStatus: 3,
|
||||||
ConfirmFailType: cast.ConfirmFailENUM_ConfirmFailENUM_NOTENOUGH,
|
|
||||||
})
|
})
|
||||||
if err != nil {
|
|
||||||
service.Error(c, errors.New(common.UpdateWorkStatusFailed))
|
|
||||||
return
|
|
||||||
}
|
|
||||||
service.Error(c, errors.New("图文余量不足"))
|
service.Error(c, errors.New("图文余量不足"))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -245,17 +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(context.Background(), &cast.UpdateStatusReq{
|
_, err = service.CastProvider.UpdateStatus(c, &cast.UpdateStatusReq{
|
||||||
WorkAction: cast.WorkActionENUM_CONFIRM,
|
WorkAction: cast.WorkActionENUM_CONFIRM,
|
||||||
WorkUuid: req.WorkUuid,
|
WorkUuid: req.WorkUuid,
|
||||||
ConfirmRemark: req.ConfirmRemark,
|
ConfirmRemark: req.ConfirmRemark,
|
||||||
ConfirmStatus: 3,
|
ConfirmStatus: 3,
|
||||||
ConfirmFailType: cast.ConfirmFailENUM_ConfirmFailENUM_NOTENOUGH,
|
|
||||||
})
|
})
|
||||||
if err != nil {
|
|
||||||
service.Error(c, errors.New(common.UpdateWorkStatusFailed))
|
|
||||||
return
|
|
||||||
}
|
|
||||||
service.Error(c, errors.New("视频余量不足"))
|
service.Error(c, errors.New("视频余量不足"))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -302,7 +287,7 @@ func WorkAnalysisConfirm(c *gin.Context) { // 确认数据分析并扣除余量
|
|||||||
fmt.Println("res:", res)
|
fmt.Println("res:", res)
|
||||||
fmt.Println("err:", err)
|
fmt.Println("err:", err)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
service.Error(c, errors.New(common.UpdateWorkStatusFailed))
|
service.Error(c, errors.New("驳回失败"))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
service.Success(c, res)
|
service.Success(c, res)
|
||||||
@ -317,6 +302,11 @@ func WorkAnalysisConfirm(c *gin.Context) { // 确认数据分析并扣除余量
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if balanceInfoRes.BundleStatus == common.BundleExpired {
|
||||||
|
service.Error(c, errors.New("套餐已过期"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
analysisInfoRes, err := service.CastProvider.GetWorkAnalysis(c, &cast.GetWorkAnalysisDetailReq{
|
analysisInfoRes, err := service.CastProvider.GetWorkAnalysis(c, &cast.GetWorkAnalysisDetailReq{
|
||||||
Uuid: req.Uuid,
|
Uuid: req.Uuid,
|
||||||
})
|
})
|
||||||
@ -328,6 +318,11 @@ func WorkAnalysisConfirm(c *gin.Context) { // 确认数据分析并扣除余量
|
|||||||
service.Error(c, errors.New("数据分析不是待确认状态"))
|
service.Error(c, errors.New("数据分析不是待确认状态"))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
artistID, _ := strconv.ParseUint(analysisInfoRes.ArtistID, 10, 64)
|
||||||
|
if artistID != uint64(userInfo.ID) {
|
||||||
|
service.Error(c, errors.New("非本人数据分析,无法操作"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
var addBalanceReq bundle.AddBundleBalanceReq
|
var addBalanceReq bundle.AddBundleBalanceReq
|
||||||
addBalanceReq.UserId = int32(userInfo.ID)
|
addBalanceReq.UserId = int32(userInfo.ID)
|
||||||
@ -353,7 +348,7 @@ func WorkAnalysisConfirm(c *gin.Context) { // 确认数据分析并扣除余量
|
|||||||
fmt.Println("res:", res)
|
fmt.Println("res:", res)
|
||||||
fmt.Println("err:", err)
|
fmt.Println("err:", err)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
service.Error(c, errors.New(common.UpdateWorkStatusFailed))
|
service.Error(c, errors.New("确认失败"))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// 如果是艺人手动确认,确认操作后,自动标记为待阅读状态
|
// 如果是艺人手动确认,确认操作后,自动标记为待阅读状态
|
||||||
@ -467,11 +462,13 @@ func writeToExcel(filename string, items []*bundle.BundleBalanceExportItem) erro
|
|||||||
"所属月份", "用户编号", "姓名", "手机号", "购买套餐时间",
|
"所属月份", "用户编号", "姓名", "手机号", "购买套餐时间",
|
||||||
"套餐金额", "增值服务金额", "支付金额", "币种", "手续费",
|
"套餐金额", "增值服务金额", "支付金额", "币种", "手续费",
|
||||||
"套餐视频总数", "增值服务视频总数", "套餐视频单价", "增值视频单价",
|
"套餐视频总数", "增值服务视频总数", "套餐视频单价", "增值视频单价",
|
||||||
|
"当月消耗套餐金额($)", "当月消耗增值金额($)",
|
||||||
"套餐账号总数", "增值账号总数", "套餐账号使用数", "增值账号使用数",
|
"套餐账号总数", "增值账号总数", "套餐账号使用数", "增值账号使用数",
|
||||||
"当前可用套餐视频数", "当前可用增值视频数", "当前已用套餐视频数", "当前已用增值视频数", "当前作废套餐视频数", "当前作废增值视频数", "当月新增可用套餐视频数", "当月新增可用增值视频数", "当月使用套餐视频数", "当月使用增值视频数", "当月作废套餐视频数", "当月作废增值视频数",
|
"当前可用套餐视频数", "当前可用增值视频数", "当前已用套餐视频数", "当前已用增值视频数", "当前作废套餐视频数", "当前作废增值视频数", "当月新增可用套餐视频数", "当月新增可用增值视频数", "当月使用套餐视频数", "当月使用增值视频数", "当月作废套餐视频数", "当月作废增值视频数",
|
||||||
"当前可用套餐图文数", "当前可用增值图文数", "当前已用套餐图文数", "当前已用增值图文数", "当前作废套餐图文数", "当前作废增值图文数", "当月新增可用套餐图文数", "当月新增可用增值图文数", "当月使用套餐图文数", "当月使用增值图文数", "当月作废套餐图文数", "当月作废增值图文数",
|
"当前可用套餐图文数", "当前可用增值图文数", "当前已用套餐图文数", "当前已用增值图文数", "当前作废套餐图文数", "当前作废增值图文数", "当月新增可用套餐图文数", "当月新增可用增值图文数", "当月使用套餐图文数", "当月使用增值图文数", "当月作废套餐图文数", "当月作废增值图文数",
|
||||||
"当前可用套餐数据分析数", "当前可用增值数据分析数", "当前已用套餐数据分析数", "当前已用增值数据分析数", "当前作废套餐数据分析数", "当前作废增值数据分析数", "当月新增可用套餐数据分析数", "当月新增可用增值数据分析数", "当月使用套餐数据分析数", "当月使用增值数据分析数", "当月作废套餐数据分析数", "当月作废增值数据分析数",
|
"当前可用套餐数据分析数", "当前可用增值数据分析数", "当前已用套餐数据分析数", "当前已用增值数据分析数", "当前作废套餐数据分析数", "当前作废增值数据分析数", "当月新增可用套餐数据分析数", "当月新增可用增值数据分析数", "当月使用套餐数据分析数", "当月使用增值数据分析数", "当月作废套餐数据分析数", "当月作废增值数据分析数",
|
||||||
"当月手动扩展账号新增数", "当月手动扩展视频新增数", "当月手动扩展图文新增数", "当月手动扩展数据分析新增数", "当月新增手动扩展时长(天)", "当月手动扩展账号使用数", "当月手动扩展视频使用数", "当月手动扩展图文使用数", "当月手动扩展数据分析使用数",
|
"当前可用套餐竞品数", "当前可用增值竞品数", "当前已用套餐竞品数", "当前已用增值竞品数", "当前作废套餐竞品数", "当前作废增值竞品数", "当月新增可用套餐竞品数", "当月新增可用增值竞品数", "当月使用套餐竞品数", "当月使用增值竞品数", "当月作废套餐竞品数", "当月作废增值竞品数",
|
||||||
|
"当月手动扩展账号新增数", "当月手动扩展视频新增数", "当月手动扩展图文新增数", "当月手动扩展数据分析新增数", "当月新增手动扩展时长(天)", "当月手动扩展账号使用数", "当月手动扩展视频使用数", "当月手动扩展图文使用数", "当月手动扩展数据分析使用数", "当月手动扩展竞品数", "当月手动扩展竞品使用数",
|
||||||
}
|
}
|
||||||
|
|
||||||
// 写表头
|
// 写表头
|
||||||
@ -509,69 +506,97 @@ 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(57, int(it.MonthlyBundleCompetitiveNumber))
|
||||||
|
_ = write(58, int(it.MonthlyIncreaseCompetitiveNumber))
|
||||||
|
_ = write(59, int(it.BundleCompetitiveConsumptionNumber))
|
||||||
|
_ = write(60, int(it.IncreaseCompetitiveConsumptionNumber))
|
||||||
|
_ = write(61, int(it.InvalidBundleCompetitiveNumber))
|
||||||
|
_ = write(62, int(it.InvalidIncreaseCompetitiveNumber))
|
||||||
|
_ = write(63, int(it.MonthlyNewBundleCompetitiveNumber))
|
||||||
|
_ = write(64, int(it.MonthlyNewIncreaseCompetitiveNumber))
|
||||||
|
_ = write(65, int(it.MonthlyBundleCompetitiveConsumptionNumber))
|
||||||
|
_ = write(66, int(it.MonthlyIncreaseCompetitiveConsumptionNumber))
|
||||||
|
_ = write(67, int(it.MonthlyInvalidBundleCompetitiveNumber))
|
||||||
|
_ = write(68, int(it.MonthlyInvalidIncreaseCompetitiveNumber))
|
||||||
|
|
||||||
// 手动扩展类
|
// 手动扩展类
|
||||||
_ = write(55, int(it.MonthlyNewManualAccountNumber))
|
_ = write(69, int(it.MonthlyNewManualAccountNumber))
|
||||||
_ = write(56, int(it.MonthlyNewManualVideoNumber))
|
_ = write(70, int(it.MonthlyNewManualVideoNumber))
|
||||||
_ = write(57, int(it.MonthlyNewManualImageNumber))
|
_ = write(71, int(it.MonthlyNewManualImageNumber))
|
||||||
_ = write(58, int(it.MonthlyNewManualDataAnalysisNumber))
|
_ = write(72, int(it.MonthlyNewManualDataAnalysisNumber))
|
||||||
_ = write(59, int(it.MonthlyNewDurationNumber))
|
_ = write(73, int(it.MonthlyNewDurationNumber))
|
||||||
_ = write(60, int(it.MonthlyManualAccountConsumptionNumber))
|
_ = write(74, int(it.MonthlyManualAccountConsumptionNumber))
|
||||||
_ = write(61, int(it.MonthlyManualVideoConsumptionNumber))
|
_ = write(75, int(it.MonthlyManualVideoConsumptionNumber))
|
||||||
_ = write(62, int(it.MonthlyManualImageConsumptionNumber))
|
_ = write(76, int(it.MonthlyManualImageConsumptionNumber))
|
||||||
_ = write(63, int(it.MonthlyManualDataAnalysisConsumptionNumber))
|
_ = write(77, int(it.MonthlyManualDataAnalysisConsumptionNumber))
|
||||||
|
_ = write(78, int(it.MonthlyNewManualCompetitiveNumber))
|
||||||
|
_ = write(79, int(it.MonthlyManualCompetitiveConsumptionNumber))
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 可选:设置列宽,使表格更美观
|
// 可选:设置列宽,使表格更美观
|
||||||
_ = f.SetColWidth(sheet, "A", "AZ", 15)
|
_ = f.SetColWidth(sheet, "A", "BZ", 15)
|
||||||
|
|
||||||
// 保存文件
|
// 保存文件
|
||||||
if err := f.SaveAs(filename); err != nil {
|
if err := f.SaveAs(filename); err != nil {
|
||||||
@ -586,7 +611,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))
|
||||||
@ -611,8 +636,143 @@ func GetAccountBundleBalance(c *gin.Context) {
|
|||||||
ImageConsumptionNumber: item.BundleImageConsumptionNumber + item.IncreaseImageConsumptionNumber + item.ManualImageNumber,
|
ImageConsumptionNumber: item.BundleImageConsumptionNumber + item.IncreaseImageConsumptionNumber + item.ManualImageNumber,
|
||||||
DataAnalysisNumber: item.BundleDataAnalysisNumber + item.IncreaseDataAnalysisNumber + item.ManualDataAnalysisNumber,
|
DataAnalysisNumber: item.BundleDataAnalysisNumber + item.IncreaseDataAnalysisNumber + item.ManualDataAnalysisNumber,
|
||||||
DataAnalysisConsumptionNumber: item.BundleDataAnalysisConsumptionNumber + item.IncreaseDataAnalysisConsumptionNumber + item.ManualDataAnalysisNumber,
|
DataAnalysisConsumptionNumber: item.BundleDataAnalysisConsumptionNumber + item.IncreaseDataAnalysisConsumptionNumber + item.ManualDataAnalysisNumber,
|
||||||
|
CompetitiveNumber: item.BundleCompetitiveNumber + item.IncreaseCompetitiveNumber + item.ManualCompetitiveNumber,
|
||||||
|
CompetitiveConsumptionNumber: item.BundleCompetitiveConsumptionNumber + item.IncreaseCompetitiveConsumptionNumber + item.ManualCompetitiveConsumptionNumber,
|
||||||
Bought: item.Bought,
|
Bought: item.Bought,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
service.Success(c, result)
|
service.Success(c, result)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func writeToExcelCast(filename string, items []*bundle.WorkCastInfo) error {
|
||||||
|
f := excelize.NewFile()
|
||||||
|
sheet := "Sheet1"
|
||||||
|
|
||||||
|
// 手动表头(顺序与写入字段顺序必须一致)
|
||||||
|
headers := []string{
|
||||||
|
"用户名称", "用户编号", "套餐名称", "下单时间",
|
||||||
|
"作品标题", "消费类型", "作品类型",
|
||||||
|
"作品上传时间", "艺人待确认时间", "艺人验收确认时间",
|
||||||
|
}
|
||||||
|
|
||||||
|
// 写表头
|
||||||
|
for i, h := range headers {
|
||||||
|
col, _ := excelize.ColumnNumberToName(i + 1)
|
||||||
|
cell := col + "1"
|
||||||
|
if err := f.SetCellValue(sheet, cell, h); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 从第2行开始写数据
|
||||||
|
for r, it := range items {
|
||||||
|
row := r + 2
|
||||||
|
// 逐列写入(注意顺序必须和 headers 一致)
|
||||||
|
write := func(colIdx int, v interface{}) error {
|
||||||
|
col, _ := excelize.ColumnNumberToName(colIdx)
|
||||||
|
cell := fmt.Sprintf("%s%d", col, row)
|
||||||
|
return f.SetCellValue(sheet, cell, v)
|
||||||
|
}
|
||||||
|
costType := ""
|
||||||
|
if it.CostType == 1 {
|
||||||
|
costType = "套餐"
|
||||||
|
} else if it.CostType == 2 {
|
||||||
|
costType = "增值"
|
||||||
|
}
|
||||||
|
workCategory := ""
|
||||||
|
if it.WorkCategory == 1 {
|
||||||
|
workCategory = "图文"
|
||||||
|
} else if it.WorkCategory == 2 {
|
||||||
|
workCategory = "视频"
|
||||||
|
}
|
||||||
|
_ = write(1, it.CustomerName)
|
||||||
|
_ = write(2, it.CustomerNum)
|
||||||
|
_ = write(3, it.BundleName)
|
||||||
|
_ = write(4, it.SignedTime)
|
||||||
|
_ = write(5, it.Title)
|
||||||
|
_ = write(6, costType)
|
||||||
|
_ = write(7, workCategory)
|
||||||
|
_ = write(8, it.SubmitTime)
|
||||||
|
_ = write(9, it.WaitingTime)
|
||||||
|
_ = write(10, it.ConfirmTime)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 可选:设置列宽,使表格更美观
|
||||||
|
_ = f.SetColWidth(sheet, "A", "AZ", 15)
|
||||||
|
|
||||||
|
// 保存文件
|
||||||
|
if err := f.SaveAs(filename); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func writeToExcelPriceInfo(filename string, items []*bundle.BundleBalanceExportItem) error {
|
||||||
|
f := excelize.NewFile()
|
||||||
|
sheet := "Sheet1"
|
||||||
|
|
||||||
|
// 手动表头(顺序与写入字段顺序必须一致)
|
||||||
|
headers := []string{
|
||||||
|
"所属月份", "用户编号", "姓名", "手机号", "手续费",
|
||||||
|
"套餐视频总数", "增值服务视频总数", "套餐视频单价", "增值视频单价",
|
||||||
|
"当月使用套餐视频数", "当月使用增值视频数",
|
||||||
|
"当月消耗套餐金额($)", "当月消耗增值金额($)",
|
||||||
|
}
|
||||||
|
|
||||||
|
// 写表头
|
||||||
|
for i, h := range headers {
|
||||||
|
col, _ := excelize.ColumnNumberToName(i + 1)
|
||||||
|
cell := col + "1"
|
||||||
|
if err := f.SetCellValue(sheet, cell, h); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 从第2行开始写数据
|
||||||
|
for r, it := range items {
|
||||||
|
row := r + 2
|
||||||
|
// 逐列写入(注意顺序必须和 headers 一致)
|
||||||
|
write := func(colIdx int, v interface{}) error {
|
||||||
|
col, _ := excelize.ColumnNumberToName(colIdx)
|
||||||
|
cell := fmt.Sprintf("%s%d", col, row)
|
||||||
|
return f.SetCellValue(sheet, cell, v)
|
||||||
|
}
|
||||||
|
_ = write(1, it.Month)
|
||||||
|
_ = write(2, it.CustomerNum)
|
||||||
|
_ = write(3, it.UserName)
|
||||||
|
_ = write(4, it.UserPhoneNumber)
|
||||||
|
_ = write(5, it.Fee)
|
||||||
|
|
||||||
|
// 套餐视频数量及单价
|
||||||
|
_ = write(6, int(it.BundleVideoNumber))
|
||||||
|
_ = write(7, int(it.IncreaseVideoNumber))
|
||||||
|
_ = write(8, fmt.Sprintf("%.2f", it.BundleVideoUnitPrice))
|
||||||
|
_ = write(9, fmt.Sprintf("%.2f", it.IncreaseVideoUnitPrice))
|
||||||
|
|
||||||
|
// 视频类
|
||||||
|
_ = write(10, int(it.MonthlyBundleVideoConsumptionNumber))
|
||||||
|
_ = write(11, int(it.MonthlyIncreaseVideoConsumptionNumber))
|
||||||
|
|
||||||
|
// 当月视频消耗金额($)
|
||||||
|
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(12, fmt.Sprintf("%.2f", monthlyBundleVideoConsumptionPrice))
|
||||||
|
_ = write(13, fmt.Sprintf("%.2f", monthlyIncreaseVideoConsumptionPrice))
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// 可选:设置列宽,使表格更美观
|
||||||
|
_ = f.SetColWidth(sheet, "A", "AZ", 15)
|
||||||
|
|
||||||
|
// 保存文件
|
||||||
|
if err := f.SaveAs(filename); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|||||||
@ -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账号名", "Instagram账号名", "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"
|
||||||
@ -185,6 +205,10 @@ func MetricsArtistAccountExport(ctx *gin.Context) {
|
|||||||
} else {
|
} else {
|
||||||
scheme = "http"
|
scheme = "http"
|
||||||
}
|
}
|
||||||
|
authStatus := map[int32]string{
|
||||||
|
1: "授权",
|
||||||
|
2: "未授权",
|
||||||
|
}
|
||||||
for r, it := range resp.Data {
|
for r, it := range resp.Data {
|
||||||
row := r + 2
|
row := r + 2
|
||||||
// 逐列写入(注意顺序必须和 headers 一致)
|
// 逐列写入(注意顺序必须和 headers 一致)
|
||||||
@ -196,9 +220,16 @@ func MetricsArtistAccountExport(ctx *gin.Context) {
|
|||||||
_ = write(1, r+1)
|
_ = write(1, r+1)
|
||||||
_ = write(2, it.ArtistName)
|
_ = write(2, it.ArtistName)
|
||||||
_ = write(3, it.UserNum)
|
_ = write(3, it.UserNum)
|
||||||
_ = write(4, it.DmAccount)
|
_ = write(4, it.DmNickname)
|
||||||
_ = write(5, it.InstagramAccount)
|
_ = write(5, authStatus[it.DmAuthStatus])
|
||||||
_ = write(6, it.TiktokAccount)
|
_ = write(6, it.InstagramNickname)
|
||||||
|
_ = write(7, authStatus[it.InsAuthStatus])
|
||||||
|
_ = write(8, it.TiktokNickname)
|
||||||
|
_ = 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)
|
||||||
@ -225,13 +256,11 @@ 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,
|
|
||||||
})
|
})
|
||||||
fmt.Printf("resp.Count: %v\n", resp.Count)
|
fmt.Printf("resp.Count: %v\n", resp.Count)
|
||||||
} else {
|
} else {
|
||||||
@ -643,3 +672,61 @@ func tsToStr(ts int64, layout string) string {
|
|||||||
t := time.Unix(ts, 0).In(time.Local)
|
t := time.Unix(ts, 0).In(time.Local)
|
||||||
return t.Format(layout)
|
return t.Format(layout)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func ExportWorkCastInfo(ctx *gin.Context) {
|
||||||
|
var req bundle.ExportWorkCastInfoReq
|
||||||
|
req.StartTime = "2025-01-01 00:00:00"
|
||||||
|
req.EndTime = "2025-12-31 23:59:59"
|
||||||
|
resp, err := service.BundleProvider.ExportWorkCastInfo(ctx, &req)
|
||||||
|
if err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
exportFileName := "作品上传数据_2025-12-31_" + time.Now().Format("20060102150405") + ".xlsx"
|
||||||
|
|
||||||
|
filePath := fmt.Sprintf("./runtime/%d/%s", 9999, exportFileName)
|
||||||
|
utils.CheckDirPath("./runtime/"+fmt.Sprint(9999), true)
|
||||||
|
if err := writeToExcelCast(filePath, resp.Data); err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var scheme string
|
||||||
|
if ctx.GetHeader("X-Forwarded-Proto") == "https" {
|
||||||
|
scheme = "https"
|
||||||
|
} else {
|
||||||
|
scheme = "http"
|
||||||
|
}
|
||||||
|
var exportUrl string = fmt.Sprintf("%s://%s/api/fiee/static/%s", scheme, ctx.Request.Host, strings.Replace(filePath, "./runtime/", "", 1))
|
||||||
|
service.Success(ctx, gin.H{
|
||||||
|
"url": exportUrl,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
func ExportBundlePriceInfo(ctx *gin.Context) {
|
||||||
|
var req bundle.BundleBalanceExportReq
|
||||||
|
exportFileName := "业务收入大表2025.1.1-2025.12.31_" + time.Now().Format("20060102150405") + ".xlsx"
|
||||||
|
filePath := fmt.Sprintf("./runtime/%d/%s", 9999, exportFileName)
|
||||||
|
utils.CheckDirPath("./runtime/"+fmt.Sprint(9999), true)
|
||||||
|
req.Month = []string{"2025-03", "2025-04", "2025-05", "2025-06", "2025-07", "2025-08", "2025-09", "2025-10", "2025-11", "2025-12"}
|
||||||
|
res, err := service.BundleProvider.BundleBalanceExport(context.Background(), &req)
|
||||||
|
if err != nil {
|
||||||
|
service.Error(ctx, errors.New(common.BalanceMetricsExportFailed))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if err := writeToExcelPriceInfo(filePath, res.Data); err != nil {
|
||||||
|
service.Error(ctx, errors.New(common.BalanceMetricsExportFailed))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var scheme string
|
||||||
|
if ctx.GetHeader("X-Forwarded-Proto") == "https" {
|
||||||
|
scheme = "https"
|
||||||
|
} else {
|
||||||
|
scheme = "http"
|
||||||
|
}
|
||||||
|
|
||||||
|
var exportUrl string = fmt.Sprintf("%s://%s/api/fiee/static/%s", scheme, ctx.Request.Host, strings.Replace(filePath, "./runtime/", "", 1))
|
||||||
|
service.Success(ctx, gin.H{
|
||||||
|
"url": exportUrl,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@ -22,6 +22,8 @@ import (
|
|||||||
"github.com/gin-gonic/gin/binding"
|
"github.com/gin-gonic/gin/binding"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const ContractUrl = "https://e-cdn.fontree.cn/fonchain-main/prod/file/contract/saas/template-25122501.pdf"
|
||||||
|
|
||||||
func DeleteBundleOrder(c *gin.Context) {
|
func DeleteBundleOrder(c *gin.Context) {
|
||||||
var req bundle.DeleteValueAddServiceRequest
|
var req bundle.DeleteValueAddServiceRequest
|
||||||
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
|
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
|
||||||
@ -239,15 +241,21 @@ func CreateBundleOrderSignature(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 签合同(金额 + 有效期)
|
// 签合同(金额 + 有效期)
|
||||||
signContract, err := logic.SignContractV2(req.CustomerNum, bundleDetail.Contract, bundleDetail.Price+addTotalPrice, expirationDay)
|
signContract, err := logic.SignContractV2(req.CustomerNum, bundleDetail.Contract, bundleDetail.Price+addTotalPrice, expirationDay, userInfo.Name, userInfo.IdNumber, userInfo.PlaceOfResidence)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
service.Error(c, err)
|
service.Error(c, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if userInfo.InviterID != 0 && logic.CheckUserFirstOrder(userInfo.ID) {
|
||||||
|
req.InviterId = userInfo.InviterID
|
||||||
|
}
|
||||||
// 组装订单信息
|
// 组装订单信息
|
||||||
req = logic.BuildOrderRequest(req, userInfo, bundleDetail, addRecords, addTotalPrice, lastContractNo, signContract)
|
req = logic.BuildOrderRequest(req, userInfo, bundleDetail, addRecords, addTotalPrice, lastContractNo, signContract)
|
||||||
|
|
||||||
|
// 校验发布平台
|
||||||
|
if len(req.PlatformIds) == 0 {
|
||||||
|
req.PlatformIds = []uint32{1, 4, 5}
|
||||||
|
}
|
||||||
// 创建订单
|
// 创建订单
|
||||||
res, err := service.BundleProvider.CreateOrderRecord(context.Background(), &req)
|
res, err := service.BundleProvider.CreateOrderRecord(context.Background(), &req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -257,7 +265,129 @@ func CreateBundleOrderSignature(c *gin.Context) {
|
|||||||
service.Success(c, res)
|
service.Success(c, res)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
func VerificationSignature(c *gin.Context) {
|
||||||
|
type VerificationSignature struct {
|
||||||
|
Signature bool `json:"signature"`
|
||||||
|
SignatureUrl string `json:"signature_url"`
|
||||||
|
}
|
||||||
|
res := VerificationSignature{Signature: false}
|
||||||
|
userInfo := login.GetUserInfoFromC(c)
|
||||||
|
|
||||||
|
// 添加用户信息验证
|
||||||
|
if userInfo.ID == 0 {
|
||||||
|
service.Success(c, res)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
req := bundle.OrderRecordsDetailRequest{
|
||||||
|
CustomerID: strconv.FormatUint(userInfo.ID, 10),
|
||||||
|
}
|
||||||
|
|
||||||
|
records, err := service.BundleProvider.OrderRecordsDetail(c, &req)
|
||||||
|
if err != nil {
|
||||||
|
// 添加错误日志但继续返回false(业务逻辑)
|
||||||
|
service.Success(c, res)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 优化空值判断链
|
||||||
|
if records == nil || records.OrderRecord == nil {
|
||||||
|
service.Success(c, res)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
order := records.OrderRecord
|
||||||
|
|
||||||
|
customerID, err := strconv.ParseUint(order.CustomerID, 10, 64)
|
||||||
|
if err != nil || customerID != userInfo.ID {
|
||||||
|
service.Success(c, res)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
//
|
||||||
|
//if order.Status != bundleModel.OrderPaid {
|
||||||
|
// service.Success(c, res)
|
||||||
|
// return
|
||||||
|
//}
|
||||||
|
expirationTime, err := time.Parse("2006-01-02 15:04:05", order.ExpirationTime)
|
||||||
|
if err != nil {
|
||||||
|
service.Success(c, res)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if expirationTime.Before(time.Now()) {
|
||||||
|
service.Success(c, res)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if order.ReSignature == 1 {
|
||||||
|
res.Signature = true
|
||||||
|
contract := ContractUrl
|
||||||
|
expirationDate := expirationTime.Format("2006-01-02")
|
||||||
|
signContract, err := logic.SignContractV2(userInfo.SubNum, contract, 0, expirationDate, userInfo.Name, userInfo.IdNumber, userInfo.PlaceOfResidence)
|
||||||
|
if err != nil {
|
||||||
|
service.Error(c, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
res.SignatureUrl = signContract
|
||||||
|
}
|
||||||
|
|
||||||
|
service.Success(c, res)
|
||||||
|
}
|
||||||
|
func RestartSignature(c *gin.Context) {
|
||||||
|
userInfo := login.GetUserInfoFromC(c)
|
||||||
|
|
||||||
|
req := bundle.OrderRecordsDetailRequest{
|
||||||
|
CustomerID: strconv.FormatUint(userInfo.ID, 10),
|
||||||
|
}
|
||||||
|
records, err := service.BundleProvider.OrderRecordsDetail(c, &req)
|
||||||
|
if err != nil {
|
||||||
|
service.Error(c, errors.New("获取订单信息失败"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// 优化空值判断链
|
||||||
|
if records == nil || records.OrderRecord == nil {
|
||||||
|
service.Error(c, errors.New("获取订单信息失败"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
order := records.OrderRecord
|
||||||
|
expirationTime, err := time.Parse("2006-01-02 15:04:05", order.ExpirationTime)
|
||||||
|
if err != nil {
|
||||||
|
service.Error(c, errors.New("获取订单过期日期错误"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if expirationTime.Before(time.Now()) {
|
||||||
|
service.Error(c, errors.New("订单已过期"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
expirationDate := expirationTime.Format("2006-01-02")
|
||||||
|
|
||||||
|
if order.ReSignature == 2 {
|
||||||
|
service.Error(c, errors.New("订单无需重新签署"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// 获取最后一次合同编号
|
||||||
|
lastContractNo, err := logic.GetLastContractNo()
|
||||||
|
if err != nil {
|
||||||
|
service.Error(c, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
contract := ContractUrl
|
||||||
|
signContract, err := logic.SignContractV2(userInfo.SubNum, contract, 0, expirationDate, userInfo.Name, userInfo.IdNumber, userInfo.PlaceOfResidence)
|
||||||
|
if err != nil {
|
||||||
|
service.Error(c, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
res, err := service.BundleProvider.ReSignTheContract(c, &bundle.ReSignTheContractRequest{
|
||||||
|
OrderNo: records.OrderRecord.OrderNo,
|
||||||
|
ContractNo: lastContractNo,
|
||||||
|
SignContract: signContract,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
service.Error(c, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
service.Success(c, res)
|
||||||
|
return
|
||||||
|
}
|
||||||
func UpdateBundleOrderStatusPaid(c *gin.Context) {
|
func UpdateBundleOrderStatusPaid(c *gin.Context) {
|
||||||
var req bundle.OrderRecord
|
var req bundle.OrderRecord
|
||||||
|
|
||||||
@ -390,7 +520,6 @@ func OrderRecordsListV2(c *gin.Context) {
|
|||||||
for id := range userIdSet {
|
for id := range userIdSet {
|
||||||
userIds = append(userIds, id)
|
userIds = append(userIds, id)
|
||||||
}
|
}
|
||||||
|
|
||||||
userListResp, err := service.AccountFieeProvider.UserList(context.Background(), &accountFiee.UserListRequest{
|
userListResp, err := service.AccountFieeProvider.UserList(context.Background(), &accountFiee.UserListRequest{
|
||||||
Ids: userIds,
|
Ids: userIds,
|
||||||
Domain: "app",
|
Domain: "app",
|
||||||
@ -412,6 +541,10 @@ func OrderRecordsListV2(c *gin.Context) {
|
|||||||
item.CustomerName = u.Name
|
item.CustomerName = u.Name
|
||||||
item.TelNum = u.TelNum
|
item.TelNum = u.TelNum
|
||||||
item.SubNum = u.SubNum
|
item.SubNum = u.SubNum
|
||||||
|
if item.InviterId != 0 {
|
||||||
|
item.InviterCode = u.InviterCode
|
||||||
|
item.InviterName = u.InviterName
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -494,6 +627,10 @@ func OrderRecordsListDownload(c *gin.Context) {
|
|||||||
item.CustomerName = u.Name
|
item.CustomerName = u.Name
|
||||||
item.TelNum = u.TelNum
|
item.TelNum = u.TelNum
|
||||||
item.SubNum = u.SubNum
|
item.SubNum = u.SubNum
|
||||||
|
if item.InviterId != 0 {
|
||||||
|
item.InviterCode = u.InviterCode
|
||||||
|
item.InviterName = u.InviterName
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -511,6 +648,129 @@ func OrderRecordsListDownload(c *gin.Context) {
|
|||||||
_ = excelFile.Write(c.Writer)
|
_ = excelFile.Write(c.Writer)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
func OrderRecordsListPasswordFreeDownload(c *gin.Context) {
|
||||||
|
var req bundle.OrderRecordsRequestV2
|
||||||
|
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
|
||||||
|
service.Error(c, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
res := &bundle.OrderRecordsResponseV2{}
|
||||||
|
|
||||||
|
// Step 1: 如果有姓名/电话筛选,先查用户列表
|
||||||
|
if req.CustomerName != "" {
|
||||||
|
userListResp, err := service.AccountFieeProvider.UserList(context.Background(), &accountFiee.UserListRequest{
|
||||||
|
BlurNameTel: req.CustomerName,
|
||||||
|
Domain: "app",
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
service.Error(c, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(userListResp.UserList) == 0 {
|
||||||
|
// 没查到用户,直接返回空结果
|
||||||
|
res.Page = req.Page
|
||||||
|
res.PageSize = req.PageSize
|
||||||
|
res.Total = 0
|
||||||
|
service.Success(c, res)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 提取用户ID列表
|
||||||
|
for _, u := range userListResp.UserList {
|
||||||
|
req.UserIds = append(req.UserIds, int64(u.Id))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Step 2: 查询订单列表
|
||||||
|
orderList, err := service.BundleProvider.OrderRecordsListV2(context.Background(), &req)
|
||||||
|
if err != nil {
|
||||||
|
service.Error(c, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// Step 3: 如果订单不为空,查一次用户信息填充(只查一次)
|
||||||
|
if len(orderList.BundleInfo) > 0 {
|
||||||
|
// 先过滤掉 InviterId == 0 的记录
|
||||||
|
var filtered []*bundle.OrderBundleRecordInfo
|
||||||
|
for _, item := range orderList.BundleInfo {
|
||||||
|
if item.InviterId != 0 {
|
||||||
|
filtered = append(filtered, item)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 如果过滤后为空,直接导出空结果
|
||||||
|
if len(filtered) == 0 {
|
||||||
|
excelFile, err := exportExcel(filtered)
|
||||||
|
if err != nil {
|
||||||
|
service.Error(c, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
c.Header("Content-Type", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")
|
||||||
|
c.Header("Content-Disposition", "attachment; filename=order_list.xlsx")
|
||||||
|
c.Header("File-Name", "order_list.xlsx")
|
||||||
|
c.Header("Access-Control-Expose-Headers", "File-Name")
|
||||||
|
_ = excelFile.Write(c.Writer)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 收集订单里的所有用户ID(仅限过滤后的)
|
||||||
|
userIdSet := make(map[int64]struct{})
|
||||||
|
for _, i := range filtered {
|
||||||
|
userIdSet[i.CustomerId] = struct{}{}
|
||||||
|
}
|
||||||
|
var userIds []int64
|
||||||
|
for id := range userIdSet {
|
||||||
|
userIds = append(userIds, id)
|
||||||
|
}
|
||||||
|
|
||||||
|
userListResp, err := service.AccountFieeProvider.UserList(context.Background(), &accountFiee.UserListRequest{
|
||||||
|
Ids: userIds,
|
||||||
|
Domain: "app",
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
service.Error(c, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 建立用户ID -> 用户信息映射
|
||||||
|
userMap := make(map[int64]*accountFiee.UserListInfo, len(userListResp.UserList))
|
||||||
|
for _, u := range userListResp.UserList {
|
||||||
|
userMap[int64(u.Id)] = u
|
||||||
|
}
|
||||||
|
|
||||||
|
// 填充订单中的用户信息(仅限过滤后的)
|
||||||
|
for _, item := range filtered {
|
||||||
|
if u, ok := userMap[item.CustomerId]; ok {
|
||||||
|
item.CustomerName = u.Name
|
||||||
|
item.TelNum = u.TelNum
|
||||||
|
item.SubNum = u.SubNum
|
||||||
|
if item.InviterId != 0 {
|
||||||
|
item.InviterCode = u.InviterCode
|
||||||
|
item.InviterName = u.InviterName
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 用过滤后的数据覆盖原数据用于导出
|
||||||
|
orderList.BundleInfo = filtered
|
||||||
|
}
|
||||||
|
excelFile, err := exportExcel(orderList.BundleInfo)
|
||||||
|
if err != nil {
|
||||||
|
service.Error(c, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 返回 Excel 文件流给前端
|
||||||
|
c.Header("Content-Type", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")
|
||||||
|
c.Header("Content-Disposition", "attachment; filename=order_list.xlsx")
|
||||||
|
c.Header("File-Name", "order_list.xlsx")
|
||||||
|
c.Header("Access-Control-Expose-Headers", "File-Name")
|
||||||
|
_ = excelFile.Write(c.Writer)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
func exportExcel(orderList []*bundle.OrderBundleRecordInfo) (*excelize.File, error) {
|
func exportExcel(orderList []*bundle.OrderBundleRecordInfo) (*excelize.File, error) {
|
||||||
f := excelize.NewFile()
|
f := excelize.NewFile()
|
||||||
sheetName := "Sheet1"
|
sheetName := "Sheet1"
|
||||||
@ -518,7 +778,7 @@ func exportExcel(orderList []*bundle.OrderBundleRecordInfo) (*excelize.File, err
|
|||||||
|
|
||||||
headers := []string{
|
headers := []string{
|
||||||
"套餐订单号", "套餐类型", "套餐付款状态", "艺人手机号", "用户编号", "艺人", "套餐订单创建时间", "套餐支付时间", "套餐金额",
|
"套餐订单号", "套餐类型", "套餐付款状态", "艺人手机号", "用户编号", "艺人", "套餐订单创建时间", "套餐支付时间", "套餐金额",
|
||||||
"增值服务订单号", "增值税服务金额", "支付金额", "币种", "手续费", "增值订单创建时间", "增值付款状态",
|
"增值服务订单号", "增值税服务金额", "支付金额", "币种", "手续费", "增值订单创建时间", "增值付款状态", "邀请码", "邀请码所属人",
|
||||||
}
|
}
|
||||||
for i, h := range headers {
|
for i, h := range headers {
|
||||||
cell := fmt.Sprintf("%s%d", string(rune('A'+i)), 1)
|
cell := fmt.Sprintf("%s%d", string(rune('A'+i)), 1)
|
||||||
@ -552,6 +812,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 {
|
||||||
|
|||||||
@ -99,13 +99,15 @@ const (
|
|||||||
BundleUnBindingAddService = "套餐未绑定增值服务"
|
BundleUnBindingAddService = "套餐未绑定增值服务"
|
||||||
)
|
)
|
||||||
|
|
||||||
//发布
|
// 发布
|
||||||
const (
|
const (
|
||||||
UpdateWorkStatusFailed = "更新作品状态失败"
|
UpdateWorkStatusFailed = "更新作品状态失败"
|
||||||
GetWorkDetailFailed = "获取作品详情失败"
|
GetWorkDetailFailed = "获取作品详情失败"
|
||||||
)
|
)
|
||||||
|
|
||||||
//余量
|
//用户套餐状态
|
||||||
|
|
||||||
|
// 余量
|
||||||
const (
|
const (
|
||||||
BundleExtendFailed = "套餐扩展失败"
|
BundleExtendFailed = "套餐扩展失败"
|
||||||
BundleExtendRecordsListFailed = "套餐扩展记录列表查询失败"
|
BundleExtendRecordsListFailed = "套餐扩展记录列表查询失败"
|
||||||
@ -122,12 +124,13 @@ const (
|
|||||||
InsufficientBalance = "余量不足"
|
InsufficientBalance = "余量不足"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
//用户套餐状态
|
||||||
const (
|
const (
|
||||||
BundleExpired = 1
|
BundleExpired = 1 //已过期
|
||||||
BundleNotExpired = 0
|
BundleNotExpired = 0 //未过期
|
||||||
)
|
)
|
||||||
|
|
||||||
//数据指标
|
// 数据指标
|
||||||
const (
|
const (
|
||||||
MetricsBusinessFailed = "业务概览查询失败"
|
MetricsBusinessFailed = "业务概览查询失败"
|
||||||
MetricsOperatingFailed = "运营数据查询失败"
|
MetricsOperatingFailed = "运营数据查询失败"
|
||||||
@ -138,7 +141,7 @@ const (
|
|||||||
BalanceMetricsExportFailed = "服务使用明细数据导出失败"
|
BalanceMetricsExportFailed = "服务使用明细数据导出失败"
|
||||||
)
|
)
|
||||||
|
|
||||||
//素材库
|
// 素材库
|
||||||
const (
|
const (
|
||||||
FileListFailed = "素材库列表查询失败"
|
FileListFailed = "素材库列表查询失败"
|
||||||
FileUsageFailed = "素材库使用情况查询失败"
|
FileUsageFailed = "素材库使用情况查询失败"
|
||||||
@ -156,7 +159,7 @@ const (
|
|||||||
ERROR_OPEN_FILE = "打开文件错误"
|
ERROR_OPEN_FILE = "打开文件错误"
|
||||||
)
|
)
|
||||||
|
|
||||||
//官网
|
// 官网
|
||||||
const (
|
const (
|
||||||
CreateSecFilingFailed = "创建官方信息失败"
|
CreateSecFilingFailed = "创建官方信息失败"
|
||||||
UpdateSecFilingFailed = "更新官方信息失败"
|
UpdateSecFilingFailed = "更新官方信息失败"
|
||||||
|
|||||||
180
pkg/service/bundle/healthCheck.go
Normal file
180
pkg/service/bundle/healthCheck.go
Normal file
@ -0,0 +1,180 @@
|
|||||||
|
package bundle
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"fonchain-fiee/api/bundle"
|
||||||
|
"fonchain-fiee/api/cast"
|
||||||
|
"fonchain-fiee/api/files"
|
||||||
|
"fonchain-fiee/api/governance"
|
||||||
|
"fonchain-fiee/api/order"
|
||||||
|
"fonchain-fiee/api/payment"
|
||||||
|
"fonchain-fiee/pkg/cache"
|
||||||
|
"fonchain-fiee/pkg/service"
|
||||||
|
"net/http"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
|
)
|
||||||
|
|
||||||
|
// HealthCheck 健康检测接口
|
||||||
|
func HealthCheck(c *gin.Context) {
|
||||||
|
healthStatus := gin.H{
|
||||||
|
"status": "ok",
|
||||||
|
"timestamp": time.Now().Unix(),
|
||||||
|
"checks": make(map[string]interface{}),
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查 Redis 连接
|
||||||
|
redisStatus := "ok"
|
||||||
|
redisErr := ""
|
||||||
|
if cache.RedisClient != nil {
|
||||||
|
_, cancel := context.WithTimeout(context.Background(), 2*time.Second)
|
||||||
|
defer cancel()
|
||||||
|
_, err := cache.RedisClient.Ping().Result()
|
||||||
|
if err != nil {
|
||||||
|
redisStatus = "failed"
|
||||||
|
redisErr = err.Error()
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
redisStatus = "failed"
|
||||||
|
redisErr = "Redis client is nil"
|
||||||
|
}
|
||||||
|
healthStatus["checks"].(map[string]interface{})["redis"] = gin.H{
|
||||||
|
"status": redisStatus,
|
||||||
|
"error": redisErr,
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查微服务连接(调用一个简单的服务方法)
|
||||||
|
serviceStatus := "ok"
|
||||||
|
serviceErr := ""
|
||||||
|
ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second)
|
||||||
|
defer cancel()
|
||||||
|
|
||||||
|
// 调用 BundleProvider 的简单方法进行健康检测
|
||||||
|
_, err := service.BundleProvider.GetBundleBalanceByUserId(ctx, &bundle.GetBundleBalanceByUserIdReq{
|
||||||
|
UserId: 0, // 使用一个不存在的用户ID,只检测服务连通性
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
// 检查是否是超时或连接错误
|
||||||
|
if ctx.Err() == context.DeadlineExceeded {
|
||||||
|
serviceStatus = "Bundle Service timeout"
|
||||||
|
serviceErr = "Service timeout"
|
||||||
|
} else {
|
||||||
|
// 其他错误(如业务错误)认为服务是可用的
|
||||||
|
serviceStatus = "ok"
|
||||||
|
serviceErr = ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
healthStatus["checks"].(map[string]interface{})["bundleService"] = gin.H{
|
||||||
|
"status": serviceStatus,
|
||||||
|
"error": serviceErr,
|
||||||
|
}
|
||||||
|
//调用 OrderProvider 的简单方法进行健康检测
|
||||||
|
_, err = service.OrderProvider.GetOrder(ctx, &order.CommonRequest{
|
||||||
|
ID: 0,
|
||||||
|
Domain: "",
|
||||||
|
SeriesUid: "", // 使用一个不存在的订单ID,只检测服务连通性
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
if ctx.Err() == context.DeadlineExceeded {
|
||||||
|
serviceStatus = "Order Service timeout"
|
||||||
|
serviceErr = "Service timeout"
|
||||||
|
} else {
|
||||||
|
// 其他错误(如业务错误)认为服务是可用的
|
||||||
|
serviceStatus = "ok"
|
||||||
|
serviceErr = ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
healthStatus["checks"].(map[string]interface{})["orderService"] = gin.H{
|
||||||
|
"status": serviceStatus,
|
||||||
|
"error": serviceErr,
|
||||||
|
}
|
||||||
|
//调用 FilesProvider 的简单方法进行健康检测
|
||||||
|
_, err = service.FilesProvider.List(ctx, &files.FileListReq{
|
||||||
|
Path: "/",
|
||||||
|
UserSpacePath: "/fiee",
|
||||||
|
Page: 1,
|
||||||
|
PageSize: 50,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
if ctx.Err() == context.DeadlineExceeded {
|
||||||
|
serviceStatus = "Filesbrowser Service timeout"
|
||||||
|
serviceErr = "Service timeout"
|
||||||
|
} else {
|
||||||
|
// 其他错误(如业务错误)认为服务是可用的
|
||||||
|
serviceStatus = "ok"
|
||||||
|
serviceErr = ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
healthStatus["checks"].(map[string]interface{})["filesbrowserService"] = gin.H{
|
||||||
|
"status": serviceStatus,
|
||||||
|
"error": serviceErr,
|
||||||
|
}
|
||||||
|
//调用 PaymentProvider 的简单方法进行健康检测
|
||||||
|
_, err = service.PaymentProvider.QueryPayByOutTradeNo(ctx, &payment.PayQueryRequest{
|
||||||
|
PayType: "2",
|
||||||
|
OutTradeNo: "1234567890",
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
if ctx.Err() == context.DeadlineExceeded {
|
||||||
|
serviceStatus = "Payment Service timeout"
|
||||||
|
serviceErr = "Service timeout"
|
||||||
|
} else {
|
||||||
|
// 其他错误(如业务错误)认为服务是可用的
|
||||||
|
serviceStatus = "ok"
|
||||||
|
serviceErr = ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
healthStatus["checks"].(map[string]interface{})["paymentService"] = gin.H{
|
||||||
|
"status": serviceStatus,
|
||||||
|
"error": serviceErr,
|
||||||
|
}
|
||||||
|
|
||||||
|
//调用 CastProvider 的简单方法进行健康检测
|
||||||
|
_, err = service.CastProvider.WorkList(ctx, &cast.WorkListReq{
|
||||||
|
Page: 1,
|
||||||
|
PageSize: 10,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
if ctx.Err() == context.DeadlineExceeded {
|
||||||
|
serviceStatus = "Cast Service timeout"
|
||||||
|
serviceErr = "Service timeout"
|
||||||
|
} else {
|
||||||
|
// 其他错误(如业务错误)认为服务是可用的
|
||||||
|
serviceStatus = "ok"
|
||||||
|
serviceErr = ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
healthStatus["checks"].(map[string]interface{})["castService"] = gin.H{
|
||||||
|
"status": serviceStatus,
|
||||||
|
"error": serviceErr,
|
||||||
|
}
|
||||||
|
//调用 GovernanceProvider 的简单方法进行健康检测
|
||||||
|
_, err = service.GovernanceProvider.List(ctx, &governance.ListReq{
|
||||||
|
Page: 1,
|
||||||
|
PageSize: 10,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
if ctx.Err() == context.DeadlineExceeded {
|
||||||
|
serviceStatus = "Document Service timeout"
|
||||||
|
serviceErr = "Service timeout"
|
||||||
|
} else {
|
||||||
|
// 其他错误(如业务错误)认为服务是可用的
|
||||||
|
serviceStatus = "ok"
|
||||||
|
serviceErr = ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
healthStatus["checks"].(map[string]interface{})["documentService"] = gin.H{
|
||||||
|
"status": serviceStatus,
|
||||||
|
"error": serviceErr,
|
||||||
|
}
|
||||||
|
|
||||||
|
// 如果所有检查都通过,返回 200,否则返回 503
|
||||||
|
httpStatus := http.StatusOK
|
||||||
|
if redisStatus != "ok" || serviceStatus != "ok" {
|
||||||
|
httpStatus = http.StatusServiceUnavailable
|
||||||
|
healthStatus["status"] = "degraded"
|
||||||
|
}
|
||||||
|
|
||||||
|
c.JSON(httpStatus, healthStatus)
|
||||||
|
}
|
||||||
@ -63,6 +63,24 @@ func CheckUserOrder(userID uint64) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 校验用户是否首次购买
|
||||||
|
func CheckUserFirstOrder(userID uint64) bool {
|
||||||
|
req := bundle.OrderRecordsDetailRequest{
|
||||||
|
CustomerID: strconv.FormatUint(userID, 10),
|
||||||
|
Status: 2,
|
||||||
|
}
|
||||||
|
records, _ := service.BundleProvider.OrderRecordsDetail(context.Background(), &req)
|
||||||
|
// 用户没有任何订单记录
|
||||||
|
if records.OrderRecord == nil {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
// 检查订单是否属于该用户
|
||||||
|
if records.OrderRecord.CustomerID != strconv.FormatUint(userID, 10) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
// 获取最后一次合同编号
|
// 获取最后一次合同编号
|
||||||
func GetLastContractNo() (string, error) {
|
func GetLastContractNo() (string, error) {
|
||||||
records, err := service.BundleProvider.OrderRecordsList(context.Background(), &bundle.OrderRecordsRequest{
|
records, err := service.BundleProvider.OrderRecordsList(context.Background(), &bundle.OrderRecordsRequest{
|
||||||
@ -94,6 +112,7 @@ func BuildServiceRecords(req *bundle.OrderCreateRecord, bundleDetail *bundle.Bun
|
|||||||
expirationDay string
|
expirationDay string
|
||||||
addUidService = make(map[string]bool)
|
addUidService = make(map[string]bool)
|
||||||
bundleUidService = make(map[string]bool)
|
bundleUidService = make(map[string]bool)
|
||||||
|
foundExpiration = false
|
||||||
)
|
)
|
||||||
|
|
||||||
// 分类权益
|
// 分类权益
|
||||||
@ -149,12 +168,15 @@ func BuildServiceRecords(req *bundle.OrderCreateRecord, bundleDetail *bundle.Bun
|
|||||||
addRecords = append(addRecords, buildAddRecord(addService, uid, 0, num, 1))
|
addRecords = append(addRecords, buildAddRecord(addService, uid, 0, num, 1))
|
||||||
|
|
||||||
// 计算到期时间
|
// 计算到期时间
|
||||||
if addService.ServiceType == 5 {
|
if !foundExpiration && addService.ServiceType == 5 {
|
||||||
expirationDay = calculateExpirationDate(time.Now(), num, addService.Unit)
|
expirationDay = calculateExpirationDate(time.Now(), num, addService.Unit)
|
||||||
} else {
|
foundExpiration = true
|
||||||
expirationDay = time.Now().AddDate(0, 0, 7).Format("2006-01-02")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 如果没有找到服务类型为5的,使用默认值
|
||||||
|
if !foundExpiration {
|
||||||
|
expirationDay = time.Now().AddDate(0, 0, 7).Format("2006-01-02")
|
||||||
|
}
|
||||||
|
|
||||||
return addRecords, addTotalPrice, expirationDay, nil
|
return addRecords, addTotalPrice, expirationDay, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,14 +8,13 @@ import (
|
|||||||
"fonchain-fiee/pkg/service/upload"
|
"fonchain-fiee/pkg/service/upload"
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"strconv"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/signintech/gopdf"
|
"github.com/signintech/gopdf"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
)
|
)
|
||||||
|
|
||||||
func SignContractV2(customerNum, contract string, price float32, expirationDate string) (outputUrl string, err error) {
|
func SignContractV2(customerNum, contract string, price float32, expirationDate string, nickName string, idCard string, address string) (outputUrl string, err error) {
|
||||||
filePath := model.MediaPath + customerNum + time.Now().Format("20060102150405") + ".pdf"
|
filePath := model.MediaPath + customerNum + time.Now().Format("20060102150405") + ".pdf"
|
||||||
downloadFileErr := DownloadFile(filePath, contract)
|
downloadFileErr := DownloadFile(filePath, contract)
|
||||||
if downloadFileErr != nil {
|
if downloadFileErr != nil {
|
||||||
@ -32,7 +31,7 @@ func SignContractV2(customerNum, contract string, price float32, expirationDate
|
|||||||
return outputUrl, errors.New(common.ErrorInsertSignature)
|
return outputUrl, errors.New(common.ErrorInsertSignature)
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
signErr := InsertSignatureV2(filePath, signFile, price, expirationDate)
|
signErr := InsertSignatureV2(filePath, signFile, price, expirationDate, nickName, idCard, address)
|
||||||
if signErr != nil {
|
if signErr != nil {
|
||||||
zap.L().Error("insert signature error: ", zap.Error(signErr))
|
zap.L().Error("insert signature error: ", zap.Error(signErr))
|
||||||
return outputUrl, errors.New(common.ErrorInsertSignature)
|
return outputUrl, errors.New(common.ErrorInsertSignature)
|
||||||
@ -47,7 +46,7 @@ func SignContractV2(customerNum, contract string, price float32, expirationDate
|
|||||||
return outputUrl, nil
|
return outputUrl, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func InsertSignatureV2(templatePath, outputPath string, price float32, expirationDate string) error {
|
func InsertSignatureV2(templatePath, outputPath string, price float32, expirationDate string, nickName string, idCard string, address string) error {
|
||||||
fmt.Println("================================templatePath:", templatePath)
|
fmt.Println("================================templatePath:", templatePath)
|
||||||
fmt.Println("================================outputPath:", outputPath)
|
fmt.Println("================================outputPath:", outputPath)
|
||||||
fmt.Println("================================price:", price)
|
fmt.Println("================================price:", price)
|
||||||
@ -65,9 +64,9 @@ func InsertSignatureV2(templatePath, outputPath string, price float32, expiratio
|
|||||||
totalPages := pdf.GetNumberOfPages()
|
totalPages := pdf.GetNumberOfPages()
|
||||||
fmt.Printf("模板文件的总页数: %d\n", totalPages)
|
fmt.Printf("模板文件的总页数: %d\n", totalPages)
|
||||||
|
|
||||||
pricePage := 3
|
onePage := 1
|
||||||
|
sixPage := 6
|
||||||
limitTimePage := 4
|
tenPage := 10
|
||||||
|
|
||||||
tffErr := pdf.AddTTFFont("simfang", "./data/simfang.ttf")
|
tffErr := pdf.AddTTFFont("simfang", "./data/simfang.ttf")
|
||||||
if tffErr != nil {
|
if tffErr != nil {
|
||||||
@ -82,42 +81,54 @@ func InsertSignatureV2(templatePath, outputPath string, price float32, expiratio
|
|||||||
log.Fatalf("设置字体失败: %v", err)
|
log.Fatalf("设置字体失败: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 填 金额
|
|
||||||
pdf.SetPage(pricePage)
|
|
||||||
pdf.SetX(383)
|
|
||||||
pdf.SetY(351)
|
|
||||||
pdf.Cell(nil, strconv.FormatFloat(float64(price), 'f', 2, 64))
|
|
||||||
|
|
||||||
pdf.SetX(345)
|
|
||||||
pdf.SetY(383)
|
|
||||||
pdf.Cell(nil, strconv.FormatFloat(float64(price), 'f', 2, 64))
|
|
||||||
// 写 有效期
|
|
||||||
pdf.SetPage(limitTimePage)
|
|
||||||
|
|
||||||
// 英文格式的时间
|
// 英文格式的时间
|
||||||
parsedTime, err := time.Parse("2006-01-02", expirationDate)
|
parsedTime, err := time.Parse("2006-01-02", expirationDate)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic("日期格式错误!")
|
fmt.Println("时间解析错误: %v", err)
|
||||||
|
fmt.Println(expirationDate)
|
||||||
|
return errors.New("时间解析错误")
|
||||||
}
|
}
|
||||||
year := parsedTime.Format("2006") // "2006"
|
year := parsedTime.Format("2006") // "2006"
|
||||||
month := parsedTime.Format("01") // "01"
|
month := parsedTime.Format("01") // "01"
|
||||||
day := parsedTime.Format("02") // "02"
|
day := parsedTime.Format("02") // "02"
|
||||||
pdf.SetX(160)
|
// 填 第一页 日期-姓名-身份证号
|
||||||
pdf.SetY(387)
|
pdf.SetPage(onePage)
|
||||||
pdf.Cell(nil, expirationDate)
|
pdf.SetX(232)
|
||||||
|
pdf.SetY(152)
|
||||||
pdf.SetX(330)
|
|
||||||
pdf.SetY(403)
|
|
||||||
pdf.Cell(nil, year)
|
pdf.Cell(nil, year)
|
||||||
|
pdf.SetX(279)
|
||||||
pdf.SetX(396)
|
pdf.SetY(152)
|
||||||
pdf.SetY(403)
|
|
||||||
pdf.Cell(nil, month)
|
pdf.Cell(nil, month)
|
||||||
|
pdf.SetX(313)
|
||||||
pdf.SetX(443)
|
pdf.SetY(152)
|
||||||
pdf.SetY(403)
|
|
||||||
pdf.Cell(nil, day)
|
pdf.Cell(nil, day)
|
||||||
|
pdf.SetX(370)
|
||||||
|
pdf.SetY(152)
|
||||||
|
pdf.Cell(nil, nickName)
|
||||||
|
pdf.SetX(175)
|
||||||
|
pdf.SetY(170)
|
||||||
|
pdf.Cell(nil, idCard)
|
||||||
|
//pdf.Cell(nil, strconv.FormatFloat(float64(price), 'f', 2, 64))
|
||||||
|
|
||||||
|
// 写 第六页 日期
|
||||||
|
pdf.SetPage(sixPage)
|
||||||
|
pdf.SetX(343)
|
||||||
|
pdf.SetY(138)
|
||||||
|
pdf.Cell(nil, year)
|
||||||
|
pdf.SetX(401)
|
||||||
|
pdf.SetY(138)
|
||||||
|
pdf.Cell(nil, month)
|
||||||
|
pdf.SetX(447)
|
||||||
|
pdf.SetY(138)
|
||||||
|
pdf.Cell(nil, day)
|
||||||
|
// 写 第十页 地址 姓名 邮件
|
||||||
|
pdf.SetPage(tenPage)
|
||||||
|
pdf.SetX(195)
|
||||||
|
pdf.SetY(253)
|
||||||
|
pdf.Cell(nil, address)
|
||||||
|
pdf.SetX(215)
|
||||||
|
pdf.SetY(270)
|
||||||
|
pdf.Cell(nil, nickName)
|
||||||
// 生成新的 PDF
|
// 生成新的 PDF
|
||||||
if err = pdf.WritePdf(outputPath); err != nil {
|
if err = pdf.WritePdf(outputPath); err != nil {
|
||||||
//zap.L().Error("WritePdf err", zap.Error(err))
|
//zap.L().Error("WritePdf err", zap.Error(err))
|
||||||
|
|||||||
@ -253,14 +253,16 @@ func AutoCreateUserAndOrder(c *gin.Context) {
|
|||||||
reportUuid := ""
|
reportUuid := ""
|
||||||
accountUuid := ""
|
accountUuid := ""
|
||||||
durationUuid := ""
|
durationUuid := ""
|
||||||
|
bundleVideoUuid := ""
|
||||||
if config.AppConfig.System.AppMode == "prod" {
|
if config.AppConfig.System.AppMode == "prod" {
|
||||||
BundleName = "全球尊享版"
|
BundleName = "全球尊享版"
|
||||||
BundleUuid = "ac4c99c2951c2fcdbf417928d321554d"
|
BundleUuid = "ac4c99c2951c2fcdbf417928d321554d"
|
||||||
videoUuid = "a29a1fa2862b2cdda1377b19066c8eb7"
|
videoUuid = "355aae784d77280197c92ff56733459d" // 增值视频
|
||||||
textAndImagesUuid = "dfba176a40ae2d23aa4ef9b30b646bc8"
|
textAndImagesUuid = "41a7753d210d22f8972dc273ff1360c4" // 套餐图文
|
||||||
reportUuid = "1727557a85c92957a3e3332d18c713aa"
|
reportUuid = "069497de55852c24a3b0f702c1250900" // 套餐数据
|
||||||
accountUuid = "e1cc219e4f682b3d8cb85929e540a0de"
|
accountUuid = "1e04078d2a8824d18be1c281bc3167a8" // 套餐账号
|
||||||
durationUuid = "f002449ac57a2e71b0673da938c0354e"
|
durationUuid = "e3ad8f15aa022b12afe47170c9051db9" // 套餐时长
|
||||||
|
bundleVideoUuid = "fdbef018707e2a8ebc82a22e257abaff" // 套餐视频
|
||||||
} else {
|
} else {
|
||||||
BundleName = "测试导入全球尊享版"
|
BundleName = "测试导入全球尊享版"
|
||||||
BundleUuid = "5e84f86cb7f92a4ab785271e4a383aa5"
|
BundleUuid = "5e84f86cb7f92a4ab785271e4a383aa5"
|
||||||
@ -275,6 +277,7 @@ func AutoCreateUserAndOrder(c *gin.Context) {
|
|||||||
var TotalPrice float32
|
var TotalPrice float32
|
||||||
var expirationDay string
|
var expirationDay string
|
||||||
numMap := make(map[string]int32)
|
numMap := make(map[string]int32)
|
||||||
|
numMap["1500.00"] = 0
|
||||||
numMap["3150.00"] = 3
|
numMap["3150.00"] = 3
|
||||||
numMap["4200.00"] = 5
|
numMap["4200.00"] = 5
|
||||||
numMap["5600.00"] = 8
|
numMap["5600.00"] = 8
|
||||||
@ -287,6 +290,7 @@ func AutoCreateUserAndOrder(c *gin.Context) {
|
|||||||
numMap["18300.00"] = 40
|
numMap["18300.00"] = 40
|
||||||
numMap["26700.00"] = 60
|
numMap["26700.00"] = 60
|
||||||
incrMap := make(map[string]float32)
|
incrMap := make(map[string]float32)
|
||||||
|
incrMap["1500.00"] = 0
|
||||||
incrMap["3150.00"] = 1650
|
incrMap["3150.00"] = 1650
|
||||||
incrMap["4200.00"] = 2700
|
incrMap["4200.00"] = 2700
|
||||||
incrMap["5600.00"] = 4100
|
incrMap["5600.00"] = 4100
|
||||||
@ -305,7 +309,21 @@ func AutoCreateUserAndOrder(c *gin.Context) {
|
|||||||
f64, err := strconv.ParseFloat(unfinishInfo.OrderPayAmount, 32)
|
f64, err := strconv.ParseFloat(unfinishInfo.OrderPayAmount, 32)
|
||||||
TotalPrice = float32(f64)
|
TotalPrice = float32(f64)
|
||||||
addRecords = append(addRecords,
|
addRecords = append(addRecords,
|
||||||
&bundle.OrderCreateAddRecord{
|
&bundle.OrderCreateAddRecord{ // 套餐视频
|
||||||
|
ServiceType: 1,
|
||||||
|
ValueUid: bundleVideoUuid,
|
||||||
|
CurrencyType: 2, //美元
|
||||||
|
Amount: 0, //增值服务金额
|
||||||
|
Num: 24,
|
||||||
|
Unit: "个",
|
||||||
|
Source: 1,
|
||||||
|
PaymentStatus: 1,
|
||||||
|
HandlingFee: unfinishInfo.OrderFeeAmount,
|
||||||
|
EquityType: 1,
|
||||||
|
QuotaType: 2,
|
||||||
|
QuotaValue: 2,
|
||||||
|
},
|
||||||
|
&bundle.OrderCreateAddRecord{ //视频增值
|
||||||
ServiceType: 1,
|
ServiceType: 1,
|
||||||
ValueUid: videoUuid,
|
ValueUid: videoUuid,
|
||||||
CurrencyType: 2, //美元
|
CurrencyType: 2, //美元
|
||||||
@ -315,6 +333,8 @@ func AutoCreateUserAndOrder(c *gin.Context) {
|
|||||||
Source: 1,
|
Source: 1,
|
||||||
PaymentStatus: 1,
|
PaymentStatus: 1,
|
||||||
HandlingFee: unfinishInfo.OrderFeeAmount,
|
HandlingFee: unfinishInfo.OrderFeeAmount,
|
||||||
|
EquityType: 2,
|
||||||
|
QuotaType: 1,
|
||||||
}, &bundle.OrderCreateAddRecord{ //图文
|
}, &bundle.OrderCreateAddRecord{ //图文
|
||||||
ServiceType: 2,
|
ServiceType: 2,
|
||||||
ValueUid: textAndImagesUuid,
|
ValueUid: textAndImagesUuid,
|
||||||
@ -325,6 +345,9 @@ func AutoCreateUserAndOrder(c *gin.Context) {
|
|||||||
Source: 1,
|
Source: 1,
|
||||||
PaymentStatus: 1,
|
PaymentStatus: 1,
|
||||||
HandlingFee: unfinishInfo.OrderFeeAmount,
|
HandlingFee: unfinishInfo.OrderFeeAmount,
|
||||||
|
EquityType: 1,
|
||||||
|
QuotaType: 2,
|
||||||
|
QuotaValue: 10,
|
||||||
}, &bundle.OrderCreateAddRecord{ //数据报表
|
}, &bundle.OrderCreateAddRecord{ //数据报表
|
||||||
ServiceType: 3,
|
ServiceType: 3,
|
||||||
ValueUid: reportUuid,
|
ValueUid: reportUuid,
|
||||||
@ -335,32 +358,40 @@ func AutoCreateUserAndOrder(c *gin.Context) {
|
|||||||
Source: 1,
|
Source: 1,
|
||||||
PaymentStatus: 1,
|
PaymentStatus: 1,
|
||||||
HandlingFee: unfinishInfo.OrderFeeAmount,
|
HandlingFee: unfinishInfo.OrderFeeAmount,
|
||||||
|
EquityType: 1,
|
||||||
|
QuotaType: 2,
|
||||||
|
QuotaValue: 1,
|
||||||
}, &bundle.OrderCreateAddRecord{ //账号数
|
}, &bundle.OrderCreateAddRecord{ //账号数
|
||||||
ServiceType: 4,
|
ServiceType: 4,
|
||||||
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,
|
||||||
HandlingFee: unfinishInfo.OrderFeeAmount,
|
HandlingFee: unfinishInfo.OrderFeeAmount,
|
||||||
|
EquityType: 1,
|
||||||
|
QuotaType: 1,
|
||||||
}, &bundle.OrderCreateAddRecord{ //可用时长
|
}, &bundle.OrderCreateAddRecord{ //可用时长
|
||||||
ServiceType: 5,
|
ServiceType: 5,
|
||||||
ValueUid: durationUuid,
|
ValueUid: durationUuid,
|
||||||
CurrencyType: 2, //美元
|
CurrencyType: 2, //美元
|
||||||
Amount: 0, //增值服务金额
|
Amount: 0, //增值服务金额
|
||||||
Num: 10,
|
Num: 1,
|
||||||
Unit: "年",
|
Unit: "年",
|
||||||
Source: 1,
|
Source: 1,
|
||||||
PaymentStatus: 1,
|
PaymentStatus: 1,
|
||||||
HandlingFee: unfinishInfo.OrderFeeAmount,
|
HandlingFee: unfinishInfo.OrderFeeAmount,
|
||||||
|
EquityType: 1,
|
||||||
|
QuotaType: 1,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
// 当前 未将 签名 写入合同中 todo 金额和有效时间待修改
|
// 当前 未将 签名 写入合同中 todo 金额和有效时间待修改
|
||||||
contract := "https://e-cdn.fontree.cn/fonchain-main/prod/file/saas/contract/template-25032801.pdf"
|
contract := ContractUrl
|
||||||
expirationDay = t.AddDate(1, 0, 0).Format("2006-01-02")
|
expirationDay = t.AddDate(1, 0, 0).Format("2006-01-02")
|
||||||
signContract, signContractErr := logic.SignContractV2(userReq.UserNum, contract, TotalPrice, expirationDay)
|
|
||||||
|
signContract, signContractErr := logic.SignContractV2(userReq.UserNum, contract, TotalPrice, expirationDay, unfinishInfo.UserName, unfinishInfo.CardNum, unfinishInfo.PlaceOfResidence)
|
||||||
if signContractErr != nil {
|
if signContractErr != nil {
|
||||||
service.Error(c, signContractErr)
|
service.Error(c, signContractErr)
|
||||||
return
|
return
|
||||||
@ -387,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)
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -61,7 +61,7 @@ func UploadMediaByURL(ctx context.Context, fileURL, fileName, description string
|
|||||||
if fileURL == "" {
|
if fileURL == "" {
|
||||||
return nil, errors.New("文件URL不能为空")
|
return nil, errors.New("文件URL不能为空")
|
||||||
}
|
}
|
||||||
ok, err := VerifyMediaURL(ctx, fileURL)
|
/*ok, err := VerifyMediaURL(ctx, fileURL) // 检测文件是否OK, 关闭遇到了检测OK 发布不OK的 不相信API了
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -73,11 +73,11 @@ func UploadMediaByURL(ctx context.Context, fileURL, fileName, description string
|
|||||||
Description: "",
|
Description: "",
|
||||||
IsAs: false,
|
IsAs: false,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}*/
|
||||||
// 下载文件到临时目录
|
// 下载文件到临时目录
|
||||||
tempFile, fileSize, err := downloadFile(ctx, fileURL)
|
tempFile, fileSize, err := downloadFile(ctx, fileURL)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("下载文件失败: %v", err)
|
return nil, fmt.Errorf("下载文件失败")
|
||||||
}
|
}
|
||||||
defer os.Remove(tempFile) // 清理临时文件
|
defer os.Remove(tempFile) // 清理临时文件
|
||||||
|
|
||||||
@ -87,14 +87,34 @@ func UploadMediaByURL(ctx context.Context, fileURL, fileName, description string
|
|||||||
if fileName == "" {
|
if fileName == "" {
|
||||||
fileName = filepath.Base(fileURL)
|
fileName = filepath.Base(fileURL)
|
||||||
}
|
}
|
||||||
|
var result *UploadMediaResponse
|
||||||
// 根据文件大小选择上传方式
|
// 根据文件大小选择上传方式
|
||||||
if fileSize < maxSmallFileSize {
|
if fileSize < maxSmallFileSize {
|
||||||
zap.L().Info("使用小文件上传方式", zap.Int64("fileSize", fileSize))
|
zap.L().Info("使用小文件上传方式", zap.Int64("fileSize", fileSize))
|
||||||
return uploadSmallMedia(ctx, tempFile, apiKey, fileName, description)
|
result, err = uploadSmallMedia(ctx, tempFile, apiKey, fileName, description)
|
||||||
|
} else {
|
||||||
|
zap.L().Info("使用大文件上传方式", zap.Int64("fileSize", fileSize))
|
||||||
|
result, err = uploadLargeMedia(ctx, tempFile, apiKey, fileName, description)
|
||||||
}
|
}
|
||||||
zap.L().Info("使用大文件上传方式", zap.Int64("fileSize", fileSize))
|
if err != nil {
|
||||||
return uploadLargeMedia(ctx, tempFile, apiKey, fileName, description)
|
return nil, err
|
||||||
|
}
|
||||||
|
// 上传后等待并验证 URL 是否可访问
|
||||||
|
maxRetries := 5
|
||||||
|
var ok bool
|
||||||
|
for i := 0; i < maxRetries; i++ {
|
||||||
|
time.Sleep(2 * time.Second)
|
||||||
|
ok, err = VerifyMediaURL(ctx, result.URL)
|
||||||
|
if err == nil && ok {
|
||||||
|
zap.L().Info("媒体URL验证成功", zap.String("url", result.URL), zap.Int("retry", i))
|
||||||
|
return result, nil
|
||||||
|
}
|
||||||
|
zap.L().Warn("媒体URL验证失败,重试中",
|
||||||
|
zap.String("url", result.URL),
|
||||||
|
zap.Int("retry", i+1),
|
||||||
|
zap.Int("maxRetries", maxRetries))
|
||||||
|
}
|
||||||
|
return nil, fmt.Errorf("媒体URL验证失败")
|
||||||
}
|
}
|
||||||
|
|
||||||
// downloadFile 下载文件到临时目录
|
// downloadFile 下载文件到临时目录
|
||||||
@ -112,7 +132,7 @@ func downloadFile(ctx context.Context, fileURL string) (string, int64, error) {
|
|||||||
defer resp.Body.Close()
|
defer resp.Body.Close()
|
||||||
|
|
||||||
if resp.StatusCode != http.StatusOK {
|
if resp.StatusCode != http.StatusOK {
|
||||||
return "", 0, fmt.Errorf("下载文件失败,HTTP状态码: %d", resp.StatusCode)
|
return "", 0, fmt.Errorf("下载文件失败")
|
||||||
}
|
}
|
||||||
|
|
||||||
// 创建临时文件
|
// 创建临时文件
|
||||||
@ -136,7 +156,7 @@ func downloadFile(ctx context.Context, fileURL string) (string, int64, error) {
|
|||||||
func uploadSmallMedia(ctx context.Context, filePath, apiKey, fileName, description string) (*UploadMediaResponse, error) {
|
func uploadSmallMedia(ctx context.Context, filePath, apiKey, fileName, description string) (*UploadMediaResponse, error) {
|
||||||
file, err := os.Open(filePath)
|
file, err := os.Open(filePath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("打开文件失败: %v", err)
|
return nil, fmt.Errorf("打开文件失败")
|
||||||
}
|
}
|
||||||
defer file.Close()
|
defer file.Close()
|
||||||
|
|
||||||
@ -178,23 +198,23 @@ func uploadSmallMedia(ctx context.Context, filePath, apiKey, fileName, descripti
|
|||||||
client := &http.Client{Timeout: 10 * time.Minute}
|
client := &http.Client{Timeout: 10 * time.Minute}
|
||||||
resp, err := client.Do(req)
|
resp, err := client.Do(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("请求失败: %v", err)
|
return nil, fmt.Errorf("请求失败")
|
||||||
}
|
}
|
||||||
defer resp.Body.Close()
|
defer resp.Body.Close()
|
||||||
|
|
||||||
respBody, err := io.ReadAll(resp.Body)
|
respBody, err := io.ReadAll(resp.Body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("读取响应失败: %v", err)
|
return nil, fmt.Errorf("读取响应失败")
|
||||||
}
|
}
|
||||||
|
|
||||||
if resp.StatusCode != http.StatusOK {
|
if resp.StatusCode != http.StatusOK {
|
||||||
zap.L().Error("上传小文件失败", zap.Int("statusCode", resp.StatusCode), zap.String("response", string(respBody)))
|
zap.L().Error("上传小文件失败", zap.Int("statusCode", resp.StatusCode), zap.String("response", string(respBody)))
|
||||||
return nil, fmt.Errorf("上传失败: HTTP %d, %s", resp.StatusCode, string(respBody))
|
return nil, fmt.Errorf("上传失败")
|
||||||
}
|
}
|
||||||
|
|
||||||
var result UploadMediaResponse
|
var result UploadMediaResponse
|
||||||
if err := json.Unmarshal(respBody, &result); err != nil {
|
if err := json.Unmarshal(respBody, &result); err != nil {
|
||||||
return nil, fmt.Errorf("解析响应失败: %v", err)
|
return nil, fmt.Errorf("解析响应失败")
|
||||||
}
|
}
|
||||||
|
|
||||||
zap.L().Info("小文件上传成功", zap.Any("response", result))
|
zap.L().Info("小文件上传成功", zap.Any("response", result))
|
||||||
@ -212,7 +232,7 @@ func uploadLargeMedia(ctx context.Context, filePath, apiKey, fileName, descripti
|
|||||||
// Step 1: 获取上传URL
|
// Step 1: 获取上传URL
|
||||||
uploadURLResp, err := getUploadURL(ctx, apiKey, fileName, ext)
|
uploadURLResp, err := getUploadURL(ctx, apiKey, fileName, ext)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("获取上传URL失败: %v", err)
|
return nil, fmt.Errorf("获取上传URL失败")
|
||||||
}
|
}
|
||||||
|
|
||||||
zap.L().Info("获取上传URL成功", zap.Any("uploadURLResp", uploadURLResp))
|
zap.L().Info("获取上传URL成功", zap.Any("uploadURLResp", uploadURLResp))
|
||||||
@ -220,14 +240,14 @@ func uploadLargeMedia(ctx context.Context, filePath, apiKey, fileName, descripti
|
|||||||
// Step 2: 上传文件到presigned URL
|
// Step 2: 上传文件到presigned URL
|
||||||
file, err := os.Open(filePath)
|
file, err := os.Open(filePath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("打开文件失败: %v", err)
|
return nil, fmt.Errorf("打开文件失败")
|
||||||
}
|
}
|
||||||
defer file.Close()
|
defer file.Close()
|
||||||
|
|
||||||
// 获取文件大小
|
// 获取文件大小
|
||||||
fileInfo, err := file.Stat()
|
fileInfo, err := file.Stat()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("获取文件信息失败: %v", err)
|
return nil, fmt.Errorf("获取文件信息失败")
|
||||||
}
|
}
|
||||||
fileSize := fileInfo.Size()
|
fileSize := fileInfo.Size()
|
||||||
|
|
||||||
@ -242,14 +262,14 @@ func uploadLargeMedia(ctx context.Context, filePath, apiKey, fileName, descripti
|
|||||||
client := &http.Client{Timeout: 30 * time.Minute}
|
client := &http.Client{Timeout: 30 * time.Minute}
|
||||||
resp, err := client.Do(req)
|
resp, err := client.Do(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("上传文件失败: %v", err)
|
return nil, fmt.Errorf("上传文件失败")
|
||||||
}
|
}
|
||||||
defer resp.Body.Close()
|
defer resp.Body.Close()
|
||||||
|
|
||||||
if resp.StatusCode != http.StatusOK {
|
if resp.StatusCode != http.StatusOK {
|
||||||
respBody, _ := io.ReadAll(resp.Body)
|
respBody, _ := io.ReadAll(resp.Body)
|
||||||
zap.L().Error("上传大文件失败", zap.Int("statusCode", resp.StatusCode), zap.String("response", string(respBody)))
|
zap.L().Error("上传大文件失败", zap.Int("statusCode", resp.StatusCode), zap.String("response", string(respBody)))
|
||||||
return nil, fmt.Errorf("上传失败: HTTP %d", resp.StatusCode)
|
return nil, fmt.Errorf("上传失败")
|
||||||
}
|
}
|
||||||
|
|
||||||
zap.L().Info("大文件上传成功")
|
zap.L().Info("大文件上传成功")
|
||||||
@ -290,12 +310,12 @@ func getUploadURL(ctx context.Context, apiKey, fileName, contentType string) (*U
|
|||||||
|
|
||||||
if resp.StatusCode != http.StatusOK {
|
if resp.StatusCode != http.StatusOK {
|
||||||
zap.L().Error("获取上传URL失败", zap.Int("statusCode", resp.StatusCode), zap.String("response", string(respBody)))
|
zap.L().Error("获取上传URL失败", zap.Int("statusCode", resp.StatusCode), zap.String("response", string(respBody)))
|
||||||
return nil, fmt.Errorf("获取上传URL失败: HTTP %d, %s", resp.StatusCode, string(respBody))
|
return nil, fmt.Errorf("获取上传URL失败了")
|
||||||
}
|
}
|
||||||
|
|
||||||
var result UploadURLResponse
|
var result UploadURLResponse
|
||||||
if err := json.Unmarshal(respBody, &result); err != nil {
|
if err := json.Unmarshal(respBody, &result); err != nil {
|
||||||
return nil, fmt.Errorf("解析响应失败: %v", err)
|
return nil, fmt.Errorf("解析响应失败")
|
||||||
}
|
}
|
||||||
|
|
||||||
return &result, nil
|
return &result, nil
|
||||||
@ -333,19 +353,23 @@ func SendMessage(ctx *gin.Context) {
|
|||||||
service.Error(ctx, err)
|
service.Error(ctx, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
mediaUserInfo, err := GetMediaInfo(req.MediaUserID)
|
if req.RecipientId == "" {
|
||||||
|
service.Error(ctx, errors.New("请选择接收者"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
mediaUserInfo, err := GetMediaInfo(req.MediaAccountUuid)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
service.Error(ctx, err)
|
service.Error(ctx, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
var platformName = modelCast.PlatformNameKv[mediaUserInfo.PlatformID]
|
var platformName = modelCast.PlatformNameKv[req.PlatformID]
|
||||||
if platformName != "facebook" && platformName != "instagram" && platformName != "twitter" {
|
if platformName != "facebook" && platformName != "instagram" && platformName != "twitter" {
|
||||||
service.Error(ctx, errors.New("不支持的媒体"))
|
service.Error(ctx, errors.New("不支持的媒体"))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
sendResp, err := service.AyrshareProvider.SendMessage(context.Background(), &aryshare.SendMessageRequest{
|
sendResp, err := service.AyrshareProvider.SendMessage(context.Background(), &aryshare.SendMessageRequest{
|
||||||
Platform: platformName,
|
Platform: platformName,
|
||||||
RecipientId: mediaUserInfo.AsInfo.AsID,
|
RecipientId: req.RecipientId,
|
||||||
Message: req.Message,
|
Message: req.Message,
|
||||||
MediaUrls: []string{},
|
MediaUrls: []string{},
|
||||||
ProfileKey: mediaUserInfo.AsInfo.ProfileKey,
|
ProfileKey: mediaUserInfo.AsInfo.ProfileKey,
|
||||||
@ -370,7 +394,7 @@ func GetMessage(ctx *gin.Context) {
|
|||||||
service.Error(ctx, err)
|
service.Error(ctx, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
mediaUserInfo, err := GetMediaInfo(req.MediaUserID)
|
mediaUserInfo, err := GetMediaInfo(req.MediaAccountUuid)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
service.Error(ctx, err)
|
service.Error(ctx, err)
|
||||||
return
|
return
|
||||||
@ -426,15 +450,16 @@ func PostComment(ctx *gin.Context) {
|
|||||||
service.Error(ctx, err)
|
service.Error(ctx, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
commentReq := &aryshare.PostCommentRequest{
|
||||||
commentResp, err := service.AyrshareProvider.PostComment(context.Background(), &aryshare.PostCommentRequest{
|
|
||||||
Id: req.PublishMediaID,
|
Id: req.PublishMediaID,
|
||||||
Comment: req.Comment,
|
Comment: req.Comment,
|
||||||
Platforms: []string{modelCast.PlatformNameKv[uint32(req.PlatformID)]},
|
Platforms: []string{modelCast.PlatformNameKv[uint32(req.PlatformID)]},
|
||||||
SearchPlatformId: true,
|
SearchPlatformId: false,
|
||||||
MediaUrls: nil,
|
MediaUrls: nil,
|
||||||
ProfileKey: artistInfo.ProfileKey,
|
ProfileKey: artistInfo.ProfileKey,
|
||||||
})
|
}
|
||||||
|
zap.L().Info("发布评论", zap.Any("commentReq", commentReq))
|
||||||
|
commentResp, err := service.AyrshareProvider.PostComment(context.Background(), commentReq)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
zap.L().Error("发布评论异常", zap.Error(err), zap.Any("artistInfo", artistInfo))
|
zap.L().Error("发布评论异常", zap.Error(err), zap.Any("artistInfo", artistInfo))
|
||||||
service.Error(ctx, errors.New("发布评论异常"))
|
service.Error(ctx, errors.New("发布评论异常"))
|
||||||
|
|||||||
40
pkg/service/cast/images.go
Normal file
40
pkg/service/cast/images.go
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
package cast
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"fonchain-fiee/api/cast"
|
||||||
|
"fonchain-fiee/pkg/service"
|
||||||
|
)
|
||||||
|
|
||||||
|
func CheckImage(workUuid string) error {
|
||||||
|
detailResp, err := service.CastProvider.WorkDetail(context.Background(), &cast.WorkDetailReq{WorkUuid: workUuid})
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if detailResp.CoverUrl == "" {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
if detailResp.WorkCategory == 1 {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
resourceResp, err := service.CastProvider.WorkResource(context.Background(), &cast.WorkResourceReq{WorkUuid: workUuid})
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if detailResp.CoverUrl == resourceResp.OldCoverUrl {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
mediaUrls, err := ProcessImg([]string{detailResp.CoverUrl})
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if len(mediaUrls) > 0 {
|
||||||
|
_, _ = service.CastProvider.UpdateWorkResource(context.Background(), &cast.UpdateWorkResourceReq{
|
||||||
|
Uuid: "",
|
||||||
|
WorkUuid: detailResp.WorkUuid,
|
||||||
|
OldCoverUrl: detailResp.CoverUrl,
|
||||||
|
NewCoverUrl: mediaUrls[0],
|
||||||
|
})
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@ -44,35 +44,45 @@ func MediaUserList(ctx *gin.Context) {
|
|||||||
service.Error(ctx, err)
|
service.Error(ctx, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
var statResp *bundle.ArtistUploadStatsResponse
|
|
||||||
if req.NeedStats {
|
if req.NeedStats {
|
||||||
|
var statResp *bundle.ArtistUploadStatsResponse
|
||||||
|
zap.L().Info("MediaUserList 1")
|
||||||
|
//取出艺人num
|
||||||
|
var artistSubNums []string
|
||||||
for _, v := range resp.Data {
|
for _, v := range resp.Data {
|
||||||
statResp, err = service.BundleProvider.GetArtistUploadStatsList(context.Background(), &bundle.TaskQueryRequest{
|
artistSubNums = append(artistSubNums, v.ArtistSubNum)
|
||||||
Keyword: v.ArtistPhone,
|
}
|
||||||
Page: 0,
|
statResp, err = service.BundleProvider.GetArtistUploadStatsList(context.Background(), &bundle.TaskQueryRequest{
|
||||||
PageSize: 0,
|
Keyword: "",
|
||||||
SortBy: "",
|
Page: 0,
|
||||||
SortType: "",
|
PageSize: 0,
|
||||||
LastTaskAssignee: "",
|
SortBy: "",
|
||||||
SubNums: nil,
|
SortType: "",
|
||||||
})
|
LastTaskAssignee: "",
|
||||||
if err != nil {
|
SubNums: artistSubNums,
|
||||||
service.Error(ctx, errors.New("查询艺人数据错误"))
|
})
|
||||||
return
|
zap.L().Info("MediaUserList 2")
|
||||||
}
|
if err != nil {
|
||||||
if statResp != nil && len(statResp.Items) > 0 {
|
service.Error(ctx, err)
|
||||||
info := statResp.Items[0]
|
return
|
||||||
// "pendingVideoCount": 10, // 待上传视频数 "uploadedVideoCount": 25, // 已上传视频数 "releasedVideoTotal": 35, // 已释放视频总数
|
}
|
||||||
//"pendingPostCount": 14, // 待上传图文数 "uploadedPostCount": 21, // 已上传图文数 "releasedPostTotal": 35, // 已释放图文总数
|
for _, v := range resp.Data {
|
||||||
v.PendingVideoCount = info.PendingVideoCount
|
for _, vv := range statResp.Items {
|
||||||
v.UploadedVideoCount = info.UploadedVideoCount
|
if v.ArtistSubNum == vv.SubNum {
|
||||||
v.ReleasedVideoTotal = info.ReleasedVideoTotal
|
info := vv
|
||||||
v.PendingPostCount = info.PendingPostCount
|
// "pendingVideoCount": 10, // 待上传视频数 "uploadedVideoCount": 25, // 已上传视频数 "releasedVideoTotal": 35, // 已释放视频总数
|
||||||
v.UploadedPostCount = info.UploadedPostCount
|
//"pendingPostCount": 14, // 待上传图文数 "uploadedPostCount": 21, // 已上传图文数 "releasedPostTotal": 35, // 已释放图文总数
|
||||||
v.ReleasedPostTotal = info.ReleasedPostTotal
|
v.PendingVideoCount = info.PendingVideoCount
|
||||||
|
v.UploadedVideoCount = info.UploadedVideoCount
|
||||||
|
v.ReleasedVideoTotal = info.ReleasedVideoTotal
|
||||||
|
v.PendingPostCount = info.PendingPostCount
|
||||||
|
v.UploadedPostCount = info.UploadedPostCount
|
||||||
|
v.ReleasedPostTotal = info.ReleasedPostTotal
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
zap.L().Info("MediaUserList 3")
|
||||||
go func() {
|
go func() {
|
||||||
for _, v := range resp.Data {
|
for _, v := range resp.Data {
|
||||||
_ = SyncAsAuth(v.ArtistUuid)
|
_ = SyncAsAuth(v.ArtistUuid)
|
||||||
@ -159,7 +169,7 @@ func UpdateMediaAccount(ctx *gin.Context) {
|
|||||||
}
|
}
|
||||||
if userResp != nil && len(userResp.Data) > 0 {
|
if userResp != nil && len(userResp.Data) > 0 {
|
||||||
for _, v := range userResp.Data {
|
for _, v := range userResp.Data {
|
||||||
if v.PlatformID == uint32(req.PlatformID) {
|
if v.PlatformID == uint32(req.PlatformID) && v.Expired == 1 {
|
||||||
service.Error(ctx, errors.New("账号已存在"))
|
service.Error(ctx, errors.New("账号已存在"))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -248,6 +258,10 @@ func OAuthAccount(ctx *gin.Context) {
|
|||||||
service.Error(ctx, errors.New("未找到该账号"))
|
service.Error(ctx, errors.New("未找到该账号"))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if mediaResp.Data[0].Expired != 1 {
|
||||||
|
service.Error(ctx, errors.New("账号已过期"))
|
||||||
|
return
|
||||||
|
}
|
||||||
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
|
||||||
@ -315,6 +329,7 @@ func OAuth2Callback(ctx *gin.Context) {
|
|||||||
service.Error(ctx, errors.New(e.GetMsg(e.InvalidParams)))
|
service.Error(ctx, errors.New(e.GetMsg(e.InvalidParams)))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
req.State = state
|
||||||
zap.L().Info("OAuth2Callback", zap.Any("req", req), zap.Any("code", code), zap.Any("state", state))
|
zap.L().Info("OAuth2Callback", zap.Any("req", req), zap.Any("code", code), zap.Any("state", state))
|
||||||
_, err := service.CastProvider.OAuthCodeToToken(ctx, req)
|
_, err := service.CastProvider.OAuthCodeToToken(ctx, req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -360,6 +375,7 @@ func AsOAuth2Callback(ctx *gin.Context) {
|
|||||||
func SyncAsAuth(artistUuid string) error {
|
func SyncAsAuth(artistUuid string) error {
|
||||||
resp, err := service.CastProvider.GetArtist(context.Background(), &cast.GetArtistReq{ArtistUuid: artistUuid})
|
resp, err := service.CastProvider.GetArtist(context.Background(), &cast.GetArtistReq{ArtistUuid: artistUuid})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
zap.L().Error("SyncAsAuth error", zap.Error(err))
|
||||||
return errors.New("获取艺人信息错误")
|
return errors.New("获取艺人信息错误")
|
||||||
}
|
}
|
||||||
if resp == nil || resp.ArtistInfo == nil || resp.ArtistInfo.ProfileKey == "" {
|
if resp == nil || resp.ArtistInfo == nil || resp.ArtistInfo.ProfileKey == "" {
|
||||||
@ -370,6 +386,7 @@ func SyncAsAuth(artistUuid string) error {
|
|||||||
InstagramDetails: true,
|
InstagramDetails: true,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
zap.L().Error("SyncAsAuth error", zap.Error(err))
|
||||||
return errors.New("获取艺人绑定信息错误")
|
return errors.New("获取艺人绑定信息错误")
|
||||||
}
|
}
|
||||||
authReq := &cast.UpdateOAuthReq{Data: make([]*cast.UpdateOAuthReq_Info, 0)}
|
authReq := &cast.UpdateOAuthReq{Data: make([]*cast.UpdateOAuthReq_Info, 0)}
|
||||||
@ -396,10 +413,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),
|
||||||
})
|
})
|
||||||
@ -640,6 +661,7 @@ func ImportMediaAccount(ctx *gin.Context) {
|
|||||||
excelSetRemark(excelData, line, fmt.Sprintf("%s:%s", blueskyName, err.Error()))
|
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)
|
||||||
|
|||||||
1107
pkg/service/cast/report.go
Normal file
1107
pkg/service/cast/report.go
Normal file
File diff suppressed because it is too large
Load Diff
440
pkg/service/cast/tag.go
Normal file
440
pkg/service/cast/tag.go
Normal file
@ -0,0 +1,440 @@
|
|||||||
|
package cast
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"errors"
|
||||||
|
"fmt"
|
||||||
|
"fonchain-fiee/api/aryshare"
|
||||||
|
"fonchain-fiee/api/cast"
|
||||||
|
"fonchain-fiee/cmd/config"
|
||||||
|
"fonchain-fiee/pkg/model/login"
|
||||||
|
"fonchain-fiee/pkg/service"
|
||||||
|
"fonchain-fiee/pkg/utils"
|
||||||
|
"math/rand"
|
||||||
|
"path/filepath"
|
||||||
|
"strings"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
|
"github.com/xuri/excelize/v2"
|
||||||
|
"go.uber.org/zap"
|
||||||
|
"google.golang.org/protobuf/types/known/emptypb"
|
||||||
|
)
|
||||||
|
|
||||||
|
// UpdateCastTag 更新话题标签
|
||||||
|
func UpdateCastTag(ctx *gin.Context) {
|
||||||
|
var req *cast.UpdateCastTagReq
|
||||||
|
var err error
|
||||||
|
if err = ctx.ShouldBind(&req); err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
newCtx := NewCtxWithUserInfo(ctx)
|
||||||
|
resp, err := service.CastProvider.UpdateCastTag(newCtx, req)
|
||||||
|
if err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
service.Success(ctx, resp)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// ListCastTags 获取话题标签列表
|
||||||
|
func ListCastTags(ctx *gin.Context) {
|
||||||
|
var req *cast.ListCastTagsReq
|
||||||
|
var err error
|
||||||
|
if err = ctx.ShouldBind(&req); err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
newCtx := NewCtxWithUserInfo(ctx)
|
||||||
|
resp, err := service.CastProvider.ListCastTags(newCtx, req)
|
||||||
|
if err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
service.Success(ctx, resp)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// ImportTagBatch 批量导入话题标签
|
||||||
|
func ImportTagBatch(ctx *gin.Context) {
|
||||||
|
// 接收form表单的Excel保存到本地进行解析
|
||||||
|
excelFile, err := ctx.FormFile("file")
|
||||||
|
if err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
tempDir := "./runtime/tag"
|
||||||
|
_, err = utils.CheckDirPath(tempDir, true)
|
||||||
|
fileName := time.Now().Format("20060102150405") + "_in_tag.xlsx"
|
||||||
|
excelPath := filepath.Join(tempDir, fileName)
|
||||||
|
if err = ctx.SaveUploadedFile(excelFile, excelPath); err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// 读取Excel中的数据
|
||||||
|
excelData, err := excelize.OpenFile(excelPath)
|
||||||
|
if err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
defer excelData.Close()
|
||||||
|
// 解析Excel中的数据
|
||||||
|
rows, err := excelData.GetRows("Sheet1")
|
||||||
|
if err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
req := cast.UpdateCastTagBatchReq{
|
||||||
|
Data: make([]*cast.CastTagInfo, 0),
|
||||||
|
}
|
||||||
|
userInfo := login.GetUserInfoFromC(ctx)
|
||||||
|
for line, row := range rows {
|
||||||
|
if line == 0 {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
temp := cast.CastTagInfo{
|
||||||
|
CreatorUuid: fmt.Sprint(userInfo.ID),
|
||||||
|
CreatorName: userInfo.Name,
|
||||||
|
Source: 1, // 固定来源:人工导入
|
||||||
|
Status: 1, // 固定状态:有效
|
||||||
|
}
|
||||||
|
// 解析Excel列:A-话题标签,B-备注
|
||||||
|
if len(row) > 0 {
|
||||||
|
temp.HashTag = strings.TrimSpace(row[0])
|
||||||
|
}
|
||||||
|
if len(row) > 1 {
|
||||||
|
temp.Remark = strings.TrimSpace(row[1])
|
||||||
|
}
|
||||||
|
zap.L().Info("ImportTagBatch row", zap.Int("line", line), zap.Strings("row", row))
|
||||||
|
// 验证必填字段:话题标签不能为空
|
||||||
|
if utils.CleanString(temp.HashTag) == "" {
|
||||||
|
temp.Remark = "必填项未填"
|
||||||
|
req.Data = append(req.Data, &temp)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
req.Data = append(req.Data, &temp)
|
||||||
|
}
|
||||||
|
newCtx := NewCtxWithUserInfo(ctx)
|
||||||
|
resp, _err := service.CastProvider.UpdateCastTagBatch(newCtx, &req)
|
||||||
|
if _err != nil {
|
||||||
|
service.Error(ctx, _err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// 打开模板 写入resp 返回的数据
|
||||||
|
templatePath := "./data/话题标签导入模板.xlsx"
|
||||||
|
template, err := excelize.OpenFile(templatePath)
|
||||||
|
if err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
defer template.Close()
|
||||||
|
var urlResult string
|
||||||
|
if resp.FailCount != 0 {
|
||||||
|
rowIndex := 2 // 从第2行开始写入(第1行是表头)
|
||||||
|
for _, v := range resp.Data {
|
||||||
|
if v.Success {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
// 写入失败的数据到Excel模板(只写入话题标签和备注两列)
|
||||||
|
template.SetCellValue("Sheet1", fmt.Sprintf("A%d", rowIndex), v.HashTag)
|
||||||
|
template.SetCellValue("Sheet1", fmt.Sprintf("B%d", rowIndex), v.Remark)
|
||||||
|
rowIndex++
|
||||||
|
}
|
||||||
|
resultFilename := strings.Replace(fileName, "_in_tag.xlsx", "_out_tag.xlsx", -1)
|
||||||
|
resultPath := fmt.Sprintf("./runtime/tag/%s", resultFilename)
|
||||||
|
if err = template.SaveAs(resultPath); err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
urlHost := config.AppConfig.System.FieeHost
|
||||||
|
urlResult = fmt.Sprintf("%s/api/fiee/static/tag/%s", urlHost, resultFilename)
|
||||||
|
}
|
||||||
|
|
||||||
|
service.Success(ctx, map[string]interface{}{
|
||||||
|
"successCount": resp.SuccessCount,
|
||||||
|
"failCount": resp.FailCount,
|
||||||
|
"resultUrl": urlResult,
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// RecalculateCastTagQuoteCount 重新计算话题标签引用数量
|
||||||
|
func RecalculateCastTagQuoteCount(ctx *gin.Context) {
|
||||||
|
newCtx := NewCtxWithUserInfo(ctx)
|
||||||
|
// 创建空的请求对象
|
||||||
|
req := &emptypb.Empty{}
|
||||||
|
resp, err := service.CastProvider.RecalculateCastTagQuoteCount(newCtx, req)
|
||||||
|
if err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
service.Success(ctx, resp)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// findNewTags 对比两次标签,找出新增的标签
|
||||||
|
func findNewTags(beforeTags, afterTags []string) []string {
|
||||||
|
// 将 beforeTags 转换为 map,方便查找
|
||||||
|
beforeMap := make(map[string]bool)
|
||||||
|
for _, tag := range beforeTags {
|
||||||
|
cleanTag := strings.TrimSpace(tag)
|
||||||
|
if cleanTag != "" {
|
||||||
|
beforeMap[cleanTag] = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 找出 afterTags 中不在 beforeTags 中的标签
|
||||||
|
newTags := make([]string, 0)
|
||||||
|
for _, tag := range afterTags {
|
||||||
|
cleanTag := strings.TrimSpace(tag)
|
||||||
|
if cleanTag != "" && !beforeMap[cleanTag] {
|
||||||
|
newTags = append(newTags, cleanTag)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return newTags
|
||||||
|
}
|
||||||
|
|
||||||
|
func GetValidProfileKey(ctx context.Context, platformIDs []uint32) (string, error) {
|
||||||
|
if len(platformIDs) == 0 {
|
||||||
|
platformIDs = []uint32{1, 2, 3, 5}
|
||||||
|
}
|
||||||
|
profileKeys, err := service.CastProvider.GetArtistAyrShareInfoByPlatformIDs(ctx, &cast.GetArtistAyrShareInfoByPlatformIDsReq{
|
||||||
|
PlatformIDs: platformIDs,
|
||||||
|
Page: 1,
|
||||||
|
PageSize: 20,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
zap.L().Error("GetArtistAyrShareInfoByPlatformIDs failed", zap.Error(err))
|
||||||
|
return "", errors.New("获取有效profileKey失败")
|
||||||
|
}
|
||||||
|
if len(profileKeys.Data) == 0 {
|
||||||
|
return "", errors.New("当前没有有效的profileKey")
|
||||||
|
}
|
||||||
|
|
||||||
|
// 过滤出所有非空的 profileKey
|
||||||
|
validProfileKeys := make([]string, 0)
|
||||||
|
for _, item := range profileKeys.Data {
|
||||||
|
if item.ProfileKey != "" {
|
||||||
|
validProfileKeys = append(validProfileKeys, item.ProfileKey)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(validProfileKeys) == 0 {
|
||||||
|
return "", errors.New("profileKey为空")
|
||||||
|
}
|
||||||
|
|
||||||
|
// 从有效的 profileKey 中随机选择一个
|
||||||
|
randIndex := rand.Intn(len(validProfileKeys))
|
||||||
|
return validProfileKeys[randIndex], nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// SaveTagsToDatabase 将标签保存到数据库
|
||||||
|
func SaveTagsToDatabase(ctx *gin.Context, tags []string, source uint32) error {
|
||||||
|
if len(tags) == 0 {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取用户信息
|
||||||
|
userInfo := login.GetUserInfoFromC(ctx)
|
||||||
|
newCtx := NewCtxWithUserInfo(ctx)
|
||||||
|
|
||||||
|
// 构建批量导入请求
|
||||||
|
req := cast.UpdateCastTagBatchReq{
|
||||||
|
Data: make([]*cast.CastTagInfo, 0, len(tags)),
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, tag := range tags {
|
||||||
|
tagInfo := &cast.CastTagInfo{
|
||||||
|
HashTag: tag,
|
||||||
|
CreatorUuid: fmt.Sprint(userInfo.ID),
|
||||||
|
CreatorName: userInfo.Name,
|
||||||
|
Source: source, // 4: 自动标签(从内容中自动提取)
|
||||||
|
Status: 1, // 1: 有效
|
||||||
|
}
|
||||||
|
req.Data = append(req.Data, tagInfo)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 调用批量导入接口
|
||||||
|
_, err := service.CastProvider.UpdateCastTagBatch(newCtx, &req)
|
||||||
|
if err != nil {
|
||||||
|
err = errors.New("标签保存到数据库失败")
|
||||||
|
zap.L().Error("SaveTagsToDatabase UpdateCastTagBatch failed", zap.Error(err))
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
zap.L().Info("SaveTagsToDatabase success", zap.Int("tagCount", len(tags)), zap.Strings("tags", tags), zap.Uint32("source", source))
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func GenerateAutoHashtags(ctx context.Context, post string, max int32, position, language string) (*aryshare.AutoHashtagsResponse, []string, bool, error) {
|
||||||
|
// 验证帖子内容
|
||||||
|
if post == "" {
|
||||||
|
return nil, nil, false, errors.New("帖子内容不能为空")
|
||||||
|
}
|
||||||
|
// post 的长度不能超过1000个字符
|
||||||
|
if len(post) > 1000 {
|
||||||
|
return nil, nil, false, errors.New("自动生成标签的帖子内容不能超过1000个字符")
|
||||||
|
}
|
||||||
|
|
||||||
|
// 提取生成前的标签
|
||||||
|
beforeTags := utils.ExtractTags(post)
|
||||||
|
zap.L().Info("GenerateAutoHashtags beforeTags", zap.Strings("beforeTags", beforeTags))
|
||||||
|
|
||||||
|
// 如果标签数量已经达到或超过5个,不需要生成
|
||||||
|
if len(beforeTags) >= 5 {
|
||||||
|
return nil, nil, false, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// 设置默认值
|
||||||
|
if position == "" {
|
||||||
|
position = "end"
|
||||||
|
}
|
||||||
|
if language == "" {
|
||||||
|
language = "zh"
|
||||||
|
}
|
||||||
|
|
||||||
|
// 如果 max 为0,则根据现有标签数自动计算,确保总数为5
|
||||||
|
if max == 0 {
|
||||||
|
max = int32(5 - len(beforeTags))
|
||||||
|
}
|
||||||
|
|
||||||
|
// 如果此时 max 小于等于0,则直接返回
|
||||||
|
if max <= 0 {
|
||||||
|
return nil, nil, false, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
profileKey, err := GetValidProfileKey(ctx, []uint32{1, 2, 3, 5})
|
||||||
|
if err != nil {
|
||||||
|
return nil, nil, false, err
|
||||||
|
}
|
||||||
|
|
||||||
|
// 构建请求
|
||||||
|
req := &aryshare.AutoHashtagsRequest{
|
||||||
|
Post: post,
|
||||||
|
Max: max,
|
||||||
|
Position: position,
|
||||||
|
Language: language,
|
||||||
|
ProfileKey: profileKey,
|
||||||
|
}
|
||||||
|
|
||||||
|
// 调用 Ayrshare 的 AutoHashtags 接口
|
||||||
|
resp, err := service.AyrshareProvider.AutoHashtags(ctx, req)
|
||||||
|
if err != nil {
|
||||||
|
zap.L().Error("AutoHashtags failed", zap.Error(err))
|
||||||
|
return nil, nil, false, errors.New("自动生成标签失败")
|
||||||
|
}
|
||||||
|
|
||||||
|
if resp.Post == "" {
|
||||||
|
return nil, nil, false, errors.New("自动生成标签返回的帖子内容为空")
|
||||||
|
}
|
||||||
|
|
||||||
|
// 去掉自动标签返回的帖子内容多余的引号
|
||||||
|
resp.Post = utils.CleanAutoHashtagsQuote(resp.Post)
|
||||||
|
|
||||||
|
// 提取生成后的标签
|
||||||
|
afterTags := utils.ExtractTags(resp.Post)
|
||||||
|
zap.L().Info("GenerateAutoHashtags afterTags", zap.Strings("afterTags", afterTags))
|
||||||
|
|
||||||
|
// 对比两次标签,找出新增的标签
|
||||||
|
newTags := findNewTags(beforeTags, afterTags)
|
||||||
|
|
||||||
|
return resp, newTags, true, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// AutoHashtags 自动生成标签
|
||||||
|
func AutoHashtags(ctx *gin.Context) {
|
||||||
|
var req *aryshare.AutoHashtagsRequest
|
||||||
|
var err error
|
||||||
|
if err = ctx.ShouldBind(&req); err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 调用核心逻辑生成标签
|
||||||
|
resp, newTags, needMore, err := GenerateAutoHashtags(
|
||||||
|
context.Background(),
|
||||||
|
req.Post,
|
||||||
|
req.Max,
|
||||||
|
req.Position,
|
||||||
|
req.Language,
|
||||||
|
)
|
||||||
|
if err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 如果标签已满5个,直接返回
|
||||||
|
if !needMore {
|
||||||
|
service.Success(ctx, map[string]interface{}{
|
||||||
|
"message": "当前帖子的标签已经有5个了",
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 保存新增的标签到数据库,Source 设置为 4(自动标签)
|
||||||
|
if len(newTags) > 0 {
|
||||||
|
if err = SaveTagsToDatabase(ctx, newTags, 4); err != nil {
|
||||||
|
zap.L().Error("SaveTagsToDatabase failed", zap.Error(err), zap.Strings("newTags", newTags))
|
||||||
|
err = errors.New("标签保存到数据库失败")
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
service.Success(ctx, resp)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// RecommendHashtags 推荐标签
|
||||||
|
func RecommendHashtags(ctx *gin.Context) {
|
||||||
|
var req *aryshare.RecommendHashtagsRequest
|
||||||
|
var err error
|
||||||
|
if err = ctx.ShouldBind(&req); err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
profileKey, err := GetValidProfileKey(context.Background(), []uint32{1})
|
||||||
|
if err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
req.ProfileKey = profileKey
|
||||||
|
resp, err := service.AyrshareProvider.RecommendHashtags(context.Background(), req)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println("err", err)
|
||||||
|
zap.L().Error("RecommendHashtags failed", zap.Error(err))
|
||||||
|
err = errors.New("推荐标签失败")
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
service.Success(ctx, resp)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// SearchHashtags 搜索标签
|
||||||
|
func SearchHashtags(ctx *gin.Context) {
|
||||||
|
var req *aryshare.SearchHashtagsRequest
|
||||||
|
var err error
|
||||||
|
if err = ctx.ShouldBind(&req); err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
profileKey, err := GetValidProfileKey(context.Background(), []uint32{3})
|
||||||
|
if err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
req.ProfileKey = profileKey
|
||||||
|
resp, err := service.AyrshareProvider.SearchHashtags(context.Background(), req)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println("err", err)
|
||||||
|
err = errors.New("获取热门话题标签失败")
|
||||||
|
zap.L().Error("SearchHashtags failed", zap.Error(err))
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
service.Success(ctx, resp)
|
||||||
|
return
|
||||||
|
}
|
||||||
@ -2,12 +2,23 @@ package cast
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"encoding/json"
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"fonchain-fiee/cmd/config"
|
||||||
|
"fonchain-fiee/pkg/service/upload"
|
||||||
|
"os"
|
||||||
|
"strings"
|
||||||
|
"time"
|
||||||
|
|
||||||
"fonchain-fiee/api/cast"
|
"fonchain-fiee/api/cast"
|
||||||
|
modelCast "fonchain-fiee/pkg/model/cast"
|
||||||
"fonchain-fiee/pkg/model/login"
|
"fonchain-fiee/pkg/model/login"
|
||||||
"fonchain-fiee/pkg/service"
|
"fonchain-fiee/pkg/service"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
"github.com/xuri/excelize/v2"
|
||||||
|
"go.uber.org/zap"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TaskList(ctx *gin.Context) {
|
func TaskList(ctx *gin.Context) {
|
||||||
@ -26,3 +37,164 @@ 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)
|
||||||
|
}
|
||||||
|
|
||||||
|
func DownloadTaskFile(ctx *gin.Context) {
|
||||||
|
var req *cast.GetTaskListReq
|
||||||
|
var err error
|
||||||
|
if err = ctx.ShouldBind(&req); err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
resp, err := service.CastProvider.GetTaskList(context.Background(), req)
|
||||||
|
if err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if resp == nil || resp.Data == nil {
|
||||||
|
service.Error(ctx, errors.New("没有此任务"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
var taskInfo modelCast.PublishTaskDto
|
||||||
|
if resp.Data.ExtraData != "" {
|
||||||
|
_ = json.Unmarshal([]byte(resp.Data.ExtraData), &taskInfo)
|
||||||
|
}
|
||||||
|
exportUrl, err := PublishTaskExcel(taskInfo.WorkUuids, false, resp.Data.Action)
|
||||||
|
if err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
service.Success(ctx, gin.H{
|
||||||
|
"url": exportUrl,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
func PublishTaskExcel(workUuids []string, uploadOss bool, action string) (string, error) {
|
||||||
|
// 创建Excel文件
|
||||||
|
f := excelize.NewFile()
|
||||||
|
sheetName := "Sheet1"
|
||||||
|
f.SetSheetName("Sheet1", sheetName)
|
||||||
|
// 设置表头
|
||||||
|
headers := []interface{}{
|
||||||
|
"艺人编号", "艺人姓名", "内容类型", "内容标题",
|
||||||
|
"执行结果", "TIKTOK", "YOUTUBE", "INS", "DM", "BULESKY",
|
||||||
|
}
|
||||||
|
sw, err := f.NewStreamWriter(sheetName)
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
if err = sw.SetRow("A1", headers); err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
// 遍历所有作品,收集数据
|
||||||
|
rowIndex := 2
|
||||||
|
for _, workUuid := range workUuids {
|
||||||
|
var workResp *cast.WorkDetailResp
|
||||||
|
workResp, err = service.CastProvider.WorkDetail(context.Background(), &cast.WorkDetailReq{WorkUuid: workUuid})
|
||||||
|
if err != nil {
|
||||||
|
continue // 如果某个作品获取失败,跳过继续处理其他作品
|
||||||
|
}
|
||||||
|
// 内容类型
|
||||||
|
contentType := ""
|
||||||
|
if workResp.WorkCategory == 1 {
|
||||||
|
contentType = "图文"
|
||||||
|
} else if workResp.WorkCategory == 2 {
|
||||||
|
contentType = "视频"
|
||||||
|
}
|
||||||
|
// 执行结果
|
||||||
|
executionResult := modelCast.WorkStatusMM[int(workResp.WorkStatus)]
|
||||||
|
tiktokStatus := ""
|
||||||
|
youtubeStatus := ""
|
||||||
|
insStatus := ""
|
||||||
|
dmStatus := ""
|
||||||
|
blueskyStatus := ""
|
||||||
|
|
||||||
|
// 获取平台信息和艺人姓名
|
||||||
|
artistName := ""
|
||||||
|
var infoResp *cast.WorkInfoResp
|
||||||
|
infoResp, err = service.CastProvider.WorkInfo(context.Background(), &cast.WorkInfoReq{WorkUuid: workUuid})
|
||||||
|
if err == nil && infoResp != nil {
|
||||||
|
artistName = infoResp.ArtistName
|
||||||
|
if infoResp.PlatformInfoData != nil {
|
||||||
|
for _, platform := range infoResp.PlatformInfoData {
|
||||||
|
statusText := modelCast.PlatformPublishStatusMM[platform.PublishMediaStatus]
|
||||||
|
switch cast.PlatformIDENUM(platform.PlatformID) {
|
||||||
|
case cast.PlatformIDENUM_TIKTOK:
|
||||||
|
tiktokStatus = statusText
|
||||||
|
case cast.PlatformIDENUM_YOUTUBE:
|
||||||
|
youtubeStatus = statusText
|
||||||
|
case cast.PlatformIDENUM_INS:
|
||||||
|
insStatus = statusText
|
||||||
|
case cast.PlatformIDENUM_DM:
|
||||||
|
dmStatus = statusText
|
||||||
|
case cast.PlatformIDENUM_BULESKY:
|
||||||
|
blueskyStatus = statusText
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
row := []interface{}{
|
||||||
|
workResp.ArtistSubNum,
|
||||||
|
artistName,
|
||||||
|
contentType,
|
||||||
|
workResp.Title,
|
||||||
|
executionResult,
|
||||||
|
tiktokStatus,
|
||||||
|
youtubeStatus,
|
||||||
|
insStatus,
|
||||||
|
dmStatus,
|
||||||
|
blueskyStatus,
|
||||||
|
}
|
||||||
|
cell, _ := excelize.CoordinatesToCellName(1, rowIndex)
|
||||||
|
if err = sw.SetRow(cell, row); err != nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
rowIndex++
|
||||||
|
}
|
||||||
|
if err = sw.Flush(); err != nil {
|
||||||
|
zap.L().Error("PublishTaskExcel Flush err", zap.Error(err))
|
||||||
|
return "", errors.New("生成Excel文件失败")
|
||||||
|
}
|
||||||
|
tempDir := "./runtime/task"
|
||||||
|
if _, err = os.Stat(tempDir); os.IsNotExist(err) {
|
||||||
|
if err = os.MkdirAll(tempDir, 0755); err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
TaskActionName, ok := modelCast.TaskActionName[action]
|
||||||
|
if !ok {
|
||||||
|
TaskActionName = "未知任务"
|
||||||
|
}
|
||||||
|
filename := fmt.Sprintf("%s_%s.xlsx", TaskActionName, time.Now().Format("20060102150405"))
|
||||||
|
filePath := tempDir + "/" + filename
|
||||||
|
var exportUrl string = fmt.Sprintf("%s/api/fiee/static/%s", config.AppConfig.System.FieeHost, strings.Replace(filePath, "./runtime/", "", 1))
|
||||||
|
if err = f.SaveAs(filePath); err != nil {
|
||||||
|
zap.L().Error("PublishTaskExcel SaveAs err", zap.Error(err))
|
||||||
|
return "", errors.New("保存Excel文件失败")
|
||||||
|
}
|
||||||
|
if uploadOss {
|
||||||
|
// 上传到阿里云
|
||||||
|
exportUrl, err = upload.PutBos(filePath, "excel", true)
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return exportUrl, nil
|
||||||
|
}
|
||||||
|
|||||||
@ -2,11 +2,13 @@ package cast
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"fonchain-fiee/api/aryshare"
|
"fonchain-fiee/api/aryshare"
|
||||||
"fonchain-fiee/api/cast"
|
"fonchain-fiee/api/cast"
|
||||||
"fonchain-fiee/cmd/config"
|
"fonchain-fiee/cmd/config"
|
||||||
"fonchain-fiee/pkg/service"
|
"fonchain-fiee/pkg/service"
|
||||||
|
"fonchain-fiee/pkg/service/check"
|
||||||
"fonchain-fiee/pkg/utils"
|
"fonchain-fiee/pkg/utils"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
@ -14,6 +16,17 @@ import (
|
|||||||
|
|
||||||
func Test(ctx *gin.Context) {
|
func Test(ctx *gin.Context) {
|
||||||
action := ctx.PostForm("action")
|
action := ctx.PostForm("action")
|
||||||
|
if action == "" {
|
||||||
|
workUuid := ctx.PostForm("workUuid")
|
||||||
|
err := CheckImage(workUuid)
|
||||||
|
if err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
service.Success(ctx, nil)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if action == "getPost" {
|
if action == "getPost" {
|
||||||
id := ctx.PostForm("id")
|
id := ctx.PostForm("id")
|
||||||
profileKey := ctx.PostForm("profileKey")
|
profileKey := ctx.PostForm("profileKey")
|
||||||
@ -68,19 +81,6 @@ func Test(ctx *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if action == "" {
|
|
||||||
profileKey := ctx.PostForm("profileKey")
|
|
||||||
resp, err := service.AyrshareProvider.GetUser(context.Background(), &aryshare.GetUserRequest{
|
|
||||||
ProfileKey: profileKey,
|
|
||||||
InstagramDetails: true,
|
|
||||||
})
|
|
||||||
if err != nil {
|
|
||||||
service.Error(ctx, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
service.Success(ctx, resp)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if action == "getProfile" {
|
if action == "getProfile" {
|
||||||
//profileKey := ctx.PostForm("profileKey")
|
//profileKey := ctx.PostForm("profileKey")
|
||||||
resp, err := service.AyrshareProvider.GetProfiles(context.Background(), &aryshare.GetProfilesRequest{
|
resp, err := service.AyrshareProvider.GetProfiles(context.Background(), &aryshare.GetProfilesRequest{
|
||||||
@ -127,6 +127,52 @@ func Test(ctx *gin.Context) {
|
|||||||
service.CastProvider.Tools(context.Background(), &cast.ToolsReq{Action: action})
|
service.CastProvider.Tools(context.Background(), &cast.ToolsReq{Action: action})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if action == "SecurityText" {
|
||||||
|
val := ctx.PostForm("val")
|
||||||
|
ok, err := check.SecurityFile(val)
|
||||||
|
if err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if !ok {
|
||||||
|
service.Error(ctx, errors.New("标题鉴定未通过"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
service.Success(ctx, "ok")
|
||||||
|
}
|
||||||
|
|
||||||
|
if action == "SecurityFile" {
|
||||||
|
val := ctx.PostForm("val")
|
||||||
|
ok, err := check.SecurityFile(val)
|
||||||
|
if err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if !ok {
|
||||||
|
service.Error(ctx, errors.New("标题鉴定未通过"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
service.Success(ctx, "ok")
|
||||||
|
}
|
||||||
|
if action == "SyncAsAuth" {
|
||||||
|
artistUuid := ctx.PostForm("artistUuid")
|
||||||
|
err := SyncAsAuth(artistUuid)
|
||||||
|
if err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
service.Success(ctx, "ok")
|
||||||
|
}
|
||||||
|
|
||||||
|
if action == "RefreshWorkList" {
|
||||||
|
resp, err := service.CastProvider.RefreshWorkList(context.Background(), &cast.RefreshWorkListReq{PublishStatus: 1})
|
||||||
|
if err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
service.Success(ctx, resp)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
service.Success(ctx, "unknow")
|
service.Success(ctx, "unknow")
|
||||||
return
|
return
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -12,6 +12,7 @@ import (
|
|||||||
pkgSecurity "fonchain-fiee/pkg/security"
|
pkgSecurity "fonchain-fiee/pkg/security"
|
||||||
|
|
||||||
"github.com/fonchain/utils/security"
|
"github.com/fonchain/utils/security"
|
||||||
|
"go.uber.org/zap"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ImageCheckUrlValid 图片黄疸检测 true 是通过
|
// ImageCheckUrlValid 图片黄疸检测 true 是通过
|
||||||
@ -55,7 +56,6 @@ func ImageCheckByte(file *multipart.FileHeader) (bool, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func SecurityFile(textVal string) (bool, error) {
|
func SecurityFile(textVal string) (bool, error) {
|
||||||
//FIXME
|
|
||||||
return true, nil
|
return true, nil
|
||||||
if textVal == "" {
|
if textVal == "" {
|
||||||
return true, nil
|
return true, nil
|
||||||
@ -80,13 +80,15 @@ 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
|
||||||
}
|
}
|
||||||
err = aliConfig.GetSTSToken()
|
err = aliConfig.GetSTSToken()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, errors.New("获取图片失败")
|
zap.L().Error("获取凭证失败", zap.Error(err))
|
||||||
|
return false, errors.New("获取凭证失败")
|
||||||
}
|
}
|
||||||
if err = handleTextScan(aliConfig, textVal); err != nil {
|
if err = handleTextScan(aliConfig, textVal); err != nil {
|
||||||
return false, err
|
return false, err
|
||||||
@ -102,6 +104,7 @@ func securityScan(fileInfo *modelSecurity.FileInfo) (err error) {
|
|||||||
}
|
}
|
||||||
err = aliConfig.GetSTSToken()
|
err = aliConfig.GetSTSToken()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
zap.L().Error("获取凭证失败", zap.Error(err))
|
||||||
return errors.New("获取凭证失败")
|
return errors.New("获取凭证失败")
|
||||||
}
|
}
|
||||||
switch fileInfo.FileType {
|
switch fileInfo.FileType {
|
||||||
@ -154,7 +157,8 @@ func handleVideoScan(config *security.Config, fileInfo *modelSecurity.FileInfo)
|
|||||||
}
|
}
|
||||||
if v.Results.RiskLevel != nil {
|
if v.Results.RiskLevel != nil {
|
||||||
lv := v.Results.RiskLevel
|
lv := v.Results.RiskLevel
|
||||||
if *lv == "none" {
|
//if *lv == "none" {
|
||||||
|
if *lv != "high" {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
return errors.New("图片违规")
|
return errors.New("图片违规")
|
||||||
@ -193,7 +197,8 @@ func handleImageScan(config *security.Config, fileInfo *modelSecurity.FileInfo)
|
|||||||
fileInfo.SecurityStatus = *v2.RiskLevel
|
fileInfo.SecurityStatus = *v2.RiskLevel
|
||||||
if v2.RiskLevel != nil {
|
if v2.RiskLevel != nil {
|
||||||
lv := v2.RiskLevel
|
lv := v2.RiskLevel
|
||||||
if *lv == "none" {
|
//if *lv == "none" {
|
||||||
|
if *lv != "high" {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
return errors.New("图片违规")
|
return errors.New("图片违规")
|
||||||
|
|||||||
@ -4,13 +4,19 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
account "fonchain-fiee/api/accountFiee"
|
||||||
"fonchain-fiee/api/cron"
|
"fonchain-fiee/api/cron"
|
||||||
"fonchain-fiee/pkg/service"
|
"fonchain-fiee/pkg/service"
|
||||||
"fonchain-fiee/pkg/utils"
|
"fonchain-fiee/pkg/utils"
|
||||||
|
"log"
|
||||||
|
"os"
|
||||||
|
"path/filepath"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/gin-gonic/gin/binding"
|
"github.com/gin-gonic/gin/binding"
|
||||||
|
"github.com/xuri/excelize/v2"
|
||||||
"google.golang.org/protobuf/types/known/emptypb"
|
"google.golang.org/protobuf/types/known/emptypb"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -112,20 +118,36 @@ func ExportExcelExecutionResult(c *gin.Context) {
|
|||||||
service.Error(c, errors.New("网络超时,请重试"))
|
service.Error(c, errors.New("网络超时,请重试"))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
userListRes, err := service.AccountFieeProvider.UserList(context.Background(), &account.UserListRequest{
|
||||||
|
Domain: "app",
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
service.Error(c, errors.New("用户查询失败"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
idFindSubName := make(map[uint64]string)
|
||||||
|
for _, v := range userListRes.UserList {
|
||||||
|
idFindSubName[v.Id] = v.SubNum
|
||||||
|
}
|
||||||
|
|
||||||
titleList := []string{
|
titleList := []string{
|
||||||
"任务标题", "艺人编号", "艺人姓名", "内容类型", "内容标题", "执行结果", "原因",
|
"任务标题", "艺人编号", "艺人姓名", "内容类型", "内容标题", "执行结果", "原因", "TIKTOK", "YOUTUBE", "INS", "DM", "BULESKY",
|
||||||
}
|
}
|
||||||
var dataList []interface{}
|
var dataList []interface{}
|
||||||
for _, task := range res.Data {
|
for _, task := range res.Data {
|
||||||
data := []interface{}{
|
data := []interface{}{
|
||||||
task.TaskTitle,
|
task.TaskTitle,
|
||||||
task.ArtistId,
|
idFindSubName[uint64(task.ArtistId)],
|
||||||
task.ArtistName,
|
task.ArtistName,
|
||||||
task.ContentTypeDescription,
|
task.ContentTypeDescription,
|
||||||
task.WorkTitle,
|
task.WorkTitle,
|
||||||
task.ResultDescription,
|
task.ResultDescription,
|
||||||
task.ResultDesc,
|
task.ResultDesc,
|
||||||
|
task.TIKTOKStatusDesc,
|
||||||
|
task.YOUTUBEStatusDesc,
|
||||||
|
task.INSStatusDesc,
|
||||||
|
task.DMStatusDesc,
|
||||||
|
task.BULESKYStatusDesc,
|
||||||
}
|
}
|
||||||
dataList = append(dataList, &data)
|
dataList = append(dataList, &data)
|
||||||
}
|
}
|
||||||
@ -205,3 +227,160 @@ func GetScheduleTaskStatus(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
service.Success(c, res)
|
service.Success(c, res)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func GetImportData(c *gin.Context) {
|
||||||
|
defer func() {
|
||||||
|
if r := recover(); r != nil {
|
||||||
|
service.Error(c, errors.New("操作失败"))
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
|
// 导入excel
|
||||||
|
excelFile, err := c.FormFile("excel")
|
||||||
|
if err != nil {
|
||||||
|
service.Error(c, errors.New("缺少excel文件"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 创建临时文件
|
||||||
|
tempDir := "tmp"
|
||||||
|
if err = os.MkdirAll(tempDir, 0755); err != nil {
|
||||||
|
service.Error(c, errors.New("创建临时目录失败"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
defer os.RemoveAll(tempDir)
|
||||||
|
|
||||||
|
// 保存excel
|
||||||
|
excelPath := filepath.Join(tempDir, "excel.xlsx")
|
||||||
|
if err = c.SaveUploadedFile(excelFile, excelPath); err != nil {
|
||||||
|
service.Error(c, errors.New("保存excel文件失败"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 读取excel
|
||||||
|
readExcelResult, err := readExcel(excelPath)
|
||||||
|
if err != nil {
|
||||||
|
service.Error(c, fmt.Errorf("读取excel失败: %v", err))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if len(readExcelResult) == 0 {
|
||||||
|
service.Error(c, errors.New("请检查excel文件"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
//去重操作
|
||||||
|
set := make(map[string]struct{})
|
||||||
|
var uniqueExcelData []excelData
|
||||||
|
for _, data := range readExcelResult {
|
||||||
|
if _, exists := set[data.SubName]; !exists {
|
||||||
|
set[data.SubName] = struct{}{}
|
||||||
|
uniqueExcelData = append(uniqueExcelData, data)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
res, err := service.AccountFieeProvider.UserList(context.Background(), &account.UserListRequest{
|
||||||
|
Domain: "app",
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
service.Error(c, errors.New("用户查询失败"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
//检查subname是否正确是否存在
|
||||||
|
subNames := make(map[string]struct{}, len(res.UserList))
|
||||||
|
for _, v := range res.UserList {
|
||||||
|
subNames[v.SubNum] = struct{}{}
|
||||||
|
}
|
||||||
|
for _, v := range uniqueExcelData {
|
||||||
|
if _, ok := subNames[v.SubName]; !ok {
|
||||||
|
service.Error(c, errors.New(fmt.Sprintf("第 %d 行数据错误,请检查数据!", v.Line)))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//检查subname和name是否匹配
|
||||||
|
subNameFindExcelData := make(map[string]excelData, len(uniqueExcelData))
|
||||||
|
for _, v := range uniqueExcelData {
|
||||||
|
subNameFindExcelData[v.SubName] = v
|
||||||
|
}
|
||||||
|
subNameFindID := make(map[string]uint64, len(uniqueExcelData))
|
||||||
|
result := make([]excelDataResult, 0, len(uniqueExcelData))
|
||||||
|
for _, v := range res.UserList {
|
||||||
|
subNameFindID[v.SubNum] = v.Id
|
||||||
|
if subNameFindExcelData[v.SubNum].Name != v.Name && subNameFindExcelData[v.SubNum].Name != "" {
|
||||||
|
fmt.Println(subNameFindExcelData[v.SubNum], v.Name)
|
||||||
|
service.Error(c, errors.New(fmt.Sprintf("第 %d 行数据错误,请检查数据!", subNameFindExcelData[v.SubNum].Line)))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for _, v := range uniqueExcelData {
|
||||||
|
result = append(result, excelDataResult{
|
||||||
|
Id: subNameFindID[v.SubName],
|
||||||
|
Name: v.Name,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
service.Success(c, result)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
type excelData struct {
|
||||||
|
Line uint `json:"line"`
|
||||||
|
SubName string `json:"subName"`
|
||||||
|
Name string `json:"name"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type excelDataResult struct {
|
||||||
|
Id uint64 `json:"id"`
|
||||||
|
Name string `json:"name"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func readExcel(excelPath string) ([]excelData, error) {
|
||||||
|
//打开excel
|
||||||
|
f, err := excelize.OpenFile(excelPath)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
defer f.Close()
|
||||||
|
|
||||||
|
//读取第一页
|
||||||
|
sheetName := f.GetSheetName(0)
|
||||||
|
if sheetName == "" {
|
||||||
|
return nil, errors.New("excel文件中没有工作表")
|
||||||
|
}
|
||||||
|
|
||||||
|
//读取数据
|
||||||
|
rows, err := f.GetRows(sheetName)
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("读取工作表失败: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(rows) <= 1 {
|
||||||
|
return nil, errors.New("excel文件没有数据行(只有表头或为空)")
|
||||||
|
}
|
||||||
|
var result []excelData
|
||||||
|
for i := 1; i < len(rows); i++ { // 从第2行开始(跳过表头)
|
||||||
|
row := rows[i]
|
||||||
|
if len(row) == 0 {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
subName := getCellValue(f, sheetName, i, 0)
|
||||||
|
name := getCellValue(f, sheetName, i, 1)
|
||||||
|
data := excelData{
|
||||||
|
Line: uint(i + 1),
|
||||||
|
SubName: subName,
|
||||||
|
Name: name,
|
||||||
|
}
|
||||||
|
result = append(result, data)
|
||||||
|
}
|
||||||
|
|
||||||
|
return result, nil
|
||||||
|
}
|
||||||
|
func getCellValue(f *excelize.File, sheetName string, rowIndex, colIndex int) string {
|
||||||
|
colName, _ := excelize.ColumnNumberToName(colIndex + 1)
|
||||||
|
cell := fmt.Sprintf("%s%d", colName, rowIndex+1)
|
||||||
|
|
||||||
|
value, err := f.GetCellValue(sheetName, cell)
|
||||||
|
if err != nil {
|
||||||
|
log.Printf("读取单元格 %s 失败: %v", cell, err)
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
return strings.TrimSpace(value)
|
||||||
|
}
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
|
"fmt"
|
||||||
"fonchain-fiee/api/files"
|
"fonchain-fiee/api/files"
|
||||||
"fonchain-fiee/pkg/service"
|
"fonchain-fiee/pkg/service"
|
||||||
"fonchain-fiee/pkg/service/bundle/common"
|
"fonchain-fiee/pkg/service/bundle/common"
|
||||||
@ -102,6 +103,15 @@ func Create(ctx *gin.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func Delete(ctx *gin.Context) {
|
func Delete(ctx *gin.Context) {
|
||||||
|
path := ctx.DefaultQuery("path", "/")
|
||||||
|
nowYear := time.Now().Year()
|
||||||
|
nowMonth := time.Now().Month()
|
||||||
|
nowYearPath := fmt.Sprintf("/fiee/video/%d", nowYear)
|
||||||
|
nowMonthPath := fmt.Sprintf("/fiee/video/%d/%d-%d", nowYear, nowYear, nowMonth)
|
||||||
|
if path == nowYearPath || path == nowMonthPath || path == "/fiee" || path == "/fiee/video" || path == "/fiee/video/old" {
|
||||||
|
service.Error(ctx, errors.New("无法删除该目录"))
|
||||||
|
return
|
||||||
|
}
|
||||||
resp, err := service.FilesProvider.Delete(ctx, &files.DeleteReq{
|
resp, err := service.FilesProvider.Delete(ctx, &files.DeleteReq{
|
||||||
Path: ctx.DefaultQuery("path", "/"),
|
Path: ctx.DefaultQuery("path", "/"),
|
||||||
UserSpacePath: getUserSpacePath(ctx),
|
UserSpacePath: getUserSpacePath(ctx),
|
||||||
|
|||||||
@ -47,7 +47,12 @@ func Delete(ctx *gin.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func Display(ctx *gin.Context) {
|
func Display(ctx *gin.Context) {
|
||||||
resp, err := service.GovernanceProvider.Display(ctx, &governance.DisplayReq{})
|
var req governance.DisplayReq
|
||||||
|
if err := ctx.ShouldBindJSON(&req); err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
resp, err := service.GovernanceProvider.Display(ctx, &req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
service.Error(ctx, errors.New(common.DisplayGovernanceFailed))
|
service.Error(ctx, errors.New(common.DisplayGovernanceFailed))
|
||||||
return
|
return
|
||||||
@ -85,3 +90,34 @@ func Edit(ctx *gin.Context) {
|
|||||||
}
|
}
|
||||||
service.Success(ctx, resp)
|
service.Success(ctx, resp)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func UpdataStatus(ctx *gin.Context) {
|
||||||
|
var req governance.UpdataStatusReq
|
||||||
|
if err := ctx.ShouldBindJSON(&req); err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
user := login.GetUserInfoFromC(ctx)
|
||||||
|
req.Operator = user.Name
|
||||||
|
req.OperatorId = int32(user.ID)
|
||||||
|
resp, err := service.GovernanceProvider.UpdataStatus(ctx, &req)
|
||||||
|
if err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
service.Success(ctx, resp)
|
||||||
|
}
|
||||||
|
|
||||||
|
func GetGovernanceInfo(ctx *gin.Context) {
|
||||||
|
var req governance.GetGovernanceInfoReq
|
||||||
|
if err := ctx.ShouldBindJSON(&req); err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
resp, err := service.GovernanceProvider.GetGovernanceInfo(ctx, &req)
|
||||||
|
if err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
service.Success(ctx, resp)
|
||||||
|
}
|
||||||
|
|||||||
@ -30,6 +30,8 @@ type excelData struct {
|
|||||||
SubNum string //用户编号 必须字段
|
SubNum string //用户编号 必须字段
|
||||||
TikTok string
|
TikTok string
|
||||||
Instagram string
|
Instagram string
|
||||||
|
YouTube string
|
||||||
|
BlueSky string
|
||||||
Youtube string
|
Youtube string
|
||||||
Desc string //艺人简介
|
Desc string //艺人简介
|
||||||
TitleRequire string //标题要求 必须字段
|
TitleRequire string //标题要求 必须字段
|
||||||
@ -178,27 +180,30 @@ func readExcel(excelPath string) ([]excelData, error) {
|
|||||||
if subNum == "" {
|
if subNum == "" {
|
||||||
return nil, fmt.Errorf("第%d行应该有编号", i+1)
|
return nil, fmt.Errorf("第%d行应该有编号", i+1)
|
||||||
}
|
}
|
||||||
tikTok := getCellValue(f, sheetName, i, 2)
|
blueSky := getCellValue(f, sheetName, i, 2)
|
||||||
|
if blueSky == "" {
|
||||||
|
return nil, fmt.Errorf("第%d行应该有bluesky账号昵称", i+1)
|
||||||
|
}
|
||||||
|
tikTok := getCellValue(f, sheetName, i, 3)
|
||||||
if tikTok == "" {
|
if tikTok == "" {
|
||||||
return nil, fmt.Errorf("第%d行应该有tiktok账号昵称", i+1)
|
return nil, fmt.Errorf("第%d行应该有tiktok账号昵称", i+1)
|
||||||
}
|
}
|
||||||
instagram := getCellValue(f, sheetName, i, 3)
|
instagram := getCellValue(f, sheetName, i, 4)
|
||||||
if instagram == "" {
|
|
||||||
return nil, fmt.Errorf("第%d行应该有ins账号昵称", i+1)
|
desc := getCellValue(f, sheetName, i, 5)
|
||||||
}
|
|
||||||
desc := getCellValue(f, sheetName, i, 4)
|
titleRequire := getCellValue(f, sheetName, i, 6)
|
||||||
titleRequire := getCellValue(f, sheetName, i, 5)
|
|
||||||
if titleRequire == "" {
|
if titleRequire == "" {
|
||||||
return nil, fmt.Errorf("第%d行应该有标题要求", i+1)
|
return nil, fmt.Errorf("第%d行应该有标题要求", i+1)
|
||||||
}
|
}
|
||||||
contentRequire := getCellValue(f, sheetName, i, 6)
|
contentRequire := getCellValue(f, sheetName, i, 7)
|
||||||
if contentRequire == "" {
|
if contentRequire == "" {
|
||||||
return nil, fmt.Errorf("第%d行应该有内容要求", i+1)
|
return nil, fmt.Errorf("第%d行应该有内容要求", i+1)
|
||||||
}
|
}
|
||||||
photoRequire := getCellValue(f, sheetName, i, 7)
|
photoRequire := getCellValue(f, sheetName, i, 8)
|
||||||
photoUrl := getCellValue(f, sheetName, i, 8)
|
photoUrl := getCellValue(f, sheetName, i, 9)
|
||||||
photoNumStr := getCellValue(f, sheetName, i, 9)
|
photoNumStr := getCellValue(f, sheetName, i, 10)
|
||||||
photoDpi := getCellValue(f, sheetName, i, 10)
|
photoDpi := getCellValue(f, sheetName, i, 11)
|
||||||
var num int
|
var num int
|
||||||
if photoUrl == "" { //如果没有关联画作,数量必须有,需求必须有
|
if photoUrl == "" { //如果没有关联画作,数量必须有,需求必须有
|
||||||
//需求必须有
|
//需求必须有
|
||||||
@ -220,6 +225,7 @@ func readExcel(excelPath string) ([]excelData, error) {
|
|||||||
data := excelData{
|
data := excelData{
|
||||||
ArtistName: artistName,
|
ArtistName: artistName,
|
||||||
SubNum: subNum,
|
SubNum: subNum,
|
||||||
|
BlueSky: blueSky,
|
||||||
TikTok: tikTok,
|
TikTok: tikTok,
|
||||||
Instagram: instagram,
|
Instagram: instagram,
|
||||||
Desc: desc,
|
Desc: desc,
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
package imports
|
package imports
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
@ -8,6 +9,9 @@ import (
|
|||||||
apiCast "fonchain-fiee/api/cast"
|
apiCast "fonchain-fiee/api/cast"
|
||||||
"fonchain-fiee/pkg/config"
|
"fonchain-fiee/pkg/config"
|
||||||
"fonchain-fiee/pkg/service"
|
"fonchain-fiee/pkg/service"
|
||||||
|
"image"
|
||||||
|
"image/draw"
|
||||||
|
"image/jpeg"
|
||||||
"io"
|
"io"
|
||||||
"log"
|
"log"
|
||||||
"math/rand"
|
"math/rand"
|
||||||
@ -293,33 +297,62 @@ func (p *BatchProcessor) submitTask(req *excelData) error {
|
|||||||
if !tiktokFound {
|
if !tiktokFound {
|
||||||
return fmt.Errorf("未找到匹配的TikTok账号: %s", req.TikTok)
|
return fmt.Errorf("未找到匹配的TikTok账号: %s", req.TikTok)
|
||||||
}
|
}
|
||||||
// 获取 Instagram 自媒体账号
|
if req.Instagram != "" {
|
||||||
accountListIns, err := service.CastProvider.MediaUserList(context.Background(), &apiCast.MediaUserListReq{
|
// 获取 Instagram 自媒体账号
|
||||||
|
accountListIns, err := service.CastProvider.MediaUserList(context.Background(), &apiCast.MediaUserListReq{
|
||||||
|
ArtistVal: req.ArtistName,
|
||||||
|
PlatformID: 3,
|
||||||
|
Page: 1,
|
||||||
|
PageSize: 10,
|
||||||
|
ArtistUuid: strconv.FormatUint(list.UserList[0].Id, 10),
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("获取 Instagram 账号失败: %s", err.Error())
|
||||||
|
}
|
||||||
|
if accountListIns == nil || len(accountListIns.Data) == 0 {
|
||||||
|
return fmt.Errorf("ins自媒体账号数量为0")
|
||||||
|
}
|
||||||
|
// 查找 Instagram 账号
|
||||||
|
insFound := false
|
||||||
|
for _, user := range accountListIns.Data {
|
||||||
|
if user.PlatformUserName == req.Instagram {
|
||||||
|
req.MediaAccountNames = append(req.MediaAccountNames, user.PlatformUserName)
|
||||||
|
req.MediaAccountUuids = append(req.MediaAccountUuids, user.MediaAccountUuid)
|
||||||
|
insFound = true
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if !insFound {
|
||||||
|
return fmt.Errorf("未找到匹配的Instagram账号: %s", req.Instagram)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
// 获取 Bluesky 自媒体账号
|
||||||
|
accountListBlueSky, err := service.CastProvider.MediaUserList(context.Background(), &apiCast.MediaUserListReq{
|
||||||
ArtistVal: req.ArtistName,
|
ArtistVal: req.ArtistName,
|
||||||
PlatformID: 3,
|
PlatformID: 5, // Bluesky platform ID
|
||||||
Page: 1,
|
Page: 1,
|
||||||
PageSize: 10,
|
PageSize: 10,
|
||||||
ArtistUuid: strconv.FormatUint(list.UserList[0].Id, 10),
|
ArtistUuid: strconv.FormatUint(list.UserList[0].Id, 10),
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("获取 Instagram 账号失败: %s", err.Error())
|
return fmt.Errorf("获取 Bluesky 账号失败: %s", err.Error())
|
||||||
}
|
}
|
||||||
if accountListIns == nil || len(accountListIns.Data) == 0 {
|
if accountListBlueSky == nil || len(accountListBlueSky.Data) == 0 {
|
||||||
return fmt.Errorf("ins自媒体账号数量为0")
|
return fmt.Errorf("bluesky自媒体账号数量为0")
|
||||||
}
|
}
|
||||||
|
// 查找 Bluesky 账号
|
||||||
// 查找 Instagram 账号
|
blueSkyFound := false
|
||||||
insFound := false
|
for _, user := range accountListBlueSky.Data {
|
||||||
for _, user := range accountListIns.Data {
|
if user.PlatformUserName == req.BlueSky {
|
||||||
if user.PlatformUserName == req.Instagram {
|
|
||||||
req.MediaAccountNames = append(req.MediaAccountNames, user.PlatformUserName)
|
req.MediaAccountNames = append(req.MediaAccountNames, user.PlatformUserName)
|
||||||
req.MediaAccountUuids = append(req.MediaAccountUuids, user.MediaAccountUuid)
|
req.MediaAccountUuids = append(req.MediaAccountUuids, user.MediaAccountUuid)
|
||||||
insFound = true
|
blueSkyFound = true
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if !insFound {
|
if !blueSkyFound {
|
||||||
return fmt.Errorf("未找到匹配的Instagram账号: %s", req.Instagram)
|
return fmt.Errorf("未找到匹配的Bluesky账号: %s", req.BlueSky)
|
||||||
}
|
}
|
||||||
|
|
||||||
switch {
|
switch {
|
||||||
@ -543,21 +576,17 @@ func downloadAndUploadToBucket(imageURL string) (string, error) {
|
|||||||
return "", fmt.Errorf("创建临时目录失败: %v", err)
|
return "", fmt.Errorf("创建临时目录失败: %v", err)
|
||||||
}
|
}
|
||||||
defer os.RemoveAll(tempDir) // 程序结束时清理整个目录
|
defer os.RemoveAll(tempDir) // 程序结束时清理整个目录
|
||||||
|
|
||||||
|
// 生成唯一文件名
|
||||||
rand.Seed(time.Now().UnixNano())
|
rand.Seed(time.Now().UnixNano())
|
||||||
fileName := fmt.Sprintf("%d%04d.jpg", time.Now().Unix(), rand.Intn(10000))
|
timestamp := time.Now().Unix()
|
||||||
|
randomNum := rand.Intn(10000)
|
||||||
|
fileName := fmt.Sprintf("%d%04d.jpg", timestamp, randomNum)
|
||||||
|
|
||||||
// 构建文件路径
|
// 构建文件路径
|
||||||
imgPath := filepath.Join(tempDir, fileName)
|
imgPath := filepath.Join(tempDir, fileName)
|
||||||
|
|
||||||
// 创建文件
|
// 下载图片
|
||||||
file, err := os.Create(imgPath)
|
|
||||||
if err != nil {
|
|
||||||
return "", fmt.Errorf("创建文件失败: %v", err)
|
|
||||||
}
|
|
||||||
defer file.Close()
|
|
||||||
|
|
||||||
log.Printf("文件创建在: %s", imgPath)
|
|
||||||
|
|
||||||
// 下载图片到文件
|
|
||||||
resp, err := http.Get(imageURL)
|
resp, err := http.Get(imageURL)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", fmt.Errorf("下载图片失败: %v", err)
|
return "", fmt.Errorf("下载图片失败: %v", err)
|
||||||
@ -568,50 +597,62 @@ func downloadAndUploadToBucket(imageURL string) (string, error) {
|
|||||||
return "", fmt.Errorf("下载失败,状态码: %d", resp.StatusCode)
|
return "", fmt.Errorf("下载失败,状态码: %d", resp.StatusCode)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 复制到文件
|
// 读取图片数据
|
||||||
_, err = io.Copy(file, resp.Body)
|
imgData, err := io.ReadAll(resp.Body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", fmt.Errorf("保存文件失败: %v", err)
|
return "", fmt.Errorf("读取图片数据失败: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
file.Sync()
|
// 检测图片格式并转换为JPG
|
||||||
|
jpgData, err := convertToJPG(imgData)
|
||||||
fileBytes, err := os.ReadFile(imgPath)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", fmt.Errorf("读取本地文件失败: %v", err)
|
return "", fmt.Errorf("转换图片格式失败: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 保存转换后的JPG文件
|
||||||
|
if err := os.WriteFile(imgPath, jpgData, 0644); err != nil {
|
||||||
|
return "", fmt.Errorf("保存JPG文件失败: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 上传到对象存储
|
||||||
BOSClient, err := objstorage.NewOSS(
|
BOSClient, err := objstorage.NewOSS(
|
||||||
os.Getenv(config.ConfigData.Oss.AccessKeyId),
|
os.Getenv(config.ConfigData.Oss.AccessKeyId),
|
||||||
os.Getenv(config.ConfigData.Oss.AccessKeySecret),
|
os.Getenv(config.ConfigData.Oss.AccessKeySecret),
|
||||||
os.Getenv(config.ConfigData.Oss.Endpoint),
|
os.Getenv(config.ConfigData.Oss.Endpoint),
|
||||||
)
|
)
|
||||||
if BOSClient == nil {
|
if err != nil {
|
||||||
return "", fmt.Errorf("上传文件失败: %v", err)
|
return "", fmt.Errorf("创建OSS客户端失败: %v", err)
|
||||||
}
|
}
|
||||||
_, err = BOSClient.PutObjectFromBytes(os.Getenv(config.ConfigData.Oss.BucketName), fileName, fileBytes)
|
if BOSClient == nil {
|
||||||
|
return "", fmt.Errorf("OSS客户端为空")
|
||||||
|
}
|
||||||
|
|
||||||
|
_, err = BOSClient.PutObjectFromBytes(os.Getenv(config.ConfigData.Oss.BucketName), fileName, jpgData)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", fmt.Errorf("上传文件失败: %v", err)
|
return "", fmt.Errorf("上传文件失败: %v", err)
|
||||||
}
|
}
|
||||||
url := fmt.Sprintf("%s/%s", os.Getenv(config.ConfigData.Oss.CdnHost), fileName)
|
|
||||||
//上传到桶
|
|
||||||
//BOSClient, err := objstorage.NewOSS(
|
|
||||||
// config.ConfigData.Oss.AccessKeyId,
|
|
||||||
// config.ConfigData.Oss.AccessKeySecret,
|
|
||||||
// config.ConfigData.Oss.Endpoint,
|
|
||||||
//)
|
|
||||||
//if BOSClient == nil {
|
//if BOSClient == nil {
|
||||||
// return "", fmt.Errorf("上传文件失败: %v", err)
|
|
||||||
//}
|
|
||||||
//_, err = BOSClient.PutObjectFromBytes(config.ConfigData.Oss.BucketName, fileName, fileBytes)
|
|
||||||
//if err != nil {
|
|
||||||
// return "", fmt.Errorf("上传文件失败: %v", err)
|
|
||||||
//}
|
|
||||||
//url := fmt.Sprintf("%s/%s", config.ConfigData.Oss.CdnHost, fileName)
|
|
||||||
|
|
||||||
|
// 返回CDN URL
|
||||||
|
url := fmt.Sprintf("%s/%s", os.Getenv(config.ConfigData.Oss.CdnHost), fileName)
|
||||||
return url, nil
|
return url, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//上传到桶
|
||||||
|
//BOSClient, err := objstorage.NewOSS(
|
||||||
|
// config.ConfigData.Oss.AccessKeyId,
|
||||||
|
// config.ConfigData.Oss.AccessKeySecret,
|
||||||
|
// config.ConfigData.Oss.Endpoint,
|
||||||
|
//)
|
||||||
|
//if BOSClient == nil {
|
||||||
|
// return "", fmt.Errorf("上传文件失败: %v", err)
|
||||||
|
//}
|
||||||
|
//_, err = BOSClient.PutObjectFromBytes(config.ConfigData.Oss.BucketName, fileName, fileBytes)
|
||||||
|
//if err != nil {
|
||||||
|
// return "", fmt.Errorf("上传文件失败: %v", err)
|
||||||
|
//}
|
||||||
|
//url := fmt.Sprintf("%s/%s", config.ConfigData.Oss.CdnHost, fileName)
|
||||||
|
|
||||||
func (p *BatchProcessor) generateTitleAndContent(req *excelData) (string, string, error) {
|
func (p *BatchProcessor) generateTitleAndContent(req *excelData) (string, string, error) {
|
||||||
if req.PhotoUrl != "" {
|
if req.PhotoUrl != "" {
|
||||||
title, content, err := NewAiGenerator().GenerateTitleAndContentFromImage(
|
title, content, err := NewAiGenerator().GenerateTitleAndContentFromImage(
|
||||||
@ -651,7 +692,7 @@ func (p *BatchProcessor) generateImage(req *excelData) (string, error) {
|
|||||||
prompt += "\n要求不能出现:低质量、残缺、人物正脸、多余的手指、乱码字符和文字、比例不良,场景以国内场景为主"
|
prompt += "\n要求不能出现:低质量、残缺、人物正脸、多余的手指、乱码字符和文字、比例不良,场景以国内场景为主"
|
||||||
|
|
||||||
if req.PhotoDpi == "" {
|
if req.PhotoDpi == "" {
|
||||||
req.PhotoDpi = "720*1280"
|
req.PhotoDpi = "1024*1024"
|
||||||
|
|
||||||
}
|
}
|
||||||
result, err := NewAiGenerator().TextToImage(
|
result, err := NewAiGenerator().TextToImage(
|
||||||
@ -665,6 +706,33 @@ func (p *BatchProcessor) generateImage(req *excelData) (string, error) {
|
|||||||
return result.Output.TaskID, nil
|
return result.Output.TaskID, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// convertToJPG 将图片数据转换为JPG格式
|
||||||
|
func convertToJPG(imgData []byte) ([]byte, error) {
|
||||||
|
// 使用标准库解码
|
||||||
|
img, format, err := image.Decode(bytes.NewReader(imgData))
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("解码图片失败: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
log.Printf("检测到图片格式: %s, 尺寸: %dx%d", format, img.Bounds().Dx(), img.Bounds().Dy())
|
||||||
|
|
||||||
|
// 创建新的RGBA图片
|
||||||
|
bounds := img.Bounds()
|
||||||
|
rgba := image.NewRGBA(bounds)
|
||||||
|
|
||||||
|
// 绘制到RGBA
|
||||||
|
draw.Draw(rgba, bounds, img, bounds.Min, draw.Src)
|
||||||
|
|
||||||
|
// 编码为JPG
|
||||||
|
var buf bytes.Buffer
|
||||||
|
opts := &jpeg.Options{Quality: 90} // 设置质量为90%
|
||||||
|
if err := jpeg.Encode(&buf, rgba, opts); err != nil {
|
||||||
|
return nil, fmt.Errorf("编码JPG失败: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
return buf.Bytes(), nil
|
||||||
|
}
|
||||||
|
|
||||||
//func (p *BatchProcessor) StartPolling() {
|
//func (p *BatchProcessor) StartPolling() {
|
||||||
// go func() {
|
// go func() {
|
||||||
// ticker := time.NewTicker(p.pollInterval) // 1秒间隔
|
// ticker := time.NewTicker(p.pollInterval) // 1秒间隔
|
||||||
|
|||||||
@ -58,6 +58,7 @@ func publishImage(req publishImageReq) (err error) {
|
|||||||
|
|
||||||
//---------------------------------------------------发布
|
//---------------------------------------------------发布
|
||||||
_, err = service.CastProvider.UpdateWorkImage(context.Background(), &apiCast.UpdateWorkImageReq{
|
_, err = service.CastProvider.UpdateWorkImage(context.Background(), &apiCast.UpdateWorkImageReq{
|
||||||
|
ArtistSubNum: list.UserList[0].SubNum,
|
||||||
Title: req.Title,
|
Title: req.Title,
|
||||||
Content: req.Content,
|
Content: req.Content,
|
||||||
Images: req.GeneratePhotoUrl,
|
Images: req.GeneratePhotoUrl,
|
||||||
|
|||||||
@ -17,6 +17,7 @@ import (
|
|||||||
"fonchain-fiee/api/pressreleases"
|
"fonchain-fiee/api/pressreleases"
|
||||||
"fonchain-fiee/api/reports"
|
"fonchain-fiee/api/reports"
|
||||||
"fonchain-fiee/api/secFilings"
|
"fonchain-fiee/api/secFilings"
|
||||||
|
"fonchain-fiee/api/supplier"
|
||||||
pkConfig "fonchain-fiee/pkg/config"
|
pkConfig "fonchain-fiee/pkg/config"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
@ -36,11 +37,12 @@ var CastProvider = new(cast.CastClientImpl)
|
|||||||
var GovernanceProvider = new(governance.GovernanceClientImpl)
|
var GovernanceProvider = new(governance.GovernanceClientImpl)
|
||||||
var PressReleasesProvider = new(pressreleases.PressReleasesClientImpl)
|
var PressReleasesProvider = new(pressreleases.PressReleasesClientImpl)
|
||||||
var SecFilingProvider = new(secFilings.SecFilingsClientImpl)
|
var SecFilingProvider = new(secFilings.SecFilingsClientImpl)
|
||||||
|
var AyrshareProvider = new(aryshare.AyrshareClientImpl)
|
||||||
|
var CronProvider = new(cron.CronClientImpl)
|
||||||
|
var SupplierProvider = new(supplier.SupplierClientImpl)
|
||||||
var ReportsProvider = new(reports.ReportsClientImpl)
|
var ReportsProvider = new(reports.ReportsClientImpl)
|
||||||
var EmailAlertsProvider = new(emailAlerts.EmailAlertsClientImpl)
|
var EmailAlertsProvider = new(emailAlerts.EmailAlertsClientImpl)
|
||||||
var MembersProvider = new(members.MembersClientImpl)
|
var MembersProvider = new(members.MembersClientImpl)
|
||||||
var AyrshareProvider = new(aryshare.AyrshareClientImpl)
|
|
||||||
var CronProvider = new(cron.CronClientImpl)
|
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
config.SetConsumerService(BundleProvider)
|
config.SetConsumerService(BundleProvider)
|
||||||
@ -53,11 +55,12 @@ func init() {
|
|||||||
config.SetConsumerService(GovernanceProvider)
|
config.SetConsumerService(GovernanceProvider)
|
||||||
config.SetConsumerService(PressReleasesProvider)
|
config.SetConsumerService(PressReleasesProvider)
|
||||||
config.SetConsumerService(SecFilingProvider)
|
config.SetConsumerService(SecFilingProvider)
|
||||||
|
config.SetConsumerService(AyrshareProvider)
|
||||||
|
config.SetConsumerService(CronProvider)
|
||||||
|
config.SetConsumerService(SupplierProvider)
|
||||||
config.SetConsumerService(ReportsProvider)
|
config.SetConsumerService(ReportsProvider)
|
||||||
config.SetConsumerService(EmailAlertsProvider)
|
config.SetConsumerService(EmailAlertsProvider)
|
||||||
config.SetConsumerService(MembersProvider)
|
config.SetConsumerService(MembersProvider)
|
||||||
config.SetConsumerService(AyrshareProvider)
|
|
||||||
config.SetConsumerService(CronProvider)
|
|
||||||
|
|
||||||
if err := config.Load(); err != nil {
|
if err := config.Load(); err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
|
|||||||
@ -8,6 +8,7 @@ import (
|
|||||||
"fonchain-fiee/api/pressreleases"
|
"fonchain-fiee/api/pressreleases"
|
||||||
"fonchain-fiee/pkg/model/login"
|
"fonchain-fiee/pkg/model/login"
|
||||||
"fonchain-fiee/pkg/service"
|
"fonchain-fiee/pkg/service"
|
||||||
|
"fonchain-fiee/pkg/service/bundle/common"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Create(ctx *gin.Context) {
|
func Create(ctx *gin.Context) {
|
||||||
@ -21,7 +22,7 @@ func Create(ctx *gin.Context) {
|
|||||||
req.OperatorId = int32(user.ID)
|
req.OperatorId = int32(user.ID)
|
||||||
resp, err := service.PressReleasesProvider.Create(ctx, &req)
|
resp, err := service.PressReleasesProvider.Create(ctx, &req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
service.Error(ctx, err)
|
service.Error(ctx, errors.New(common.CreatePressReleasesFailed))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
service.Success(ctx, resp)
|
service.Success(ctx, resp)
|
||||||
@ -35,7 +36,7 @@ func Delete(ctx *gin.Context) {
|
|||||||
}
|
}
|
||||||
resp, err := service.PressReleasesProvider.Delete(ctx, &req)
|
resp, err := service.PressReleasesProvider.Delete(ctx, &req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
service.Error(ctx, err)
|
service.Error(ctx, errors.New(common.DisplayPressReleasesFailed))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
service.Success(ctx, resp)
|
service.Success(ctx, resp)
|
||||||
@ -47,9 +48,13 @@ func Display(ctx *gin.Context) {
|
|||||||
service.Error(ctx, err)
|
service.Error(ctx, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if req.LangType == "" {
|
||||||
|
service.Error(ctx, errors.New("语言类型为空"))
|
||||||
|
return
|
||||||
|
}
|
||||||
resp, err := service.PressReleasesProvider.Display(ctx, &req)
|
resp, err := service.PressReleasesProvider.Display(ctx, &req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
service.Error(ctx, err)
|
service.Error(ctx, errors.New(common.ListPressReleasesFailed))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
service.Success(ctx, resp)
|
service.Success(ctx, resp)
|
||||||
@ -91,7 +96,7 @@ func List(ctx *gin.Context) {
|
|||||||
}
|
}
|
||||||
resp, err := service.PressReleasesProvider.List(ctx, &req)
|
resp, err := service.PressReleasesProvider.List(ctx, &req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
service.Error(ctx, err)
|
service.Error(ctx, errors.New(common.EditPressReleasesFailed))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
service.Success(ctx, resp)
|
service.Success(ctx, resp)
|
||||||
@ -108,7 +113,7 @@ func Edit(ctx *gin.Context) {
|
|||||||
req.OperatorId = int32(user.ID)
|
req.OperatorId = int32(user.ID)
|
||||||
resp, err := service.PressReleasesProvider.Edit(ctx, &req)
|
resp, err := service.PressReleasesProvider.Edit(ctx, &req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
service.Error(ctx, err)
|
service.Error(ctx, errors.New(common.EditPressReleasesFailed))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
service.Success(ctx, resp)
|
service.Success(ctx, resp)
|
||||||
@ -130,7 +135,7 @@ func Get(ctx *gin.Context) {
|
|||||||
req.LangType = langType
|
req.LangType = langType
|
||||||
resp, err := service.PressReleasesProvider.Get(ctx, &req)
|
resp, err := service.PressReleasesProvider.Get(ctx, &req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
service.Error(ctx, err)
|
service.Error(ctx, errors.New(common.GetPressReleasesFailed))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
service.Success(ctx, resp)
|
service.Success(ctx, resp)
|
||||||
|
|||||||
394
pkg/service/supplier/supplier.go
Normal file
394
pkg/service/supplier/supplier.go
Normal file
@ -0,0 +1,394 @@
|
|||||||
|
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 == "" || i.ConnectedParty == "" {
|
||||||
|
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,
|
||||||
|
ConnectedParty: i.ConnectedParty,
|
||||||
|
})
|
||||||
|
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", "*是否关联方/Connected party", "准入状态/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
|
||||||
|
ConnectedParty 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,
|
||||||
|
ConnectedParty: info.ConnectedParty,
|
||||||
|
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.ConnectedParty, 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
|
||||||
|
}
|
||||||
@ -10,7 +10,6 @@ import (
|
|||||||
"fonchain-fiee/api/cast"
|
"fonchain-fiee/api/cast"
|
||||||
"fonchain-fiee/cmd/config"
|
"fonchain-fiee/cmd/config"
|
||||||
"fonchain-fiee/pkg/e"
|
"fonchain-fiee/pkg/e"
|
||||||
modelCast "fonchain-fiee/pkg/model/cast"
|
|
||||||
"fonchain-fiee/pkg/model/login"
|
"fonchain-fiee/pkg/model/login"
|
||||||
"fonchain-fiee/pkg/service"
|
"fonchain-fiee/pkg/service"
|
||||||
castService "fonchain-fiee/pkg/service/cast"
|
castService "fonchain-fiee/pkg/service/cast"
|
||||||
@ -23,23 +22,6 @@ import (
|
|||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
)
|
)
|
||||||
|
|
||||||
// GetPendingTaskList 查询待指派任务记录
|
|
||||||
func GetPendingTaskList(c *gin.Context) {
|
|
||||||
var req bundle.TaskQueryRequest
|
|
||||||
if err := c.ShouldBindJSON(&req); err != nil {
|
|
||||||
service.Error(c, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
res, err := service.BundleProvider.GetPendingTaskList(context.Background(), &req)
|
|
||||||
if err != nil {
|
|
||||||
service.Error(c, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
service.Success(c, res)
|
|
||||||
}
|
|
||||||
|
|
||||||
func GetPendingTaskLayout(c *gin.Context) {
|
func GetPendingTaskLayout(c *gin.Context) {
|
||||||
res, err := service.BundleProvider.GetPendingTaskLayout(context.Background(), &bundle.GetPendingTaskLayoutReq{})
|
res, err := service.BundleProvider.GetPendingTaskLayout(context.Background(), &bundle.GetPendingTaskLayoutReq{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -145,26 +127,6 @@ func BatchTerminateTask(c *gin.Context) {
|
|||||||
service.Success(c, res)
|
service.Success(c, res)
|
||||||
}
|
}
|
||||||
|
|
||||||
// UpdatePendingCount 修改待发数量
|
|
||||||
func UpdatePendingCount(c *gin.Context) {
|
|
||||||
var req bundle.UpdatePendingCountRequest
|
|
||||||
if err := c.ShouldBindJSON(&req); err != nil {
|
|
||||||
service.Error(c, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
userInfo := login.GetUserInfoFromC(c)
|
|
||||||
req.OperatorNum = userInfo.TelNum
|
|
||||||
req.Operator = userInfo.Name
|
|
||||||
|
|
||||||
res, err := service.BundleProvider.UpdatePendingCount(context.Background(), &req)
|
|
||||||
if err != nil {
|
|
||||||
service.Error(c, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
service.Success(c, res)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetRecentAssignRecords 查询最近被指派记录
|
// GetRecentAssignRecords 查询最近被指派记录
|
||||||
func GetRecentAssignRecords(c *gin.Context) {
|
func GetRecentAssignRecords(c *gin.Context) {
|
||||||
var req bundle.RecentAssignRecordsRequest
|
var req bundle.RecentAssignRecordsRequest
|
||||||
@ -239,23 +201,6 @@ func CompleteTaskManually(c *gin.Context) {
|
|||||||
service.Success(c, res)
|
service.Success(c, res)
|
||||||
}
|
}
|
||||||
|
|
||||||
// UpdateTaskProgress 员工实际完成任务状态更新
|
|
||||||
func UpdateTaskProgress(c *gin.Context) {
|
|
||||||
var req bundle.UpdateTaskProgressRequest
|
|
||||||
if err := c.ShouldBindJSON(&req); err != nil {
|
|
||||||
service.Error(c, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
res, err := service.BundleProvider.UpdateTaskProgress(context.Background(), &req)
|
|
||||||
if err != nil {
|
|
||||||
service.Error(c, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
service.Success(c, res)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetTaskAssignRecordsList 多条件查询操作记录表
|
// GetTaskAssignRecordsList 多条件查询操作记录表
|
||||||
func GetTaskAssignRecordsList(c *gin.Context) {
|
func GetTaskAssignRecordsList(c *gin.Context) {
|
||||||
var req bundle.TaskAssignRecordsQueryRequest
|
var req bundle.TaskAssignRecordsQueryRequest
|
||||||
@ -377,6 +322,11 @@ func UpdateWorkImageWithTaskUUID(ctx *gin.Context) {
|
|||||||
service.Error(ctx, errors.New("任务已中止,不能上传图文"))
|
service.Error(ctx, errors.New("任务已中止,不能上传图文"))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
resp, err := castService.UpdateWorkImageCore(ctx, req.UpdateWorkImageReq)
|
||||||
|
if err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
if config.AppConfig.System.AppMode != "dev" {
|
if config.AppConfig.System.AppMode != "dev" {
|
||||||
artistId, _ := strconv.ParseUint(req.ArtistUuid, 10, 64)
|
artistId, _ := strconv.ParseUint(req.ArtistUuid, 10, 64)
|
||||||
infoResp, err = service.AccountFieeProvider.Info(context.Background(), &accountFiee.InfoRequest{
|
infoResp, err = service.AccountFieeProvider.Info(context.Background(), &accountFiee.InfoRequest{
|
||||||
@ -394,21 +344,6 @@ func UpdateWorkImageWithTaskUUID(ctx *gin.Context) {
|
|||||||
TelAreaCode: "86",
|
TelAreaCode: "86",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
req.ArtistName = infoResp.Name
|
|
||||||
req.ArtistPhone = infoResp.TelNum
|
|
||||||
req.ArtistPhoneAreaCode = infoResp.TelAreaCode
|
|
||||||
artistID, _ := strconv.ParseUint(req.ArtistUuid, 10, 64)
|
|
||||||
if _, err = castService.CheckUserBundleBalance(int32(artistID), modelCast.BalanceTypeImageValue); err != nil {
|
|
||||||
service.Error(ctx, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
newCtx := castService.NewCtxWithUserInfo(ctx)
|
|
||||||
req.Source = 1
|
|
||||||
resp, err := service.CastProvider.UpdateWorkImage(newCtx, req.UpdateWorkImageReq)
|
|
||||||
if err != nil {
|
|
||||||
service.Error(ctx, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
// EmployeeName 和 EmployeeNum 从 toekn 里面拿
|
// EmployeeName 和 EmployeeNum 从 toekn 里面拿
|
||||||
userInfo := login.GetUserInfoFromC(ctx)
|
userInfo := login.GetUserInfoFromC(ctx)
|
||||||
// 调用员工实际任务状态更新
|
// 调用员工实际任务状态更新
|
||||||
@ -425,6 +360,32 @@ func UpdateWorkImageWithTaskUUID(ctx *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
zap.L().Info("UpdateTaskProgress", zap.Any("resp", resp1))
|
zap.L().Info("UpdateTaskProgress", zap.Any("resp", resp1))
|
||||||
|
|
||||||
|
// 记录任务工作日志,如果失败不影响主流程
|
||||||
|
logReq := &bundle.CreateTaskWorkLogRequest{
|
||||||
|
AssignRecordsUUID: req.AssignRecordsUUID,
|
||||||
|
WorkUUID: resp.WorkUuid,
|
||||||
|
Title: req.Title,
|
||||||
|
ArtistUUID: req.ArtistUuid,
|
||||||
|
SubNum: infoResp.SubNum,
|
||||||
|
TelNum: infoResp.TelNum,
|
||||||
|
ArtistName: infoResp.Name,
|
||||||
|
OperationType: 3, // 3:完成任务
|
||||||
|
TaskType: 2, // 2:图片
|
||||||
|
TaskCount: 1,
|
||||||
|
OperatorName: userInfo.Name,
|
||||||
|
OperatorNum: userInfo.TelNum,
|
||||||
|
}
|
||||||
|
// 记录请求参数
|
||||||
|
zap.L().Info("CreateTaskWorkLog request", zap.Any("req", logReq))
|
||||||
|
logResp, err := service.BundleProvider.CreateTaskWorkLog(context.Background(), logReq)
|
||||||
|
if err != nil {
|
||||||
|
// 记录错误但不影响主流程
|
||||||
|
zap.L().Error("CreateTaskWorkLog failed", zap.Error(err), zap.Any("req", logReq))
|
||||||
|
} else {
|
||||||
|
zap.L().Info("CreateTaskWorkLog success", zap.Any("resp", logResp))
|
||||||
|
}
|
||||||
|
|
||||||
service.Success(ctx, resp)
|
service.Success(ctx, resp)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -449,6 +410,11 @@ func UpdateWorkVideoWithUUID(ctx *gin.Context) {
|
|||||||
service.Error(ctx, errors.New("任务已中止,不能上传视频"))
|
service.Error(ctx, errors.New("任务已中止,不能上传视频"))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
resp, err := castService.UpdateWorkVideoCore(ctx, req.UpdateWorkVideoReq)
|
||||||
|
if err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
if config.AppConfig.System.AppMode != "dev" {
|
if config.AppConfig.System.AppMode != "dev" {
|
||||||
artistId, _ := strconv.ParseUint(req.ArtistUuid, 10, 64)
|
artistId, _ := strconv.ParseUint(req.ArtistUuid, 10, 64)
|
||||||
infoResp, err = service.AccountFieeProvider.Info(context.Background(), &accountFiee.InfoRequest{
|
infoResp, err = service.AccountFieeProvider.Info(context.Background(), &accountFiee.InfoRequest{
|
||||||
@ -466,21 +432,6 @@ func UpdateWorkVideoWithUUID(ctx *gin.Context) {
|
|||||||
TelAreaCode: "86",
|
TelAreaCode: "86",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
artistID, _ := strconv.ParseUint(req.ArtistUuid, 10, 64)
|
|
||||||
if _, err = castService.CheckUserBundleBalance(int32(artistID), modelCast.BalanceTypeVideoValue); err != nil {
|
|
||||||
service.Error(ctx, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
req.ArtistName = infoResp.Name
|
|
||||||
req.ArtistPhone = infoResp.TelNum
|
|
||||||
req.ArtistPhoneAreaCode = infoResp.TelAreaCode
|
|
||||||
newCtx := castService.NewCtxWithUserInfo(ctx)
|
|
||||||
req.Source = 1
|
|
||||||
resp, err := service.CastProvider.UpdateWorkVideo(newCtx, req.UpdateWorkVideoReq)
|
|
||||||
if err != nil {
|
|
||||||
service.Error(ctx, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
// EmployeeName 和 EmployeeNum 从 toekn 里面拿
|
// EmployeeName 和 EmployeeNum 从 toekn 里面拿
|
||||||
userInfo := login.GetUserInfoFromC(ctx)
|
userInfo := login.GetUserInfoFromC(ctx)
|
||||||
// 调用员工实际任务状态更新
|
// 调用员工实际任务状态更新
|
||||||
@ -497,27 +448,36 @@ func UpdateWorkVideoWithUUID(ctx *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
zap.L().Info("UpdateTaskProgress", zap.Any("resp", resp1))
|
zap.L().Info("UpdateTaskProgress", zap.Any("resp", resp1))
|
||||||
|
|
||||||
|
// 记录任务工作日志,如果失败不影响主流程
|
||||||
|
logReq := &bundle.CreateTaskWorkLogRequest{
|
||||||
|
AssignRecordsUUID: req.AssignRecordsUUID,
|
||||||
|
WorkUUID: resp.WorkUuid,
|
||||||
|
Title: req.Title,
|
||||||
|
ArtistUUID: req.ArtistUuid,
|
||||||
|
SubNum: infoResp.SubNum,
|
||||||
|
TelNum: infoResp.TelNum,
|
||||||
|
ArtistName: infoResp.Name,
|
||||||
|
OperationType: 3, // 3:完成任务
|
||||||
|
TaskType: 1, // 1:视频
|
||||||
|
TaskCount: 1,
|
||||||
|
OperatorName: userInfo.Name,
|
||||||
|
OperatorNum: userInfo.TelNum,
|
||||||
|
}
|
||||||
|
// 记录请求参数
|
||||||
|
zap.L().Info("CreateTaskWorkLog request", zap.Any("req", logReq))
|
||||||
|
logResp, err := service.BundleProvider.CreateTaskWorkLog(context.Background(), logReq)
|
||||||
|
if err != nil {
|
||||||
|
// 记录错误但不影响主流程
|
||||||
|
zap.L().Error("CreateTaskWorkLog failed", zap.Error(err), zap.Any("req", logReq))
|
||||||
|
} else {
|
||||||
|
zap.L().Info("CreateTaskWorkLog success", zap.Any("resp", logResp))
|
||||||
|
}
|
||||||
|
|
||||||
service.Success(ctx, resp)
|
service.Success(ctx, resp)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetArtistBundleBalance 查询艺人套餐剩余数量
|
|
||||||
func GetArtistBundleBalance(c *gin.Context) {
|
|
||||||
var req bundle.ArtistBundleBalanceRequest
|
|
||||||
if err := c.ShouldBindJSON(&req); err != nil {
|
|
||||||
service.Error(c, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
res, err := service.BundleProvider.GetArtistBundleBalance(context.Background(), &req)
|
|
||||||
if err != nil {
|
|
||||||
service.Error(c, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
service.Success(c, res)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetArtistUploadStatsList 查询艺人待上传列表
|
// GetArtistUploadStatsList 查询艺人待上传列表
|
||||||
func GetArtistUploadStatsList(c *gin.Context) {
|
func GetArtistUploadStatsList(c *gin.Context) {
|
||||||
var req bundle.TaskQueryRequest
|
var req bundle.TaskQueryRequest
|
||||||
@ -535,22 +495,6 @@ func GetArtistUploadStatsList(c *gin.Context) {
|
|||||||
service.Success(c, res)
|
service.Success(c, res)
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetPendingUploadBreakdown(c *gin.Context) {
|
|
||||||
var req bundle.PendingUploadBreakdownRequest
|
|
||||||
if err := c.ShouldBindJSON(&req); err != nil {
|
|
||||||
service.Error(c, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
res, err := service.BundleProvider.GetPendingUploadBreakdown(context.Background(), &req)
|
|
||||||
if err != nil {
|
|
||||||
service.Error(c, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
service.Success(c, res)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetArtistUploadStatsListDownload 导出艺人待上传列表为Excel
|
// GetArtistUploadStatsListDownload 导出艺人待上传列表为Excel
|
||||||
func GetArtistUploadStatsListDownload(c *gin.Context) {
|
func GetArtistUploadStatsListDownload(c *gin.Context) {
|
||||||
var req bundle.TaskQueryRequest
|
var req bundle.TaskQueryRequest
|
||||||
@ -676,6 +620,32 @@ func UpdateVideoScriptWithUUID(ctx *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
zap.L().Info("UpdateTaskProgress", zap.Any("resp", resp1))
|
zap.L().Info("UpdateTaskProgress", zap.Any("resp", resp1))
|
||||||
|
|
||||||
|
// 记录任务工作日志,如果失败不影响主流程
|
||||||
|
logReq := &bundle.CreateTaskWorkLogRequest{
|
||||||
|
AssignRecordsUUID: req.AssignRecordsUUID,
|
||||||
|
WorkUUID: resp.Uuid,
|
||||||
|
Title: req.Title,
|
||||||
|
ArtistUUID: req.ArtistUuid,
|
||||||
|
SubNum: infoResp.SubNum,
|
||||||
|
TelNum: infoResp.TelNum,
|
||||||
|
ArtistName: infoResp.Name,
|
||||||
|
OperationType: 3, // 3:完成任务
|
||||||
|
TaskType: 1, // 1:视频(脚本属于视频类型)
|
||||||
|
TaskCount: 1,
|
||||||
|
OperatorName: userInfo.Name,
|
||||||
|
OperatorNum: userInfo.TelNum,
|
||||||
|
}
|
||||||
|
// 记录请求参数
|
||||||
|
zap.L().Info("CreateTaskWorkLog request", zap.Any("req", logReq))
|
||||||
|
logResp, err := service.BundleProvider.CreateTaskWorkLog(context.Background(), logReq)
|
||||||
|
if err != nil {
|
||||||
|
// 记录错误但不影响主流程
|
||||||
|
zap.L().Error("CreateTaskWorkLog failed", zap.Error(err), zap.Any("req", logReq))
|
||||||
|
} else {
|
||||||
|
zap.L().Info("CreateTaskWorkLog success", zap.Any("resp", logResp))
|
||||||
|
}
|
||||||
|
|
||||||
service.Success(ctx, resp)
|
service.Success(ctx, resp)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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
|
||||||
|
}
|
||||||
|
|||||||
381
pkg/utils/excel/excelInter.go
Normal file
381
pkg/utils/excel/excelInter.go
Normal 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))
|
||||||
|
}
|
||||||
|
}
|
||||||
52
pkg/utils/excel/options.go
Normal file
52
pkg/utils/excel/options.go
Normal 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
54
pkg/utils/excel/style.go
Normal 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
41
pkg/utils/excel/utils.go
Normal 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
81
pkg/utils/excel/writer.go
Normal 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
|
||||||
|
}
|
||||||
@ -7,6 +7,7 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
@ -50,3 +51,50 @@ func SaveUrlFileDisk(url string, path string, filename string) (fullPath string,
|
|||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetRemoteFileSize 通过HTTP HEAD请求获取远程文件大小(不下载文件)
|
||||||
|
func GetRemoteFileSize(url string) (size int64, err error) {
|
||||||
|
// 创建HEAD请求
|
||||||
|
req, err := http.NewRequest("HEAD", url, nil)
|
||||||
|
if err != nil {
|
||||||
|
zap.L().Error("GetRemoteFileSize create request err", zap.String("url", url), zap.Error(err))
|
||||||
|
err = errors.New(e.GetMsg(e.ERROR_DOWNLOAD_FILE))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 发送请求
|
||||||
|
client := &http.Client{}
|
||||||
|
resp, err := client.Do(req)
|
||||||
|
if err != nil {
|
||||||
|
zap.L().Error("GetRemoteFileSize request err", zap.String("url", url), zap.Error(err))
|
||||||
|
err = errors.New(e.GetMsg(e.ERROR_DOWNLOAD_FILE))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
defer resp.Body.Close()
|
||||||
|
|
||||||
|
// 检查HTTP状态码
|
||||||
|
if resp.StatusCode != http.StatusOK {
|
||||||
|
zap.L().Error("GetRemoteFileSize status code err", zap.String("url", url), zap.Int("status", resp.StatusCode))
|
||||||
|
err = errors.New(e.GetMsg(e.ERROR_DOWNLOAD_FILE))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取Content-Length头部
|
||||||
|
contentLength := resp.Header.Get("Content-Length")
|
||||||
|
if contentLength == "" {
|
||||||
|
zap.L().Error("GetRemoteFileSize Content-Length header not found", zap.String("url", url))
|
||||||
|
err = errors.New("无法获取文件大小")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 解析文件大小
|
||||||
|
size, err = strconv.ParseInt(contentLength, 10, 64)
|
||||||
|
size = size / 1024 / 1024
|
||||||
|
if err != nil {
|
||||||
|
zap.L().Error("GetRemoteFileSize parse size err", zap.String("url", url), zap.String("contentLength", contentLength), zap.Error(err))
|
||||||
|
err = errors.New("解析文件大小失败")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|||||||
555
pkg/utils/img/imageproc.go
Normal file
555
pkg/utils/img/imageproc.go
Normal file
@ -0,0 +1,555 @@
|
|||||||
|
package img
|
||||||
|
|
||||||
|
import (
|
||||||
|
"bytes"
|
||||||
|
"context"
|
||||||
|
"crypto/sha256"
|
||||||
|
"encoding/hex"
|
||||||
|
"errors"
|
||||||
|
"fmt"
|
||||||
|
"image"
|
||||||
|
"image/color"
|
||||||
|
"image/gif"
|
||||||
|
"image/jpeg"
|
||||||
|
"image/png"
|
||||||
|
"io"
|
||||||
|
"net/http"
|
||||||
|
"net/url"
|
||||||
|
"os"
|
||||||
|
"path/filepath"
|
||||||
|
"strings"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/disintegration/imaging"
|
||||||
|
)
|
||||||
|
|
||||||
|
// ResizeMode controls how the source image is mapped to the target WxH.
|
||||||
|
//
|
||||||
|
// - ResizeModeFit: contain (keep aspect), no cropping; resulting image may be smaller than WxH
|
||||||
|
// - ResizeModeFill: cover + crop (center crop) to exactly WxH
|
||||||
|
// - ResizeModePad: keep aspect + pad (letterbox) to exactly WxH (no crop, no stretch)
|
||||||
|
//
|
||||||
|
// If you only pass a single dimension (e.g. W>0, H=0), Fit will keep aspect.
|
||||||
|
// Fill/Pad requires both W and H.
|
||||||
|
//
|
||||||
|
// Note: GIF input will be processed as a single frame (first frame).
|
||||||
|
// If you need animated GIF support, we can extend this later.
|
||||||
|
type ResizeMode string
|
||||||
|
|
||||||
|
const (
|
||||||
|
ResizeModeFit ResizeMode = "fit"
|
||||||
|
ResizeModeFill ResizeMode = "fill"
|
||||||
|
// ResizeModePad keeps aspect ratio (no crop, no stretch) and pads to exactly WxH.
|
||||||
|
// Typical use: 16:9 -> 1024x1024 with white/black bars.
|
||||||
|
ResizeModePad ResizeMode = "pad"
|
||||||
|
)
|
||||||
|
|
||||||
|
type Options struct {
|
||||||
|
TargetWidth int
|
||||||
|
TargetHeight int
|
||||||
|
MaxSizeMB float64
|
||||||
|
|
||||||
|
Mode ResizeMode
|
||||||
|
|
||||||
|
// PadColor is used only when Mode == ResizeModePad.
|
||||||
|
// Default: white.
|
||||||
|
PadColor color.Color
|
||||||
|
|
||||||
|
// OutputDir is where the processed image will be written.
|
||||||
|
// Default: ./runtime/tmp/images/processed
|
||||||
|
OutputDir string
|
||||||
|
|
||||||
|
// Timeout controls total download time.
|
||||||
|
// Default: 30s.
|
||||||
|
Timeout time.Duration
|
||||||
|
|
||||||
|
// MaxDownloadMB caps download size to protect memory/disk.
|
||||||
|
// Default: max( maxSizeMB*6, 30MB ).
|
||||||
|
MaxDownloadMB float64
|
||||||
|
|
||||||
|
// MinQuality is the minimum JPEG quality to try (1-100).
|
||||||
|
// Default: 10. If compression still can't meet MaxSizeMB, returns error.
|
||||||
|
MinQuality int
|
||||||
|
|
||||||
|
// MaxRetries controls how many quality adjustments to attempt.
|
||||||
|
// Default: 15.
|
||||||
|
MaxRetries int
|
||||||
|
|
||||||
|
// AllowResolutionReduction allows reducing resolution further if compression fails.
|
||||||
|
// Default: false.
|
||||||
|
AllowResolutionReduction bool
|
||||||
|
|
||||||
|
// ForceJPEG forces output to JPEG format even if input is PNG/GIF/etc.
|
||||||
|
// If image has alpha channel, it will be flattened to white background.
|
||||||
|
// Default: false.
|
||||||
|
ForceJPEG bool
|
||||||
|
}
|
||||||
|
|
||||||
|
// ProcessFromURL downloads an image from imgURL, resizes it, compresses it to <= MaxSizeMB,
|
||||||
|
// and returns the local output path.
|
||||||
|
//
|
||||||
|
// Contract:
|
||||||
|
// - imgURL: http/https
|
||||||
|
// - TargetWidth/TargetHeight: pixels, >=0
|
||||||
|
// - MaxSizeMB: >0
|
||||||
|
// - returns: absolute or relative file path (depending on OutputDir), and error
|
||||||
|
func ProcessFromURL(imgURL string, opt Options) (string, error) {
|
||||||
|
if strings.TrimSpace(imgURL) == "" {
|
||||||
|
return "", errors.New("imgURL is empty")
|
||||||
|
}
|
||||||
|
u, err := url.Parse(imgURL)
|
||||||
|
if err != nil || (u.Scheme != "http" && u.Scheme != "https") {
|
||||||
|
return "", errors.New("imgURL must be http/https")
|
||||||
|
}
|
||||||
|
if opt.MaxSizeMB <= 0 {
|
||||||
|
return "", errors.New("MaxSizeMB must be > 0")
|
||||||
|
}
|
||||||
|
if opt.TargetWidth < 0 || opt.TargetHeight < 0 {
|
||||||
|
return "", errors.New("TargetWidth/TargetHeight must be >= 0")
|
||||||
|
}
|
||||||
|
if opt.TargetWidth == 0 && opt.TargetHeight == 0 {
|
||||||
|
return "", errors.New("TargetWidth and TargetHeight cannot both be 0")
|
||||||
|
}
|
||||||
|
if opt.Mode == "" {
|
||||||
|
opt.Mode = ResizeModeFit
|
||||||
|
}
|
||||||
|
if opt.Mode != ResizeModeFit && opt.Mode != ResizeModeFill && opt.Mode != ResizeModePad {
|
||||||
|
return "", errors.New("invalid resize Mode")
|
||||||
|
}
|
||||||
|
if (opt.Mode == ResizeModeFill || opt.Mode == ResizeModePad) && (opt.TargetWidth == 0 || opt.TargetHeight == 0) {
|
||||||
|
return "", errors.New("fill/pad mode requires both TargetWidth and TargetHeight")
|
||||||
|
}
|
||||||
|
if opt.Timeout <= 0 {
|
||||||
|
opt.Timeout = 30 * time.Second
|
||||||
|
}
|
||||||
|
if opt.OutputDir == "" {
|
||||||
|
opt.OutputDir = filepath.FromSlash("./runtime/tmp/images/processed")
|
||||||
|
}
|
||||||
|
if opt.MaxDownloadMB <= 0 {
|
||||||
|
opt.MaxDownloadMB = opt.MaxSizeMB * 6
|
||||||
|
if opt.MaxDownloadMB < 30 {
|
||||||
|
opt.MaxDownloadMB = 30
|
||||||
|
}
|
||||||
|
if opt.MaxDownloadMB > 200 {
|
||||||
|
opt.MaxDownloadMB = 200
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if opt.MinQuality <= 0 {
|
||||||
|
opt.MinQuality = 10
|
||||||
|
}
|
||||||
|
if opt.MinQuality > 100 {
|
||||||
|
opt.MinQuality = 100
|
||||||
|
}
|
||||||
|
if opt.MaxRetries <= 0 {
|
||||||
|
opt.MaxRetries = 15
|
||||||
|
}
|
||||||
|
|
||||||
|
// Ensure output dir exists.
|
||||||
|
if err := os.MkdirAll(opt.OutputDir, os.ModePerm); err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
|
||||||
|
ctx, cancel := context.WithTimeout(context.Background(), opt.Timeout)
|
||||||
|
defer cancel()
|
||||||
|
|
||||||
|
data, contentType, err := downloadWithLimit(ctx, imgURL, int64(opt.MaxDownloadMB*1024*1024))
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
|
||||||
|
img, fmtName, err := decodeImage(data, contentType)
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if image already meets requirements
|
||||||
|
if alreadyMeetsRequirements(img, data, opt) {
|
||||||
|
return "", nil
|
||||||
|
}
|
||||||
|
|
||||||
|
img = applyResize(img, opt)
|
||||||
|
|
||||||
|
// Determine output format
|
||||||
|
outExt := ".jpg"
|
||||||
|
outFormat := "jpeg"
|
||||||
|
|
||||||
|
if opt.ForceJPEG {
|
||||||
|
// Force JPEG output, flatten alpha if needed
|
||||||
|
outFormat = "jpeg"
|
||||||
|
outExt = ".jpg"
|
||||||
|
if imageHasAlpha(img) {
|
||||||
|
img = flattenToWhite(img)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// Auto-detect: if image has alpha, output PNG; otherwise JPEG
|
||||||
|
hasAlpha := imageHasAlpha(img)
|
||||||
|
if hasAlpha {
|
||||||
|
outExt = ".png"
|
||||||
|
outFormat = "png"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create a stable file name based on url + options + content signature.
|
||||||
|
h := sha256.New()
|
||||||
|
h.Write([]byte(imgURL))
|
||||||
|
h.Write([]byte(fmt.Sprintf("|%d|%d|%f|%s|%s", opt.TargetWidth, opt.TargetHeight, opt.MaxSizeMB, opt.Mode, outFormat)))
|
||||||
|
h.Write(data[:minInt(len(data), 1024)])
|
||||||
|
name := hex.EncodeToString(h.Sum(nil))[:32] + outExt
|
||||||
|
outPath := filepath.Join(opt.OutputDir, name)
|
||||||
|
|
||||||
|
maxBytes := int64(opt.MaxSizeMB * 1024 * 1024)
|
||||||
|
encoded, err := encodeUnderSize(img, outFormat, maxBytes, opt.MinQuality, opt.MaxRetries)
|
||||||
|
if err != nil {
|
||||||
|
// Fallback: if PNG can't fit, try JPEG (dropping alpha with white background).
|
||||||
|
if outFormat == "png" {
|
||||||
|
flattened := flattenToWhite(img)
|
||||||
|
encoded, err = encodeUnderSize(flattened, "jpeg", maxBytes, opt.MinQuality, opt.MaxRetries)
|
||||||
|
if err == nil {
|
||||||
|
outPath = strings.TrimSuffix(outPath, filepath.Ext(outPath)) + ".jpg"
|
||||||
|
} else {
|
||||||
|
// If AllowResolutionReduction is true, try reducing resolution
|
||||||
|
if opt.AllowResolutionReduction {
|
||||||
|
return tryWithReducedResolution(img, opt, outPath, maxBytes)
|
||||||
|
}
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// If AllowResolutionReduction is true, try reducing resolution
|
||||||
|
if opt.AllowResolutionReduction {
|
||||||
|
return tryWithReducedResolution(img, opt, outPath, maxBytes)
|
||||||
|
}
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
tmpPath := outPath + ".tmp"
|
||||||
|
if err := os.WriteFile(tmpPath, encoded, 0o644); err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
if err := os.Rename(tmpPath, outPath); err != nil {
|
||||||
|
_ = os.Remove(tmpPath)
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
|
||||||
|
_ = fmtName // reserved for future behavior
|
||||||
|
return outPath, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func downloadWithLimit(ctx context.Context, imgURL string, maxBytes int64) ([]byte, string, error) {
|
||||||
|
req, err := http.NewRequestWithContext(ctx, http.MethodGet, imgURL, nil)
|
||||||
|
if err != nil {
|
||||||
|
return nil, "", err
|
||||||
|
}
|
||||||
|
// Reasonable defaults; could be overridden later.
|
||||||
|
req.Header.Set("User-Agent", "fonchain-tools/1.0")
|
||||||
|
|
||||||
|
client := &http.Client{}
|
||||||
|
resp, err := client.Do(req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, "", err
|
||||||
|
}
|
||||||
|
defer func() { _ = resp.Body.Close() }()
|
||||||
|
|
||||||
|
if resp.StatusCode < 200 || resp.StatusCode >= 300 {
|
||||||
|
return nil, "", fmt.Errorf("download failed: %s", resp.Status)
|
||||||
|
}
|
||||||
|
if resp.ContentLength > 0 && resp.ContentLength > maxBytes {
|
||||||
|
return nil, "", fmt.Errorf("remote file too large: %d > %d", resp.ContentLength, maxBytes)
|
||||||
|
}
|
||||||
|
|
||||||
|
lr := &io.LimitedReader{R: resp.Body, N: maxBytes + 1}
|
||||||
|
b, err := io.ReadAll(lr)
|
||||||
|
if err != nil {
|
||||||
|
return nil, "", err
|
||||||
|
}
|
||||||
|
if int64(len(b)) > maxBytes {
|
||||||
|
return nil, "", fmt.Errorf("download exceeded limit: %d > %d", len(b), maxBytes)
|
||||||
|
}
|
||||||
|
return b, resp.Header.Get("Content-Type"), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func decodeImage(data []byte, contentType string) (image.Image, string, error) {
|
||||||
|
// Register gif (jpeg/png already registered) for Decode.
|
||||||
|
_ = gif.GIF{}
|
||||||
|
reader := bytes.NewReader(data)
|
||||||
|
img, fmtName, err := image.Decode(reader)
|
||||||
|
if err == nil {
|
||||||
|
return img, fmtName, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Some servers set odd content-type; try simple sniff.
|
||||||
|
_ = contentType
|
||||||
|
return nil, "", fmt.Errorf("decode image failed: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
func applyResize(img image.Image, opt Options) image.Image {
|
||||||
|
w := opt.TargetWidth
|
||||||
|
h := opt.TargetHeight
|
||||||
|
|
||||||
|
srcW := img.Bounds().Dx()
|
||||||
|
srcH := img.Bounds().Dy()
|
||||||
|
if srcW <= 0 || srcH <= 0 {
|
||||||
|
return img
|
||||||
|
}
|
||||||
|
|
||||||
|
switch opt.Mode {
|
||||||
|
case ResizeModeFill:
|
||||||
|
return imaging.Fill(img, w, h, imaging.Center, imaging.Lanczos)
|
||||||
|
case ResizeModeFit:
|
||||||
|
// If only one dimension is provided, keep aspect.
|
||||||
|
if w == 0 {
|
||||||
|
w = int(float64(srcW) * (float64(h) / float64(srcH)))
|
||||||
|
if w < 1 {
|
||||||
|
w = 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if h == 0 {
|
||||||
|
h = int(float64(srcH) * (float64(w) / float64(srcW)))
|
||||||
|
if h < 1 {
|
||||||
|
h = 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// imaging.Fit ensures the result fits within w,h without cropping.
|
||||||
|
return imaging.Fit(img, w, h, imaging.Lanczos)
|
||||||
|
case ResizeModePad:
|
||||||
|
bg := opt.PadColor
|
||||||
|
if bg == nil {
|
||||||
|
bg = color.White
|
||||||
|
}
|
||||||
|
// First, fit within WxH (no crop).
|
||||||
|
fitted := imaging.Fit(img, w, h, imaging.Lanczos)
|
||||||
|
// Then, paste centered onto WxH canvas.
|
||||||
|
canvas := imaging.New(w, h, bg)
|
||||||
|
x := (w - fitted.Bounds().Dx()) / 2
|
||||||
|
y := (h - fitted.Bounds().Dy()) / 2
|
||||||
|
return imaging.Paste(canvas, fitted, image.Pt(x, y))
|
||||||
|
default:
|
||||||
|
return img
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func encodeUnderSize(img image.Image, format string, maxBytes int64, minQuality, maxRetries int) ([]byte, error) {
|
||||||
|
if maxBytes <= 0 {
|
||||||
|
return nil, errors.New("maxBytes must be > 0")
|
||||||
|
}
|
||||||
|
|
||||||
|
switch format {
|
||||||
|
case "jpeg":
|
||||||
|
// Binary search quality.
|
||||||
|
lo, hi := minQuality, 92
|
||||||
|
var best []byte
|
||||||
|
iterations := 0
|
||||||
|
maxIterations := maxInt(8, maxRetries/2)
|
||||||
|
|
||||||
|
for i := 0; i < maxIterations && lo <= hi; i++ {
|
||||||
|
iterations++
|
||||||
|
q := (lo + hi) / 2
|
||||||
|
b, err := encodeJPEG(img, q)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if int64(len(b)) <= maxBytes {
|
||||||
|
best = b
|
||||||
|
lo = q + 1
|
||||||
|
} else {
|
||||||
|
hi = q - 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if best != nil {
|
||||||
|
return best, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Try more aggressive qualities from minQuality down to 1
|
||||||
|
qualities := []int{}
|
||||||
|
for q := minQuality; q >= 1; q -= 5 {
|
||||||
|
qualities = append(qualities, q)
|
||||||
|
}
|
||||||
|
// Ensure we try the lowest qualities
|
||||||
|
if minQuality > 3 {
|
||||||
|
qualities = append(qualities, 3, 1)
|
||||||
|
}
|
||||||
|
|
||||||
|
var lastSize int64
|
||||||
|
for _, q := range qualities {
|
||||||
|
if iterations >= maxRetries {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
iterations++
|
||||||
|
b, err := encodeJPEG(img, q)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
lastSize = int64(len(b))
|
||||||
|
if lastSize <= maxBytes {
|
||||||
|
return b, nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sizeMB := float64(lastSize) / (1024 * 1024)
|
||||||
|
targetMB := float64(maxBytes) / (1024 * 1024)
|
||||||
|
return nil, fmt.Errorf("cannot compress to %.2fMB (best: %.2fMB at quality %d after %d attempts). Consider increasing MaxSizeMB or enabling AllowResolutionReduction",
|
||||||
|
targetMB, sizeMB, minQuality, iterations)
|
||||||
|
|
||||||
|
case "png":
|
||||||
|
// PNG size depends heavily on content; try best compression.
|
||||||
|
b, err := encodePNG(img, png.BestCompression)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if int64(len(b)) <= maxBytes {
|
||||||
|
return b, nil
|
||||||
|
}
|
||||||
|
sizeMB := float64(len(b)) / (1024 * 1024)
|
||||||
|
targetMB := float64(maxBytes) / (1024 * 1024)
|
||||||
|
return nil, fmt.Errorf("PNG cannot compress to %.2fMB (got %.2fMB). Consider using JPEG format or enabling AllowResolutionReduction",
|
||||||
|
targetMB, sizeMB)
|
||||||
|
|
||||||
|
default:
|
||||||
|
return nil, errors.New("unsupported output format")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func encodeJPEG(img image.Image, quality int) ([]byte, error) {
|
||||||
|
var buf bytes.Buffer
|
||||||
|
// Use 4:2:0 subsampling (default) for smaller size.
|
||||||
|
err := jpeg.Encode(&buf, img, &jpeg.Options{Quality: quality})
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return buf.Bytes(), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func encodePNG(img image.Image, level png.CompressionLevel) ([]byte, error) {
|
||||||
|
var buf bytes.Buffer
|
||||||
|
enc := png.Encoder{CompressionLevel: level}
|
||||||
|
if err := enc.Encode(&buf, img); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return buf.Bytes(), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func imageHasAlpha(img image.Image) bool {
|
||||||
|
switch img.(type) {
|
||||||
|
case *image.NRGBA, *image.NRGBA64, *image.RGBA, *image.RGBA64, *image.Alpha, *image.Alpha16, *image.Paletted:
|
||||||
|
// Need to inspect pixels if we want exactness; but this is good enough and stable.
|
||||||
|
return true
|
||||||
|
default:
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func flattenToWhite(img image.Image) image.Image {
|
||||||
|
b := img.Bounds()
|
||||||
|
dst := image.NewRGBA(b)
|
||||||
|
|
||||||
|
// Fill with white.
|
||||||
|
for y := b.Min.Y; y < b.Max.Y; y++ {
|
||||||
|
for x := b.Min.X; x < b.Max.X; x++ {
|
||||||
|
dst.Set(x, y, image.White)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Draw original image over white background.
|
||||||
|
return imaging.Overlay(dst, img, image.Pt(0, 0), 1.0)
|
||||||
|
}
|
||||||
|
|
||||||
|
func minInt(a, b int) int {
|
||||||
|
if a < b {
|
||||||
|
return a
|
||||||
|
}
|
||||||
|
return b
|
||||||
|
}
|
||||||
|
|
||||||
|
func maxInt(a, b int) int {
|
||||||
|
if a > b {
|
||||||
|
return a
|
||||||
|
}
|
||||||
|
return b
|
||||||
|
}
|
||||||
|
|
||||||
|
// alreadyMeetsRequirements checks if the image already satisfies the size and dimension requirements
|
||||||
|
func alreadyMeetsRequirements(img image.Image, data []byte, opt Options) bool {
|
||||||
|
// Check file size
|
||||||
|
maxBytes := int64(opt.MaxSizeMB * 1024 * 1024)
|
||||||
|
if int64(len(data)) > maxBytes {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check dimensions based on mode
|
||||||
|
srcW := img.Bounds().Dx()
|
||||||
|
srcH := img.Bounds().Dy()
|
||||||
|
targetW := opt.TargetWidth
|
||||||
|
targetH := opt.TargetHeight
|
||||||
|
|
||||||
|
switch opt.Mode {
|
||||||
|
case ResizeModeFit:
|
||||||
|
// For fit mode, check if image is already within or equal to target dimensions
|
||||||
|
if targetW > 0 && srcW > targetW {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if targetH > 0 && srcH > targetH {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
// If only one dimension is specified, check aspect ratio compatibility
|
||||||
|
if targetW > 0 && targetH == 0 && srcW <= targetW {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
if targetH > 0 && targetW == 0 && srcH <= targetH {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
if targetW > 0 && targetH > 0 && srcW <= targetW && srcH <= targetH {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
|
||||||
|
case ResizeModeFill, ResizeModePad:
|
||||||
|
// For fill/pad mode, image must be exactly the target dimensions
|
||||||
|
if srcW != targetW || srcH != targetH {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
|
||||||
|
default:
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// tryWithReducedResolution attempts to compress by progressively reducing resolution
|
||||||
|
func tryWithReducedResolution(img image.Image, opt Options, outPath string, maxBytes int64) (string, error) {
|
||||||
|
bounds := img.Bounds()
|
||||||
|
w := bounds.Dx()
|
||||||
|
h := bounds.Dy()
|
||||||
|
|
||||||
|
// Try reducing resolution in steps: 90%, 80%, 70%, 60%, 50%
|
||||||
|
reductions := []float64{0.9, 0.8, 0.7, 0.6, 0.5}
|
||||||
|
|
||||||
|
for _, factor := range reductions {
|
||||||
|
newW := int(float64(w) * factor)
|
||||||
|
newH := int(float64(h) * factor)
|
||||||
|
|
||||||
|
if newW < 100 || newH < 100 {
|
||||||
|
break // Don't reduce too much
|
||||||
|
}
|
||||||
|
|
||||||
|
resized := imaging.Resize(img, newW, newH, imaging.Lanczos)
|
||||||
|
|
||||||
|
// Try to encode with reduced resolution
|
||||||
|
encoded, err := encodeUnderSize(resized, "jpeg", maxBytes, opt.MinQuality, opt.MaxRetries/2)
|
||||||
|
if err == nil {
|
||||||
|
// Success! Save it
|
||||||
|
tmpPath := outPath + ".tmp"
|
||||||
|
if err := os.WriteFile(tmpPath, encoded, 0o644); err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
if err := os.Rename(tmpPath, outPath); err != nil {
|
||||||
|
_ = os.Remove(tmpPath)
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
return outPath, nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
targetMB := float64(maxBytes) / (1024 * 1024)
|
||||||
|
return "", fmt.Errorf("cannot compress to %.2fMB even after reducing resolution to 50%%. Original size too large", targetMB)
|
||||||
|
}
|
||||||
174
pkg/utils/pdf.go
Normal file
174
pkg/utils/pdf.go
Normal file
@ -0,0 +1,174 @@
|
|||||||
|
package utils
|
||||||
|
|
||||||
|
import (
|
||||||
|
"errors"
|
||||||
|
"fmt"
|
||||||
|
"io"
|
||||||
|
"net/http"
|
||||||
|
"net/url"
|
||||||
|
"os"
|
||||||
|
"path/filepath"
|
||||||
|
"unicode"
|
||||||
|
|
||||||
|
"github.com/phpdave11/gofpdf"
|
||||||
|
)
|
||||||
|
|
||||||
|
// cleanTextForPDF 清理文本,移除PDF不支持的字符(如emoji)
|
||||||
|
// gofpdf库不支持某些特殊字符
|
||||||
|
func cleanTextForPDF(text string) string {
|
||||||
|
var result []rune
|
||||||
|
for _, r := range text {
|
||||||
|
// 保留基本多文种平面(BMP)内的字符(码点 <= 0xFFFF)
|
||||||
|
// 这样可以保留中文、英文、数字等常用字符,但过滤掉emoji等特殊字符
|
||||||
|
if r <= 0xFFFF && (unicode.IsPrint(r) || unicode.IsSpace(r)) {
|
||||||
|
result = append(result, r)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return string(result)
|
||||||
|
}
|
||||||
|
|
||||||
|
// loadChineseFont 加载中文字体
|
||||||
|
func loadChineseFont(pdf *gofpdf.Fpdf, fontPath string) error {
|
||||||
|
var fontData []byte
|
||||||
|
var err error
|
||||||
|
|
||||||
|
// 如果提供了本地字体路径,优先使用本地字体
|
||||||
|
if fontPath == "" {
|
||||||
|
return errors.New("字体文件路径不能为空")
|
||||||
|
}
|
||||||
|
|
||||||
|
fontData, err = os.ReadFile(fontPath)
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("读取字体文件失败: %v", err)
|
||||||
|
}
|
||||||
|
// 使用本地字体文件
|
||||||
|
pdf.AddUTF8FontFromBytes("Chinese", "", fontData)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// GeneratePDF 生成PDF文件
|
||||||
|
func GeneratePDF(text, imageURL, outputPath, fontPath string) error {
|
||||||
|
if text == "" {
|
||||||
|
return errors.New("文本不能为空")
|
||||||
|
}
|
||||||
|
// 创建PDF实例,P=纵向,mm=毫米单位,A4=页面大小
|
||||||
|
pdf := gofpdf.New("P", "mm", "A4", "")
|
||||||
|
|
||||||
|
// 加载中文字体
|
||||||
|
err := loadChineseFont(pdf, fontPath)
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("加载中文字体失败: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 添加新页面
|
||||||
|
pdf.AddPage()
|
||||||
|
|
||||||
|
// 设置字体,使用中文字体,12号字体
|
||||||
|
pdf.SetFont("Chinese", "", 12)
|
||||||
|
|
||||||
|
// 设置页面边距(左、上、右)
|
||||||
|
pdf.SetMargins(20, 10, 20)
|
||||||
|
|
||||||
|
// 设置当前位置(x, y),从左上角开始
|
||||||
|
pdf.SetXY(20, 10)
|
||||||
|
|
||||||
|
// 清理文本,移除PDF不支持的字符(如emoji)
|
||||||
|
cleanedText := cleanTextForPDF(text)
|
||||||
|
|
||||||
|
// 添加文本内容
|
||||||
|
// 使用MultiCell方法处理多行文本,支持自动换行
|
||||||
|
// 参数:宽度、行高、文本内容、边框、对齐方式、是否填充
|
||||||
|
// A4页面宽度210mm,减去左右边距40mm,可用宽度170mm
|
||||||
|
textWidth := 170.0
|
||||||
|
lineHeight := 7.0
|
||||||
|
pdf.MultiCell(textWidth, lineHeight, cleanedText, "", "L", false)
|
||||||
|
|
||||||
|
// 如果提供了图片URL,则添加图片
|
||||||
|
if imageURL != "" {
|
||||||
|
// 添加一些间距
|
||||||
|
pdf.Ln(5)
|
||||||
|
|
||||||
|
// 解析URL获取文件扩展名
|
||||||
|
u, err := url.Parse(imageURL)
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("图片链接解析错误: %v", err)
|
||||||
|
}
|
||||||
|
fileExt := filepath.Ext(u.Path)
|
||||||
|
// 如果没有扩展名,默认使用.jpg
|
||||||
|
if fileExt == "" {
|
||||||
|
fileExt = ".jpg"
|
||||||
|
}
|
||||||
|
|
||||||
|
// 下载图片
|
||||||
|
resp, err := http.Get(imageURL)
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("下载图片失败: %v", err)
|
||||||
|
}
|
||||||
|
defer resp.Body.Close()
|
||||||
|
|
||||||
|
// 读取图片数据
|
||||||
|
imageData, err := io.ReadAll(resp.Body)
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("读取图片数据失败: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 将图片数据保存到临时文件(gofpdf需要文件路径)
|
||||||
|
tmpFile, err := os.CreateTemp("", "pdf_image_*"+fileExt)
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("创建临时文件失败: %v", err)
|
||||||
|
}
|
||||||
|
defer os.Remove(tmpFile.Name()) // 使用完后删除临时文件
|
||||||
|
defer tmpFile.Close()
|
||||||
|
|
||||||
|
// 写入图片数据到临时文件
|
||||||
|
_, err = tmpFile.Write(imageData)
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("写入临时文件失败: %v", err)
|
||||||
|
}
|
||||||
|
tmpFile.Close()
|
||||||
|
|
||||||
|
// A4纵向页面宽度210mm,减去左右边距40mm,可用宽度170mm
|
||||||
|
// 图片宽度设为可用宽度的70%
|
||||||
|
imageWidth := textWidth * 0.7
|
||||||
|
// 计算居中位置:页面宽度210mm,图片居中
|
||||||
|
imageX := (210.0 - imageWidth) / 2
|
||||||
|
currentY := pdf.GetY()
|
||||||
|
|
||||||
|
// 注册图片并获取原始尺寸,用于计算缩放后的高度
|
||||||
|
imgInfo := pdf.RegisterImageOptions(tmpFile.Name(), gofpdf.ImageOptions{})
|
||||||
|
if imgInfo == nil {
|
||||||
|
return fmt.Errorf("注册图片失败")
|
||||||
|
}
|
||||||
|
|
||||||
|
// 计算缩放后的图片高度(按比例缩放)
|
||||||
|
// 原始宽度:原始高度 = 缩放后宽度:缩放后高度
|
||||||
|
originalWidth, originalHeight := imgInfo.Extent()
|
||||||
|
imageHeight := (imageWidth / originalWidth) * originalHeight
|
||||||
|
|
||||||
|
// A4页面高度297mm,底部边距10mm,计算可用的最大Y坐标
|
||||||
|
pageHeight := 297.0
|
||||||
|
bottomMargin := 10.0
|
||||||
|
maxY := pageHeight - bottomMargin
|
||||||
|
|
||||||
|
// 检查当前页面剩余空间是否足够放下图片
|
||||||
|
// 如果图片底部会超出页面可用区域,则添加新页面
|
||||||
|
if currentY+imageHeight > maxY {
|
||||||
|
pdf.AddPage()
|
||||||
|
// 新页面从顶部边距开始
|
||||||
|
currentY = 10.0
|
||||||
|
}
|
||||||
|
|
||||||
|
// 添加图片
|
||||||
|
// ImageOptions参数:图片路径、x坐标、y坐标、宽度、高度、是否流式布局、选项、链接
|
||||||
|
// 高度设为0表示按比例自动计算
|
||||||
|
pdf.ImageOptions(tmpFile.Name(), imageX, currentY, imageWidth, 0, false, gofpdf.ImageOptions{}, 0, "")
|
||||||
|
}
|
||||||
|
|
||||||
|
// 生成并保存PDF文件
|
||||||
|
err = pdf.OutputFileAndClose(outputPath)
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("生成PDF失败: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user