Compare commits

..

262 Commits
chat ... main

Author SHA1 Message Date
173cb0af0f Merge branch 'jng' 2025-07-03 16:53:51 +08:00
d03049762f 修改 2025-07-03 16:53:08 +08:00
f1bb8d54ca Merge branch 'jng' 2025-07-03 16:12:17 +08:00
aecd26d08c 11 2025-07-03 16:05:48 +08:00
3c618f52c8 修改 2025-07-03 16:02:06 +08:00
e7b3fe54bd 修改 2025-07-03 15:50:53 +08:00
db9edc057d Merge branch 'jng' 2025-07-02 15:36:42 +08:00
a0afa6f17a 修改 2025-07-02 15:33:22 +08:00
3e003ca581 修改 2025-07-02 14:02:10 +08:00
bb7184c480 Merge branch 'feat-zjy-fixbug-003' into main 2025-06-27 17:44:55 +08:00
633c903f33 fix: 处理对账单金额问题 2025-06-27 17:43:09 +08:00
eea1b146eb Merge branch 'main' of http://172.16.100.91:3000/fiee/fonchain-fiee 2025-06-27 17:19:27 +08:00
6848e73ac6 管理人是我 2025-06-27 17:19:22 +08:00
sxy
f0c81cc22f Merge branch 'sxy-fix' 2025-06-27 15:59:45 +08:00
sxy
6406396d75 修改路由认证-1 2025-06-27 15:59:28 +08:00
b8e9353a99 Merge branch 'feat-zjy-fixbug-003' into main 2025-06-27 15:51:18 +08:00
58abfab434 fix: 处理对账单金额问题 2025-06-27 15:50:17 +08:00
8f5caf80bf 修改审批接口 2025-06-27 15:31:39 +08:00
d1181e4460 修改 2025-06-27 14:58:39 +08:00
gy
d71d77647f 1 2025-06-27 11:54:15 +08:00
sxy
7934b253b0 修改路由认证 2025-06-27 11:11:17 +08:00
sxy
5caf271d18 修改路由 2025-06-27 10:52:35 +08:00
sxy
06e764dfd1 "修改路由重复-冲突" 2025-06-26 18:22:35 +08:00
sxy
23ef741181 Merge branch 'main' of https://gitea-inner.fontree.cn/fiee/fonchain-fiee 2025-06-26 17:47:45 +08:00
sxy
ef16bf69f9 "修改msg-冲突" 2025-06-26 17:47:24 +08:00
sxy
24fe5e3760 Merge branch 'sxy' 2025-06-26 17:46:33 +08:00
7ea988ccc5 解决冲突 2025-06-26 17:39:51 +08:00
lzh
7735b710dd Merge branch 'dev-lzh' 2025-06-26 17:18:46 +08:00
9546978e3c fix: 处理pb冲突 2025-06-26 17:10:01 +08:00
bbf093e104 Merge branch 'feat-zjy-issue-008' into main
# Conflicts:
#	api/bundle/bundle.pb.go
#	api/bundle/bundle_triple.pb.go
#	docs/dev/dubbogo.yaml
#	pkg/router/bundle.go
#	pkg/service/init.go
2025-06-26 17:07:16 +08:00
4af106da5d Update bundle.validator.pb.go 2025-06-26 16:56:44 +08:00
2fc8ee5cb2 合并代码 2025-06-26 16:54:59 +08:00
lzh
fe9f4dcc95 调整资源原始文件鉴权 2025-06-26 16:12:50 +08:00
62efe6a80d 短信通知 2025-06-26 09:19:18 +08:00
lzh
ab135ed80e 修复作品确认接口的提前返回问题 2025-06-25 16:52:11 +08:00
f583a771d6 修改 2025-06-25 16:30:34 +08:00
cd40e1c9ca Merge branch 'chat' 2025-06-25 15:53:57 +08:00
2ea9d6bc45 Update handler.go 2025-06-25 15:49:52 +08:00
23cf374c95 修改 2025-06-25 15:32:51 +08:00
lzh
b46286c584 更新proto 2025-06-25 15:23:55 +08:00
9e3445319b Update work.go 2025-06-25 14:16:21 +08:00
85567c24a5 Update work.go 2025-06-25 11:08:55 +08:00
ce9deac980 1 2025-06-25 10:25:24 +08:00
e0d7b3775c 添加作品数量 2025-06-24 18:27:55 +08:00
b9ca6c67ef 添加取号 2025-06-24 16:38:26 +08:00
3890d74c0c 添加取号 2025-06-24 16:33:06 +08:00
b5ec90382f 1 2025-06-24 16:01:50 +08:00
sxy
0d529d47db 修改套餐proto文件-1 2025-06-24 16:01:39 +08:00
44bff5db82 修改 2025-06-24 15:53:24 +08:00
422b426c37 添加日志 2025-06-24 15:43:38 +08:00
lzh
a3703f1d52 更新proto文件 2025-06-24 15:17:10 +08:00
786347f0d5 修改 2025-06-24 14:38:34 +08:00
sxy
a30636b387 修改套餐proto文件 2025-06-24 14:26:13 +08:00
490b0d7787 添加合同删除 2025-06-24 13:56:22 +08:00
a8f0107656 修改 2025-06-24 13:42:57 +08:00
62c48b2ea9 修改日志排序 2025-06-24 13:19:41 +08:00
090538be0d 修改 2025-06-24 10:55:59 +08:00
lzh
a6a04bf263 添加跨域支持 2025-06-24 09:42:17 +08:00
sxy
4344f1ff2c 修改多语言msg 2025-06-23 16:28:39 +08:00
lzh
beb0ab72ab 确认列表过滤 2025-06-23 16:17:10 +08:00
382a32bec4 fix: 处理金额比较问题 2025-06-23 15:53:04 +08:00
94cf7ba83e 修改 2025-06-23 15:31:34 +08:00
0788c6a770 修改 2025-06-23 15:14:53 +08:00
7588bf4b28 绑定 2025-06-20 16:41:24 +08:00
a3f38b8377 修改 2025-06-20 15:51:16 +08:00
sxy
e53d3decd7 修改多语言msg-1 2025-06-20 15:30:27 +08:00
sxy
81115cee52 修改多语言msg 2025-06-20 14:57:53 +08:00
b51d4d39ca Update approval.go 2025-06-20 13:32:44 +08:00
sxy
42eac3d70b 修改bug-msg 2025-06-20 13:10:00 +08:00
cf413538fa fix: 处理bug 2025-06-20 11:48:20 +08:00
42522327a5 1 2025-06-20 11:46:06 +08:00
sxy
051f4d9f1d 修改bug 2025-06-20 11:42:04 +08:00
c20c6871c9 fix: 处理冲突,增加自行购买 2025-06-20 11:26:16 +08:00
383f8bef10 Merge branch 'jng' into feat-zjy-issue-008
# Conflicts:
#	api/bundle/bundle.pb.go
#	api/bundle/bundle_triple.pb.go
2025-06-20 11:21:22 +08:00
sxy
87e9701f72 修改h5 list接口 2025-06-20 11:15:01 +08:00
e663606c78 Update work.go 2025-06-20 11:11:49 +08:00
acf472f1ef fix: 注掉没用信息,太强说会更新两次 2025-06-20 11:02:48 +08:00
7c6edab53d fix: 去掉单独购买增值服务的0远金额限制 2025-06-20 10:23:32 +08:00
lzh
320e110f8c 补充缺失字段 2025-06-20 09:44:03 +08:00
sxy
736e3b1bd0 修改H5套餐列表 2025-06-19 16:19:37 +08:00
8cfcbf345e 修改 2025-06-19 15:32:54 +08:00
lzh
a6e83c162d 添加扩展类型字段 2025-06-19 15:13:36 +08:00
lzh
c0be49a610 添加扩展类型字段 2025-06-19 15:13:15 +08:00
lzh
dff14a45be 更新proto文件 2025-06-19 15:12:32 +08:00
2facb5c0fb Merge branch 'chat' 2025-06-19 15:07:05 +08:00
lzh
686a57ebc5 更新proto文件 2025-06-19 15:06:01 +08:00
bc17428bd6 fix: 增加筛选过滤 2025-06-19 14:40:09 +08:00
6eb8e2cef8 fix: 处理订单金额是0的情况,直接返回 2025-06-19 13:57:12 +08:00
sxy
d96222ba1e 修改错误信息返回 2025-06-19 11:53:45 +08:00
480551a738 添加重新发布 2025-06-19 11:04:37 +08:00
a9474f1a3d 修改 2025-06-19 10:32:44 +08:00
bf28865012 fix: 处理订单金额是0的情况 2025-06-19 09:51:44 +08:00
62a0a2c0af fix: 打日志 2025-06-18 16:27:17 +08:00
sxy
039cd019e9 修改套餐中间表 2025-06-18 15:51:31 +08:00
sxy
ef2a15879c 修改返回语言 2025-06-18 11:38:53 +08:00
sxy
a4e8774077 Merge branch 'sxy-sec' 2025-06-18 10:53:31 +08:00
sxy
70fe9ae034 修改返回语言 2025-06-18 10:51:57 +08:00
lzh
eebaada8f6 修改protoc版本 2025-06-17 21:29:00 +08:00
lzh
4495e996cb 1 2025-06-17 21:25:39 +08:00
sxy
8ba1cd7101 Merge branch 'sxy-sec' 2025-06-17 20:28:37 +08:00
sxy
c98591b2bb Revert "修改"
This reverts commit 8f8e28ca3d.
2025-06-17 19:55:01 +08:00
lzh
e250a5dbc9 忽略未上线消费者 2025-06-17 19:45:50 +08:00
lzh
096f691067 忽略未上线消费者 2025-06-17 19:43:47 +08:00
lzh
d00a4d48ad Merge branch 'dev-lzh' 2025-06-17 19:34:51 +08:00
lzh
661eb9c72a 添加跨域处理 2025-06-17 19:34:42 +08:00
sxy
5aaf8d92bf Merge branch 'sxy-sec' 2025-06-17 18:33:52 +08:00
sxy
8f8e28ca3d 修改 2025-06-17 18:30:36 +08:00
lzh
e2fb31e67d Merge branch 'dev-lzh' 2025-06-17 18:26:27 +08:00
28cd572cbd 修改 2025-06-17 15:39:47 +08:00
sxy
8d28627e5f 修改接口认证 2025-06-17 14:46:09 +08:00
lzh
5ad6d318e0 添加确认变更的接口 2025-06-17 14:27:43 +08:00
sxy
0a5cb9f175 修改接口认证 2025-06-17 14:21:18 +08:00
sxy
d14dbaaf99 修改官网数据 2025-06-17 14:07:30 +08:00
sxy
73537c1a21 修改数据返回 2025-06-17 10:07:39 +08:00
sxy
9f5948a253 修改proto-color 2025-06-17 09:27:20 +08:00
lzh
f064802fcb 添加官网文档多语言支持 2025-06-16 15:32:56 +08:00
sxy
80fd028885 修改page-1 2025-06-16 14:32:18 +08:00
sxy
d0a51000d0 修改page 2025-06-16 14:26:00 +08:00
lzh
8a13754309 素材库路径修改 2025-06-16 14:11:11 +08:00
7bc66c7107 fix: 处理支付更新对账单id错误问题 2025-06-16 13:57:30 +08:00
lzh
b29c2fcad3 匹配路径修改 2025-06-16 13:54:42 +08:00
lzh
c07d4a3abb 修改预览接口路径 2025-06-16 13:47:14 +08:00
sxy
de1ad8e06e 增加 修改 2025-06-16 13:22:20 +08:00
lzh
87fed2c831 文件上传修改为表单格式 2025-06-16 13:09:06 +08:00
af9a59227f fix: 新增app端的根据orderNo查询子套餐 2025-06-16 13:05:29 +08:00
ac14cabe1b Update work.go 2025-06-16 11:52:30 +08:00
sxy
4d8b89c68c 增加 page 2025-06-16 11:48:11 +08:00
1e6e026aae 添加日志修改提示 2025-06-16 11:37:05 +08:00
lzh
0fb393e9ed 文件上传修改为表单格式 2025-06-16 11:25:17 +08:00
21f6837fec 修改 2025-06-16 11:19:42 +08:00
lzh
e9120402af 添加套餐金额类型 2025-06-16 11:06:17 +08:00
92364e194f merge jng 2025-06-16 10:53:22 +08:00
abe68c7f6e 1 2025-06-16 10:37:18 +08:00
lzh
6c194a0646 作品类型判断 2025-06-16 10:20:18 +08:00
638f2a9554 fix: 调整代码,创建支付的时候加入创建对账单。支付成功通知时更新对账单 2025-06-16 09:56:09 +08:00
sxy
549b5f05c6 增加 form list 2025-06-16 09:31:23 +08:00
lzh
c1ad440e83 提交时间类型修改 2025-06-16 09:04:45 +08:00
e370308b10 fix: 调整校验状态 2025-06-15 20:57:02 +08:00
cf18598b96 Merge branch 'jng' into feat-zjy-issue-008
# Conflicts:
#	api/bundle/bundle.pb.go
2025-06-15 20:54:42 +08:00
c5ee0d1ae7 获取用户余量 2025-06-15 20:46:05 +08:00
057565b0aa fix: 新增接口,根据orderNo,仅查询它单独购买的增值服务,调整支付创建时候仅增值的情况 2025-06-15 19:19:10 +08:00
32cf742fa8 fix: detail接口增加addBundle的字段 2025-06-15 18:29:10 +08:00
d332b0e1d4 修改 2025-06-15 15:59:40 +08:00
lzh
cc591a2e04 磁盘使用率接口 2025-06-15 15:53:57 +08:00
8000f56c06 修改 2025-06-15 15:27:51 +08:00
lzh
d47c033d7b 作品状态确认 2025-06-15 15:12:42 +08:00
lzh
3e16c413e5 作品状态判断 2025-06-15 15:00:45 +08:00
lzh
cb84e6195d 1 2025-06-15 14:58:29 +08:00
59ed859aae fix: 调整支付配置文件 2025-06-15 14:50:26 +08:00
lzh
e5efa596d9 补齐json tag 2025-06-15 14:28:33 +08:00
lzh
bfef9134b7 余量查询修改 2025-06-15 13:58:07 +08:00
e26c9f0c51 fix: 调整创建支付的代码逻辑 2025-06-15 13:23:11 +08:00
lzh
d3b16ace79 作品确认、用户余量信息 2025-06-15 12:18:50 +08:00
701b27215f 详情添加分类 2025-06-15 12:12:17 +08:00
b75a07c4dd Merge branch 'jng' into feat-zjy-issue-008 2025-06-15 10:12:06 +08:00
eb3e1f809b 修改 2025-06-15 10:06:57 +08:00
f8c6a2ff96 完成套餐查询 2025-06-15 00:33:25 +08:00
1617c6170d APP接口 2025-06-14 19:46:02 +08:00
f987f964b5 1 2025-06-14 19:00:37 +08:00
2db47664a3 1 2025-06-14 18:29:26 +08:00
sxy
9402bad9fd 修改语言传输 2025-06-14 17:40:06 +08:00
lzh
f2277fa337 添加待确认作品详情查看 2025-06-14 17:13:30 +08:00
sxy
637fc47188 z增加详情接口 2025-06-14 17:10:28 +08:00
sxy
1bab9a17e6 修改proto 2025-06-14 17:09:14 +08:00
sxy
f36758d8ac 修改proto 2025-06-14 17:01:47 +08:00
sxy
ba65fbe5b7 修改 2025-06-14 16:41:21 +08:00
lzh
625ed25b67 添加鉴权方式 2025-06-14 15:42:52 +08:00
c4e72efcb5 11 2025-06-14 15:23:14 +08:00
584938b537 更新自媒体账号ID 2025-06-14 14:44:12 +08:00
lzh
ed8844be34 添加文件修改日期 2025-06-14 14:27:11 +08:00
48343889e2 修改配置 2025-06-14 14:10:55 +08:00
lzh
ae7b87aa17 添加作品记录和详情接口 2025-06-14 13:52:51 +08:00
lzh
bef40ad0f1 Merge remote-tracking branch 'origin/feature-multicast-daiyb' into dev-lzh 2025-06-14 13:31:29 +08:00
lzh
a41962ba8d 添加使用记录接口 2025-06-14 13:29:05 +08:00
lzh
bb36d88c98 补齐依赖 2025-06-14 13:21:02 +08:00
lzh
0d28141f65 Merge remote-tracking branch 'origin/jng' into dev-lzh 2025-06-14 13:20:21 +08:00
lzh
73ad76501c 添加时间扩展单位 2025-06-14 11:32:06 +08:00
99cfbbf6f7 添加订单详情接口 2025-06-14 11:29:21 +08:00
d4b50302fa 添加轮播接口 2025-06-14 10:22:02 +08:00
lzh
e447ff1d42 素材库添加鉴权 2025-06-14 09:50:12 +08:00
8449969682 修改 2025-06-13 22:38:03 +08:00
a439342ba2 修改订单创建 2025-06-13 19:25:39 +08:00
129d3fafa1 更新审批 2025-06-13 19:00:38 +08:00
sxy
b71fef10ef 修改 2025-06-13 16:48:38 +08:00
sxy
cd79fe7319 修改 2025-06-13 15:00:40 +08:00
sxy
8d9260aca5 修改返回数据 2025-06-13 14:44:24 +08:00
lzh
34a724268a 修改接口路径 2025-06-13 14:34:28 +08:00
6ae9395add 修改 2025-06-13 14:31:29 +08:00
4a30ddad23 修改 2025-06-13 14:02:34 +08:00
lzh
11b0192a23 添加扩展和余量接口 2025-06-13 14:00:29 +08:00
sxy
a63b001e5b 修改 2025-06-13 10:53:59 +08:00
sxy
76e30e9211 修改冲突 2025-06-13 10:47:42 +08:00
sxy
63da647619 修改冲突 2025-06-13 10:45:30 +08:00
sxy
49a935d6c6 修改 2025-06-13 10:34:36 +08:00
lzh
44d5704606 修改请求方法 2025-06-12 19:46:55 +08:00
lzh
816d1e108e 修改请求方法 2025-06-12 19:42:12 +08:00
lzh
586d28119a 添加字段 2025-06-12 19:23:11 +08:00
449ff68d3a 修改 2025-06-12 18:15:28 +08:00
lzh
d621faa3ca 修改proto 2025-06-12 17:20:02 +08:00
03574bd25f 修改 2025-06-12 16:38:55 +08:00
7c54d3ce30 更新审批信息 2025-06-12 15:20:11 +08:00
lzh
3a47be645f 添加摘要字段 2025-06-12 14:36:29 +08:00
lzh
fb48a52910 修改鉴权 2025-06-12 13:44:20 +08:00
sxy
78246a5b2a 修改 2025-06-12 11:59:19 +08:00
347b97f9d9 添加详情 2025-06-12 11:38:19 +08:00
ca0023a1e6 1 2025-06-12 10:23:57 +08:00
sxy
7b228e0c03 修改节省金额 2025-06-12 10:20:32 +08:00
lzh
48365942d1 修改路由路径 2025-06-11 18:16:15 +08:00
lzh
83c218564f 修改文档接口method 2025-06-11 17:51:45 +08:00
1f77285201 1 2025-06-11 17:02:28 +08:00
lzh
908c7cba05 添加操作人信息 2025-06-11 16:56:24 +08:00
7ccebd8621 修改设置 2025-06-11 16:52:04 +08:00
sxy
9120e6acfd 修改路由接口-2 2025-06-11 16:23:49 +08:00
a6078341ab 更新列表接口 2025-06-11 16:11:16 +08:00
lzh
60111dac43 添加展示字段 2025-06-11 15:56:39 +08:00
sxy
463404d774 修改路由接口-1 2025-06-11 15:55:42 +08:00
sxy
99f4ca986a 修改路由接口 2025-06-11 15:41:04 +08:00
lzh
df6a9db80b 添加附件名字段 2025-06-11 15:17:41 +08:00
db54a355e8 修改 2025-06-11 14:33:48 +08:00
lzh
dc54b70b59 完善文档相关接口 2025-06-11 14:13:11 +08:00
lzh
8e8cc16853 添加官网新闻接口 2025-06-11 13:59:35 +08:00
d6fd804005 Update conf.ini 2025-06-11 10:25:26 +08:00
19b5a693d2 Update conf.ini 2025-06-11 10:24:33 +08:00
fc482ff71e 更新cast 2025-06-11 09:54:04 +08:00
5556a76025 Merge branch 'main' into feature-multicast-daiyb 2025-06-11 09:24:06 +08:00
c67c4da26f 1 2025-06-11 09:24:01 +08:00
7008b4aa2a 完成部分接口 2025-06-11 09:16:11 +08:00
8f4dd8aee0 修改 2025-06-10 16:15:57 +08:00
lzh
272d59af4c 添加套餐扩展、扩展记录接口 2025-06-09 14:22:39 +08:00
lzh
d067c785fb Merge branch 'dev-resource-library' into dev-lzh 2025-06-09 13:40:19 +08:00
lzh
4b443be4e3 路由错误修改 2025-06-09 13:31:44 +08:00
bd540ad262 合并main 2025-06-09 11:48:50 +08:00
99520e87d4 完成账号更新 2025-06-06 14:15:37 +08:00
9711496a8b 合并代码 2025-06-06 11:53:54 +08:00
5d7f617c4d Update init.go 2025-06-06 11:46:25 +08:00
4f6101be68 merge 2025-06-06 11:45:47 +08:00
a922813d24 Delete dubbogo.yaml 2025-06-06 11:44:17 +08:00
78f4a98993 merge main 2025-06-06 11:44:06 +08:00
lzh
5a8bb4216c 添加素材库接口 2025-06-03 15:58:52 +08:00
d9275166e7 Merge branch 'main' into feature-multicast-daiyb 2025-05-29 14:28:16 +08:00
f7a0e319b5 删除忽略文件 2025-05-29 14:28:00 +08:00
c250930722 Merge branch 'jng' into dev 2025-05-28 15:32:06 +08:00
ed7b95d707 Merge branch 'jng' into dev 2025-05-28 15:04:59 +08:00
jhc
5bbf97eaf2 修改引用问题 2025-05-27 10:56:19 +08:00
jhc
c1978c9ee7 修改冲突 2025-05-27 10:49:22 +08:00
jhc
73f269f847 导出文件 上传 oss 2025-05-27 10:46:36 +08:00
60caecc1b9 Merge branch 'jng' into dev 2025-05-27 09:53:45 +08:00
a23504c746 Merge branch 'jng' into dev 2025-05-27 09:41:45 +08:00
d0cf3bb208 Merge branch 'jng' into dev 2025-05-27 09:36:16 +08:00
8d43eaf18d Merge branch 'jng' into dev 2025-05-27 09:15:44 +08:00
8e30f6c984 Merge branch 'jng' into dev 2025-05-26 17:16:54 +08:00
2d0a24100e Merge branch 'jng' into dev 2025-05-26 17:03:15 +08:00
ef50c8626a 解决冲突 2025-05-26 16:32:36 +08:00
db0a50ed33 Merge branch 'jng' into dev 2025-05-26 09:17:47 +08:00
b4c173df5f Merge branch 'jng' into dev 2025-05-26 09:13:22 +08:00
d0453c222d 添加cast微服务 2025-05-23 13:25:47 +08:00
a6919e8396 11 2025-05-23 11:16:03 +08:00
2779dcc5bd 11 2025-05-23 11:06:08 +08:00
8562d64dd5 11 2025-05-23 10:57:29 +08:00
2de0d9dc9b 解决冲突 2025-05-23 10:54:31 +08:00
a357389fac 11 2025-05-22 20:43:47 +08:00
72ee1f7265 提交文件 2025-05-21 14:52:33 +08:00
90 changed files with 35247 additions and 3426 deletions

3
.gitignore vendored
View File

@ -28,3 +28,6 @@
*.out *.out
/cmd/runtime /cmd/runtime
/cmd/logs/*.log
/cmd/runtime/log/*.log
/build/*

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -62,6 +62,7 @@ service AccountFiee {
rpc VerifySliderCaptcha(VerifySliderCaptchaRequest) returns (VerifySliderCaptchaResponse) {}// rpc VerifySliderCaptcha(VerifySliderCaptchaRequest) returns (VerifySliderCaptchaResponse) {}//
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) {} // --
// submit info // submit info
rpc SaveSubmitInfo(SubmitInfoRequest) returns (CommonResponse); rpc SaveSubmitInfo(SubmitInfoRequest) returns (CommonResponse);
@ -207,6 +208,7 @@ message UserInfoResponse{
string subscriberNumber = 16; string subscriberNumber = 16;
string nickName = 17; string nickName = 17;
string telNum = 18; string telNum = 18;
string telAreaCode = 19;
} }
message RealNameResponse{ message RealNameResponse{
uint64 id = 1; uint64 id = 1;

View File

@ -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.8
// - protoc v4.22.0--rc2 // - protoc v4.24.0--rc1
// source: accountFiee.proto // source: api/accountFiee/accountFiee.proto
package accountFiee package accountFiee
@ -35,7 +35,7 @@ type AccountFieeClient interface {
OnlineLog(ctx context.Context, in *LoginInfosByUserIdRequest, opts ...grpc_go.CallOption) (*LoginLogsResponse, common.ErrorWithAttachment) OnlineLog(ctx context.Context, in *LoginInfosByUserIdRequest, opts ...grpc_go.CallOption) (*LoginLogsResponse, common.ErrorWithAttachment)
OnlineLogById(ctx context.Context, in *OnlineLogByIdRequest, opts ...grpc_go.CallOption) (*LoginLog, common.ErrorWithAttachment) OnlineLogById(ctx context.Context, in *OnlineLogByIdRequest, opts ...grpc_go.CallOption) (*LoginLog, common.ErrorWithAttachment)
CheckPwd(ctx context.Context, in *CheckPwdRequest, opts ...grpc_go.CallOption) (*UpdateResponse, common.ErrorWithAttachment) CheckPwd(ctx context.Context, in *CheckPwdRequest, opts ...grpc_go.CallOption) (*UpdateResponse, common.ErrorWithAttachment)
// rpc RegisterOrExist (RegistRequest) returns (RequestStatus) {} // rpc RegisterOrExist (RegistRequest) returns (RequestStatus) {}
SendMsg(ctx context.Context, in *SendMsgRequest, opts ...grpc_go.CallOption) (*SendMsgStatusResponse, common.ErrorWithAttachment) SendMsg(ctx context.Context, in *SendMsgRequest, opts ...grpc_go.CallOption) (*SendMsgStatusResponse, common.ErrorWithAttachment)
SendCustomMsg(ctx context.Context, in *SendCustomMsgRequest, opts ...grpc_go.CallOption) (*SendMsgStatusResponse, common.ErrorWithAttachment) SendCustomMsg(ctx context.Context, in *SendCustomMsgRequest, opts ...grpc_go.CallOption) (*SendMsgStatusResponse, common.ErrorWithAttachment)
SendExCustomMsg(ctx context.Context, in *SendCustomMsgRequest, opts ...grpc_go.CallOption) (*SendMsgStatusResponse, common.ErrorWithAttachment) SendExCustomMsg(ctx context.Context, in *SendCustomMsgRequest, opts ...grpc_go.CallOption) (*SendMsgStatusResponse, common.ErrorWithAttachment)
@ -68,9 +68,10 @@ type AccountFieeClient interface {
VerifySliderCaptcha(ctx context.Context, in *VerifySliderCaptchaRequest, opts ...grpc_go.CallOption) (*VerifySliderCaptchaResponse, common.ErrorWithAttachment) VerifySliderCaptcha(ctx context.Context, in *VerifySliderCaptchaRequest, opts ...grpc_go.CallOption) (*VerifySliderCaptchaResponse, common.ErrorWithAttachment)
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)
// 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)
// -----------------------------客服聊天系统-------------------------------- //-----------------------------客服聊天系统--------------------------------
CreateChatUser(ctx context.Context, in *ChatUserData, opts ...grpc_go.CallOption) (*CreateChatUserResp, common.ErrorWithAttachment) CreateChatUser(ctx context.Context, in *ChatUserData, opts ...grpc_go.CallOption) (*CreateChatUserResp, common.ErrorWithAttachment)
UpdateChatUser(ctx context.Context, in *ChatUserData, opts ...grpc_go.CallOption) (*CommonMsg, common.ErrorWithAttachment) UpdateChatUser(ctx context.Context, in *ChatUserData, opts ...grpc_go.CallOption) (*CommonMsg, common.ErrorWithAttachment)
SaveChatUser(ctx context.Context, in *ChatUserData, opts ...grpc_go.CallOption) (*CommonMsg, common.ErrorWithAttachment) SaveChatUser(ctx context.Context, in *ChatUserData, opts ...grpc_go.CallOption) (*CommonMsg, common.ErrorWithAttachment)
@ -143,6 +144,7 @@ type AccountFieeClientImpl struct {
VerifySliderCaptcha func(ctx context.Context, in *VerifySliderCaptchaRequest) (*VerifySliderCaptchaResponse, error) VerifySliderCaptcha func(ctx context.Context, in *VerifySliderCaptchaRequest) (*VerifySliderCaptchaResponse, error)
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)
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)
UpdateChatUser func(ctx context.Context, in *ChatUserData) (*CommonMsg, error) UpdateChatUser func(ctx context.Context, in *ChatUserData) (*CommonMsg, error)
@ -418,6 +420,12 @@ func (c *accountFieeClient) VerifySliderStatus(ctx context.Context, in *VerifySl
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/VerifySliderStatus", in, out) return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/VerifySliderStatus", in, out)
} }
func (c *accountFieeClient) SendNationTemplateMsg(ctx context.Context, in *SendNationMsgRequest, opts ...grpc_go.CallOption) (*SendMsgStatusResponse, common.ErrorWithAttachment) {
out := new(SendMsgStatusResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/SendNationTemplateMsg", in, out)
}
func (c *accountFieeClient) SaveSubmitInfo(ctx context.Context, in *SubmitInfoRequest, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment) { func (c *accountFieeClient) SaveSubmitInfo(ctx context.Context, in *SubmitInfoRequest, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment) {
out := new(CommonResponse) out := new(CommonResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string) interfaceKey := ctx.Value(constant.InterfaceKey).(string)
@ -591,7 +599,7 @@ type AccountFieeServer interface {
OnlineLog(context.Context, *LoginInfosByUserIdRequest) (*LoginLogsResponse, error) OnlineLog(context.Context, *LoginInfosByUserIdRequest) (*LoginLogsResponse, error)
OnlineLogById(context.Context, *OnlineLogByIdRequest) (*LoginLog, error) OnlineLogById(context.Context, *OnlineLogByIdRequest) (*LoginLog, error)
CheckPwd(context.Context, *CheckPwdRequest) (*UpdateResponse, error) CheckPwd(context.Context, *CheckPwdRequest) (*UpdateResponse, error)
// rpc RegisterOrExist (RegistRequest) returns (RequestStatus) {} // rpc RegisterOrExist (RegistRequest) returns (RequestStatus) {}
SendMsg(context.Context, *SendMsgRequest) (*SendMsgStatusResponse, error) SendMsg(context.Context, *SendMsgRequest) (*SendMsgStatusResponse, error)
SendCustomMsg(context.Context, *SendCustomMsgRequest) (*SendMsgStatusResponse, error) SendCustomMsg(context.Context, *SendCustomMsgRequest) (*SendMsgStatusResponse, error)
SendExCustomMsg(context.Context, *SendCustomMsgRequest) (*SendMsgStatusResponse, error) SendExCustomMsg(context.Context, *SendCustomMsgRequest) (*SendMsgStatusResponse, error)
@ -624,9 +632,10 @@ type AccountFieeServer interface {
VerifySliderCaptcha(context.Context, *VerifySliderCaptchaRequest) (*VerifySliderCaptchaResponse, error) VerifySliderCaptcha(context.Context, *VerifySliderCaptchaRequest) (*VerifySliderCaptchaResponse, error)
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)
// submit info // submit info
SaveSubmitInfo(context.Context, *SubmitInfoRequest) (*CommonResponse, error) SaveSubmitInfo(context.Context, *SubmitInfoRequest) (*CommonResponse, error)
// -----------------------------客服聊天系统-------------------------------- //-----------------------------客服聊天系统--------------------------------
CreateChatUser(context.Context, *ChatUserData) (*CreateChatUserResp, error) CreateChatUser(context.Context, *ChatUserData) (*CreateChatUserResp, error)
UpdateChatUser(context.Context, *ChatUserData) (*CommonMsg, error) UpdateChatUser(context.Context, *ChatUserData) (*CommonMsg, error)
SaveChatUser(context.Context, *ChatUserData) (*CommonMsg, error) SaveChatUser(context.Context, *ChatUserData) (*CommonMsg, error)
@ -778,6 +787,9 @@ func (UnimplementedAccountFieeServer) SendNationMsg(context.Context, *SendNation
func (UnimplementedAccountFieeServer) VerifySliderStatus(context.Context, *VerifySliderStatusRequest) (*VerifySliderStatusResponse, error) { func (UnimplementedAccountFieeServer) VerifySliderStatus(context.Context, *VerifySliderStatusRequest) (*VerifySliderStatusResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method VerifySliderStatus not implemented") return nil, status.Errorf(codes.Unimplemented, "method VerifySliderStatus not implemented")
} }
func (UnimplementedAccountFieeServer) SendNationTemplateMsg(context.Context, *SendNationMsgRequest) (*SendMsgStatusResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method SendNationTemplateMsg not implemented")
}
func (UnimplementedAccountFieeServer) SaveSubmitInfo(context.Context, *SubmitInfoRequest) (*CommonResponse, error) { func (UnimplementedAccountFieeServer) SaveSubmitInfo(context.Context, *SubmitInfoRequest) (*CommonResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method SaveSubmitInfo not implemented") return nil, status.Errorf(codes.Unimplemented, "method SaveSubmitInfo not implemented")
} }
@ -2018,6 +2030,35 @@ func _AccountFiee_VerifySliderStatus_Handler(srv interface{}, ctx context.Contex
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
func _AccountFiee_SendNationTemplateMsg_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(SendNationMsgRequest)
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("SendNationTemplateMsg", 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_SaveSubmitInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) { func _AccountFiee_SaveSubmitInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(SubmitInfoRequest) in := new(SubmitInfoRequest)
if err := dec(in); err != nil { if err := dec(in); err != nil {
@ -2964,6 +3005,10 @@ var AccountFiee_ServiceDesc = grpc_go.ServiceDesc{
MethodName: "VerifySliderStatus", MethodName: "VerifySliderStatus",
Handler: _AccountFiee_VerifySliderStatus_Handler, Handler: _AccountFiee_VerifySliderStatus_Handler,
}, },
{
MethodName: "SendNationTemplateMsg",
Handler: _AccountFiee_SendNationTemplateMsg_Handler,
},
{ {
MethodName: "SaveSubmitInfo", MethodName: "SaveSubmitInfo",
Handler: _AccountFiee_SaveSubmitInfo_Handler, Handler: _AccountFiee_SaveSubmitInfo_Handler,
@ -3074,5 +3119,5 @@ var AccountFiee_ServiceDesc = grpc_go.ServiceDesc{
}, },
}, },
Streams: []grpc_go.StreamDesc{}, Streams: []grpc_go.StreamDesc{},
Metadata: "accountFiee.proto", Metadata: "api/accountFiee/accountFiee.proto",
} }

File diff suppressed because it is too large Load Diff

View File

@ -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"
_ "google.golang.org/protobuf/types/descriptorpb"
_ "github.com/mwitkow/go-proto-validators" _ "github.com/mwitkow/go-proto-validators"
_ "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"
) )
@ -17,10 +17,100 @@ var _ = proto.Marshal
var _ = fmt.Errorf var _ = fmt.Errorf
var _ = math.Inf var _ = math.Inf
func (this *DeleteValueAddServiceRequest) Validate() error {
return nil
}
func (this *GetReconciliationListReq) Validate() error {
return nil
}
func (this *GetReconciliationListResp) 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 *ReconciliationInfo) Validate() error {
return nil
}
func (this *OrderInfoByOrderNoRequest) Validate() error {
return nil
}
func (this *OrderInfoByOrderNoResp) Validate() error {
return nil
}
func (this *OrderCreateRecord) Validate() error {
for _, item := range this.AddRecords {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("AddRecords", err)
}
}
}
return nil
}
func (this *OrderCreateAddRecord) Validate() error {
return nil
}
func (this *OrderRecordsRequestV2) Validate() error {
return nil
}
func (this *OrderRecordsResponseV2) Validate() error {
for _, item := range this.BundleInfo {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("BundleInfo", err)
}
}
}
return nil
}
func (this *OrderBundleRecordInfo) Validate() error {
for _, item := range this.AddBundleInfo {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("AddBundleInfo", err)
}
}
}
return nil
}
func (this *OrderAddBundleRecordInfo) Validate() error {
return nil
}
func (this *PackagePriceAndTimeResponse) Validate() error {
return nil
}
func (this *CommonResponse) Validate() error { func (this *CommonResponse) Validate() error {
return nil return nil
} }
func (this *BundleProfile) Validate() error { func (this *BundleProfile) Validate() error {
for _, item := range this.SelectValueAddService {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("SelectValueAddService", err)
}
}
}
for _, item := range this.BundleProfileLang {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("BundleProfileLang", err)
}
}
}
return nil
}
func (this *BundleProfileLang) Validate() error {
return nil
}
func (this *SaveResponse) Validate() error {
return nil
}
func (this *SelectValueAddService) Validate() error {
return nil return nil
} }
func (this *DelBundleRequest) Validate() error { func (this *DelBundleRequest) Validate() error {
@ -42,6 +132,9 @@ func (this *BundleListResponse) Validate() error {
func (this *BundleDetailRequest) Validate() error { func (this *BundleDetailRequest) Validate() error {
return nil return nil
} }
func (this *HandShelfRequest) Validate() error {
return nil
}
func (this *BundleDetailResponse) Validate() error { func (this *BundleDetailResponse) Validate() error {
if this.Bundle != nil { if this.Bundle != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Bundle); err != nil { if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Bundle); err != nil {
@ -50,7 +143,48 @@ func (this *BundleDetailResponse) Validate() error {
} }
return nil return nil
} }
func (this *BundleDetailResponseV2) Validate() error {
if this.Bundle != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Bundle); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Bundle", err)
}
}
return nil
}
func (this *OrderRecord) Validate() error { func (this *OrderRecord) Validate() error {
for _, item := range this.PriceOptionsInfo {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("PriceOptionsInfo", err)
}
}
}
for _, item := range this.AddInfos {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("AddInfos", err)
}
}
}
return nil
}
func (this *AddInfo) Validate() error {
return nil
}
func (this *OrderAddRecord) Validate() error {
for _, item := range this.AddPriceOptionsList {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("AddPriceOptionsList", err)
}
}
}
return nil
}
func (this *AddPriceOptionsInfo) Validate() error {
return nil
}
func (this *PriceOptionsInfo) Validate() error {
return nil return nil
} }
func (this *OrderRecordsRequest) Validate() error { func (this *OrderRecordsRequest) Validate() error {
@ -119,3 +253,197 @@ func (this *ValueAddBundleDetailResponse) Validate() error {
func (this *FinancialConfirmationRequest) Validate() error { func (this *FinancialConfirmationRequest) Validate() error {
return nil return nil
} }
func (this *ValueAddService) Validate() error {
for _, item := range this.ServiceLang {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("ServiceLang", err)
}
}
}
return nil
}
func (this *ValueAddServiceLang) Validate() error {
for _, item := range this.Options {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Options", err)
}
}
}
return nil
}
func (this *ValueAddPriceOptions) Validate() error {
return nil
}
func (this *ValueAddServiceListRequest) Validate() error {
return nil
}
func (this *ValueAddServiceListResponse) Validate() error {
for _, item := range this.ValueAddServiceList {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("ValueAddServiceList", err)
}
}
}
return nil
}
func (this *ValueAddServiceDetailRequest) Validate() error {
return nil
}
func (this *ValueAddServiceDetailResponse) Validate() error {
if this.ValueAddService != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.ValueAddService); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("ValueAddService", err)
}
}
return nil
}
func (this *CalculatePriceRequest) Validate() error {
return nil
}
func (this *CalculatePriceResponse) Validate() error {
return nil
}
func (this *BatchGetValueAddServiceLangRequest) Validate() error {
return nil
}
func (this *BatchGetValueAddServiceLangResponse) Validate() error {
for _, item := range this.ValueAddServiceLangList {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("ValueAddServiceLangList", err)
}
}
}
return nil
}
func (this *BundleExtendRequest) Validate() error {
return nil
}
func (this *BundleExtendResponse) Validate() error {
return nil
}
func (this *BundleExtendRecordsListRequest) Validate() error {
return nil
}
func (this *BundleExtendRecordsListResponse) 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 *BundleExtendRecordItem) Validate() error {
return nil
}
func (this *GetBundleBalanceListReq) Validate() error {
return nil
}
func (this *GetBundleBalanceReq) Validate() error {
return nil
}
func (this *BundleBalanceItem) Validate() error {
return nil
}
func (this *GetBundleBalanceListResp) 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 *CreateBundleBalanceReq) Validate() error {
return nil
}
func (this *CreateBundleBalanceResp) Validate() error {
return nil
}
func (this *AddBundleBalanceReq) Validate() error {
return nil
}
func (this *AddBundleBalanceResp) Validate() error {
return nil
}
func (this *GetUsedRecordListReq) Validate() error {
return nil
}
func (this *GetUsedRecordListResp) 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 *WorkCastItem) Validate() error {
return nil
}
func (this *GetImageWorkDetailReq) Validate() error {
return nil
}
func (this *GetVedioWorkDetailReq) Validate() error {
return nil
}
func (this *GetImageWorkDetailResp) Validate() error {
return nil
}
func (this *GetVedioeWorkDetailResp) Validate() error {
return nil
}
func (this *ToBeComfirmedWorksReq) Validate() error {
return nil
}
func (this *WorkItem) Validate() error {
return nil
}
func (this *ToBeComfirmedWorksResp) 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 *GetBundleBalanceByUserIdReq) Validate() error {
return nil
}
func (this *GetBundleBalanceByUserIdResp) Validate() error {
return nil
}
func (this *OnlyAddValueListByOrderNoRequest) Validate() error {
return nil
}
func (this *OnlyAddValueListByOrderNoResp) Validate() error {
for _, item := range this.AddBundleInfos {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("AddBundleInfos", err)
}
}
}
return nil
}
func (this *AddBundleInfo) Validate() error {
return nil
}
func (this *UpdateStatusAndPayTimeBySerialNumber) Validate() error {
return nil
}
func (this *ConfirmWorkReq) Validate() error {
return nil
}
func (this *ConfirmWorkResp) Validate() error {
return nil
}

File diff suppressed because it is too large Load Diff

3525
api/cast/cast.pb.go Normal file

File diff suppressed because it is too large Load Diff

4320
api/cast/cast.pb.validate.go Normal file

File diff suppressed because it is too large Load Diff

823
api/cast/cast_triple.pb.go Normal file
View File

@ -0,0 +1,823 @@
// Code generated by protoc-gen-go-triple. DO NOT EDIT.
// versions:
// - protoc-gen-go-triple v1.0.8
// - protoc v3.21.1
// source: pb/fiee/cast.proto
package cast
import (
context "context"
protocol "dubbo.apache.org/dubbo-go/v3/protocol"
dubbo3 "dubbo.apache.org/dubbo-go/v3/protocol/dubbo3"
invocation "dubbo.apache.org/dubbo-go/v3/protocol/invocation"
grpc_go "github.com/dubbogo/grpc-go"
codes "github.com/dubbogo/grpc-go/codes"
metadata "github.com/dubbogo/grpc-go/metadata"
status "github.com/dubbogo/grpc-go/status"
common "github.com/dubbogo/triple/pkg/common"
constant "github.com/dubbogo/triple/pkg/common/constant"
triple "github.com/dubbogo/triple/pkg/triple"
emptypb "google.golang.org/protobuf/types/known/emptypb"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc_go.SupportPackageIsVersion7
// CastClient is the client API for Cast 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 CastClient interface {
MediaUserList(ctx context.Context, in *MediaUserListReq, opts ...grpc_go.CallOption) (*MediaUserListResp, common.ErrorWithAttachment)
UpdateMediaAccount(ctx context.Context, in *UpdateMediaAccountReq, opts ...grpc_go.CallOption) (*UpdateMediaAccountResp, common.ErrorWithAttachment)
UnbindManager(ctx context.Context, in *UnbindManagerReq, opts ...grpc_go.CallOption) (*UnbindManagerResp, common.ErrorWithAttachment)
BindManager(ctx context.Context, in *BindManagerReq, opts ...grpc_go.CallOption) (*emptypb.Empty, common.ErrorWithAttachment)
UpdateWorkImage(ctx context.Context, in *UpdateWorkImageReq, opts ...grpc_go.CallOption) (*UpdateWorkImageResp, common.ErrorWithAttachment)
UpdateWorkVideo(ctx context.Context, in *UpdateWorkVideoReq, opts ...grpc_go.CallOption) (*UpdateWorkVideoResp, common.ErrorWithAttachment)
WorkList(ctx context.Context, in *WorkListReq, opts ...grpc_go.CallOption) (*WorkListResp, common.ErrorWithAttachment)
WorkDetail(ctx context.Context, in *WorkDetailReq, opts ...grpc_go.CallOption) (*WorkDetailResp, common.ErrorWithAttachment)
UpdateStatus(ctx context.Context, in *UpdateStatusReq, opts ...grpc_go.CallOption) (*emptypb.Empty, common.ErrorWithAttachment)
MediaAccounts(ctx context.Context, in *MediaAccountsReq, opts ...grpc_go.CallOption) (*MediaAccountsResp, common.ErrorWithAttachment)
MediaWorks(ctx context.Context, in *MediaWorksReq, opts ...grpc_go.CallOption) (*MediaWorksResp, common.ErrorWithAttachment)
RePublish(ctx context.Context, in *RePublishReq, opts ...grpc_go.CallOption) (*RePublishResp, common.ErrorWithAttachment)
DelWork(ctx context.Context, in *DelWorkReq, opts ...grpc_go.CallOption) (*emptypb.Empty, common.ErrorWithAttachment)
WorkInfo(ctx context.Context, in *WorkInfoReq, opts ...grpc_go.CallOption) (*WorkInfoResp, common.ErrorWithAttachment)
OAuthYoutubeUrl(ctx context.Context, in *OAuthYoutubeUrlReq, opts ...grpc_go.CallOption) (*OAuthYoutubeUrlResp, common.ErrorWithAttachment)
OAuthYoutubeToken(ctx context.Context, in *OAuthYoutubeTokenReq, opts ...grpc_go.CallOption) (*OAuthYoutubeTokenResp, common.ErrorWithAttachment)
}
type castClient struct {
cc *triple.TripleConn
}
type CastClientImpl struct {
MediaUserList func(ctx context.Context, in *MediaUserListReq) (*MediaUserListResp, error)
UpdateMediaAccount func(ctx context.Context, in *UpdateMediaAccountReq) (*UpdateMediaAccountResp, error)
UnbindManager func(ctx context.Context, in *UnbindManagerReq) (*UnbindManagerResp, error)
BindManager func(ctx context.Context, in *BindManagerReq) (*emptypb.Empty, error)
UpdateWorkImage func(ctx context.Context, in *UpdateWorkImageReq) (*UpdateWorkImageResp, error)
UpdateWorkVideo func(ctx context.Context, in *UpdateWorkVideoReq) (*UpdateWorkVideoResp, error)
WorkList func(ctx context.Context, in *WorkListReq) (*WorkListResp, error)
WorkDetail func(ctx context.Context, in *WorkDetailReq) (*WorkDetailResp, error)
UpdateStatus func(ctx context.Context, in *UpdateStatusReq) (*emptypb.Empty, error)
MediaAccounts func(ctx context.Context, in *MediaAccountsReq) (*MediaAccountsResp, error)
MediaWorks func(ctx context.Context, in *MediaWorksReq) (*MediaWorksResp, error)
RePublish func(ctx context.Context, in *RePublishReq) (*RePublishResp, error)
DelWork func(ctx context.Context, in *DelWorkReq) (*emptypb.Empty, error)
WorkInfo func(ctx context.Context, in *WorkInfoReq) (*WorkInfoResp, error)
OAuthYoutubeUrl func(ctx context.Context, in *OAuthYoutubeUrlReq) (*OAuthYoutubeUrlResp, error)
OAuthYoutubeToken func(ctx context.Context, in *OAuthYoutubeTokenReq) (*OAuthYoutubeTokenResp, error)
}
func (c *CastClientImpl) GetDubboStub(cc *triple.TripleConn) CastClient {
return NewCastClient(cc)
}
func (c *CastClientImpl) XXX_InterfaceName() string {
return "Cast.Cast"
}
func NewCastClient(cc *triple.TripleConn) CastClient {
return &castClient{cc}
}
func (c *castClient) MediaUserList(ctx context.Context, in *MediaUserListReq, opts ...grpc_go.CallOption) (*MediaUserListResp, common.ErrorWithAttachment) {
out := new(MediaUserListResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/MediaUserList", in, out)
}
func (c *castClient) UpdateMediaAccount(ctx context.Context, in *UpdateMediaAccountReq, opts ...grpc_go.CallOption) (*UpdateMediaAccountResp, common.ErrorWithAttachment) {
out := new(UpdateMediaAccountResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/UpdateMediaAccount", in, out)
}
func (c *castClient) UnbindManager(ctx context.Context, in *UnbindManagerReq, opts ...grpc_go.CallOption) (*UnbindManagerResp, common.ErrorWithAttachment) {
out := new(UnbindManagerResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/UnbindManager", in, out)
}
func (c *castClient) BindManager(ctx context.Context, in *BindManagerReq, opts ...grpc_go.CallOption) (*emptypb.Empty, common.ErrorWithAttachment) {
out := new(emptypb.Empty)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/BindManager", in, out)
}
func (c *castClient) UpdateWorkImage(ctx context.Context, in *UpdateWorkImageReq, opts ...grpc_go.CallOption) (*UpdateWorkImageResp, common.ErrorWithAttachment) {
out := new(UpdateWorkImageResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/UpdateWorkImage", in, out)
}
func (c *castClient) UpdateWorkVideo(ctx context.Context, in *UpdateWorkVideoReq, opts ...grpc_go.CallOption) (*UpdateWorkVideoResp, common.ErrorWithAttachment) {
out := new(UpdateWorkVideoResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/UpdateWorkVideo", in, out)
}
func (c *castClient) WorkList(ctx context.Context, in *WorkListReq, opts ...grpc_go.CallOption) (*WorkListResp, common.ErrorWithAttachment) {
out := new(WorkListResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/WorkList", in, out)
}
func (c *castClient) WorkDetail(ctx context.Context, in *WorkDetailReq, opts ...grpc_go.CallOption) (*WorkDetailResp, common.ErrorWithAttachment) {
out := new(WorkDetailResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/WorkDetail", in, out)
}
func (c *castClient) UpdateStatus(ctx context.Context, in *UpdateStatusReq, opts ...grpc_go.CallOption) (*emptypb.Empty, common.ErrorWithAttachment) {
out := new(emptypb.Empty)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/UpdateStatus", in, out)
}
func (c *castClient) MediaAccounts(ctx context.Context, in *MediaAccountsReq, opts ...grpc_go.CallOption) (*MediaAccountsResp, common.ErrorWithAttachment) {
out := new(MediaAccountsResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/MediaAccounts", in, out)
}
func (c *castClient) MediaWorks(ctx context.Context, in *MediaWorksReq, opts ...grpc_go.CallOption) (*MediaWorksResp, common.ErrorWithAttachment) {
out := new(MediaWorksResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/MediaWorks", in, out)
}
func (c *castClient) RePublish(ctx context.Context, in *RePublishReq, opts ...grpc_go.CallOption) (*RePublishResp, common.ErrorWithAttachment) {
out := new(RePublishResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/RePublish", in, out)
}
func (c *castClient) DelWork(ctx context.Context, in *DelWorkReq, opts ...grpc_go.CallOption) (*emptypb.Empty, common.ErrorWithAttachment) {
out := new(emptypb.Empty)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/DelWork", in, out)
}
func (c *castClient) WorkInfo(ctx context.Context, in *WorkInfoReq, opts ...grpc_go.CallOption) (*WorkInfoResp, common.ErrorWithAttachment) {
out := new(WorkInfoResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/WorkInfo", in, out)
}
func (c *castClient) OAuthYoutubeUrl(ctx context.Context, in *OAuthYoutubeUrlReq, opts ...grpc_go.CallOption) (*OAuthYoutubeUrlResp, common.ErrorWithAttachment) {
out := new(OAuthYoutubeUrlResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/OAuthYoutubeUrl", in, out)
}
func (c *castClient) OAuthYoutubeToken(ctx context.Context, in *OAuthYoutubeTokenReq, opts ...grpc_go.CallOption) (*OAuthYoutubeTokenResp, common.ErrorWithAttachment) {
out := new(OAuthYoutubeTokenResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/OAuthYoutubeToken", in, out)
}
// CastServer is the server API for Cast service.
// All implementations must embed UnimplementedCastServer
// for forward compatibility
type CastServer interface {
MediaUserList(context.Context, *MediaUserListReq) (*MediaUserListResp, error)
UpdateMediaAccount(context.Context, *UpdateMediaAccountReq) (*UpdateMediaAccountResp, error)
UnbindManager(context.Context, *UnbindManagerReq) (*UnbindManagerResp, error)
BindManager(context.Context, *BindManagerReq) (*emptypb.Empty, error)
UpdateWorkImage(context.Context, *UpdateWorkImageReq) (*UpdateWorkImageResp, error)
UpdateWorkVideo(context.Context, *UpdateWorkVideoReq) (*UpdateWorkVideoResp, error)
WorkList(context.Context, *WorkListReq) (*WorkListResp, error)
WorkDetail(context.Context, *WorkDetailReq) (*WorkDetailResp, error)
UpdateStatus(context.Context, *UpdateStatusReq) (*emptypb.Empty, error)
MediaAccounts(context.Context, *MediaAccountsReq) (*MediaAccountsResp, error)
MediaWorks(context.Context, *MediaWorksReq) (*MediaWorksResp, error)
RePublish(context.Context, *RePublishReq) (*RePublishResp, error)
DelWork(context.Context, *DelWorkReq) (*emptypb.Empty, error)
WorkInfo(context.Context, *WorkInfoReq) (*WorkInfoResp, error)
OAuthYoutubeUrl(context.Context, *OAuthYoutubeUrlReq) (*OAuthYoutubeUrlResp, error)
OAuthYoutubeToken(context.Context, *OAuthYoutubeTokenReq) (*OAuthYoutubeTokenResp, error)
mustEmbedUnimplementedCastServer()
}
// UnimplementedCastServer must be embedded to have forward compatible implementations.
type UnimplementedCastServer struct {
proxyImpl protocol.Invoker
}
func (UnimplementedCastServer) MediaUserList(context.Context, *MediaUserListReq) (*MediaUserListResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method MediaUserList not implemented")
}
func (UnimplementedCastServer) UpdateMediaAccount(context.Context, *UpdateMediaAccountReq) (*UpdateMediaAccountResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateMediaAccount not implemented")
}
func (UnimplementedCastServer) UnbindManager(context.Context, *UnbindManagerReq) (*UnbindManagerResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method UnbindManager not implemented")
}
func (UnimplementedCastServer) BindManager(context.Context, *BindManagerReq) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method BindManager not implemented")
}
func (UnimplementedCastServer) UpdateWorkImage(context.Context, *UpdateWorkImageReq) (*UpdateWorkImageResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateWorkImage not implemented")
}
func (UnimplementedCastServer) UpdateWorkVideo(context.Context, *UpdateWorkVideoReq) (*UpdateWorkVideoResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateWorkVideo not implemented")
}
func (UnimplementedCastServer) WorkList(context.Context, *WorkListReq) (*WorkListResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method WorkList not implemented")
}
func (UnimplementedCastServer) WorkDetail(context.Context, *WorkDetailReq) (*WorkDetailResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method WorkDetail not implemented")
}
func (UnimplementedCastServer) UpdateStatus(context.Context, *UpdateStatusReq) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateStatus not implemented")
}
func (UnimplementedCastServer) MediaAccounts(context.Context, *MediaAccountsReq) (*MediaAccountsResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method MediaAccounts not implemented")
}
func (UnimplementedCastServer) MediaWorks(context.Context, *MediaWorksReq) (*MediaWorksResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method MediaWorks not implemented")
}
func (UnimplementedCastServer) RePublish(context.Context, *RePublishReq) (*RePublishResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method RePublish not implemented")
}
func (UnimplementedCastServer) DelWork(context.Context, *DelWorkReq) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method DelWork not implemented")
}
func (UnimplementedCastServer) WorkInfo(context.Context, *WorkInfoReq) (*WorkInfoResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method WorkInfo not implemented")
}
func (UnimplementedCastServer) OAuthYoutubeUrl(context.Context, *OAuthYoutubeUrlReq) (*OAuthYoutubeUrlResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method OAuthYoutubeUrl not implemented")
}
func (UnimplementedCastServer) OAuthYoutubeToken(context.Context, *OAuthYoutubeTokenReq) (*OAuthYoutubeTokenResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method OAuthYoutubeToken not implemented")
}
func (s *UnimplementedCastServer) XXX_SetProxyImpl(impl protocol.Invoker) {
s.proxyImpl = impl
}
func (s *UnimplementedCastServer) XXX_GetProxyImpl() protocol.Invoker {
return s.proxyImpl
}
func (s *UnimplementedCastServer) XXX_ServiceDesc() *grpc_go.ServiceDesc {
return &Cast_ServiceDesc
}
func (s *UnimplementedCastServer) XXX_InterfaceName() string {
return "Cast.Cast"
}
func (UnimplementedCastServer) mustEmbedUnimplementedCastServer() {}
// UnsafeCastServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to CastServer will
// result in compilation errors.
type UnsafeCastServer interface {
mustEmbedUnimplementedCastServer()
}
func RegisterCastServer(s grpc_go.ServiceRegistrar, srv CastServer) {
s.RegisterService(&Cast_ServiceDesc, srv)
}
func _Cast_MediaUserList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(MediaUserListReq)
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("MediaUserList", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _Cast_UpdateMediaAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdateMediaAccountReq)
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("UpdateMediaAccount", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _Cast_UnbindManager_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(UnbindManagerReq)
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("UnbindManager", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _Cast_BindManager_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(BindManagerReq)
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("BindManager", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _Cast_UpdateWorkImage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdateWorkImageReq)
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("UpdateWorkImage", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _Cast_UpdateWorkVideo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdateWorkVideoReq)
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("UpdateWorkVideo", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _Cast_WorkList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(WorkListReq)
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("WorkList", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _Cast_WorkDetail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(WorkDetailReq)
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("WorkDetail", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _Cast_UpdateStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdateStatusReq)
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("UpdateStatus", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _Cast_MediaAccounts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(MediaAccountsReq)
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("MediaAccounts", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _Cast_MediaWorks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(MediaWorksReq)
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("MediaWorks", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _Cast_RePublish_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(RePublishReq)
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("RePublish", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _Cast_DelWork_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(DelWorkReq)
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("DelWork", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _Cast_WorkInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(WorkInfoReq)
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("WorkInfo", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _Cast_OAuthYoutubeUrl_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(OAuthYoutubeUrlReq)
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("OAuthYoutubeUrl", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _Cast_OAuthYoutubeToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(OAuthYoutubeTokenReq)
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("OAuthYoutubeToken", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
// Cast_ServiceDesc is the grpc_go.ServiceDesc for Cast service.
// It's only intended for direct use with grpc_go.RegisterService,
// and not to be introspected or modified (even as a copy)
var Cast_ServiceDesc = grpc_go.ServiceDesc{
ServiceName: "Cast.Cast",
HandlerType: (*CastServer)(nil),
Methods: []grpc_go.MethodDesc{
{
MethodName: "MediaUserList",
Handler: _Cast_MediaUserList_Handler,
},
{
MethodName: "UpdateMediaAccount",
Handler: _Cast_UpdateMediaAccount_Handler,
},
{
MethodName: "UnbindManager",
Handler: _Cast_UnbindManager_Handler,
},
{
MethodName: "BindManager",
Handler: _Cast_BindManager_Handler,
},
{
MethodName: "UpdateWorkImage",
Handler: _Cast_UpdateWorkImage_Handler,
},
{
MethodName: "UpdateWorkVideo",
Handler: _Cast_UpdateWorkVideo_Handler,
},
{
MethodName: "WorkList",
Handler: _Cast_WorkList_Handler,
},
{
MethodName: "WorkDetail",
Handler: _Cast_WorkDetail_Handler,
},
{
MethodName: "UpdateStatus",
Handler: _Cast_UpdateStatus_Handler,
},
{
MethodName: "MediaAccounts",
Handler: _Cast_MediaAccounts_Handler,
},
{
MethodName: "MediaWorks",
Handler: _Cast_MediaWorks_Handler,
},
{
MethodName: "RePublish",
Handler: _Cast_RePublish_Handler,
},
{
MethodName: "DelWork",
Handler: _Cast_DelWork_Handler,
},
{
MethodName: "WorkInfo",
Handler: _Cast_WorkInfo_Handler,
},
{
MethodName: "OAuthYoutubeUrl",
Handler: _Cast_OAuthYoutubeUrl_Handler,
},
{
MethodName: "OAuthYoutubeToken",
Handler: _Cast_OAuthYoutubeToken_Handler,
},
},
Streams: []grpc_go.StreamDesc{},
Metadata: "pb/fiee/cast.proto",
}

2583
api/files/files.pb.go Normal file

File diff suppressed because it is too large Load Diff

194
api/files/files.proto Normal file
View File

@ -0,0 +1,194 @@
syntax = "proto3";
package files;
option go_package = "./;files";
service File {
rpc List(FileListReq) returns (FileListResp) {} //
rpc Info(FileInfoReq) returns (FileInfoResp) {} //
rpc Create(CreateReq) returns (CreateResp) {} //
rpc Delete(DeleteReq) returns (DeleteResp) {} //
rpc Search(searchReq) returns (searchResp) {} //
rpc Upload(UploadReq) returns (UploadResp) {} //
rpc TusCreate(TusCreateReq) returns (TusCreateResp) {
} //
rpc TusUpload(TusUploadReq) returns (TusUploadResp) {
} //
rpc ResumableTransfer(ResumableTransferReq) returns (ResumableTransferResp) {
} // grpc实现
rpc Preview(PreviewReq) returns (PreviewResp) {} //
rpc Action(ActionReq) returns (ActionResp) {} //
rpc DirDownload(DirDownloadReq) returns (stream DirDownloadResp) {
} //
rpc Usage(UsageReq) returns (UsageResp) {} //使
}
message FileListReq {
string path = 1; //
string userSpacePath = 2; //
Sorting sorting = 3;
}
message Items {
string path = 1;
string name = 2;
int64 size = 3;
string extension = 4;
string modified = 5;
int64 modTime = 6;
string mode = 7;
bool isDir = 8;
bool isSymlink = 9;
string type = 10;
}
message Sorting {
string by = 1;
bool asc = 2;
}
message FileListResp {
repeated Items items = 1;
int32 numDirs = 2;
int32 numFiles = 3;
Sorting sorting = 4;
string path = 5;
string name = 6;
int64 size = 7;
string extension = 8;
string modified = 9;
int64 modTime = 10;
string mode = 11;
bool isDir = 12;
bool isSymlink = 13;
string type = 14;
}
message CreateReq {
string path = 1;
string userSpacePath = 2;
}
message CreateResp {}
message DeleteReq {
string path = 1;
string userSpacePath = 2;
}
message DeleteResp {}
message UploadReq {
string path = 1;
string userSpacePath = 2;
bytes content = 3;
}
message UploadResp {}
message searchReq {
string path = 1;
string userSpacePath = 2;
string query = 3;
}
message searchResp {
message Nested {
bool isDir = 1;
string path = 2;
string name = 3;
int64 size = 4;
int64 modTime = 5;
}
repeated Nested items = 1;
}
message TusCreateReq {
string path = 1;
string userSpacePath = 2;
bool override = 3;
}
message TusCreateResp {
int64 uploadLength = 1;
int64 uploadOffset = 2;
}
message TusUploadReq {
string path = 1;
string userSpacePath = 2;
int64 uploadOffset = 3;
bytes content = 4;
}
message TusUploadResp { int64 uploadOffset = 1; }
message ResumableTransferReq {
string path = 1;
string userSpacePath = 2;
int64 offset = 3;
int64 length = 4;
}
message ResumableTransferResp { bytes content = 1; }
message FileInfoReq {
string path = 1;
string userSpacePath = 2;
}
message FileInfoResp {
string path = 1;
string name = 2;
int64 size = 3;
string extension = 4;
string modified = 5;
string mode = 6;
int64 modTime = 7;
bool isDir = 8;
bool isSymlink = 9;
string type = 10;
}
message PreviewReq {
string path = 1;
string userSpacePath = 2;
uint32 size = 3; // 0256x256, 1:1080x1080
}
message PreviewResp {
bytes content = 1;
string fileName = 2;
int64 modTime = 3;
}
message ActionReq {
string path = 1;
string userSpacePath = 2;
string action = 3;
string destination = 4;
bool override = 5;
bool rename = 6;
}
message ActionResp {}
message DirDownloadReq {
string path = 1;
string userSpacePath = 2;
repeated string files = 3;
string algo = 4;
}
message DirDownloadResp { bytes content = 1; }
message UsageReq {
string path = 1;
string userSpacePath = 2;
}
message UsageResp {
int64 total = 1;
int64 used = 2;
}

View File

@ -0,0 +1,128 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: files.proto
package files
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 *FileListReq) Validate() error {
if this.Sorting != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Sorting); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Sorting", err)
}
}
return nil
}
func (this *Items) Validate() error {
return nil
}
func (this *Sorting) Validate() error {
return nil
}
func (this *FileListResp) Validate() error {
for _, item := range this.Items {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Items", err)
}
}
}
if this.Sorting != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Sorting); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Sorting", err)
}
}
return nil
}
func (this *CreateReq) Validate() error {
return nil
}
func (this *CreateResp) Validate() error {
return nil
}
func (this *DeleteReq) Validate() error {
return nil
}
func (this *DeleteResp) Validate() error {
return nil
}
func (this *UploadReq) Validate() error {
return nil
}
func (this *UploadResp) Validate() error {
return nil
}
func (this *SearchReq) Validate() error {
return nil
}
func (this *SearchResp) Validate() error {
for _, item := range this.Items {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Items", err)
}
}
}
return nil
}
func (this *SearchResp_Nested) Validate() error {
return nil
}
func (this *TusCreateReq) Validate() error {
return nil
}
func (this *TusCreateResp) Validate() error {
return nil
}
func (this *TusUploadReq) Validate() error {
return nil
}
func (this *TusUploadResp) Validate() error {
return nil
}
func (this *ResumableTransferReq) Validate() error {
return nil
}
func (this *ResumableTransferResp) Validate() error {
return nil
}
func (this *FileInfoReq) Validate() error {
return nil
}
func (this *FileInfoResp) Validate() error {
return nil
}
func (this *PreviewReq) Validate() error {
return nil
}
func (this *PreviewResp) Validate() error {
return nil
}
func (this *ActionReq) Validate() error {
return nil
}
func (this *ActionResp) Validate() error {
return nil
}
func (this *DirDownloadReq) Validate() error {
return nil
}
func (this *DirDownloadResp) Validate() error {
return nil
}
func (this *UsageReq) Validate() error {
return nil
}
func (this *UsageResp) Validate() error {
return nil
}

View File

@ -0,0 +1,723 @@
// Code generated by protoc-gen-go-triple. DO NOT EDIT.
// versions:
// - protoc-gen-go-triple v1.0.8
// - protoc v3.20.3
// source: files.proto
package files
import (
context "context"
constant1 "dubbo.apache.org/dubbo-go/v3/common/constant"
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"
fmt "fmt"
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
// FileClient is the client API for File 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 FileClient interface {
List(ctx context.Context, in *FileListReq, opts ...grpc_go.CallOption) (*FileListResp, common.ErrorWithAttachment)
Info(ctx context.Context, in *FileInfoReq, opts ...grpc_go.CallOption) (*FileInfoResp, common.ErrorWithAttachment)
Create(ctx context.Context, in *CreateReq, opts ...grpc_go.CallOption) (*CreateResp, common.ErrorWithAttachment)
Delete(ctx context.Context, in *DeleteReq, opts ...grpc_go.CallOption) (*DeleteResp, common.ErrorWithAttachment)
Search(ctx context.Context, in *SearchReq, opts ...grpc_go.CallOption) (*SearchResp, common.ErrorWithAttachment)
Upload(ctx context.Context, in *UploadReq, opts ...grpc_go.CallOption) (*UploadResp, common.ErrorWithAttachment)
TusCreate(ctx context.Context, in *TusCreateReq, opts ...grpc_go.CallOption) (*TusCreateResp, common.ErrorWithAttachment)
TusUpload(ctx context.Context, in *TusUploadReq, opts ...grpc_go.CallOption) (*TusUploadResp, common.ErrorWithAttachment)
ResumableTransfer(ctx context.Context, in *ResumableTransferReq, opts ...grpc_go.CallOption) (*ResumableTransferResp, common.ErrorWithAttachment)
Preview(ctx context.Context, in *PreviewReq, opts ...grpc_go.CallOption) (*PreviewResp, common.ErrorWithAttachment)
Action(ctx context.Context, in *ActionReq, opts ...grpc_go.CallOption) (*ActionResp, common.ErrorWithAttachment)
DirDownload(ctx context.Context, in *DirDownloadReq, opts ...grpc_go.CallOption) (File_DirDownloadClient, error)
Usage(ctx context.Context, in *UsageReq, opts ...grpc_go.CallOption) (*UsageResp, common.ErrorWithAttachment)
}
type fileClient struct {
cc *triple.TripleConn
}
type FileClientImpl struct {
List func(ctx context.Context, in *FileListReq) (*FileListResp, error)
Info func(ctx context.Context, in *FileInfoReq) (*FileInfoResp, error)
Create func(ctx context.Context, in *CreateReq) (*CreateResp, error)
Delete func(ctx context.Context, in *DeleteReq) (*DeleteResp, error)
Search func(ctx context.Context, in *SearchReq) (*SearchResp, error)
Upload func(ctx context.Context, in *UploadReq) (*UploadResp, error)
TusCreate func(ctx context.Context, in *TusCreateReq) (*TusCreateResp, error)
TusUpload func(ctx context.Context, in *TusUploadReq) (*TusUploadResp, error)
ResumableTransfer func(ctx context.Context, in *ResumableTransferReq) (*ResumableTransferResp, error)
Preview func(ctx context.Context, in *PreviewReq) (*PreviewResp, error)
Action func(ctx context.Context, in *ActionReq) (*ActionResp, error)
DirDownload func(ctx context.Context, in *DirDownloadReq) (File_DirDownloadClient, error)
Usage func(ctx context.Context, in *UsageReq) (*UsageResp, error)
}
func (c *FileClientImpl) GetDubboStub(cc *triple.TripleConn) FileClient {
return NewFileClient(cc)
}
func (c *FileClientImpl) XXX_InterfaceName() string {
return "files.File"
}
func NewFileClient(cc *triple.TripleConn) FileClient {
return &fileClient{cc}
}
func (c *fileClient) List(ctx context.Context, in *FileListReq, opts ...grpc_go.CallOption) (*FileListResp, common.ErrorWithAttachment) {
out := new(FileListResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/List", in, out)
}
func (c *fileClient) Info(ctx context.Context, in *FileInfoReq, opts ...grpc_go.CallOption) (*FileInfoResp, common.ErrorWithAttachment) {
out := new(FileInfoResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/Info", in, out)
}
func (c *fileClient) Create(ctx context.Context, in *CreateReq, opts ...grpc_go.CallOption) (*CreateResp, common.ErrorWithAttachment) {
out := new(CreateResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/Create", in, out)
}
func (c *fileClient) Delete(ctx context.Context, in *DeleteReq, opts ...grpc_go.CallOption) (*DeleteResp, common.ErrorWithAttachment) {
out := new(DeleteResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/Delete", in, out)
}
func (c *fileClient) Search(ctx context.Context, in *SearchReq, opts ...grpc_go.CallOption) (*SearchResp, common.ErrorWithAttachment) {
out := new(SearchResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/Search", in, out)
}
func (c *fileClient) Upload(ctx context.Context, in *UploadReq, opts ...grpc_go.CallOption) (*UploadResp, common.ErrorWithAttachment) {
out := new(UploadResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/Upload", in, out)
}
func (c *fileClient) TusCreate(ctx context.Context, in *TusCreateReq, opts ...grpc_go.CallOption) (*TusCreateResp, common.ErrorWithAttachment) {
out := new(TusCreateResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/TusCreate", in, out)
}
func (c *fileClient) TusUpload(ctx context.Context, in *TusUploadReq, opts ...grpc_go.CallOption) (*TusUploadResp, common.ErrorWithAttachment) {
out := new(TusUploadResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/TusUpload", in, out)
}
func (c *fileClient) ResumableTransfer(ctx context.Context, in *ResumableTransferReq, opts ...grpc_go.CallOption) (*ResumableTransferResp, common.ErrorWithAttachment) {
out := new(ResumableTransferResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/ResumableTransfer", in, out)
}
func (c *fileClient) Preview(ctx context.Context, in *PreviewReq, opts ...grpc_go.CallOption) (*PreviewResp, common.ErrorWithAttachment) {
out := new(PreviewResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/Preview", in, out)
}
func (c *fileClient) Action(ctx context.Context, in *ActionReq, opts ...grpc_go.CallOption) (*ActionResp, common.ErrorWithAttachment) {
out := new(ActionResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/Action", in, out)
}
func (c *fileClient) DirDownload(ctx context.Context, in *DirDownloadReq, opts ...grpc_go.CallOption) (File_DirDownloadClient, error) {
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
stream, err := c.cc.NewStream(ctx, "/"+interfaceKey+"/DirDownload", opts...)
if err != nil {
return nil, err
}
x := &fileDirDownloadClient{stream}
if err := x.ClientStream.SendMsg(in); err != nil {
return nil, err
}
if err := x.ClientStream.CloseSend(); err != nil {
return nil, err
}
return x, nil
}
type File_DirDownloadClient interface {
Recv() (*DirDownloadResp, error)
grpc_go.ClientStream
}
type fileDirDownloadClient struct {
grpc_go.ClientStream
}
func (x *fileDirDownloadClient) Recv() (*DirDownloadResp, error) {
m := new(DirDownloadResp)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func (c *fileClient) Usage(ctx context.Context, in *UsageReq, opts ...grpc_go.CallOption) (*UsageResp, common.ErrorWithAttachment) {
out := new(UsageResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/Usage", in, out)
}
// FileServer is the server API for File service.
// All implementations must embed UnimplementedFileServer
// for forward compatibility
type FileServer interface {
List(context.Context, *FileListReq) (*FileListResp, error)
Info(context.Context, *FileInfoReq) (*FileInfoResp, error)
Create(context.Context, *CreateReq) (*CreateResp, error)
Delete(context.Context, *DeleteReq) (*DeleteResp, error)
Search(context.Context, *SearchReq) (*SearchResp, error)
Upload(context.Context, *UploadReq) (*UploadResp, error)
TusCreate(context.Context, *TusCreateReq) (*TusCreateResp, error)
TusUpload(context.Context, *TusUploadReq) (*TusUploadResp, error)
ResumableTransfer(context.Context, *ResumableTransferReq) (*ResumableTransferResp, error)
Preview(context.Context, *PreviewReq) (*PreviewResp, error)
Action(context.Context, *ActionReq) (*ActionResp, error)
DirDownload(*DirDownloadReq, File_DirDownloadServer) error
Usage(context.Context, *UsageReq) (*UsageResp, error)
mustEmbedUnimplementedFileServer()
}
// UnimplementedFileServer must be embedded to have forward compatible implementations.
type UnimplementedFileServer struct {
proxyImpl protocol.Invoker
}
func (UnimplementedFileServer) List(context.Context, *FileListReq) (*FileListResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method List not implemented")
}
func (UnimplementedFileServer) Info(context.Context, *FileInfoReq) (*FileInfoResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method Info not implemented")
}
func (UnimplementedFileServer) Create(context.Context, *CreateReq) (*CreateResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method Create not implemented")
}
func (UnimplementedFileServer) Delete(context.Context, *DeleteReq) (*DeleteResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented")
}
func (UnimplementedFileServer) Search(context.Context, *SearchReq) (*SearchResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method Search not implemented")
}
func (UnimplementedFileServer) Upload(context.Context, *UploadReq) (*UploadResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method Upload not implemented")
}
func (UnimplementedFileServer) TusCreate(context.Context, *TusCreateReq) (*TusCreateResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method TusCreate not implemented")
}
func (UnimplementedFileServer) TusUpload(context.Context, *TusUploadReq) (*TusUploadResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method TusUpload not implemented")
}
func (UnimplementedFileServer) ResumableTransfer(context.Context, *ResumableTransferReq) (*ResumableTransferResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method ResumableTransfer not implemented")
}
func (UnimplementedFileServer) Preview(context.Context, *PreviewReq) (*PreviewResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method Preview not implemented")
}
func (UnimplementedFileServer) Action(context.Context, *ActionReq) (*ActionResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method Action not implemented")
}
func (UnimplementedFileServer) DirDownload(*DirDownloadReq, File_DirDownloadServer) error {
return status.Errorf(codes.Unimplemented, "method DirDownload not implemented")
}
func (UnimplementedFileServer) Usage(context.Context, *UsageReq) (*UsageResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method Usage not implemented")
}
func (s *UnimplementedFileServer) XXX_SetProxyImpl(impl protocol.Invoker) {
s.proxyImpl = impl
}
func (s *UnimplementedFileServer) XXX_GetProxyImpl() protocol.Invoker {
return s.proxyImpl
}
func (s *UnimplementedFileServer) XXX_ServiceDesc() *grpc_go.ServiceDesc {
return &File_ServiceDesc
}
func (s *UnimplementedFileServer) XXX_InterfaceName() string {
return "files.File"
}
func (UnimplementedFileServer) mustEmbedUnimplementedFileServer() {}
// UnsafeFileServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to FileServer will
// result in compilation errors.
type UnsafeFileServer interface {
mustEmbedUnimplementedFileServer()
}
func RegisterFileServer(s grpc_go.ServiceRegistrar, srv FileServer) {
s.RegisterService(&File_ServiceDesc, srv)
}
func _File_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(FileListReq)
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("List", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _File_Info_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(FileInfoReq)
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("Info", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _File_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateReq)
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("Create", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _File_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(DeleteReq)
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("Delete", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _File_Search_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(SearchReq)
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("Search", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _File_Upload_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(UploadReq)
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("Upload", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _File_TusCreate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(TusCreateReq)
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("TusCreate", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _File_TusUpload_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(TusUploadReq)
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("TusUpload", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _File_ResumableTransfer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(ResumableTransferReq)
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("ResumableTransfer", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _File_Preview_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(PreviewReq)
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("Preview", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _File_Action_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(ActionReq)
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("Action", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _File_DirDownload_Handler(srv interface{}, stream grpc_go.ServerStream) error {
_, ok := srv.(dubbo3.Dubbo3GrpcService)
ctx := stream.Context()
md, _ := metadata.FromIncomingContext(ctx)
invAttachment := make(map[string]interface{}, len(md))
for k, v := range md {
invAttachment[k] = v
}
stream.(grpc_go.CtxSetterStream).SetContext(context.WithValue(ctx, constant1.AttachmentKey, invAttachment))
invo := invocation.NewRPCInvocation("DirDownload", nil, nil)
if !ok {
fmt.Println(invo)
return nil
}
m := new(DirDownloadReq)
if err := stream.RecvMsg(m); err != nil {
return err
}
return srv.(FileServer).DirDownload(m, &fileDirDownloadServer{stream})
}
type File_DirDownloadServer interface {
Send(*DirDownloadResp) error
grpc_go.ServerStream
}
type fileDirDownloadServer struct {
grpc_go.ServerStream
}
func (x *fileDirDownloadServer) Send(m *DirDownloadResp) error {
return x.ServerStream.SendMsg(m)
}
func _File_Usage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(UsageReq)
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("Usage", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
// File_ServiceDesc is the grpc_go.ServiceDesc for File service.
// It's only intended for direct use with grpc_go.RegisterService,
// and not to be introspected or modified (even as a copy)
var File_ServiceDesc = grpc_go.ServiceDesc{
ServiceName: "files.File",
HandlerType: (*FileServer)(nil),
Methods: []grpc_go.MethodDesc{
{
MethodName: "List",
Handler: _File_List_Handler,
},
{
MethodName: "Info",
Handler: _File_Info_Handler,
},
{
MethodName: "Create",
Handler: _File_Create_Handler,
},
{
MethodName: "Delete",
Handler: _File_Delete_Handler,
},
{
MethodName: "Search",
Handler: _File_Search_Handler,
},
{
MethodName: "Upload",
Handler: _File_Upload_Handler,
},
{
MethodName: "TusCreate",
Handler: _File_TusCreate_Handler,
},
{
MethodName: "TusUpload",
Handler: _File_TusUpload_Handler,
},
{
MethodName: "ResumableTransfer",
Handler: _File_ResumableTransfer_Handler,
},
{
MethodName: "Preview",
Handler: _File_Preview_Handler,
},
{
MethodName: "Action",
Handler: _File_Action_Handler,
},
{
MethodName: "Usage",
Handler: _File_Usage_Handler,
},
},
Streams: []grpc_go.StreamDesc{
{
StreamName: "DirDownload",
Handler: _File_DirDownload_Handler,
ServerStreams: true,
},
},
Metadata: "files.proto",
}

View File

@ -0,0 +1,997 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.29.1
// protoc v3.20.3
// source: governance.proto
package governance
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type Item struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"`
Attachment string `protobuf:"bytes,3,opt,name=attachment,proto3" json:"attachment,omitempty"`
AttachmentName string `protobuf:"bytes,4,opt,name=attachmentName,proto3" json:"attachmentName,omitempty"`
Sort int32 `protobuf:"varint,5,opt,name=sort,proto3" json:"sort,omitempty"`
Status int32 `protobuf:"varint,6,opt,name=status,proto3" json:"status,omitempty"`
UpdatedAt int64 `protobuf:"varint,7,opt,name=updatedAt,proto3" json:"updatedAt,omitempty"`
Operator string `protobuf:"bytes,8,opt,name=operator,proto3" json:"operator,omitempty"`
OperatorId int32 `protobuf:"varint,9,opt,name=operatorId,proto3" json:"operatorId,omitempty"`
}
func (x *Item) Reset() {
*x = Item{}
if protoimpl.UnsafeEnabled {
mi := &file_governance_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Item) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Item) ProtoMessage() {}
func (x *Item) ProtoReflect() protoreflect.Message {
mi := &file_governance_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Item.ProtoReflect.Descriptor instead.
func (*Item) Descriptor() ([]byte, []int) {
return file_governance_proto_rawDescGZIP(), []int{0}
}
func (x *Item) GetId() int32 {
if x != nil {
return x.Id
}
return 0
}
func (x *Item) GetTitle() string {
if x != nil {
return x.Title
}
return ""
}
func (x *Item) GetAttachment() string {
if x != nil {
return x.Attachment
}
return ""
}
func (x *Item) GetAttachmentName() string {
if x != nil {
return x.AttachmentName
}
return ""
}
func (x *Item) GetSort() int32 {
if x != nil {
return x.Sort
}
return 0
}
func (x *Item) GetStatus() int32 {
if x != nil {
return x.Status
}
return 0
}
func (x *Item) GetUpdatedAt() int64 {
if x != nil {
return x.UpdatedAt
}
return 0
}
func (x *Item) GetOperator() string {
if x != nil {
return x.Operator
}
return ""
}
func (x *Item) GetOperatorId() int32 {
if x != nil {
return x.OperatorId
}
return 0
}
type ListReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"`
Status int32 `protobuf:"varint,2,opt,name=status,proto3" json:"status,omitempty"` // 1 下架 2 上架
Page int32 `protobuf:"varint,3,opt,name=page,proto3" json:"page,omitempty"`
PageSize int32 `protobuf:"varint,4,opt,name=pageSize,proto3" json:"pageSize,omitempty"`
}
func (x *ListReq) Reset() {
*x = ListReq{}
if protoimpl.UnsafeEnabled {
mi := &file_governance_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ListReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ListReq) ProtoMessage() {}
func (x *ListReq) ProtoReflect() protoreflect.Message {
mi := &file_governance_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ListReq.ProtoReflect.Descriptor instead.
func (*ListReq) Descriptor() ([]byte, []int) {
return file_governance_proto_rawDescGZIP(), []int{1}
}
func (x *ListReq) GetTitle() string {
if x != nil {
return x.Title
}
return ""
}
func (x *ListReq) GetStatus() int32 {
if x != nil {
return x.Status
}
return 0
}
func (x *ListReq) GetPage() int32 {
if x != nil {
return x.Page
}
return 0
}
func (x *ListReq) GetPageSize() int32 {
if x != nil {
return x.PageSize
}
return 0
}
type ListResp struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Total int32 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"`
Data []*Item `protobuf:"bytes,2,rep,name=data,proto3" json:"data,omitempty"`
}
func (x *ListResp) Reset() {
*x = ListResp{}
if protoimpl.UnsafeEnabled {
mi := &file_governance_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ListResp) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ListResp) ProtoMessage() {}
func (x *ListResp) ProtoReflect() protoreflect.Message {
mi := &file_governance_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ListResp.ProtoReflect.Descriptor instead.
func (*ListResp) Descriptor() ([]byte, []int) {
return file_governance_proto_rawDescGZIP(), []int{2}
}
func (x *ListResp) GetTotal() int32 {
if x != nil {
return x.Total
}
return 0
}
func (x *ListResp) GetData() []*Item {
if x != nil {
return x.Data
}
return nil
}
type DeleteReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
}
func (x *DeleteReq) Reset() {
*x = DeleteReq{}
if protoimpl.UnsafeEnabled {
mi := &file_governance_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DeleteReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DeleteReq) ProtoMessage() {}
func (x *DeleteReq) ProtoReflect() protoreflect.Message {
mi := &file_governance_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use DeleteReq.ProtoReflect.Descriptor instead.
func (*DeleteReq) Descriptor() ([]byte, []int) {
return file_governance_proto_rawDescGZIP(), []int{3}
}
func (x *DeleteReq) GetId() int32 {
if x != nil {
return x.Id
}
return 0
}
type DeleteResp struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *DeleteResp) Reset() {
*x = DeleteResp{}
if protoimpl.UnsafeEnabled {
mi := &file_governance_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DeleteResp) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DeleteResp) ProtoMessage() {}
func (x *DeleteResp) ProtoReflect() protoreflect.Message {
mi := &file_governance_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use DeleteResp.ProtoReflect.Descriptor instead.
func (*DeleteResp) Descriptor() ([]byte, []int) {
return file_governance_proto_rawDescGZIP(), []int{4}
}
type EditReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"`
Attachment string `protobuf:"bytes,3,opt,name=attachment,proto3" json:"attachment,omitempty"`
AttachmentName string `protobuf:"bytes,4,opt,name=attachmentName,proto3" json:"attachmentName,omitempty"`
Sort int32 `protobuf:"varint,5,opt,name=sort,proto3" json:"sort,omitempty"`
Status int32 `protobuf:"varint,6,opt,name=status,proto3" json:"status,omitempty"`
Operator string `protobuf:"bytes,7,opt,name=operator,proto3" json:"operator,omitempty"`
OperatorId int32 `protobuf:"varint,8,opt,name=operatorId,proto3" json:"operatorId,omitempty"`
}
func (x *EditReq) Reset() {
*x = EditReq{}
if protoimpl.UnsafeEnabled {
mi := &file_governance_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *EditReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*EditReq) ProtoMessage() {}
func (x *EditReq) ProtoReflect() protoreflect.Message {
mi := &file_governance_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use EditReq.ProtoReflect.Descriptor instead.
func (*EditReq) Descriptor() ([]byte, []int) {
return file_governance_proto_rawDescGZIP(), []int{5}
}
func (x *EditReq) GetId() uint32 {
if x != nil {
return x.Id
}
return 0
}
func (x *EditReq) GetTitle() string {
if x != nil {
return x.Title
}
return ""
}
func (x *EditReq) GetAttachment() string {
if x != nil {
return x.Attachment
}
return ""
}
func (x *EditReq) GetAttachmentName() string {
if x != nil {
return x.AttachmentName
}
return ""
}
func (x *EditReq) GetSort() int32 {
if x != nil {
return x.Sort
}
return 0
}
func (x *EditReq) GetStatus() int32 {
if x != nil {
return x.Status
}
return 0
}
func (x *EditReq) GetOperator() string {
if x != nil {
return x.Operator
}
return ""
}
func (x *EditReq) GetOperatorId() int32 {
if x != nil {
return x.OperatorId
}
return 0
}
type EditResp struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *EditResp) Reset() {
*x = EditResp{}
if protoimpl.UnsafeEnabled {
mi := &file_governance_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *EditResp) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*EditResp) ProtoMessage() {}
func (x *EditResp) ProtoReflect() protoreflect.Message {
mi := &file_governance_proto_msgTypes[6]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use EditResp.ProtoReflect.Descriptor instead.
func (*EditResp) Descriptor() ([]byte, []int) {
return file_governance_proto_rawDescGZIP(), []int{6}
}
type CreateReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"`
Sort uint32 `protobuf:"varint,2,opt,name=sort,proto3" json:"sort,omitempty"`
Attachment string `protobuf:"bytes,3,opt,name=attachment,proto3" json:"attachment,omitempty"`
AttachmentName string `protobuf:"bytes,4,opt,name=attachmentName,proto3" json:"attachmentName,omitempty"`
Status int32 `protobuf:"varint,5,opt,name=status,proto3" json:"status,omitempty"`
Operator string `protobuf:"bytes,6,opt,name=operator,proto3" json:"operator,omitempty"`
OperatorId int32 `protobuf:"varint,7,opt,name=operatorId,proto3" json:"operatorId,omitempty"`
}
func (x *CreateReq) Reset() {
*x = CreateReq{}
if protoimpl.UnsafeEnabled {
mi := &file_governance_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CreateReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CreateReq) ProtoMessage() {}
func (x *CreateReq) ProtoReflect() protoreflect.Message {
mi := &file_governance_proto_msgTypes[7]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CreateReq.ProtoReflect.Descriptor instead.
func (*CreateReq) Descriptor() ([]byte, []int) {
return file_governance_proto_rawDescGZIP(), []int{7}
}
func (x *CreateReq) GetTitle() string {
if x != nil {
return x.Title
}
return ""
}
func (x *CreateReq) GetSort() uint32 {
if x != nil {
return x.Sort
}
return 0
}
func (x *CreateReq) GetAttachment() string {
if x != nil {
return x.Attachment
}
return ""
}
func (x *CreateReq) GetAttachmentName() string {
if x != nil {
return x.AttachmentName
}
return ""
}
func (x *CreateReq) GetStatus() int32 {
if x != nil {
return x.Status
}
return 0
}
func (x *CreateReq) GetOperator() string {
if x != nil {
return x.Operator
}
return ""
}
func (x *CreateReq) GetOperatorId() int32 {
if x != nil {
return x.OperatorId
}
return 0
}
type CreateResp struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *CreateResp) Reset() {
*x = CreateResp{}
if protoimpl.UnsafeEnabled {
mi := &file_governance_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CreateResp) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CreateResp) ProtoMessage() {}
func (x *CreateResp) ProtoReflect() protoreflect.Message {
mi := &file_governance_proto_msgTypes[8]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CreateResp.ProtoReflect.Descriptor instead.
func (*CreateResp) Descriptor() ([]byte, []int) {
return file_governance_proto_rawDescGZIP(), []int{8}
}
type DisplayReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *DisplayReq) Reset() {
*x = DisplayReq{}
if protoimpl.UnsafeEnabled {
mi := &file_governance_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DisplayReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DisplayReq) ProtoMessage() {}
func (x *DisplayReq) ProtoReflect() protoreflect.Message {
mi := &file_governance_proto_msgTypes[9]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use DisplayReq.ProtoReflect.Descriptor instead.
func (*DisplayReq) Descriptor() ([]byte, []int) {
return file_governance_proto_rawDescGZIP(), []int{9}
}
type DisplayResp struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Data []*Item `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"`
}
func (x *DisplayResp) Reset() {
*x = DisplayResp{}
if protoimpl.UnsafeEnabled {
mi := &file_governance_proto_msgTypes[10]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DisplayResp) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DisplayResp) ProtoMessage() {}
func (x *DisplayResp) ProtoReflect() protoreflect.Message {
mi := &file_governance_proto_msgTypes[10]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use DisplayResp.ProtoReflect.Descriptor instead.
func (*DisplayResp) Descriptor() ([]byte, []int) {
return file_governance_proto_rawDescGZIP(), []int{10}
}
func (x *DisplayResp) GetData() []*Item {
if x != nil {
return x.Data
}
return nil
}
var File_governance_proto protoreflect.FileDescriptor
var file_governance_proto_rawDesc = []byte{
0x0a, 0x10, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x12, 0x0a, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x61, 0x6e, 0x63, 0x65, 0x22, 0xfa,
0x01, 0x0a, 0x04, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20,
0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65,
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x1e, 0x0a,
0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28,
0x09, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x26, 0x0a,
0x0e, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18,
0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e,
0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x05, 0x20,
0x01, 0x28, 0x05, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61,
0x74, 0x75, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75,
0x73, 0x12, 0x1c, 0x0a, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x18, 0x07,
0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12,
0x1a, 0x0a, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x08, 0x20, 0x01, 0x28,
0x09, 0x52, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x6f,
0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52,
0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x22, 0x67, 0x0a, 0x07, 0x4c,
0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18,
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x16, 0x0a, 0x06,
0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74,
0x61, 0x74, 0x75, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01,
0x28, 0x05, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x67, 0x65,
0x53, 0x69, 0x7a, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65,
0x53, 0x69, 0x7a, 0x65, 0x22, 0x46, 0x0a, 0x08, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70,
0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52,
0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x24, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02,
0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x61, 0x6e, 0x63,
0x65, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x1b, 0x0a, 0x09,
0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18,
0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x22, 0x0c, 0x0a, 0x0a, 0x44, 0x65, 0x6c,
0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0xdf, 0x01, 0x0a, 0x07, 0x45, 0x64, 0x69, 0x74,
0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52,
0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01,
0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x74, 0x74,
0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x61,
0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x26, 0x0a, 0x0e, 0x61, 0x74, 0x74,
0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28,
0x09, 0x52, 0x0e, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x4e, 0x61, 0x6d,
0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52,
0x04, 0x73, 0x6f, 0x72, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18,
0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1a, 0x0a,
0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52,
0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x6f, 0x70, 0x65,
0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x6f,
0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x22, 0x0a, 0x0a, 0x08, 0x45, 0x64, 0x69,
0x74, 0x52, 0x65, 0x73, 0x70, 0x22, 0xd1, 0x01, 0x0a, 0x09, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65,
0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01,
0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6f, 0x72,
0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x12, 0x1e, 0x0a,
0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28,
0x09, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x26, 0x0a,
0x0e, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18,
0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e,
0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18,
0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1a, 0x0a,
0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52,
0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x6f, 0x70, 0x65,
0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x6f,
0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x22, 0x0c, 0x0a, 0x0a, 0x43, 0x72, 0x65,
0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x0c, 0x0a, 0x0a, 0x44, 0x69, 0x73, 0x70, 0x6c,
0x61, 0x79, 0x52, 0x65, 0x71, 0x22, 0x33, 0x0a, 0x0b, 0x44, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79,
0x52, 0x65, 0x73, 0x70, 0x12, 0x24, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x03,
0x28, 0x0b, 0x32, 0x10, 0x2e, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x61, 0x6e, 0x63, 0x65, 0x2e,
0x49, 0x74, 0x65, 0x6d, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x32, 0xaa, 0x02, 0x0a, 0x0a, 0x47,
0x6f, 0x76, 0x65, 0x72, 0x6e, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x33, 0x0a, 0x04, 0x4c, 0x69, 0x73,
0x74, 0x12, 0x13, 0x2e, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x4c,
0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x61,
0x6e, 0x63, 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x39,
0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x15, 0x2e, 0x67, 0x6f, 0x76, 0x65, 0x72,
0x6e, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x1a,
0x16, 0x2e, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x44, 0x65, 0x6c,
0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x33, 0x0a, 0x04, 0x45, 0x64, 0x69,
0x74, 0x12, 0x13, 0x2e, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x45,
0x64, 0x69, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x61,
0x6e, 0x63, 0x65, 0x2e, 0x45, 0x64, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x39,
0x0a, 0x06, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x12, 0x15, 0x2e, 0x67, 0x6f, 0x76, 0x65, 0x72,
0x6e, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x1a,
0x16, 0x2e, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x43, 0x72, 0x65,
0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x3c, 0x0a, 0x07, 0x44, 0x69, 0x73,
0x70, 0x6c, 0x61, 0x79, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x61, 0x6e, 0x63,
0x65, 0x2e, 0x44, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x67,
0x6f, 0x76, 0x65, 0x72, 0x6e, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x44, 0x69, 0x73, 0x70, 0x6c, 0x61,
0x79, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x42, 0x0f, 0x5a, 0x0d, 0x2e, 0x2f, 0x3b, 0x67, 0x6f,
0x76, 0x65, 0x72, 0x6e, 0x61, 0x6e, 0x63, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_governance_proto_rawDescOnce sync.Once
file_governance_proto_rawDescData = file_governance_proto_rawDesc
)
func file_governance_proto_rawDescGZIP() []byte {
file_governance_proto_rawDescOnce.Do(func() {
file_governance_proto_rawDescData = protoimpl.X.CompressGZIP(file_governance_proto_rawDescData)
})
return file_governance_proto_rawDescData
}
var file_governance_proto_msgTypes = make([]protoimpl.MessageInfo, 11)
var file_governance_proto_goTypes = []interface{}{
(*Item)(nil), // 0: governance.Item
(*ListReq)(nil), // 1: governance.ListReq
(*ListResp)(nil), // 2: governance.ListResp
(*DeleteReq)(nil), // 3: governance.DeleteReq
(*DeleteResp)(nil), // 4: governance.DeleteResp
(*EditReq)(nil), // 5: governance.EditReq
(*EditResp)(nil), // 6: governance.EditResp
(*CreateReq)(nil), // 7: governance.CreateReq
(*CreateResp)(nil), // 8: governance.CreateResp
(*DisplayReq)(nil), // 9: governance.DisplayReq
(*DisplayResp)(nil), // 10: governance.DisplayResp
}
var file_governance_proto_depIdxs = []int32{
0, // 0: governance.ListResp.data:type_name -> governance.Item
0, // 1: governance.DisplayResp.data:type_name -> governance.Item
1, // 2: governance.Governance.List:input_type -> governance.ListReq
3, // 3: governance.Governance.Delete:input_type -> governance.DeleteReq
5, // 4: governance.Governance.Edit:input_type -> governance.EditReq
7, // 5: governance.Governance.Create:input_type -> governance.CreateReq
9, // 6: governance.Governance.Display:input_type -> governance.DisplayReq
2, // 7: governance.Governance.List:output_type -> governance.ListResp
4, // 8: governance.Governance.Delete:output_type -> governance.DeleteResp
6, // 9: governance.Governance.Edit:output_type -> governance.EditResp
8, // 10: governance.Governance.Create:output_type -> governance.CreateResp
10, // 11: governance.Governance.Display:output_type -> governance.DisplayResp
7, // [7:12] is the sub-list for method output_type
2, // [2:7] is the sub-list for method input_type
2, // [2:2] is the sub-list for extension type_name
2, // [2:2] is the sub-list for extension extendee
0, // [0:2] is the sub-list for field type_name
}
func init() { file_governance_proto_init() }
func file_governance_proto_init() {
if File_governance_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_governance_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Item); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_governance_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ListReq); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_governance_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ListResp); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_governance_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DeleteReq); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_governance_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DeleteResp); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_governance_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*EditReq); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_governance_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*EditResp); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_governance_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CreateReq); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_governance_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CreateResp); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_governance_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DisplayReq); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_governance_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DisplayResp); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_governance_proto_rawDesc,
NumEnums: 0,
NumMessages: 11,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_governance_proto_goTypes,
DependencyIndexes: file_governance_proto_depIdxs,
MessageInfos: file_governance_proto_msgTypes,
}.Build()
File_governance_proto = out.File
file_governance_proto_rawDesc = nil
file_governance_proto_goTypes = nil
file_governance_proto_depIdxs = nil
}

View File

@ -0,0 +1,81 @@
syntax = "proto3";
package governance;
//import "descriptor.proto";
//import "validator.proto";
option go_package = "./;governance";
service Governance{
rpc List(ListReq) returns (ListResp) {}
rpc Delete(DeleteReq) returns (DeleteResp) {}
rpc Edit(EditReq) returns (EditResp) {}
rpc Create(CreateReq) returns (CreateResp) {}
rpc Display(DisplayReq) returns (DisplayResp) {}
}
message Item{
int32 id = 1;
string title = 2;
string attachment = 3;
string attachmentName = 4;
int32 sort = 5;
int32 status = 6;
int64 updatedAt = 7;
string operator = 8;
int32 operatorId = 9;
}
message ListReq{
string title = 1;
int32 status = 2; // 1 2
int32 page = 3;
int32 pageSize = 4;
}
message ListResp{
int32 total = 1;
repeated Item data =2;
}
message DeleteReq{
int32 id = 1;
}
message DeleteResp{
}
message EditReq{
uint32 id = 1;
string title = 2;
string attachment = 3;
string attachmentName = 4;
int32 sort = 5;
int32 status = 6;
string operator = 7;
int32 operatorId = 8;
}
message EditResp{
}
message CreateReq{
string title = 1;
uint32 sort = 2;
string attachment = 3;
string attachmentName = 4;
int32 status = 5;
string operator = 6;
int32 operatorId = 7;
}
message CreateResp{
}
message DisplayReq{
}
message DisplayResp{
repeated Item data = 1;
}

View File

@ -0,0 +1,64 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: governance.proto
package governance
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 *Item) Validate() error {
return nil
}
func (this *ListReq) Validate() error {
return nil
}
func (this *ListResp) 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 *DeleteReq) Validate() error {
return nil
}
func (this *DeleteResp) Validate() error {
return nil
}
func (this *EditReq) Validate() error {
return nil
}
func (this *EditResp) Validate() error {
return nil
}
func (this *CreateReq) Validate() error {
return nil
}
func (this *CreateResp) Validate() error {
return nil
}
func (this *DisplayReq) Validate() error {
return nil
}
func (this *DisplayResp) 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
}

View File

@ -0,0 +1,327 @@
// Code generated by protoc-gen-go-triple. DO NOT EDIT.
// versions:
// - protoc-gen-go-triple v1.0.8
// - protoc v3.20.3
// source: governance.proto
package governance
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
// GovernanceClient is the client API for Governance 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 GovernanceClient interface {
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)
Edit(ctx context.Context, in *EditReq, opts ...grpc_go.CallOption) (*EditResp, 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)
}
type governanceClient struct {
cc *triple.TripleConn
}
type GovernanceClientImpl struct {
List func(ctx context.Context, in *ListReq) (*ListResp, error)
Delete func(ctx context.Context, in *DeleteReq) (*DeleteResp, error)
Edit func(ctx context.Context, in *EditReq) (*EditResp, 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 {
return NewGovernanceClient(cc)
}
func (c *GovernanceClientImpl) XXX_InterfaceName() string {
return "governance.Governance"
}
func NewGovernanceClient(cc *triple.TripleConn) GovernanceClient {
return &governanceClient{cc}
}
func (c *governanceClient) List(ctx context.Context, in *ListReq, opts ...grpc_go.CallOption) (*ListResp, common.ErrorWithAttachment) {
out := new(ListResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/List", in, out)
}
func (c *governanceClient) Delete(ctx context.Context, in *DeleteReq, opts ...grpc_go.CallOption) (*DeleteResp, common.ErrorWithAttachment) {
out := new(DeleteResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/Delete", in, out)
}
func (c *governanceClient) Edit(ctx context.Context, in *EditReq, opts ...grpc_go.CallOption) (*EditResp, common.ErrorWithAttachment) {
out := new(EditResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/Edit", in, out)
}
func (c *governanceClient) Create(ctx context.Context, in *CreateReq, opts ...grpc_go.CallOption) (*CreateResp, common.ErrorWithAttachment) {
out := new(CreateResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/Create", in, out)
}
func (c *governanceClient) Display(ctx context.Context, in *DisplayReq, opts ...grpc_go.CallOption) (*DisplayResp, common.ErrorWithAttachment) {
out := new(DisplayResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/Display", in, out)
}
// GovernanceServer is the server API for Governance service.
// All implementations must embed UnimplementedGovernanceServer
// for forward compatibility
type GovernanceServer interface {
List(context.Context, *ListReq) (*ListResp, error)
Delete(context.Context, *DeleteReq) (*DeleteResp, error)
Edit(context.Context, *EditReq) (*EditResp, error)
Create(context.Context, *CreateReq) (*CreateResp, error)
Display(context.Context, *DisplayReq) (*DisplayResp, error)
mustEmbedUnimplementedGovernanceServer()
}
// UnimplementedGovernanceServer must be embedded to have forward compatible implementations.
type UnimplementedGovernanceServer struct {
proxyImpl protocol.Invoker
}
func (UnimplementedGovernanceServer) List(context.Context, *ListReq) (*ListResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method List not implemented")
}
func (UnimplementedGovernanceServer) Delete(context.Context, *DeleteReq) (*DeleteResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented")
}
func (UnimplementedGovernanceServer) Edit(context.Context, *EditReq) (*EditResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method Edit not implemented")
}
func (UnimplementedGovernanceServer) Create(context.Context, *CreateReq) (*CreateResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method Create not implemented")
}
func (UnimplementedGovernanceServer) Display(context.Context, *DisplayReq) (*DisplayResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method Display not implemented")
}
func (s *UnimplementedGovernanceServer) XXX_SetProxyImpl(impl protocol.Invoker) {
s.proxyImpl = impl
}
func (s *UnimplementedGovernanceServer) XXX_GetProxyImpl() protocol.Invoker {
return s.proxyImpl
}
func (s *UnimplementedGovernanceServer) XXX_ServiceDesc() *grpc_go.ServiceDesc {
return &Governance_ServiceDesc
}
func (s *UnimplementedGovernanceServer) XXX_InterfaceName() string {
return "governance.Governance"
}
func (UnimplementedGovernanceServer) mustEmbedUnimplementedGovernanceServer() {}
// UnsafeGovernanceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to GovernanceServer will
// result in compilation errors.
type UnsafeGovernanceServer interface {
mustEmbedUnimplementedGovernanceServer()
}
func RegisterGovernanceServer(s grpc_go.ServiceRegistrar, srv GovernanceServer) {
s.RegisterService(&Governance_ServiceDesc, srv)
}
func _Governance_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(ListReq)
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("List", 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_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(DeleteReq)
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("Delete", 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_Edit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(EditReq)
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("Edit", 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) {
in := new(CreateReq)
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("Create", 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_Display_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(DisplayReq)
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("Display", 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)
}
// Governance_ServiceDesc is the grpc_go.ServiceDesc for Governance service.
// It's only intended for direct use with grpc_go.RegisterService,
// and not to be introspected or modified (even as a copy)
var Governance_ServiceDesc = grpc_go.ServiceDesc{
ServiceName: "governance.Governance",
HandlerType: (*GovernanceServer)(nil),
Methods: []grpc_go.MethodDesc{
{
MethodName: "List",
Handler: _Governance_List_Handler,
},
{
MethodName: "Delete",
Handler: _Governance_Delete_Handler,
},
{
MethodName: "Edit",
Handler: _Governance_Edit_Handler,
},
{
MethodName: "Create",
Handler: _Governance_Create_Handler,
},
{
MethodName: "Display",
Handler: _Governance_Display_Handler,
},
},
Streams: []grpc_go.StreamDesc{},
Metadata: "governance.proto",
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,119 @@
syntax = "proto3";
package pressreleases;
//import "descriptor.proto";
//import "validator.proto";
option go_package = "./;pressreleases";
service PressReleases{
rpc List(ListReq) returns (ListResp) {}
rpc Display(DisplayReq) returns (DisplayResp) {}
rpc Edit(EditReq) returns (EditResp) {}
rpc Create(CreateReq) returns (CreateResp) {}
rpc Delete(DeleteReq) returns (DeleteResp) {}
rpc Get(GetReq) returns (GetResp) {}
}
message Item{
uint32 id = 1;
string title = 2;
uint64 createdAt = 3;
uint32 sort = 4;
string content = 5;
string attachment = 6;
string attachmentName = 7;
uint64 updatedAt = 8;
uint32 status = 9;
uint32 display = 10;
string summary = 11;
string operator = 12;
int32 operatorId = 13;
}
message ListReq{
string title = 1;
uint64 startTime = 2;
uint64 endTime = 3;
uint32 status = 4;
uint32 display = 5;
int32 page = 6;
int32 pageSize = 7;
}
message ListResp{
uint64 total = 1;
repeated Item data = 2;
}
message DisplayReq{
string query = 1;
uint32 page = 2;
uint32 pageSize = 3;
int64 timeStart = 4;
int64 timeEnd = 5;
int32 display = 6;
}
message DisplayResp{
int64 total = 1;
repeated Item data = 2;
}
message EditReq{
uint32 id = 1;
string title = 2;
uint64 createdAt = 3;
uint32 sort = 4;
string content = 5;
string attachment = 6;
string attachmentName = 7;
uint32 status = 8;
uint32 display = 9;
string summary = 10;
string operator = 11;
int32 operatorId = 12;
}
message EditResp{
}
message CreateReq{
string title = 1;
uint64 createdAt = 2;
uint32 sort = 3;
string content = 4;
string attachment = 5;
string attachmentName = 6;
uint32 status = 7;
uint32 display = 8;
string summary = 9;
string operator = 10;
int32 operatorId = 11;
}
message CreateResp{
}
message DeleteReq{
uint32 id = 1;
}
message DeleteResp{
}
message GetReq{
int64 id = 1;
}
message GetResp{
uint32 id = 1;
string title = 2;
uint64 createdAt = 3;
string content = 4;
string attachment = 5;
string attachmentName = 6;
string summary = 7;
}

View File

@ -0,0 +1,70 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: press_releases.proto
package pressreleases
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 *Item) Validate() error {
return nil
}
func (this *ListReq) Validate() error {
return nil
}
func (this *ListResp) 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 *DisplayReq) Validate() error {
return nil
}
func (this *DisplayResp) 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 *EditReq) Validate() error {
return nil
}
func (this *EditResp) Validate() error {
return nil
}
func (this *CreateReq) Validate() error {
return nil
}
func (this *CreateResp) Validate() error {
return nil
}
func (this *DeleteReq) Validate() error {
return nil
}
func (this *DeleteResp) Validate() error {
return nil
}
func (this *GetReq) Validate() error {
return nil
}
func (this *GetResp) Validate() error {
return nil
}

View File

@ -0,0 +1,372 @@
// Code generated by protoc-gen-go-triple. DO NOT EDIT.
// versions:
// - protoc-gen-go-triple v1.0.8
// - protoc v3.20.3
// source: press_releases.proto
package pressreleases
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
// PressReleasesClient is the client API for PressReleases 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 PressReleasesClient interface {
List(ctx context.Context, in *ListReq, opts ...grpc_go.CallOption) (*ListResp, common.ErrorWithAttachment)
Display(ctx context.Context, in *DisplayReq, opts ...grpc_go.CallOption) (*DisplayResp, common.ErrorWithAttachment)
Edit(ctx context.Context, in *EditReq, opts ...grpc_go.CallOption) (*EditResp, common.ErrorWithAttachment)
Create(ctx context.Context, in *CreateReq, opts ...grpc_go.CallOption) (*CreateResp, common.ErrorWithAttachment)
Delete(ctx context.Context, in *DeleteReq, opts ...grpc_go.CallOption) (*DeleteResp, common.ErrorWithAttachment)
Get(ctx context.Context, in *GetReq, opts ...grpc_go.CallOption) (*GetResp, common.ErrorWithAttachment)
}
type pressReleasesClient struct {
cc *triple.TripleConn
}
type PressReleasesClientImpl struct {
List func(ctx context.Context, in *ListReq) (*ListResp, error)
Display func(ctx context.Context, in *DisplayReq) (*DisplayResp, error)
Edit func(ctx context.Context, in *EditReq) (*EditResp, error)
Create func(ctx context.Context, in *CreateReq) (*CreateResp, error)
Delete func(ctx context.Context, in *DeleteReq) (*DeleteResp, error)
Get func(ctx context.Context, in *GetReq) (*GetResp, error)
}
func (c *PressReleasesClientImpl) GetDubboStub(cc *triple.TripleConn) PressReleasesClient {
return NewPressReleasesClient(cc)
}
func (c *PressReleasesClientImpl) XXX_InterfaceName() string {
return "pressreleases.PressReleases"
}
func NewPressReleasesClient(cc *triple.TripleConn) PressReleasesClient {
return &pressReleasesClient{cc}
}
func (c *pressReleasesClient) List(ctx context.Context, in *ListReq, opts ...grpc_go.CallOption) (*ListResp, common.ErrorWithAttachment) {
out := new(ListResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/List", in, out)
}
func (c *pressReleasesClient) Display(ctx context.Context, in *DisplayReq, opts ...grpc_go.CallOption) (*DisplayResp, common.ErrorWithAttachment) {
out := new(DisplayResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/Display", in, out)
}
func (c *pressReleasesClient) Edit(ctx context.Context, in *EditReq, opts ...grpc_go.CallOption) (*EditResp, common.ErrorWithAttachment) {
out := new(EditResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/Edit", in, out)
}
func (c *pressReleasesClient) Create(ctx context.Context, in *CreateReq, opts ...grpc_go.CallOption) (*CreateResp, common.ErrorWithAttachment) {
out := new(CreateResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/Create", in, out)
}
func (c *pressReleasesClient) Delete(ctx context.Context, in *DeleteReq, opts ...grpc_go.CallOption) (*DeleteResp, common.ErrorWithAttachment) {
out := new(DeleteResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/Delete", in, out)
}
func (c *pressReleasesClient) Get(ctx context.Context, in *GetReq, opts ...grpc_go.CallOption) (*GetResp, common.ErrorWithAttachment) {
out := new(GetResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/Get", in, out)
}
// PressReleasesServer is the server API for PressReleases service.
// All implementations must embed UnimplementedPressReleasesServer
// for forward compatibility
type PressReleasesServer interface {
List(context.Context, *ListReq) (*ListResp, error)
Display(context.Context, *DisplayReq) (*DisplayResp, error)
Edit(context.Context, *EditReq) (*EditResp, error)
Create(context.Context, *CreateReq) (*CreateResp, error)
Delete(context.Context, *DeleteReq) (*DeleteResp, error)
Get(context.Context, *GetReq) (*GetResp, error)
mustEmbedUnimplementedPressReleasesServer()
}
// UnimplementedPressReleasesServer must be embedded to have forward compatible implementations.
type UnimplementedPressReleasesServer struct {
proxyImpl protocol.Invoker
}
func (UnimplementedPressReleasesServer) List(context.Context, *ListReq) (*ListResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method List not implemented")
}
func (UnimplementedPressReleasesServer) Display(context.Context, *DisplayReq) (*DisplayResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method Display not implemented")
}
func (UnimplementedPressReleasesServer) Edit(context.Context, *EditReq) (*EditResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method Edit not implemented")
}
func (UnimplementedPressReleasesServer) Create(context.Context, *CreateReq) (*CreateResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method Create not implemented")
}
func (UnimplementedPressReleasesServer) Delete(context.Context, *DeleteReq) (*DeleteResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented")
}
func (UnimplementedPressReleasesServer) Get(context.Context, *GetReq) (*GetResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method Get not implemented")
}
func (s *UnimplementedPressReleasesServer) XXX_SetProxyImpl(impl protocol.Invoker) {
s.proxyImpl = impl
}
func (s *UnimplementedPressReleasesServer) XXX_GetProxyImpl() protocol.Invoker {
return s.proxyImpl
}
func (s *UnimplementedPressReleasesServer) XXX_ServiceDesc() *grpc_go.ServiceDesc {
return &PressReleases_ServiceDesc
}
func (s *UnimplementedPressReleasesServer) XXX_InterfaceName() string {
return "pressreleases.PressReleases"
}
func (UnimplementedPressReleasesServer) mustEmbedUnimplementedPressReleasesServer() {}
// UnsafePressReleasesServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to PressReleasesServer will
// result in compilation errors.
type UnsafePressReleasesServer interface {
mustEmbedUnimplementedPressReleasesServer()
}
func RegisterPressReleasesServer(s grpc_go.ServiceRegistrar, srv PressReleasesServer) {
s.RegisterService(&PressReleases_ServiceDesc, srv)
}
func _PressReleases_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(ListReq)
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("List", 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 _PressReleases_Display_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(DisplayReq)
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("Display", 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 _PressReleases_Edit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(EditReq)
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("Edit", 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 _PressReleases_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateReq)
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("Create", 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 _PressReleases_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(DeleteReq)
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("Delete", 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 _PressReleases_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(GetReq)
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("Get", 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)
}
// PressReleases_ServiceDesc is the grpc_go.ServiceDesc for PressReleases service.
// It's only intended for direct use with grpc_go.RegisterService,
// and not to be introspected or modified (even as a copy)
var PressReleases_ServiceDesc = grpc_go.ServiceDesc{
ServiceName: "pressreleases.PressReleases",
HandlerType: (*PressReleasesServer)(nil),
Methods: []grpc_go.MethodDesc{
{
MethodName: "List",
Handler: _PressReleases_List_Handler,
},
{
MethodName: "Display",
Handler: _PressReleases_Display_Handler,
},
{
MethodName: "Edit",
Handler: _PressReleases_Edit_Handler,
},
{
MethodName: "Create",
Handler: _PressReleases_Create_Handler,
},
{
MethodName: "Delete",
Handler: _PressReleases_Delete_Handler,
},
{
MethodName: "Get",
Handler: _PressReleases_Get_Handler,
},
},
Streams: []grpc_go.StreamDesc{},
Metadata: "press_releases.proto",
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,135 @@
syntax = "proto3";
package secFilings;
//import "descriptor.proto";
//import "validator.proto";
option go_package = "./;secFilings";
service SecFilings{
rpc CreateSecFiling(CreateSecFilingReq) returns (CommonResp) {}
rpc UpdateSecFiling(UpdateSecFilingReq) returns (CommonResp) {}
rpc DetailSecFiling(DetailSecFilingReq) returns (SecFilingDetailResp) {}
rpc ListSecFiling(ListSecFilingReq) returns (SecFilingListResp) {}
rpc DeleteSecFiling(DeleteSecFilingReq)returns(CommonResp){}
rpc IsSecFilingExist(IsSecFilingExistReq) returns (IsSecFilingExistResp) {}
rpc UpdateSecFilingStatus(UpdateSecFilingStatusReq) returns(CommonResp) {}
rpc ListFormType(ListFormTypeReq) returns (FormTypeListResp) {}
rpc WebListSecFiling(WebListSecFilingReq) returns (WebListSecFilingResp) {}
}
message ListFormTypeReq{
int32 page = 1;
int32 pageSize = 2;
}
message FormTypeListResp{
int64 total = 1;
repeated FormType formType = 2;
}
message FormType{
int32 id = 1;
string formType = 2;
}
message IsSecFilingExistReq{
string filingDate = 1;
string form = 2;
string finalLink = 3;
}
message IsSecFilingExistResp{
bool exist = 1;
}
message CommonResp{
string msg = 1 [json_name="msg"];
string filingKey = 2[json_name="filing_key"];
}
message SecFiling{
int32 idx = 1 [json_name="idx"];
string filingKey = 2[json_name="filing_key"];
string filingDate = 3[json_name="filing_date"];
string form = 4[json_name="form"];
string description = 5[json_name="description"];
string formDescription = 6[json_name="form_description"];
string fileLink = 7[json_name="file_link"];
repeated DataFiles dataFiles = 8[json_name="data_files"];
string pdfFile = 9[json_name="pdf_file"];
string wordFile = 10[json_name="word_file"];
string excelFile = 11[json_name="excel_file"];
int32 status = 12[json_name="status"];
string operator = 13[json_name="operator"];
int32 operatorId = 14[json_name="operator_id"];
string createdAt =15[json_name="created_at"];
string updatedAt=16[json_name="updated_at"];
}
message DataFiles {
string description = 1[json_name="description"];
string fileUrl = 2[json_name="file_url"];
}
message CreateSecFilingReq{
string filingDate = 1;
string form = 2;
string description = 3;
string formDescription = 4;
string fileLink = 5;
repeated DataFiles dataFiles = 6;
string pdfFile = 7;
string wordFile = 8;
string excelFile = 9;
string operator = 10;
int32 operatorId = 11;
}
message UpdateSecFilingReq{
string filingKey = 1;
string form = 2;
string description = 3;
string formDescription = 4;
string fileLink = 5;
repeated DataFiles dataFiles = 6;
string pdfFile = 7;
string wordFile = 8;
string excelFile = 9;
string operator = 10;
int32 operatorId = 11;
string filingDate = 12;
}
message DetailSecFilingReq{
string filingKey = 1;
}
message SecFilingDetailResp{
string msg = 1;
SecFiling data = 2;
}
message ListSecFilingReq{
uint32 page = 1;
uint32 pageSize = 2;
string form = 3;
string filingDateBegin = 4;
string filingDateEnd = 5;
int32 status = 6;
}
message SecFilingListResp{
string msg = 1 [json_name="msg"];
uint32 total = 2 [json_name="total"];
repeated SecFiling data = 3 [json_name="data"];
}
message WebListSecFilingReq{
uint32 page = 1;
uint32 pageSize = 2;
string year = 3;
string sortField = 4;
string sortOrder = 5;
}
message WebListSecFilingResp{
string msg = 1 [json_name="msg"];
uint32 total = 2 [json_name="total"];
repeated SecFiling data = 3 [json_name="data"];
}
message DeleteSecFilingReq {
string filingKey = 1;
string operator = 2;
int32 operatorId = 3;
}
message UpdateSecFilingStatusReq{
string filingKey = 1;
int32 status = 2;
string operator = 3;
int32 operatorId = 4;
}

View File

@ -0,0 +1,118 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: secFilings.proto
package secFilings
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 *ListFormTypeReq) Validate() error {
return nil
}
func (this *FormTypeListResp) Validate() error {
for _, item := range this.FormType {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("FormType", err)
}
}
}
return nil
}
func (this *FormType) Validate() error {
return nil
}
func (this *IsSecFilingExistReq) Validate() error {
return nil
}
func (this *IsSecFilingExistResp) Validate() error {
return nil
}
func (this *CommonResp) Validate() error {
return nil
}
func (this *SecFiling) Validate() error {
for _, item := range this.DataFiles {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("DataFiles", err)
}
}
}
return nil
}
func (this *DataFiles) Validate() error {
return nil
}
func (this *CreateSecFilingReq) Validate() error {
for _, item := range this.DataFiles {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("DataFiles", err)
}
}
}
return nil
}
func (this *UpdateSecFilingReq) Validate() error {
for _, item := range this.DataFiles {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("DataFiles", err)
}
}
}
return nil
}
func (this *DetailSecFilingReq) Validate() error {
return nil
}
func (this *SecFilingDetailResp) 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 *ListSecFilingReq) Validate() error {
return nil
}
func (this *SecFilingListResp) 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 *WebListSecFilingReq) Validate() error {
return nil
}
func (this *WebListSecFilingResp) 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 *DeleteSecFilingReq) Validate() error {
return nil
}
func (this *UpdateSecFilingStatusReq) Validate() error {
return nil
}

View File

@ -0,0 +1,507 @@
// Code generated by protoc-gen-go-triple. DO NOT EDIT.
// versions:
// - protoc-gen-go-triple v1.0.8
// - protoc v3.20.3
// source: secFilings.proto
package secFilings
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
// SecFilingsClient is the client API for SecFilings 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 SecFilingsClient interface {
CreateSecFiling(ctx context.Context, in *CreateSecFilingReq, opts ...grpc_go.CallOption) (*CommonResp, common.ErrorWithAttachment)
UpdateSecFiling(ctx context.Context, in *UpdateSecFilingReq, opts ...grpc_go.CallOption) (*CommonResp, common.ErrorWithAttachment)
DetailSecFiling(ctx context.Context, in *DetailSecFilingReq, opts ...grpc_go.CallOption) (*SecFilingDetailResp, common.ErrorWithAttachment)
ListSecFiling(ctx context.Context, in *ListSecFilingReq, opts ...grpc_go.CallOption) (*SecFilingListResp, common.ErrorWithAttachment)
DeleteSecFiling(ctx context.Context, in *DeleteSecFilingReq, opts ...grpc_go.CallOption) (*CommonResp, common.ErrorWithAttachment)
IsSecFilingExist(ctx context.Context, in *IsSecFilingExistReq, opts ...grpc_go.CallOption) (*IsSecFilingExistResp, common.ErrorWithAttachment)
UpdateSecFilingStatus(ctx context.Context, in *UpdateSecFilingStatusReq, opts ...grpc_go.CallOption) (*CommonResp, common.ErrorWithAttachment)
ListFormType(ctx context.Context, in *ListFormTypeReq, opts ...grpc_go.CallOption) (*FormTypeListResp, common.ErrorWithAttachment)
WebListSecFiling(ctx context.Context, in *WebListSecFilingReq, opts ...grpc_go.CallOption) (*WebListSecFilingResp, common.ErrorWithAttachment)
}
type secFilingsClient struct {
cc *triple.TripleConn
}
type SecFilingsClientImpl struct {
CreateSecFiling func(ctx context.Context, in *CreateSecFilingReq) (*CommonResp, error)
UpdateSecFiling func(ctx context.Context, in *UpdateSecFilingReq) (*CommonResp, error)
DetailSecFiling func(ctx context.Context, in *DetailSecFilingReq) (*SecFilingDetailResp, error)
ListSecFiling func(ctx context.Context, in *ListSecFilingReq) (*SecFilingListResp, error)
DeleteSecFiling func(ctx context.Context, in *DeleteSecFilingReq) (*CommonResp, error)
IsSecFilingExist func(ctx context.Context, in *IsSecFilingExistReq) (*IsSecFilingExistResp, error)
UpdateSecFilingStatus func(ctx context.Context, in *UpdateSecFilingStatusReq) (*CommonResp, error)
ListFormType func(ctx context.Context, in *ListFormTypeReq) (*FormTypeListResp, error)
WebListSecFiling func(ctx context.Context, in *WebListSecFilingReq) (*WebListSecFilingResp, error)
}
func (c *SecFilingsClientImpl) GetDubboStub(cc *triple.TripleConn) SecFilingsClient {
return NewSecFilingsClient(cc)
}
func (c *SecFilingsClientImpl) XXX_InterfaceName() string {
return "secFilings.SecFilings"
}
func NewSecFilingsClient(cc *triple.TripleConn) SecFilingsClient {
return &secFilingsClient{cc}
}
func (c *secFilingsClient) CreateSecFiling(ctx context.Context, in *CreateSecFilingReq, opts ...grpc_go.CallOption) (*CommonResp, common.ErrorWithAttachment) {
out := new(CommonResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/CreateSecFiling", in, out)
}
func (c *secFilingsClient) UpdateSecFiling(ctx context.Context, in *UpdateSecFilingReq, opts ...grpc_go.CallOption) (*CommonResp, common.ErrorWithAttachment) {
out := new(CommonResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/UpdateSecFiling", in, out)
}
func (c *secFilingsClient) DetailSecFiling(ctx context.Context, in *DetailSecFilingReq, opts ...grpc_go.CallOption) (*SecFilingDetailResp, common.ErrorWithAttachment) {
out := new(SecFilingDetailResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/DetailSecFiling", in, out)
}
func (c *secFilingsClient) ListSecFiling(ctx context.Context, in *ListSecFilingReq, opts ...grpc_go.CallOption) (*SecFilingListResp, common.ErrorWithAttachment) {
out := new(SecFilingListResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/ListSecFiling", in, out)
}
func (c *secFilingsClient) DeleteSecFiling(ctx context.Context, in *DeleteSecFilingReq, opts ...grpc_go.CallOption) (*CommonResp, common.ErrorWithAttachment) {
out := new(CommonResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/DeleteSecFiling", in, out)
}
func (c *secFilingsClient) IsSecFilingExist(ctx context.Context, in *IsSecFilingExistReq, opts ...grpc_go.CallOption) (*IsSecFilingExistResp, common.ErrorWithAttachment) {
out := new(IsSecFilingExistResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/IsSecFilingExist", in, out)
}
func (c *secFilingsClient) UpdateSecFilingStatus(ctx context.Context, in *UpdateSecFilingStatusReq, opts ...grpc_go.CallOption) (*CommonResp, common.ErrorWithAttachment) {
out := new(CommonResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/UpdateSecFilingStatus", in, out)
}
func (c *secFilingsClient) ListFormType(ctx context.Context, in *ListFormTypeReq, opts ...grpc_go.CallOption) (*FormTypeListResp, common.ErrorWithAttachment) {
out := new(FormTypeListResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/ListFormType", in, out)
}
func (c *secFilingsClient) WebListSecFiling(ctx context.Context, in *WebListSecFilingReq, opts ...grpc_go.CallOption) (*WebListSecFilingResp, common.ErrorWithAttachment) {
out := new(WebListSecFilingResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/WebListSecFiling", in, out)
}
// SecFilingsServer is the server API for SecFilings service.
// All implementations must embed UnimplementedSecFilingsServer
// for forward compatibility
type SecFilingsServer interface {
CreateSecFiling(context.Context, *CreateSecFilingReq) (*CommonResp, error)
UpdateSecFiling(context.Context, *UpdateSecFilingReq) (*CommonResp, error)
DetailSecFiling(context.Context, *DetailSecFilingReq) (*SecFilingDetailResp, error)
ListSecFiling(context.Context, *ListSecFilingReq) (*SecFilingListResp, error)
DeleteSecFiling(context.Context, *DeleteSecFilingReq) (*CommonResp, error)
IsSecFilingExist(context.Context, *IsSecFilingExistReq) (*IsSecFilingExistResp, error)
UpdateSecFilingStatus(context.Context, *UpdateSecFilingStatusReq) (*CommonResp, error)
ListFormType(context.Context, *ListFormTypeReq) (*FormTypeListResp, error)
WebListSecFiling(context.Context, *WebListSecFilingReq) (*WebListSecFilingResp, error)
mustEmbedUnimplementedSecFilingsServer()
}
// UnimplementedSecFilingsServer must be embedded to have forward compatible implementations.
type UnimplementedSecFilingsServer struct {
proxyImpl protocol.Invoker
}
func (UnimplementedSecFilingsServer) CreateSecFiling(context.Context, *CreateSecFilingReq) (*CommonResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateSecFiling not implemented")
}
func (UnimplementedSecFilingsServer) UpdateSecFiling(context.Context, *UpdateSecFilingReq) (*CommonResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateSecFiling not implemented")
}
func (UnimplementedSecFilingsServer) DetailSecFiling(context.Context, *DetailSecFilingReq) (*SecFilingDetailResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method DetailSecFiling not implemented")
}
func (UnimplementedSecFilingsServer) ListSecFiling(context.Context, *ListSecFilingReq) (*SecFilingListResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListSecFiling not implemented")
}
func (UnimplementedSecFilingsServer) DeleteSecFiling(context.Context, *DeleteSecFilingReq) (*CommonResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeleteSecFiling not implemented")
}
func (UnimplementedSecFilingsServer) IsSecFilingExist(context.Context, *IsSecFilingExistReq) (*IsSecFilingExistResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method IsSecFilingExist not implemented")
}
func (UnimplementedSecFilingsServer) UpdateSecFilingStatus(context.Context, *UpdateSecFilingStatusReq) (*CommonResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateSecFilingStatus not implemented")
}
func (UnimplementedSecFilingsServer) ListFormType(context.Context, *ListFormTypeReq) (*FormTypeListResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListFormType not implemented")
}
func (UnimplementedSecFilingsServer) WebListSecFiling(context.Context, *WebListSecFilingReq) (*WebListSecFilingResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method WebListSecFiling not implemented")
}
func (s *UnimplementedSecFilingsServer) XXX_SetProxyImpl(impl protocol.Invoker) {
s.proxyImpl = impl
}
func (s *UnimplementedSecFilingsServer) XXX_GetProxyImpl() protocol.Invoker {
return s.proxyImpl
}
func (s *UnimplementedSecFilingsServer) XXX_ServiceDesc() *grpc_go.ServiceDesc {
return &SecFilings_ServiceDesc
}
func (s *UnimplementedSecFilingsServer) XXX_InterfaceName() string {
return "secFilings.SecFilings"
}
func (UnimplementedSecFilingsServer) mustEmbedUnimplementedSecFilingsServer() {}
// UnsafeSecFilingsServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to SecFilingsServer will
// result in compilation errors.
type UnsafeSecFilingsServer interface {
mustEmbedUnimplementedSecFilingsServer()
}
func RegisterSecFilingsServer(s grpc_go.ServiceRegistrar, srv SecFilingsServer) {
s.RegisterService(&SecFilings_ServiceDesc, srv)
}
func _SecFilings_CreateSecFiling_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateSecFilingReq)
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("CreateSecFiling", 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 _SecFilings_UpdateSecFiling_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdateSecFilingReq)
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("UpdateSecFiling", 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 _SecFilings_DetailSecFiling_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(DetailSecFilingReq)
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("DetailSecFiling", 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 _SecFilings_ListSecFiling_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(ListSecFilingReq)
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("ListSecFiling", 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 _SecFilings_DeleteSecFiling_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(DeleteSecFilingReq)
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("DeleteSecFiling", 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 _SecFilings_IsSecFilingExist_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(IsSecFilingExistReq)
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("IsSecFilingExist", 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 _SecFilings_UpdateSecFilingStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdateSecFilingStatusReq)
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("UpdateSecFilingStatus", 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 _SecFilings_ListFormType_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(ListFormTypeReq)
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("ListFormType", 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 _SecFilings_WebListSecFiling_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(WebListSecFilingReq)
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("WebListSecFiling", 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)
}
// SecFilings_ServiceDesc is the grpc_go.ServiceDesc for SecFilings service.
// It's only intended for direct use with grpc_go.RegisterService,
// and not to be introspected or modified (even as a copy)
var SecFilings_ServiceDesc = grpc_go.ServiceDesc{
ServiceName: "secFilings.SecFilings",
HandlerType: (*SecFilingsServer)(nil),
Methods: []grpc_go.MethodDesc{
{
MethodName: "CreateSecFiling",
Handler: _SecFilings_CreateSecFiling_Handler,
},
{
MethodName: "UpdateSecFiling",
Handler: _SecFilings_UpdateSecFiling_Handler,
},
{
MethodName: "DetailSecFiling",
Handler: _SecFilings_DetailSecFiling_Handler,
},
{
MethodName: "ListSecFiling",
Handler: _SecFilings_ListSecFiling_Handler,
},
{
MethodName: "DeleteSecFiling",
Handler: _SecFilings_DeleteSecFiling_Handler,
},
{
MethodName: "IsSecFilingExist",
Handler: _SecFilings_IsSecFilingExist_Handler,
},
{
MethodName: "UpdateSecFilingStatus",
Handler: _SecFilings_UpdateSecFilingStatus_Handler,
},
{
MethodName: "ListFormType",
Handler: _SecFilings_ListFormType_Handler,
},
{
MethodName: "WebListSecFiling",
Handler: _SecFilings_WebListSecFiling_Handler,
},
},
Streams: []grpc_go.StreamDesc{},
Metadata: "secFilings.proto",
}

View File

@ -1,3 +1,4 @@
ls api/account/*.pb.go | xargs -n1 -IX bash -c 'sed s/,omitempty// X > X.tmp && mv X{.tmp,}'; ls api/account/*.pb.go | xargs -n1 -IX bash -c 'sed s/,omitempty// X > X.tmp && mv X{.tmp,}';
ls api/bundle/*.pb.go | xargs -n1 -IX bash -c 'sed s/,omitempty// X > X.tmp && mv X{.tmp,}'; ls api/bundle/*.pb.go | xargs -n1 -IX bash -c 'sed s/,omitempty// X > X.tmp && mv X{.tmp,}';
ls api/order/*.pb.go | xargs -n1 -IX bash -c 'sed s/,omitempty// X > X.tmp && mv X{.tmp,}'; ls api/order/*.pb.go | xargs -n1 -IX bash -c 'sed s/,omitempty// X > X.tmp && mv X{.tmp,}';
ls api/secFilings/*.pb.go | xargs -n1 -IX bash -c 'sed s/,omitempty// X > X.tmp && mv X{.tmp,}';

View File

@ -21,6 +21,7 @@ import (
"fmt" "fmt"
"fonchain-fiee/cmd/config" "fonchain-fiee/cmd/config"
"fonchain-fiee/pkg/cache" "fonchain-fiee/pkg/cache"
"fonchain-fiee/pkg/logger"
"fonchain-fiee/pkg/router" "fonchain-fiee/pkg/router"
) )
@ -44,6 +45,7 @@ func bootstrap() (err error) {
fmt.Println(configEnv) fmt.Println(configEnv)
fmt.Println(config.AppConfig) fmt.Println(config.AppConfig)
logger.LogInit(config.AppConfig)
////redis ////redis
redisConfig := cache.RedisConfig{ redisConfig := cache.RedisConfig{
RedisDB: configEnv.Redis.RedisDB, RedisDB: configEnv.Redis.RedisDB,

View File

@ -109,11 +109,14 @@ type Redis struct {
type System struct { type System struct {
Mode string Mode string
AppMode string
Version string Version string
HttpPort string HttpPort string
Host string Host string
RedirectUri string RedirectUri string
Domain string Domain string
ErpHost string
FieeHost string
} }
type Oss struct { type Oss struct {
AccessKeyId string AccessKeyId string
@ -123,6 +126,14 @@ type Oss struct {
BaseDir string BaseDir string
CdnHost string CdnHost string
} }
type ZapLog struct {
Level string
Filename string
MaxSize int
MaxAge int
MaxBackups int
}
type Mobile struct { type Mobile struct {
SK string SK string
AK string AK string
@ -142,6 +153,7 @@ type Config struct {
Mobile Mobile `toml:"mobile"` Mobile Mobile `toml:"mobile"`
Ai Ai `toml:"ai"` Ai Ai `toml:"ai"`
Oss Oss `toml:"oss"` Oss Oss `toml:"oss"`
ZapLog ZapLog `toml:"zapLog"`
} }
/********start-配置信息*********/ /********start-配置信息*********/

2
conf/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
conf.ini
dubbogo.yaml

View File

@ -1,38 +0,0 @@
[system]
Domain = "app"
AppMode = "debug"
HttpPort = ":8085"
Host = "http://127.0.0.1:8085"
RedirectUri = "/api/redirect/url"
[bos]
Ak = "ALTAKxrqOQHnAN525Tb2GX4Bhe"
Sk = "d2ecaa9d75114d3b9f42b99014198306"
BucketName = "dci-file-new"
BosUrl = ".bj.bcebos.com"
BosBaseDir = "fonchain-main"
BosHttp = "https://"
BosDomain = "cdns.fontree.cn"
[oss]
AccessKeyId="LTAI5tLz1fSK53FQAEC9uNSb"
AccessKeysecret ="oGB9chrQzQzITXR2IGv37Ji5WxZh4j"
Endpoint = "oss-cn-hangzhou.aliyuncs.com"
BucketName = "fontree-test"
BaseDir = "artistinfo"
CdnHost = "https://cdn-test.szjixun.cn"
[redis]
RedisDB = "2"
RedisAddr = "127.0.0.1:6379"
RedisPW = ""
RedisDBNAme = "2"
[ai]
Host = "https://erpapi.fontree.cn"
TelNum = "18021272627"
Password = "Gy.123456"
[service]
IsHTTPS = false

View File

@ -26,4 +26,8 @@ dubbo:
BundleClientImpl: BundleClientImpl:
protocol: tri protocol: tri
retries: 0 retries: 0
interface: com.fontree.microservices.fiee.bundle # must be compatible with grpc or dubbo-java interface: com.fontree.microservices.fiee.bundle # must be compatible with grpc or dubbo-java
SecFilingsClientImpl:
protocol: tri
retries: 0
interface: com.fontree.microservices.fiee.SecFiling

View File

@ -4,7 +4,8 @@ AppMode = "dev"
HttpPort = ":8085" HttpPort = ":8085"
Host = "https://common.szjixun.cn" Host = "https://common.szjixun.cn"
RedirectUri = "/api/redirect/url" RedirectUri = "/api/redirect/url"
ErpHost = "http://114.218.158.24:9020"
FieeHost = "http://114.218.158.24:9020"
[bos] [bos]
Ak = "ALTAKxrqOQHnAN525Tb2GX4Bhe" Ak = "ALTAKxrqOQHnAN525Tb2GX4Bhe"
Sk = "d2ecaa9d75114d3b9f42b99014198306" Sk = "d2ecaa9d75114d3b9f42b99014198306"
@ -34,3 +35,10 @@ Password = "Gy.123456"
[stripe] [stripe]
Webhookkey = "whsec_uOQpG6IZTqtfLuePIDtfLCGJPqedSCCN" Webhookkey = "whsec_uOQpG6IZTqtfLuePIDtfLCGJPqedSCCN"
[zapLog]
level = "info"
filename = "logs/fiee_zap.log"
max_size = 5
max_age = 30
max_backups = 30

View File

@ -37,8 +37,53 @@ dubbo:
interface: com.fontree.microservices.common.micro.account.fiee interface: com.fontree.microservices.common.micro.account.fiee
# filter: echo,metrics,token,accesslog,sign,tps,generic_service,execute,pshutdown,auth,fonValidateFilter # filter: echo,metrics,token,accesslog,sign,tps,generic_service,execute,pshutdown,auth,fonValidateFilter
PaymentCentClientImpl: PaymentCentClientImpl:
interface: com.fontree.microservices.common.payment # must be compatible with grpc or dubbo-java protocol: tri
filter: cshutdown,sign,auth retries: 0
params: interface: com.fontree.microservices.common.payment.cent # must be compatible with grpc or dubbo-java
.accessKeyId: "Paymentksl" CastClientImpl:
.secretAccessKey: "BSDY-FDF1-Fontree_payment" protocol: tri
interface: com.fontree.microservices.fiee.multicast
SecFilingsClientImpl:
protocol: tri
retries: 0
interface: com.fontree.microservices.fiee.SecFiling
logger:
zap-config:
level: error # 日志级别
development: false
disableCaller: false
disableStacktrace: false
encoding: "json"
# zap encoder 配置
encoderConfig:
messageKey: "message"
levelKey: "level"
timeKey: "time"
nameKey: "logger"
callerKey: "caller"
stacktraceKey: "stacktrace"
lineEnding: ""
levelEncoder: "capitalColor"
timeEncoder: "iso8601"
durationEncoder: "seconds"
callerEncoder: "short"
nameEncoder: ""
EncodeTime: zapcore.TimeEncoderOfLayout("2006-01-02 15:04:05.000"),
EncodeDuration: zapcore.SecondsDurationEncoder,
outputPaths:
- "stderr"
errorOutputPaths:
- "stderr"
lumberjack-config:
# 写日志的文件名称
filename: "runtime/logs/fiee.log"
# 每个日志文件长度的最大大小,单位是 MiB。默认 100MiB
maxSize: 5
# 日志保留的最大天数(只保留最近多少天的日志)
maxAge: 30
# 只保留最近多少个日志文件,用于控制程序总日志的大小
maxBackups: 30
# 是否使用本地时间,默认使用 UTC 时间
localTime: true
# 是否压缩日志文件,压缩方法 gzip
compress: false

View File

@ -4,7 +4,8 @@ AppMode = "prod"
HttpPort = ":8085" HttpPort = ":8085"
Host = "https://common.szjixun.cn" Host = "https://common.szjixun.cn"
RedirectUri = "/api/redirect/url" RedirectUri = "/api/redirect/url"
ErpHost = "https://erpapi.fontree.cn"
FieeHost = "https://erpapi.fiee.com"
[bos] [bos]
Ak = "ALTAKxrqOQHnAN525Tb2GX4Bhe" Ak = "ALTAKxrqOQHnAN525Tb2GX4Bhe"
Sk = "d2ecaa9d75114d3b9f42b99014198306" Sk = "d2ecaa9d75114d3b9f42b99014198306"
@ -27,10 +28,17 @@ Password = "Gy.123456"
[oss] [oss]
AccessKeyId = "LTAI5tHfjSmWXHqfWgaL7Uo5" AccessKeyId = "LTAI5tHfjSmWXHqfWgaL7Uo5"
AccessKeySecret = "kOPctFZ3DHsbdSSym1fLyDK39hkzPI" AccessKeySecret = "kOPctFZ3DHsbdSSym1fLyDK39hkzPI"
Endpoint = "oss-cn-hangzhou-internal.aliyuncs.com" Endpoint = "oss-cn-hangzhou.aliyuncs.com"
BucketName = "erp-k8s-store" BucketName = "erp-k8s-store"
BaseDir = "fiee" BaseDir = "fiee"
CdnHost = "https://e-cdn.fontree.cn" CdnHost = "https://e-cdn.fontree.cn"
[stripe] [stripe]
Webhookkey = "whsec_Mol32WD1KcKHUdYsSwap0LR03q2g9qNY" Webhookkey = "whsec_Mol32WD1KcKHUdYsSwap0LR03q2g9qNY"
[zapLog]
level = "info"
filename = "logs/fiee_zap.log"
max_size = 5
max_age = 30
max_backups = 30

View File

@ -42,3 +42,50 @@ dubbo:
params: params:
.accessKeyId: "Paymentksl" .accessKeyId: "Paymentksl"
.secretAccessKey: "BSDY-FDF1-Fontree_payment" .secretAccessKey: "BSDY-FDF1-Fontree_payment"
CastClientImpl:
protocol: tri
interface: com.fontree.microservices.fiee.multicast
SecFilingsClientImpl:
protocol: tri
retries: 0
interface: com.fontree.microservices.fiee.SecFiling
logger:
zap-config:
level: error # 日志级别
development: false
disableCaller: false
disableStacktrace: false
encoding: "json"
# zap encoder 配置
encoderConfig:
messageKey: "message"
levelKey: "level"
timeKey: "time"
nameKey: "logger"
callerKey: "caller"
stacktraceKey: "stacktrace"
lineEnding: ""
levelEncoder: "capitalColor"
timeEncoder: "iso8601"
durationEncoder: "seconds"
callerEncoder: "short"
nameEncoder: ""
EncodeTime: zapcore.TimeEncoderOfLayout("2006-01-02 15:04:05.000"),
EncodeDuration: zapcore.SecondsDurationEncoder,
outputPaths:
- "stderr"
errorOutputPaths:
- "stderr"
lumberjack-config:
# 写日志的文件名称
filename: "runtime/logs/fiee.log"
# 每个日志文件长度的最大大小,单位是 MiB。默认 100MiB
maxSize: 5
# 日志保留的最大天数(只保留最近多少天的日志)
maxAge: 30
# 只保留最近多少个日志文件,用于控制程序总日志的大小
maxBackups: 30
# 是否使用本地时间,默认使用 UTC 时间
localTime: true
# 是否压缩日志文件,压缩方法 gzip
compress: false

View File

@ -4,14 +4,23 @@ AppMode = "test"
HttpPort = ":8085" HttpPort = ":8085"
Host = "https://common.szjixun.cn" Host = "https://common.szjixun.cn"
RedirectUri = "/api/redirect/url" RedirectUri = "/api/redirect/url"
ErpHost = "http://114.218.158.24:9020"
FieeHost = "http://114.218.158.24:9020"
[bos] [bos]
Ak = "ALTAKxrqOQHnAN525Tb2GX4Bhe" Ak = "ALTAKxrqOQHnAN525Tb2GX4Bhe"
Sk = "d2ecaa9d75114d3b9f42b99014198306" Sk = "d2ecaa9d75114d3b9f42b99014198306"
BucketName = "dci-file-new" BucketName = "dci-file-new"
BosUrl = ".bj.bcebos.com" BosUrl = ".bj.bcebos.com"
BosBaseDir = "fonchain-main" BosBaseDir = "fiee"
BosHttp = "https://" BosHttp = "https://"
BosDomain = "cdns.fontree.cn"
[oss]
AccessKeyId = "LTAI5tLz1fSK53FQAEC9uNSb"
AccessKeySecret = "oGB9chrQzQzITXR2IGv37Ji5WxZh4j"
Endpoint = "oss-cn-hangzhou.aliyuncs.com"
BucketName = "fontree-test"
BaseDir = "fiee"
CdnHost = "https://cdn-test.szjixun.cn"
[oss] [oss]
AccessKeyId="LTAI5tLz1fSK53FQAEC9uNSb" AccessKeyId="LTAI5tLz1fSK53FQAEC9uNSb"
@ -23,11 +32,21 @@ CdnHost = "https://cdn-test.szjixun.cn"
[redis] [redis]
RedisDB = "2" RedisDB = "2"
RedisAddr = "redis:6379" RedisAddr = "172.16.100.114:6379"
RedisPW = "root" RedisPW = "kP6tW4tS3qB2dW4aE6uI5cX2"
RedisDBNAme = "2" RedisDBNAme = "2"
[ai] [ai]
Host = "https://erpapi.fontree.cn" Host = "https://erpapi.fontree.cn"
TelNum = "18021272627" TelNum = "18021272627"
Password = "Gy.123456" Password = "Gy.123456"
[stripe]
Webhookkey = "whsec_uOQpG6IZTqtfLuePIDtfLCGJPqedSCCN"
[zapLog]
level = "info"
filename = "logs/fiee_zap.log"
max_size = 5
max_age = 30
max_backups = 30

View File

@ -4,5 +4,86 @@ dubbo:
protocol: zookeeper protocol: zookeeper
timeout: 3s timeout: 3s
# address: 121.229.45.214:9004 # address: 121.229.45.214:9004
address: 127.0.0.1:2181 address: 172.16.100.93:2181
# address: 114.218.158.24:2181 # address: 127.0.0.1:2181
# address: 114.218.158.24:2181
consumer:
filter: tracing
request-timeout: 30s
references:
OrderClientImpl:
protocol: tri
retries: 0
interface: com.fontree.microservices.common.order # must be compatible with grpc or dubbo-java
# filter: cshutdown,sign,fonDomainFilter,fonValidateFilter
params:
.accessKeyId: "SYD8-order-04"
.secretAccessKey: "Al-order-FDF112"
BundleClientImpl:
protocol: tri
retries: 0
interface: com.fontree.microservices.fiee.bundle # must be compatible with grpc or dubbo-java
AccountClientImpl:
protocol: tri
retries: 0
interface: com.fontree.microservices.common.Account
filter: echo,metrics,token,accesslog,sign,tps,generic_service,execute
params:
.accessKeyId: "Accountksl"
.secretAccessKey: "BSDY-FDF1-Fontree_account"
AccountFieeClientImpl:
protocol: tri
retries: 3
interface: com.fontree.microservices.common.micro.account.fiee
# filter: echo,metrics,token,accesslog,sign,tps,generic_service,execute,pshutdown,auth,fonValidateFilter
PaymentCentClientImpl:
protocol: tri
retries: 0
interface: com.fontree.microservices.common.payment.cent # must be compatible with grpc or dubbo-java
CastClientImpl:
protocol: tri
interface: com.fontree.microservices.fiee.multicast
SecFilingsClientImpl:
protocol: tri
retries: 0
interface: com.fontree.microservices.fiee.SecFiling
logger:
zap-config:
level: error # 日志级别
development: false
disableCaller: false
disableStacktrace: false
encoding: "json"
# zap encoder 配置
encoderConfig:
messageKey: "message"
levelKey: "level"
timeKey: "time"
nameKey: "logger"
callerKey: "caller"
stacktraceKey: "stacktrace"
lineEnding: ""
levelEncoder: "capitalColor"
timeEncoder: "iso8601"
durationEncoder: "seconds"
callerEncoder: "short"
nameEncoder: ""
EncodeTime: zapcore.TimeEncoderOfLayout("2006-01-02 15:04:05.000"),
EncodeDuration: zapcore.SecondsDurationEncoder,
outputPaths:
- "stderr"
errorOutputPaths:
- "stderr"
lumberjack-config:
# 写日志的文件名称
filename: "runtime/logs/fiee.log"
# 每个日志文件长度的最大大小,单位是 MiB。默认 100MiB
maxSize: 5
# 日志保留的最大天数(只保留最近多少天的日志)
maxAge: 30
# 只保留最近多少个日志文件,用于控制程序总日志的大小
maxBackups: 30
# 是否使用本地时间,默认使用 UTC 时间
localTime: true
# 是否压缩日志文件,压缩方法 gzip
compress: false

5
go.mod
View File

@ -104,6 +104,7 @@ require (
github.com/BurntSushi/toml v1.2.1 github.com/BurntSushi/toml v1.2.1
github.com/PuerkitoBio/goquery v1.8.1 github.com/PuerkitoBio/goquery v1.8.1
github.com/disintegration/imaging v1.6.2 github.com/disintegration/imaging v1.6.2
github.com/envoyproxy/protoc-gen-validate v0.1.0
github.com/fonchain/utils/voice v0.0.0-00010101000000-000000000000 github.com/fonchain/utils/voice v0.0.0-00010101000000-000000000000
github.com/fonchain_enterprise/utils/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
@ -113,7 +114,7 @@ require (
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e
github.com/spf13/viper v1.7.1 github.com/spf13/viper v1.7.1
github.com/u2takey/ffmpeg-go v0.5.0 github.com/u2takey/ffmpeg-go v0.5.0
golang.org/x/image v0.0.0-20191009234506-e7c1f5e7dbb8 golang.org/x/image v0.0.0-20220902085622-e7cb96979f69
) )
require ( require (
@ -136,7 +137,6 @@ require (
github.com/dubbogo/go-zookeeper v1.0.4-0.20211212162352-f9d2183d89d5 // indirect github.com/dubbogo/go-zookeeper v1.0.4-0.20211212162352-f9d2183d89d5 // indirect
github.com/emicklei/go-restful/v3 v3.7.4 // indirect github.com/emicklei/go-restful/v3 v3.7.4 // indirect
github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1 // indirect github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1 // indirect
github.com/envoyproxy/protoc-gen-validate v0.1.0 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/ghodss/yaml v1.0.0 // indirect github.com/ghodss/yaml v1.0.0 // indirect
github.com/go-co-op/gocron v1.9.0 // indirect github.com/go-co-op/gocron v1.9.0 // indirect
@ -173,6 +173,7 @@ require (
github.com/spf13/jwalterweatherman v1.0.0 // indirect github.com/spf13/jwalterweatherman v1.0.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect github.com/spf13/pflag v1.0.5 // indirect
github.com/subosito/gotenv v1.2.0 // indirect github.com/subosito/gotenv v1.2.0 // indirect
github.com/tealeg/xlsx v1.0.5 // indirect
github.com/tklauser/go-sysconf v0.3.6 // indirect github.com/tklauser/go-sysconf v0.3.6 // indirect
github.com/tklauser/numcpus v0.2.2 // indirect github.com/tklauser/numcpus v0.2.2 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect github.com/twitchyliquid64/golang-asm v0.15.1 // indirect

5
go.sum
View File

@ -837,6 +837,8 @@ github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gt
github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s=
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
github.com/tealeg/xlsx v1.0.5 h1:+f8oFmvY8Gw1iUXzPk+kz+4GpbDZPK1FhPiQRd+ypgE=
github.com/tealeg/xlsx v1.0.5/go.mod h1:btRS8dz54TDnvKNosuAqxrM1QgN1udgk9O34bDCnORM=
github.com/tebeka/strftime v0.1.3/go.mod h1:7wJm3dZlpr4l/oVK0t1HYIc4rMzQ2XJlOMIUJUJH6XQ= github.com/tebeka/strftime v0.1.3/go.mod h1:7wJm3dZlpr4l/oVK0t1HYIc4rMzQ2XJlOMIUJUJH6XQ=
github.com/tevid/gohamcrest v1.1.1 h1:ou+xSqlIw1xfGTg1uq1nif/htZ2S3EzRqLm2BP+tYU0= github.com/tevid/gohamcrest v1.1.1 h1:ou+xSqlIw1xfGTg1uq1nif/htZ2S3EzRqLm2BP+tYU0=
github.com/tevid/gohamcrest v1.1.1/go.mod h1:3UvtWlqm8j5JbwYZh80D/PVBt0mJ1eJiYgZMibh0H/k= github.com/tevid/gohamcrest v1.1.1/go.mod h1:3UvtWlqm8j5JbwYZh80D/PVBt0mJ1eJiYgZMibh0H/k=
@ -977,8 +979,9 @@ 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-20191009234506-e7c1f5e7dbb8 h1:hVwzHzIUGRjiF7EcUjqNxk3NCfkPxbDKRdnNE1Rpg0U=
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.0.0-20220902085622-e7cb96979f69 h1:Lj6HJGCSn5AjxRAH2+r35Mir4icalbqku+CLUtjnvXY=
golang.org/x/image v0.0.0-20220902085622-e7cb96979f69/go.mod h1:doUCurBvlfPMKfmIpRIywoHmhN3VyhnoFDbvIEWF4hY=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=

View File

@ -17,7 +17,6 @@ func TestGptContent(t *testing.T) {
want string want string
wantErr bool wantErr bool
}{ }{
// TODO: Add test cases.
{args: args{content: "i want many nice cars"}}, {args: args{content: "i want many nice cars"}},
{args: args{content: "you are so beautiful,i like(把前面文字翻译成中文,去除斜杠,本括号内的忽略)"}}, {args: args{content: "you are so beautiful,i like(把前面文字翻译成中文,去除斜杠,本括号内的忽略)"}},
{args: args{content: "有一个美丽的蓝色天空,天空下边站着一个小孩,小孩穿着绿色的衣服,绿色的帽子,帽子上有个毛毛虫(把前面文字翻译成英语,如果前面是英语则原样返回,去除斜杠,本括号内的忽略)"}}, {args: args{content: "有一个美丽的蓝色天空,天空下边站着一个小孩,小孩穿着绿色的衣服,绿色的帽子,帽子上有个毛毛虫(把前面文字翻译成英语,如果前面是英语则原样返回,去除斜杠,本括号内的忽略)"}},

View File

@ -44,19 +44,60 @@ var EnMessages = map[string]string{
"系统提示:已经发送过,验证码尚可用": "System message: Already sent, verification code is still available", "系统提示:已经发送过,验证码尚可用": "System message: Already sent, verification code is still available",
"您的手机号当天发送次数过多,请联系管理员通过密码登录": "Your mobile phone number is sent too many times that day, please contact the administrator to log in through the password", "您的手机号当天发送次数过多,请联系管理员通过密码登录": "Your mobile phone number is sent too many times that day, please contact the administrator to log in through the password",
"您的手机号验证码错误,请确认之后注册": "Your phone number verification code is incorrect, please confirm and register", "您的手机号验证码错误,请确认之后注册": "Your phone number verification code is incorrect, please confirm and register",
"手机号不合法": "The phone number is illegal", "手机号不合法": "The phone number is illegal",
"手机号未更改": "The phone number has not been changed", "手机号未更改": "The phone number has not been changed",
"新手机号过期": "New phone number expired", "新手机号过期": "New phone number expired",
"验证码错误": "Verification code error", "验证码错误": "Verification code error",
"验证码未发送": "The verification code was not sent", "验证码未发送": "The verification code was not sent",
"账号不存在": "Account does not exist", "账号不存在": "Account does not exist",
"已实名": "In real name", "已实名": "In real name",
"实名审核中,请勿重复提交": "During real-name audit, please do not submit repeatedly", "实名审核中,请勿重复提交": "During real-name audit, please do not submit repeatedly",
"用户状态异常,无法进行审核": "The user is abnormal and cannot be audited. Procedure", "用户状态异常,无法进行审核": "The user is abnormal and cannot be audited. Procedure",
"验证码已失效": "The verification code is invalid", "验证码已失效": "The verification code is invalid",
"服务器错误": "Server error", "服务器错误": "Server error",
"验证失败,请控制拼图对齐缺口": "Verification failed, please control puzzle alignment gap", "验证失败,请控制拼图对齐缺口": "Verification failed, please control puzzle alignment gap",
"滑块验证状态不存在,请退出重试": "The slider verification status does not exist. Please exit and try again", "滑块验证状态不存在,请退出重试": "The slider verification status does not exist. Please exit and try again",
"语言不能为空": "The language cannot be empty",
"排序参数需为正整数": "The sorting parameter must be a positive integer",
"请先创建中文版本套餐": "Please create the Chinese version bundle first",
"增值服务不存在": "Value-added service does not exist",
"所选增值服务币种与套餐币种不一致": "The selected value-added service currency is not the same as the bundle currency",
"文件转换失败": "File conversion failed",
"每种增值服务类型只可选择一个": "Each type of value-added service can only be selected once",
"保存套餐与增值服务关联失败": "Failed to save bundle with value-added service association",
"删除套餐与增值服务关联失败": "Failed to delete bundle with value-added service association",
"查询套餐与增值服务关联失败": "Failed to query bundle with value-added service association",
"更新套餐与增值服务关联失败": "Failed to update bundle with value-added service association",
"查询增值服务失败": "Failed to query value-added service",
"更新套餐状态失败": "Failed to update bundle status",
"查询增值服务详情失败": "Failed to query value-added service details",
"序列化转换失败": "Serialization conversion failed",
"保存套餐历史记录失败": "Failed to save bundle history record",
"原价不能为空": "Original price cannot be empty",
"原价格式转换失败": "Original price format conversion failed",
"数量参数需为0-99": "Quantity parameter must be between 0 and 99",
"优惠单价需小于等于原价": "The discounted price must be less than or equal to the original price",
"请先创建中文版本增值服务": "Please create the Chinese version value-added service first",
"保存增值服务失败": "Failed to save value-added service",
"保存增值服务历史记录失败": "Failed to save value-added service history record",
"更新增值服务失败": "Failed to update value-added service",
"查询增值服务列表失败": "Failed to query value-added service list",
"计算价格失败": "Failed to calculate price",
"更新成功": "Update successful",
"保存成功": "Save successful",
"优惠单价转换失败": "Discount unit price conversion failed",
"符号错误": "Symbol error",
"条件存在冲突,请重新设置": "Condition conflict exists, please reconfigure",
"币种已修改,已取消关联部分增值服务": "Currency has been modified, some value-added services have been unlinked",
"币种已修改,已取消关联部分套餐": "Currency has been modified, some packages have been unlinked",
"新增增值服务成功": "Successfully added value-added service",
"状态值无效": "Invalid status value",
"套餐已上架,请勿重复操作": "Plan is already published, do not repeat the operation",
"套餐已下架,请勿重复操作": "Plan is already unpublished, do not repeat the operation",
"请先实名": "Please use your real name first",
"实名审核中": "Real-name verification is underway",
"实名审核失败": "The real-name verification failed",
"未知实名状态": "Unknown real-name status",
} }
var DeDEMessages = map[string]string{ var DeDEMessages = map[string]string{
@ -95,19 +136,60 @@ 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 ungültig",
"手机号未更改": "Telefonnummer wurde nicht geändert", "手机号未更改": "Telefonnummer wurde nicht geändert",
"新手机号过期": "Neue Telefonnummer abgelaufen", "新手机号过期": "Neue Telefonnummer abgelaufen",
"验证码错误": "Verifizierungscode falsch", "验证码错误": "Verifizierungscode falsch",
"验证码未发送": "Der Verifizierungscode wurde nicht gesendet", "验证码未发送": "Der Verifizierungscode wurde nicht gesendet",
"账号不存在": "Konto existiert nicht", "账号不存在": "Konto existiert nicht",
"已实名": "In echt", "已实名": "In echt",
"实名审核中,请勿重复提交": "Während der Echtheitsprüfung bitte nicht wiederholen", "实名审核中,请勿重复提交": "Während der Echtheitsprüfung bitte nicht wiederholen",
"用户状态异常,无法进行审核": "Der Benutzer ist abnorm und kann nicht geprüft werden. Verfahren", "用户状态异常,无法进行审核": "Der Benutzer ist abnorm und kann nicht geprüft werden. Verfahren",
"验证码已失效": "Der Verifizierungscode ist ungültig", "验证码已失效": "Der Verifizierungscode ist ungültig",
"服务器错误": "Serverfehler", "服务器错误": "Serverfehler",
"验证失败,请控制拼图对齐缺口": "Überprüfung fehlgeschlagen, bitte Steuerung Puzzle-Ausrichtungslücke", "验证失败,请控制拼图对齐缺口": "Überprüfung fehlgeschlagen, bitte Steuerung Puzzle-Ausrichtungslücke",
"滑块验证状态不存在,请退出重试": "Die krümmbestätigung existiert nicht. Bitte beenden sie den vorgang", "滑块验证状态不存在,请退出重试": "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",
} }
var JaJPMessages = map[string]string{ var JaJPMessages = map[string]string{
@ -159,6 +241,48 @@ var JaJPMessages = map[string]string{
"服务器错误": "サーバーエラー", "服务器错误": "サーバーエラー",
"验证失败,请控制拼图对齐缺口": "検証に失敗しました。パズルの整列ギャップを制御してください", "验证失败,请控制拼图对齐缺口": "検証に失敗しました。パズルの整列ギャップを制御してください",
"滑块验证状态不存在,请退出重试": "スライダー検証状態が存在しません,リトライをログアウトしてください", "滑块验证状态不存在,请退出重试": "スライダー検証状態が存在しません,リトライをログアウトしてください",
"语言不能为空": "言語が空です",
"排序参数需为正整数": "ソートパラメーターは正の整数でなければなりません",
"请先创建中文版本套餐": "最初に中国語バージョンのパッケージを作成してください",
"增值服务不存在": "付加サービスは存在しません",
"所选增值服务币种与套餐币种不一致": "選択した付加サービスの通貨とパッケージの通貨が一致しません",
"文件转换失败": "ファイル変換に失敗しました",
"每种增值服务类型只可选择一个": "各種付加サービスタイプは一つしか選択できません",
"保存套餐与增值服务关联失败": "パッケージと付加サービスの関連付けの保存に失敗しました",
"删除套餐与增值服务关联失败": "パッケージと付加サービスの関連付けの削除に失敗しました",
"查询套餐与增值服务关联失败": "パッケージと付加サービスの関連付けの検索に失敗しました",
"更新套餐与增值服务关联失败": "パッケージと付加サービスの関連付けの更新に失敗しました",
"查询增值服务失败": "付加サービスの検索に失敗しました",
"更新套餐状态失败": "パッケージステータスの更新に失敗しました",
"查询增值服务详情失败": "付加サービスの詳細検索に失敗しました",
"序列化转换失败": "シリアライズ変換に失敗しました",
"保存套餐历史记录失败": "パッケージ履歴の保存に失敗しました",
"原价不能为空": "原価は空にできません",
"原价格式转换失败": "原価のフォーマット変換に失敗しました",
"数量参数需为0-99": "数量パラメーターは0-99でなければなりません",
"优惠单价需小于等于原价": "割引単価は原価以下でなければなりません",
"请先创建中文版本增值服务": "最初に中国語バージョンの付加サービスを作成してください",
"保存增值服务失败": "付加サービスの保存に失敗しました",
"保存增值服务历史记录失败": "付加サービス履歴の保存に失敗しました",
"更新增值服务失败": "付加サービスの更新に失敗しました",
"查询增值服务列表失败": "付加サービスリストの検索に失敗しました",
"计算价格失败": "価格計算に失敗しました",
"更新成功": "更新が成功しました",
"保存成功": "保存が成功しました",
"优惠单价转换失败": "割引単価変換に失敗しました",
"符号错误": "記号エラー",
"条件存在冲突,请重新设置": "条件が競合しています、再設定してください",
"币种已修改,已取消关联部分增值服务": "通貨が変更され、一部の付加サービスの関連付けが解除されました",
"币种已修改,已取消关联部分套餐": "通貨が変更され、一部のパッケージの関連付けが解除されました",
"新增增值服务成功": "付加サービスの追加に成功しました",
"状态值无效": "状態値が無効です",
"套餐已上架,请勿重复操作": "プランはすでに公開済みです、重複操作は避けてください",
"套餐已下架,请勿重复操作": "プランはすでに非公開です、重複操作は避けてください",
"请先实名": "まずは実名でお願いします",
"实名审核中": "実名審査中です",
"实名审核失败": "実名検証失敗です",
"未知实名状态": "未知の実名状態です",
} }
var ZhTWMessages = map[string]string{ var ZhTWMessages = map[string]string{
@ -210,4 +334,56 @@ var ZhTWMessages = map[string]string{
"服务器错误": "服務器錯誤", "服务器错误": "服務器錯誤",
"验证失败,请控制拼图对齐缺口": "驗證失敗,請控制拼圖對齊缺口", "验证失败,请控制拼图对齐缺口": "驗證失敗,請控制拼圖對齊缺口",
"滑块验证状态不存在,请退出重试": "滑塊驗證狀態不存在,請退出重試", "滑块验证状态不存在,请退出重试": "滑塊驗證狀態不存在,請退出重試",
"语言不能为空": "語言不能為空",
"排序参数需为正整数": "排序參數需為正整數",
"请先创建中文版本套餐": "請先建立中文版本套餐",
"增值服务不存在": "增值服務不存在",
"所选增值服务币种与套餐币种不一致": "所選增值服務幣種與套餐幣種不一致",
"文件转换失败": "文件轉換失敗",
"每种增值服务类型只可选择一个": "每種增值服務類型只可選擇一個",
"保存套餐与增值服务关联失败": "保存套餐與增值服務關聯失敗",
"删除套餐与增值服务关联失败": "刪除套餐與增值服務關聯失敗",
"查询套餐与增值服务关联失败": "查詢套餐與增值服務關聯失敗",
"更新套餐与增值服务关联失败": "更新套餐與增值服務關聯失敗",
"查询增值服务失败": "查詢增值服務失敗",
"更新套餐状态失败": "更新套餐狀態失敗",
"查询增值服务详情失败": "查詢增值服務詳情失敗",
"序列化转换失败": "序列化轉換失敗",
"保存套餐历史记录失败": "保存套餐歷史記錄失敗",
"原价不能为空": "原價不能為空",
"原价格式转换失败": "原價格式轉換失敗",
"数量参数需为0-99": "數量參數需為0-99",
"优惠单价需小于等于原价": "優惠單價需小於等於原價",
"请先创建中文版本增值服务": "請先建立中文版本增值服務",
"保存增值服务失败": "保存增值服務失敗",
"保存增值服务历史记录失败": "保存增值服務歷史記錄失敗",
"更新增值服务失败": "更新增值服務失敗",
"查询增值服务列表失败": "查詢增值服務列表失敗",
"计算价格失败": "計算價格失敗",
"更新成功": "更新成功",
"保存成功": "儲存成功",
"优惠单价转换失败": "優惠單價轉換失敗",
"符号错误": "符號錯誤",
"条件存在冲突,请重新设置": "條件存在衝突,請重新設定",
"币种已修改,已取消关联部分增值服务": "幣種已修改,已取消關聯部分增值服務",
"币种已修改,已取消关联部分套餐": "幣種已修改,已取消關聯部分套餐",
"新增增值服务成功": "新增增值服務成功",
"状态值无效": "狀態值無效",
"套餐已上架,请勿重复操作": "套餐已上架,請勿重複操作",
"套餐已下架,请勿重复操作": "套餐已下架,請勿重複操作",
"请先实名": "請先實名",
"实名审核中": "實名審覈中",
"实名审核失败": "實名審覈失敗",
"未知实名状态": "未知實名狀態",
"已存在标题相同的数据": "已存在標題相同的數據",
"展示数量不能超过5个": "展示數量不能超過5個",
"查询失败": "查詢失敗",
"操作失败": "操作失敗",
"参数缺失": "參數缺失",
"创建失败": "創建失敗",
"更新失败": "更新失敗",
"删除失败": "刪除失敗",
"更新状态失败": "更新狀態失敗",
} }

View File

@ -23,7 +23,6 @@ var (
DriverUrl string DriverUrl string
AppointUrl string AppointUrl string
MaterialHost string MaterialHost string
//TODO
//BosAk string //BosAk string
//BosSk string //BosSk string
//BosBucketName string //BosBucketName string
@ -31,7 +30,6 @@ var (
//BosUrl string //BosUrl string
//BosHttp string //BosHttp string
//BosDomain string //BosDomain string
//TODO
ProjectMapDir string ProjectMapDir string
JaegerHost string JaegerHost string
JaegerOpen bool JaegerOpen bool

View File

@ -21,8 +21,9 @@ const (
) )
const ( const (
ErrNotLogin = "请先登录" ErrNotLogin = "请先登录"
ErrOffline = "您已经下线" ErrOffline = "您已经下线"
InvalidStatus = "状态非法"
) )
const ( const (

View File

@ -151,7 +151,8 @@ var MsgFlags = map[int]string{
} }
const ( const (
ErrorCreateFeedback = "请勿重复提交" ErrorCreateFeedback = "请勿重复提交"
ErrorBalanceInsufficient = "余额不足"
) )
// GetMsg 获取状态码对应信息 // GetMsg 获取状态码对应信息

View File

@ -29,7 +29,7 @@ package e
ERR_NOT_NEED_BALANCE = "无需查询余额" ERR_NOT_NEED_BALANCE = "无需查询余额"
ErrNoBalance = "假期余额不足" ErrNoBalance = "余额不足"
ErrHourNoBalance = "请假时长超出范围" ErrHourNoBalance = "请假时长超出范围"
ErrApplyTime = "无效的请假时间" ErrApplyTime = "无效的请假时间"
@ -165,7 +165,7 @@ var errorMessagesZhCN = map[string]string{
"ERR_NOT_NEED_BALANCEZhCN": "无需查询余额", "ERR_NOT_NEED_BALANCEZhCN": "无需查询余额",
"ErrNoBalanceZhCN": "假期余额不足", "ErrNoBalanceZhCN": "余额不足",
"ErrHourNoBalanceZhCN": "请假时长超出范围", "ErrHourNoBalanceZhCN": "请假时长超出范围",
"ErrApplyTimeZhCN": "无效的请假时间", "ErrApplyTimeZhCN": "无效的请假时间",
@ -325,7 +325,7 @@ var errorMessagesZhTW = map[string]string{
"ERR_NOT_NEED_BALANCEZhTW": "無需查詢餘額", "ERR_NOT_NEED_BALANCEZhTW": "無需查詢餘額",
"ErrNoBalanceZhTW": "假期餘額不足", "ErrNoBalanceZhTW": "餘額不足",
"ErrHourNoBalanceZhTW": "請假時長超出範圍", "ErrHourNoBalanceZhTW": "請假時長超出範圍",
"ErrApplyTimeZhTW": "無效的請假時間", "ErrApplyTimeZhTW": "無效的請假時間",

54
pkg/logger/zap_logger.go Normal file
View File

@ -0,0 +1,54 @@
package logger
import (
"fonchain-fiee/cmd/config"
"github.com/natefinch/lumberjack"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
"os"
)
func LogInit(appConfig *config.Config) *zap.Logger {
var err error
writeSyncer := getLogWriter(appConfig.ZapLog.Filename, appConfig.ZapLog.MaxSize, appConfig.ZapLog.MaxBackups, appConfig.ZapLog.MaxAge)
encoder := getEncoder()
var l = new(zapcore.Level)
err = l.UnmarshalText([]byte(appConfig.ZapLog.Level))
if err != nil {
return nil
}
var core zapcore.Core
//if appConfig.System.Mode == "dev" {
// 进入开发模式,日志输出到终端
consoleEncoder := zapcore.NewConsoleEncoder(zap.NewDevelopmentEncoderConfig())
core = zapcore.NewTee(
zapcore.NewCore(encoder, writeSyncer, l),
zapcore.NewCore(consoleEncoder, zapcore.Lock(os.Stdout), zapcore.DebugLevel),
)
//} else {
// core = zapcore.NewCore(encoder, writeSyncer, l)
//}
lg := zap.New(core, zap.AddCaller())
zap.ReplaceGlobals(lg)
return lg
}
func getEncoder() zapcore.Encoder {
encoderConfig := zap.NewProductionEncoderConfig()
encoderConfig.EncodeTime = zapcore.ISO8601TimeEncoder
encoderConfig.TimeKey = "time"
encoderConfig.EncodeLevel = zapcore.CapitalLevelEncoder
encoderConfig.EncodeDuration = zapcore.SecondsDurationEncoder
encoderConfig.EncodeCaller = zapcore.ShortCallerEncoder
return zapcore.NewJSONEncoder(encoderConfig)
}
func getLogWriter(filename string, maxSize, maxBackup, maxAge int) zapcore.WriteSyncer {
lumberJackLogger := &lumberjack.Logger{
Filename: filename,
MaxSize: maxSize,
MaxBackups: maxBackup,
MaxAge: maxAge,
}
return zapcore.AddSync(lumberJackLogger)
}

View File

@ -1,7 +1,6 @@
package middleware package middleware
import ( import (
"dubbo.apache.org/dubbo-go/v3/common/logger"
"errors" "errors"
"fmt" "fmt"
"fonchain-fiee/api/account" "fonchain-fiee/api/account"
@ -14,8 +13,10 @@ import (
"fonchain-fiee/pkg/model/login" "fonchain-fiee/pkg/model/login"
"fonchain-fiee/pkg/service" "fonchain-fiee/pkg/service"
"fonchain-fiee/pkg/utils/secret" "fonchain-fiee/pkg/utils/secret"
"github.com/gin-gonic/gin"
"time" "time"
"dubbo.apache.org/dubbo-go/v3/common/logger"
"github.com/gin-gonic/gin"
) )
// CheckLogin 检测登陆 // CheckLogin 检测登陆
@ -81,6 +82,9 @@ func CheckWebLogin(provider *account.AccountClientImpl) gin.HandlerFunc {
startTime := time.Now() startTime := time.Now()
//如果没有登录 //如果没有登录
authorization := ctx.GetHeader(e.Authorization) authorization := ctx.GetHeader(e.Authorization)
if authorization == "" {
authorization = ctx.Query("token")
}
if authorization == "" { if authorization == "" {
service.NotLoginRes(ctx, logic.ConvertLoginMsg(ctx, e.ErrNotLogin)) service.NotLoginRes(ctx, logic.ConvertLoginMsg(ctx, e.ErrNotLogin))
return return
@ -150,6 +154,7 @@ func CheckWebLogin(provider *account.AccountClientImpl) gin.HandlerFunc {
loginInfo := login.Info{ loginInfo := login.Info{
Domain: info.Domain, Domain: info.Domain,
ID: info.ID, ID: info.ID,
Name: info.NickName,
//Account: info.Account, //Account: info.Account,
//NickName: info.NickName, //NickName: info.NickName,
//PositionUsers: qres.PositionUsers, //PositionUsers: qres.PositionUsers,

View File

@ -29,12 +29,12 @@ func Cors() gin.HandlerFunc {
c.Header("Access-Control-Allow-Origin", "*") // 这是允许访问所有域 c.Header("Access-Control-Allow-Origin", "*") // 这是允许访问所有域
c.Header("Access-Control-Allow-Methods", "POST, GET, OPTIONS, PUT, DELETE,UPDATE") //服务器支持的所有跨域请求的方法,为了避免浏览次请求的多次'预检'请求 c.Header("Access-Control-Allow-Methods", "POST, GET, OPTIONS, PUT, DELETE,UPDATE") //服务器支持的所有跨域请求的方法,为了避免浏览次请求的多次'预检'请求
// header的类型 // header的类型
c.Header("Access-Control-Allow-Headers", "Authorization, Content-Length, X-CSRF-Token, Token, tokenC, session,X_Requested_With,Accept, Origin, Host, Connection, Accept-Encoding, Accept-Language,DNT, X-CustomHeader, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, Cache-Control, Content-Type, Pragma") c.Header("Access-Control-Allow-Headers", "Authorization, Content-Length, X-CSRF-Token, Token, tokenC, session,X_Requested_With,Accept, Origin, Host, Connection, Accept-Encoding, Accept-Language,DNT, X-CustomHeader, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, Cache-Control, Content-Type, Pragma, Upload-Offset")
// 允许跨域设置 可以返回其他子段 // 允许跨域设置 可以返回其他子段
c.Header("Access-Control-Expose-Headers", "Content-Length, Access-Control-Allow-Origin, Access-Control-Allow-Headers,Cache-Control,Content-Language,Content-Type,Expires,Last-Modified,Pragma,FooBar") // 跨域关键设置 让浏览器可以解析 c.Header("Access-Control-Expose-Headers", "Content-Length, Access-Control-Allow-Origin, Access-Control-Allow-Headers,Cache-Control,Content-Language,Content-Type,Expires,Last-Modified,Pragma,FooBar") // 跨域关键设置 让浏览器可以解析
c.Header("Access-Control-Max-Age", "172800") // 缓存请求信息 单位为秒 c.Header("Access-Control-Max-Age", "172800") // 缓存请求信息 单位为秒
c.Header("Access-Control-Allow-Credentials", "false") // 跨域请求是否需要带cookie信息 默认设置为true c.Header("Access-Control-Allow-Credentials", "false") // 跨域请求是否需要带cookie信息 默认设置为true
c.Set("content-type", "application/json") c.Set("content-type", c.ContentType())
//c.Header("Access-Control-Allow-Credentials", "true") // 跨域请求是否需要带cookie信息 默认设置为true //c.Header("Access-Control-Allow-Credentials", "true") // 跨域请求是否需要带cookie信息 默认设置为true
//c.Header("Access-Control-Request-Private-Network", "true") // 跨域请求是否需要带cookie信息 默认设置为true //c.Header("Access-Control-Request-Private-Network", "true") // 跨域请求是否需要带cookie信息 默认设置为true
//c.Header("Access-Control-Allow-Private-Network", "true") // 设置返回格式是json //c.Header("Access-Control-Allow-Private-Network", "true") // 设置返回格式是json

View File

@ -3,7 +3,6 @@ package middleware
import ( import (
"bytes" "bytes"
"io" "io"
"io/ioutil"
"log" "log"
"net" "net"
"net/http" "net/http"
@ -25,23 +24,16 @@ func NewLogger() gin.HandlerFunc {
latencyTime := endTime.Sub(startTime) // 请求方式 latencyTime := endTime.Sub(startTime) // 请求方式
path := c.Request.URL.Path path := c.Request.URL.Path
query := c.Request.URL.RawQuery query := c.Request.URL.RawQuery
if _, err := c.FormFile("file"); err != nil {
data, _ := ioutil.ReadAll(c.Request.Body)
log.Printf("[%s] %s %d %s %s %s %s %s %s", path, c.Request.Method, c.Writer.Status(), query,
string(data), c.ClientIP(), c.Request.UserAgent(), c.Errors.ByType(gin.ErrorTypePrivate).String(), latencyTime.String())
c.Request.Body = ioutil.NopCloser(bytes.NewBuffer(data))
}
val := c.GetHeader("Accept-Language")
if val == "" {
c.Request.Header.Set("Accept-Language", "zh-CN")
}
if _, err := c.FormFile("file"); err != nil { if _, err := c.FormFile("file"); err != nil {
data, _ := io.ReadAll(c.Request.Body) data, _ := io.ReadAll(c.Request.Body)
log.Printf("[%s] %s %d %s %s %s %s %s %s", path, c.Request.Method, c.Writer.Status(), query, log.Printf("[%s] %s %d %s %s %s %s %s %s", path, c.Request.Method, c.Writer.Status(), query,
string(data), c.ClientIP(), c.Request.UserAgent(), c.Errors.ByType(gin.ErrorTypePrivate).String(), latencyTime.String()) string(data), c.ClientIP(), c.Request.UserAgent(), c.Errors.ByType(gin.ErrorTypePrivate).String(), latencyTime.String())
c.Request.Body = ioutil.NopCloser(bytes.NewBuffer(data)) c.Request.Body = io.NopCloser(bytes.NewBuffer(data))
}
val := c.GetHeader("Accept-Language")
if val == "" {
c.Request.Header.Set("Accept-Language", "zh-CN")
} }
c.Next() c.Next()
} }

View File

@ -0,0 +1,7 @@
package bundle
type UserWorkConfirmReq struct {
WorkUuid string `json:"workUuid"`
ConfirmRemark string `json:"confirmRemark"`
ConfirmStatus int `json:"confirmStatus"` // 1确认 2 驳回
}

View File

@ -0,0 +1,25 @@
package cast
type ApprovalDetailResponse struct {
Status int `json:"status"`
Data Data `json:"data"`
Msg string `json:"msg"`
Code int `json:"code"`
Error *string `json:"error"`
Err string `json:"err"`
Keys []string `json:"keys"`
Positions *interface{} `json:"positions"`
}
type Data struct {
Count int `json:"Count"`
Data []Item `json:"data"`
Status int `json:"Status"`
}
type Item struct {
ID int `json:"ID"`
Domain string `json:"Domain"`
Status int `json:"Status"`
Reply string `json:"Reply"`
}

10
pkg/model/cast/media.go Normal file
View File

@ -0,0 +1,10 @@
package cast
type BalanceTypeEnum int32
// 定义枚举值
const (
BalanceTypeAccountValue BalanceTypeEnum = 1
BalanceTypeImageValue BalanceTypeEnum = 2
BalanceTypeVideoValue BalanceTypeEnum = 3
)

10
pkg/model/cast/oauth.go Normal file
View File

@ -0,0 +1,10 @@
package cast
type OAuthPlatformReq struct {
MediaAccountUuid string `json:"mediaAccountUuid" form:"mediaAccountUuid" binding:"required"`
PlatformID int `json:"platformID" form:"platformID" binding:"required"`
}
type OAuthPlatformResp struct {
Url string `json:"url"`
}

11
pkg/model/cast/work.go Normal file
View File

@ -0,0 +1,11 @@
package cast
const (
WorkStatusPending = 1 // 待提交
WorkStatusReviewing = 2 // 审核中
WorkStatusReviewFailed = 3 // 审核失败
WorkStatusArtistConfirming = 4 // 待艺人确认
WorkStatusArtistRejected = 5 // 艺人驳回
WorkStatusPublishSuccess = 6 // 发布成功
WorkStatusPublishFailed = 7 // 发布失败
)

5
pkg/model/query/cast.go Normal file
View File

@ -0,0 +1,5 @@
package query
type RemindReq struct {
WorkUuid string `json:"workUuid"`
}

18
pkg/router/app/media.go Normal file
View File

@ -0,0 +1,18 @@
package app
import (
"fonchain-fiee/pkg/middleware"
"fonchain-fiee/pkg/service"
serviceCast "fonchain-fiee/pkg/service/app/cast"
"github.com/gin-gonic/gin"
)
func MediaAppRouter(r *gin.RouterGroup) {
auth := r.Group("")
auth.Use(middleware.CheckLogin(service.AccountFieeProvider))
media := auth.Group("app/media")
{
media.POST("user-accounts", serviceCast.UserAccounts)
media.POST("work-list", serviceCast.MediaWorks)
}
}

View File

@ -4,6 +4,7 @@ import (
"fonchain-fiee/pkg/middleware" "fonchain-fiee/pkg/middleware"
"fonchain-fiee/pkg/service" "fonchain-fiee/pkg/service"
"fonchain-fiee/pkg/service/bundle" "fonchain-fiee/pkg/service/bundle"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
) )
@ -11,6 +12,7 @@ func BundleRouter(r *gin.RouterGroup) {
bundleRoute := r.Group("bundle") bundleRoute := r.Group("bundle")
bundleRoute.Use(middleware.CheckWebLogin(service.AccountProvider)) bundleRoute.Use(middleware.CheckWebLogin(service.AccountProvider))
bundleAppRoute := r.Group("bundle") bundleAppRoute := r.Group("bundle")
bundleAppNoAuthRoute := r.Group("bundle")
bundleAppRoute.Use(middleware.CheckLogin(service.AccountFieeProvider)) bundleAppRoute.Use(middleware.CheckLogin(service.AccountFieeProvider))
// 套餐 // 套餐
{ {
@ -20,13 +22,48 @@ func BundleRouter(r *gin.RouterGroup) {
bundleClientRoute.POST("update", bundle.UpdateBundle) bundleClientRoute.POST("update", bundle.UpdateBundle)
bundleClientRoute.POST("remove", bundle.DeleteBundle) bundleClientRoute.POST("remove", bundle.DeleteBundle)
bundleClientRoute.POST("bundle-list", bundle.BundleList) bundleClientRoute.POST("bundle-list", bundle.BundleList)
} bundleClientRoute.POST("add-value/only", bundle.OnlyAddValueListByOrderNo)
bundleAppRoute = bundleAppRoute.Group("common") bundleExtend := bundleClientRoute.Group("extend")
{
bundleExtend.POST("", bundle.BundleExtend)
bundleExtend.POST("list", bundle.BundleExtendRecordsList)
}
bundleBalance := bundleClientRoute.Group("balance")
{
bundleBalance.POST("list", bundle.GetBundleBalance)
bundleBalance.POST("used-record", bundle.GetUsedRecordList)
}
}
bundleClientRouteV2 := bundleRoute.Group("system/v2")
{ {
bundleAppRoute.POST("bundle-list", bundle.BundleList) bundleClientRouteV2.POST("save", bundle.SaveBundleV2)
bundleClientRouteV2.POST("update/shelfStatus", bundle.HandShelf)
bundleClientRouteV2.POST("bundle-list", bundle.BundleListV2)
bundleClientRouteV2.POST("bundle-detail", bundle.BundleDetailV2)
} }
bundleAppRouteV1 := bundleAppRoute.Group("common")
{
bundleAppRouteV1.POST("bundle-list", bundle.BundleList)
bundleAppRoute.POST("bundle-list", bundle.BundleList)
bundleAppRoute.POST("pending-confirmation-list", bundle.GetToBeComfirmedWorks) // 作品状态变更的待确认记录
bundleAppRoute.POST("confirm-cast-log", bundle.CastLogConfirm) // 对变更记录进行确认
bundleAppRoute.POST("balance", bundle.GetUserBalance)
bundleAppRoute.POST("work-detail", bundle.GetWorkDetail)
bundleAppRoute.POST("work-confirm", bundle.WorkConfirm)
}
bundleAppRouteV2 := bundleAppRoute.Group("app/system/v2")
{
bundleAppRouteV2.POST("add-value/only", bundle.OnlyAddValueListByOrderNo)
}
bundleAppNoAuthRouteV2 := bundleAppNoAuthRoute.Group("app/system/v2")
{
bundleAppNoAuthRouteV2.POST("bundle-list", bundle.BundleListH5V2)
bundleAppNoAuthRouteV2.POST("bundle-detail", bundle.BundleDetailV2)
}
} }
} }

View File

@ -12,17 +12,21 @@ func BundleOrderRouter(r *gin.RouterGroup) {
r.POST("/stripe-pay/callback", bundle.StripeCheckoutSessionWebhook) r.POST("/stripe-pay/callback", bundle.StripeCheckoutSessionWebhook)
r.POST("/antom/callback", bundle.AntomWebhook) // Antom回调 r.POST("/antom/callback", bundle.AntomWebhook) // Antom回调
r.POST("/home-page/roll", bundle.HomePageRoll)
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.Use(middleware.CheckWebLogin(service.AccountProvider)) bundleOrderWebRoute.Use(middleware.CheckWebLogin(service.AccountProvider))
// 套餐 // 套餐
{ {
bundleOrderClientWebRoute := bundleOrderRoute.Group("common/web") bundleOrderClientWebRoute := bundleOrderWebRoute.Group("common/web")
{ {
bundleOrderClientWebRoute.POST("bundle-order-list", bundle.OrderRecordsList) bundleOrderClientWebRoute.POST("bundle-order-list", bundle.OrderRecordsList)
bundleOrderClientWebRoute.POST("bundle-order-list-V2", bundle.OrderRecordsListV2)
bundleOrderClientWebRoute.POST("bundle-order-list-download", bundle.OrderRecordsListDownload)
bundleOrderClientWebRoute.POST("reconciliation-list", bundle.GetReconciliationList)
bundleOrderClientWebRoute.POST("reconciliation-list-download", bundle.GetReconciliationListDownload)
} }
bundleOrderClientAppRoute := bundleOrderRoute.Group("common/app") bundleOrderClientAppRoute := bundleOrderRoute.Group("common/app")
{ {
@ -31,13 +35,15 @@ func BundleOrderRouter(r *gin.RouterGroup) {
//bundleOrderWebRoute := bundleOrderRoute.Group("web") //bundleOrderWebRoute := bundleOrderRoute.Group("web")
{ {
bundleOrderRoute.POST("financial-confirm", bundle.UpdateFinancialConfirmationStatus) bundleOrderWebRoute.POST("financial-confirm", bundle.UpdateFinancialConfirmationStatus)
bundleOrderRoute.POST("order-export", bundle.ExportOrderInfo) bundleOrderWebRoute.POST("order-export", bundle.ExportOrderInfoOss)
} }
bundleOrderAppRoute := bundleOrderRoute.Group("app") bundleOrderAppRoute := bundleOrderRoute.Group("app")
{ {
bundleOrderAppRoute.POST("order-signature", bundle.CreateBundleOrderSignature) bundleOrderAppRoute.POST("order-signature", bundle.CreateBundleOrderSignature)
bundleOrderAppRoute.POST("order-add-signature", bundle.CreateBundleOrderAddSignature)
bundleOrderAppRoute.POST("order-del", bundle.DeleteBundleOrder)
bundleOrderAppRoute.POST("update-pay", bundle.UpdateBundleOrderStatusPaid) bundleOrderAppRoute.POST("update-pay", bundle.UpdateBundleOrderStatusPaid)
bundleOrderAppRoute.POST("order-detail", bundle.OrderRecordsDetail) bundleOrderAppRoute.POST("order-detail", bundle.OrderRecordsDetail)

39
pkg/router/media.go Normal file
View File

@ -0,0 +1,39 @@
package router
import (
"fonchain-fiee/pkg/middleware"
"fonchain-fiee/pkg/service"
serviceCast "fonchain-fiee/pkg/service/cast"
"github.com/gin-gonic/gin"
)
func MediaRouter(r *gin.RouterGroup) {
//noAuth := r.Group("")
auth := r.Group("")
auth.Use(middleware.CheckWebLogin(service.AccountProvider))
media := auth.Group("media")
{
media.POST("user-list", serviceCast.MediaUserList)
media.POST("unbind-manager", serviceCast.UnbindManager)
media.POST("bind-manager", serviceCast.BindManager)
media.POST("update-account", serviceCast.UpdateMediaAccount)
media.POST("oauth-url", serviceCast.OAuthUrl)
}
mediaNoLogin := r.Group("media")
{
mediaNoLogin.GET("oauth2callback", serviceCast.OAuth2Callback)
mediaNoLogin.GET("test", serviceCast.Test)
}
work := auth.Group("work")
{
work.POST("update-work-image", serviceCast.UpdateWorkImage)
work.POST("update-work-video", serviceCast.UpdateWorkVideo)
work.POST("update-approval", serviceCast.UpdateApproval)
work.POST("list", serviceCast.WorkList)
work.POST("detail", serviceCast.WorkDetail)
work.POST("republish", serviceCast.RePublish)
work.POST("delete", serviceCast.DelWork)
work.POST("remind", serviceCast.Remind)
}
}

View File

@ -2,11 +2,15 @@ package router
import ( import (
"fonchain-fiee/pkg/middleware" "fonchain-fiee/pkg/middleware"
"fonchain-fiee/pkg/router/app"
"fonchain-fiee/pkg/service" "fonchain-fiee/pkg/service"
"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/file"
"fonchain-fiee/pkg/service/governance"
"fonchain-fiee/pkg/service/lang" "fonchain-fiee/pkg/service/lang"
"fonchain-fiee/pkg/service/pressreleases"
"fonchain-fiee/pkg/service/qr" "fonchain-fiee/pkg/service/qr"
"fonchain-fiee/pkg/service/redirect" "fonchain-fiee/pkg/service/redirect"
"fonchain-fiee/pkg/service/upload" "fonchain-fiee/pkg/service/upload"
@ -46,7 +50,9 @@ func NewRouter() *gin.Engine {
BundleRouter(privateGroup) BundleRouter(privateGroup)
BundleOrderRouter(privateGroup) BundleOrderRouter(privateGroup)
ValueAddBundleRouter(privateGroup) ValueAddBundleRouter(privateGroup)
MediaRouter(privateGroup)
SecFilingRouter(privateGroup)
app.MediaAppRouter(privateGroup)
{ {
v1.POST("version", version.Version) //版本号公共 v1.POST("version", version.Version) //版本号公共
} }
@ -68,7 +74,7 @@ func NewRouter() *gin.Engine {
} }
webAcRouter := privateGroup.Group("/user") webAcRouter := privateGroup.Group("/user")
//webAcRouter.Use(middleware.CheckWebLogin(service.AccountProvider)) //webAcRouter.Use(middleware.CheckWebLogin(service.AccountProvider))
webAcRouter.Use(middleware.CheckLogin(service.AccountFieeProvider)) webAcRouter.Use(middleware.CheckWebLogin(service.AccountProvider))
{ {
webAcRouter.POST("list", account.UserList) //用户列表 webAcRouter.POST("list", account.UserList) //用户列表
webAcRouter.POST("approval", account.UserApproval) //实名审核 webAcRouter.POST("approval", account.UserApproval) //实名审核
@ -134,6 +140,50 @@ func NewRouter() *gin.Engine {
v1.POST("/aschat/test", asChat.Handler.Test) v1.POST("/aschat/test", asChat.Handler.Test)
} }
{
// 素材库
resourceRoute := v1.Group("/resource").Use(middleware.CheckWebLogin(service.AccountProvider))
resourceRoute.GET("", file.Info)
resourceRoute.DELETE("", file.Delete)
resourceRoute.PUT("", file.Action)
resourceRoute.POST("", file.Create)
resourceRoute.GET("/search", file.Search)
resourceRoute.POST("/upload", file.Upload)
resourceRoute.POST("/tus/create", file.TusCreate)
resourceRoute.POST("/tus/upload", file.TusUpload)
v1.Group("/resource").GET("/raw/*path", file.Raw)
resourceRoute.GET("/dir/raw", file.DirDownload)
resourceRoute.GET("/preview/:size/*path", file.Preview)
resourceRoute.GET("/list", file.List)
resourceRoute.GET("/usage", file.Usage)
}
{
// 官网文档
governanceRoute := v1.Group("/governance")
governanceRouteLogin := governanceRoute.Group("", middleware.CheckWebLogin(service.AccountProvider))
governanceRoute.GET("/display", middleware.Cors(), governance.Display)
governanceRouteLogin.POST("/list", governance.List)
governanceRouteLogin.POST("", governance.Create)
governanceRouteLogin.POST("/edit", governance.Edit)
governanceRouteLogin.POST("/delete", governance.Delete)
}
{
// 官网新闻
pressreleasesRoute := v1.Group("/pressreleases")
pressreleasesRouteLogin := pressreleasesRoute.Group("", middleware.CheckWebLogin(service.AccountProvider))
pressreleasesRoute.POST("/display", middleware.Cors(), pressreleases.Display)
pressreleasesRoute.GET("", middleware.Cors(), pressreleases.Get)
pressreleasesRouteLogin.POST("/list", pressreleases.List)
pressreleasesRouteLogin.POST("", pressreleases.Create)
pressreleasesRouteLogin.POST("/edit", pressreleases.Edit)
pressreleasesRouteLogin.POST("/delete", pressreleases.Delete)
}
//静态文件 //静态文件
r.StaticFS("/api/static", http.Dir("./runtime")) r.StaticFS("/api/static", http.Dir("./runtime"))
r.NoRoute(func(c *gin.Context) { r.NoRoute(func(c *gin.Context) {

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

@ -0,0 +1,35 @@
package router
import (
"fonchain-fiee/pkg/middleware"
"fonchain-fiee/pkg/service"
"fonchain-fiee/pkg/service/secfilings"
"github.com/gin-gonic/gin"
)
func SecFilingRouter(r *gin.RouterGroup) {
SecFilingRouter := r.Group("sec-filing")
SecNoAuthRouter := r.Group("sec-filing")
SecFilingRouter.Use(middleware.CheckWebLogin(service.AccountProvider))
// sec-filing
secFilingRoute := SecFilingRouter.Group("system")
{
secFilingRoute.POST("create", secfilings.CreateSecFiling)
secFilingRoute.POST("update", secfilings.UpdateSecFiling)
secFilingRoute.POST("list", secfilings.ListSecFiling)
secFilingRoute.POST("detail", secfilings.DetailSecFiling)
secFilingRoute.POST("delete", secfilings.DeleteSecFiling)
secFilingRoute.POST("get", secfilings.GetSecFilings)
secFilingRoute.POST("update/status", secfilings.UpdateSecFilingStatus)
secFilingRoute.POST("form/list", secfilings.GetFormList)
}
secNoAUthRouter := SecNoAuthRouter.Group("web")
{
secNoAUthRouter.POST("list", secfilings.WebListSecFiling)
secNoAUthRouter.POST("detail", secfilings.DetailSecFiling)
}
}

View File

@ -23,10 +23,22 @@ func ValueAddBundleRouter(r *gin.RouterGroup) {
bundleClientRoute.POST("list", bundle.ValueAddBundleList) bundleClientRoute.POST("list", bundle.ValueAddBundleList)
bundleClientRoute.POST("detail", bundle.ValueAddBundleDetail) bundleClientRoute.POST("detail", bundle.ValueAddBundleDetail)
} }
bundleClientRouteV2 := valueAddBundleRoute.Group("system/v2")
valueAddBundleAppRoute = valueAddBundleAppRoute.Group("system")
{ {
valueAddBundleAppRoute.POST("list", bundle.ValueAddBundleList) bundleClientRouteV2.POST("save", bundle.SaveValueAddService)
bundleClientRouteV2.POST("list", bundle.ValueAddServiceList)
bundleClientRouteV2.POST("detail", bundle.ValueAddServiceDetail)
}
valueAddBundleAppRouteV1 := valueAddBundleAppRoute.Group("system")
{
valueAddBundleAppRouteV1.POST("list", bundle.ValueAddBundleList)
}
valueAddBundleAppRouteV2 := valueAddBundleAppRoute.Group("system/v2")
{
valueAddBundleAppRouteV2.POST("list", bundle.ValueAddServiceList)
valueAddBundleAppRouteV2.POST("detail", bundle.ValueAddServiceDetail)
valueAddBundleAppRouteV2.POST("detail/lang", bundle.ValueAddServiceLangDetail)
} }
} }

View File

@ -156,7 +156,7 @@ func SendMsg(c *gin.Context) {
service.Error(c, err) service.Error(c, err)
return return
} }
service.Success(c, res) service.Success1(c, "发送成功", res)
return return
} else { } else {
res, err := service.AccountFieeProvider.SendMsg(context.Background(), &req) res, err := service.AccountFieeProvider.SendMsg(context.Background(), &req)
@ -165,7 +165,7 @@ func SendMsg(c *gin.Context) {
return return
} }
service.Success(c, res) service.Success1(c, "发送成功", res)
return return
} }

View File

@ -0,0 +1,57 @@
package cast
import (
"fmt"
"fonchain-fiee/api/cast"
"fonchain-fiee/cmd/config"
"fonchain-fiee/pkg/model/login"
"fonchain-fiee/pkg/service"
"github.com/gin-gonic/gin"
)
func UserAccounts(ctx *gin.Context) {
var req *cast.MediaAccountsReq = &cast.MediaAccountsReq{}
var err error
if config.AppConfig.System.AppMode != "dev" {
userInfo := login.GetUserInfoFromC(ctx)
req.ArtistUuid = fmt.Sprint(userInfo.ID)
} else {
req.ArtistUuid = "61"
}
if err = ctx.ShouldBind(&req); err != nil {
service.Error(ctx, err)
return
}
if err = req.Validate(); err != nil {
service.Error(ctx, err)
return
}
resp, err := service.CastProvider.MediaAccounts(ctx, req)
if err != nil {
service.Error(ctx, err)
return
}
service.Success(ctx, resp)
return
}
func MediaWorks(ctx *gin.Context) {
var req *cast.MediaWorksReq
var err error
if err = ctx.ShouldBind(&req); err != nil {
service.Error(ctx, err)
return
}
if err = req.Validate(); err != nil {
service.Error(ctx, err)
return
}
resp, err := service.CastProvider.MediaWorks(ctx, req)
if err != nil {
service.Error(ctx, err)
return
}
service.Success(ctx, resp)
return
}

View File

@ -24,7 +24,6 @@ import (
"fonchain-fiee/pkg/service/asChat/logic" "fonchain-fiee/pkg/service/asChat/logic"
"fonchain-fiee/pkg/service/asChat/robot" "fonchain-fiee/pkg/service/asChat/robot"
"fonchain-fiee/pkg/service/upload" "fonchain-fiee/pkg/service/upload"
"fonchain-fiee/pkg/utils"
"fonchain-fiee/pkg/utils/stime" "fonchain-fiee/pkg/utils/stime"
"io" "io"
"log" "log"
@ -266,7 +265,7 @@ func (cr ChatHandler) MessageList(c *gin.Context) {
var returnDataIdList = make([]int64, 0) var returnDataIdList = make([]int64, 0)
defer func() { defer func() {
//获取最新数据时,重置新消息数量统计 //获取最新数据时,重置新消息数量统计
if request.Direction == 2 || request.Recent { if request.Direction == 1 || request.Recent {
cr.cache.ResetNewMessageTotal(accessUser.ID, request.SessionId) cr.cache.ResetNewMessageTotal(accessUser.ID, request.SessionId)
} }
//设置消息已被客服阅读,当客服重新通过通过websocket连接时这些消息将不被纳入新消息数量统计 //设置消息已被客服阅读,当客服重新通过通过websocket连接时这些消息将不被纳入新消息数量统计
@ -503,9 +502,22 @@ func (cr ChatHandler) UserMessageStat(c *gin.Context) {
} }
} }
if result[i].Name == "" { if result[i].Name == "" {
result[i].Name = beautifulZeroNameWithPhone(result[i].Name, result[i].UserId) result[i].Name = logic.BeautifulZeroNameWithPhone(result[i].Name, result[i].UserId)
} }
} }
//筛选
if request.Account != "" || request.Name != "" {
newData := []dto.UserMsgStatic{}
for _, v := range listRes.List {
for _, vv := range result {
if v.UserId == vv.UserId {
vv := vv
newData = append(newData, vv)
}
}
}
result = newData
}
reverse(result) reverse(result)
if chatUser.Role == 1 { if chatUser.Role == 1 {
userSessionId := fmt.Sprintf("%d", chatUser.ID) userSessionId := fmt.Sprintf("%d", chatUser.ID)
@ -600,36 +612,3 @@ func (cr ChatHandler) UserDetail(c *gin.Context) {
service.Success(c, detail) service.Success(c, detail)
} }
// 对没有名字的name进行优化
func beautifulZeroName(name string, userId int64) string {
return utils.IfGec(name == "", fmt.Sprintf("未实名用户:%d", userId), name)
}
var userIdMapPhone = make(map[int64]string)
func beautifulZeroNameWithPhone(name string, userId int64) string {
var ctx = context.Background()
if name == "" {
telNum, ok := userIdMapPhone[userId]
if ok {
return telNum
}
chatUserRes, err := service.AccountFieeProvider.GetChatUserDetail(ctx, &accountFiee.GetChatUserByIdRequest{Id: userId})
if err != nil {
return fmt.Sprintf("未实名用户:%d", userId)
} else {
if userRes, errs := service.AccountFieeProvider.Info(ctx, &accountFiee.InfoRequest{
Domain: chatUserRes.Origin,
ID: uint64(chatUserRes.OriginId),
Scene: "",
}); errs != nil {
return fmt.Sprintf("未实名用户:%d", userId)
} else {
userIdMapPhone[userId] = userRes.TelNum
return userRes.TelNum
}
}
}
return name
}

View File

@ -54,7 +54,8 @@ func NewMessage(ctx context.Context, cache *chatCache.ChatCache, sender *account
//存储入库 //存储入库
if sender.NickName == "" { if sender.NickName == "" {
sender.NickName = fmt.Sprintf("未知用户(%d)", sender.ID) //sender.NickName = fmt.Sprintf("未知用户(%d)", sender.ID)
sender.NickName = BeautifulZeroNameWithPhone(sender.NickName, sender.ID)
} }
fmt.Println("NewMessage 3333333333333333333333333333333333") fmt.Println("NewMessage 3333333333333333333333333333333333")
var data = accountFiee.ChatRecordData{ var data = accountFiee.ChatRecordData{

View File

@ -0,0 +1,42 @@
package logic
import (
"context"
"fmt"
"fonchain-fiee/api/accountFiee"
"fonchain-fiee/pkg/service"
"fonchain-fiee/pkg/utils"
)
// 对没有名字的name进行优化
func beautifulZeroName(name string, userId int64) string {
return utils.IfGec(name == "", fmt.Sprintf("未实名用户:%d", userId), name)
}
var userIdMapPhone = make(map[int64]string)
func BeautifulZeroNameWithPhone(name string, userId int64) string {
var ctx = context.Background()
if name == "" {
telNum, ok := userIdMapPhone[userId]
if ok {
return telNum
}
chatUserRes, err := service.AccountFieeProvider.GetChatUserDetail(ctx, &accountFiee.GetChatUserByIdRequest{Id: userId})
if err != nil {
return fmt.Sprintf("未实名用户:%d", userId)
} else {
if userRes, errs := service.AccountFieeProvider.Info(ctx, &accountFiee.InfoRequest{
Domain: chatUserRes.Origin,
ID: uint64(chatUserRes.OriginId),
Scene: "",
}); errs != nil {
return fmt.Sprintf("未实名用户:%d", userId)
} else {
userIdMapPhone[userId] = userRes.TelNum
return userRes.TelNum
}
}
}
return name
}

View File

@ -0,0 +1,250 @@
package bundle
import (
"context"
"errors"
"fonchain-fiee/api/bundle"
"fonchain-fiee/api/cast"
"fonchain-fiee/pkg/service"
"strconv"
bundleModel "fonchain-fiee/pkg/model/bundle"
"fonchain-fiee/pkg/model/login"
"github.com/gin-gonic/gin"
)
func BundleExtend(c *gin.Context) {
var req bundle.BundleExtendRequest
userInfo := login.GetUserInfoFromC(c)
req.Type = 1 // 设置未手动扩展'
req.OperatorName = userInfo.Name
req.OperatorPhoneNumber = userInfo.TelNum
req.OperatorId = userInfo.ID
if err := c.ShouldBindJSON(&req); err != nil {
service.Error(c, err)
return
}
res, err := service.BundleProvider.BundleExtend(context.Background(), &req)
if err != nil {
service.Error(c, err)
return
}
service.Success(c, res)
}
func BundleExtendRecordsList(c *gin.Context) {
var req bundle.BundleExtendRecordsListRequest
if err := c.ShouldBindJSON(&req); err != nil {
service.Error(c, err)
return
}
res, err := service.BundleProvider.BundleExtendRecordsList(context.Background(), &req)
if err != nil {
service.Error(c, err)
return
}
service.Success(c, res)
}
func GetBundleBalance(c *gin.Context) {
var req bundle.GetBundleBalanceListReq
if err := c.ShouldBindJSON(&req); err != nil {
service.Error(c, err)
return
}
res, err := service.BundleProvider.GetBundleBalanceList(context.Background(), &req)
if err != nil {
service.Error(c, err)
return
}
service.Success(c, res)
}
func GetUsedRecordList(c *gin.Context) {
var req bundle.GetUsedRecordListReq
if err := c.ShouldBindJSON(&req); err != nil {
service.Error(c, err)
return
}
res, err := service.BundleProvider.GetUsedRecordList(context.Background(), &req)
if err != nil {
service.Error(c, err)
return
}
service.Success(c, res)
}
func GetWorkDetail(c *gin.Context) {
var req cast.WorkDetailReq
if err := c.ShouldBindJSON(&req); err != nil {
service.Error(c, err)
return
}
// userInfo := login.GetUserInfoFromC(c)
// res, err := service.BundleProvider.GetBundleBalanceByUserId(context.TODO(), &bundle.GetBundleBalanceByUserIdReq{
// UserId: int32(userInfo.ID),
// })
// if err != nil {
// service.Error(c, err)
// return
// }
// if res.ExpiredTime <= time.Now().UnixMilli() {
// service.Success(c, gin.H{
// "status": 1,
// "message": "套餐过期请重新购买",
// })
// return
// }
workRes, err := service.CastProvider.WorkDetail(context.Background(), &req)
if err != nil {
service.Error(c, err)
return
}
// if len(workRes.Images) > 0 && res.ImageConsumptionNumber >= res.ImageNumber { // 图片用尽
// service.Success(c, gin.H{
// "status": 2,
// "message": "增值服务已用尽",
// })
// return
// } else {
// if res.VideoConsumptionNumber >= res.VideoNumber { // 视频用尽
// service.Success(c, gin.H{
// "status": 2,
// "message": "增值服务已用尽",
// })
// return
// }
// }
service.Success(c, workRes)
}
func GetToBeComfirmedWorks(c *gin.Context) {
var req bundle.ToBeComfirmedWorksReq
if err := c.ShouldBindJSON(&req); err != nil {
service.Error(c, err)
return
}
userInfo := login.GetUserInfoFromC(c)
req.ArtistUuid = strconv.Itoa(int(userInfo.ID))
res, err := service.BundleProvider.ToBeComfirmedWorks(context.Background(), &req)
if err != nil {
service.Error(c, err)
return
}
service.Success(c, res)
}
func GetUserBalance(c *gin.Context) {
userInfo := login.GetUserInfoFromC(c)
res, err := service.BundleProvider.GetBundleBalanceByUserId(context.Background(), &bundle.GetBundleBalanceByUserIdReq{
UserId: int32(userInfo.ID),
})
if err != nil {
service.Error(c, err)
return
}
service.Success(c, res)
}
func WorkConfirm(c *gin.Context) { // 确认作品并扣除余量
var req bundleModel.UserWorkConfirmReq
if err := c.ShouldBindJSON(&req); err != nil {
service.Error(c, err)
return
}
if req.ConfirmStatus == 2 { // 驳回完直接结束
res, err := service.CastProvider.UpdateStatus(c, &cast.UpdateStatusReq{
WorkAction: cast.WorkActionENUM_CONFIRM,
WorkUuid: req.WorkUuid,
ConfirmRemark: req.ConfirmRemark,
ConfirmStatus: 2,
})
if err != nil {
service.Error(c, err)
return
}
service.Success(c, res)
return
}
userInfo := login.GetUserInfoFromC(c)
balanceInfoRes, err := service.BundleProvider.GetBundleBalanceByUserId(context.Background(), &bundle.GetBundleBalanceByUserIdReq{
UserId: int32(userInfo.ID),
})
if err != nil {
service.Error(c, err)
return
}
wordInfoRes, err := service.CastProvider.WorkDetail(c, &cast.WorkDetailReq{
WorkUuid: req.WorkUuid,
})
if err != nil {
service.Error(c, err)
return
}
if wordInfoRes.WorkStatus != 4 {
service.Error(c, errors.New("作品不是待确认状态"))
return
}
var workCategory = wordInfoRes.WorkCategory
var addBalanceReq bundle.AddBundleBalanceReq
addBalanceReq.UserId = int32(userInfo.ID)
switch workCategory {
case 1:
{
if balanceInfoRes.ImageConsumptionNumber >= balanceInfoRes.ImageNumber { // 图文余量不足
service.Error(c, errors.New("图文余量不足"))
return
}
addBalanceReq.ImageConsumptionNumber = 1
}
case 2:
{
if balanceInfoRes.VideoConsumptionNumber >= balanceInfoRes.VideoNumber { // 视频余量不足
service.Error(c, errors.New("视频余量不足"))
return
}
addBalanceReq.VideoConsumptionNumber = 1
}
default:
service.Error(c, errors.New("不支持的类型"))
return
}
_, err = service.BundleProvider.AddBundleBalance(c, &addBalanceReq)
if err != nil {
service.Error(c, err)
return
}
res, err := service.CastProvider.UpdateStatus(c, &cast.UpdateStatusReq{
WorkAction: cast.WorkActionENUM_CONFIRM,
WorkUuid: req.WorkUuid,
ConfirmRemark: req.ConfirmRemark,
ConfirmStatus: 1,
})
if err != nil {
service.Error(c, err)
return
}
service.Success(c, res)
}
func CastLogConfirm(ctx *gin.Context) {
var req bundle.ConfirmWorkReq
if err := ctx.ShouldBindJSON(&req); err != nil {
service.Error(ctx, err)
return
}
res, err := service.BundleProvider.ConfirmWork(context.Background(), &req)
if err != nil {
service.Error(ctx, err)
return
}
service.Success(ctx, res)
}

View File

@ -12,16 +12,186 @@ import (
"fonchain-fiee/pkg/service/bundle/common" "fonchain-fiee/pkg/service/bundle/common"
"fonchain-fiee/pkg/service/bundle/logic" "fonchain-fiee/pkg/service/bundle/logic"
bundleModel "fonchain-fiee/pkg/service/bundle/model" bundleModel "fonchain-fiee/pkg/service/bundle/model"
"math/big" "fonchain-fiee/pkg/service/upload"
"strconv" "github.com/360EntSecGroup-Skylar/excelize"
"strings"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/gin-gonic/gin/binding" "github.com/gin-gonic/gin/binding"
"strconv"
"strings"
"time"
) )
func DeleteBundleOrder(c *gin.Context) {
var req bundle.DeleteValueAddServiceRequest
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
service.Error(c, err)
return
}
userInfo := login.GetUserInfoFromC(c)
req.UserID = userInfo.ID
res, err := service.BundleProvider.DeleteValueAddService(context.Background(), &req)
if err != nil {
service.Error(c, err)
return
}
service.Success(c, res)
return
}
func CreateBundleOrderAddSignature(c *gin.Context) {
var req bundle.OrderAddRecord
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
service.Error(c, err)
return
}
if req.Language == "" {
req.Language = c.GetHeader("Accept-Language")
if req.Language == "" {
service.Error(c, errors.New(common.MissLanguageTypes))
return
}
}
if req.BundleUuid == "" {
service.Error(c, errors.New(common.MissOrderNo))
return
}
// 获取用户信息
userInfo := login.GetUserInfoFromC(c)
if msg, exists := map[int32]string{
1: common.Unnamed,
2: common.UnderReview,
3: common.ReviewFailed,
}[userInfo.Status]; userInfo.Status != 4 {
if exists {
service.Error(c, errors.New(msg))
} else {
service.Error(c, errors.New(common.UnknownStatus))
}
return
}
// 校验套餐是否已购买
orderRecordReq := bundle.OrderRecordsDetailRequest{
BundleUUID: req.BundleUuid,
CustomerID: strconv.FormatUint(userInfo.ID, 10),
}
orderRecordResp, err := service.BundleProvider.OrderRecordsDetail(context.Background(), &orderRecordReq)
if err != nil {
service.Error(c, err)
return
}
if orderRecordResp.OrderRecord.ExpirationTime == "" || orderRecordResp.OrderRecord.ExpirationTime < time.Now().Format("2006-01-02") {
service.Error(c, errors.New(common.ThePackageHasExpired))
return
}
// 获取套餐详情(待替换逻辑)
//bundleDetail, err := service.BundleProvider.BundleDetail(context.Background(), &bundle.BundleDetailRequest{
// Uuid: req.BundleUuid,
//})
//if err != nil {
// service.Error(c, err)
// return
//}
// todo 需要判断购买的增值服务是否为可用时长 如果为可以用时长 合同截止日期为购买时长时间 否则合同截止日期为主套餐截止日期
// 处理多个增值服务
type ValueAddServiceInfo struct {
Service *bundle.ValueAddServiceLang
Options *bundle.ValueAddPriceOptions
ID int32
}
// 计算总金额和确定截止日期
//var expirationDate string
var addPriceList []*bundle.AddPriceOptionsInfo
var totalAmount float32
for _, svc := range req.AddPriceOptionsList {
valueAddInfo, err := service.BundleProvider.ValueAddServiceLangByUuidAndLanguage(context.Background(), &bundle.ValueAddServiceDetailRequest{
Uuid: svc.ValueUid,
Language: req.Language,
})
if err != nil {
service.Error(c, err)
return
}
valuePrice, err := service.BundleProvider.CalculatePrice(context.Background(), &bundle.CalculatePriceRequest{
Uuid: svc.ValueUid,
Num: svc.Num,
Language: req.Language,
})
if err != nil {
service.Error(c, err)
return
}
totalAmount += valuePrice.Price
addPriceList = append(addPriceList, &bundle.AddPriceOptionsInfo{
ValueUid: valueAddInfo.Uuid,
ServiceType: valueAddInfo.ServiceType,
CurrencyType: valueAddInfo.PriceType,
Amount: valuePrice.Price,
Num: svc.Num,
Unit: valueAddInfo.Unit,
})
// 如果是可用时长服务,计算新的截止日期 todo 不需要计算到期时间 在完成支付时添加
/*if valueAddInfo.ServiceType == 5 {
endDate := orderRecordResp.OrderRecord.ExpirationTime
if endDate == "9999-12-31" {
service.Error(c, errors.New(common.ErrorPermanentPackage))
return
}
t, err := time.Parse("2006-01-02", endDate)
if err != nil {
fmt.Println("解析时间出错:", err)
return
}
newDeadline := calculateExpirationDate(t, svc.Num, valueAddInfo.Unit)
expirationDate = newDeadline
//}
}*/
}
// 如果没有可用时长服务,使用主套餐截止日期
//if expirationDate == "" {
// expirationDate = orderRecordResp.OrderRecord.ExpirationTime
//}
req.CustomerNum = userInfo.SubNum
req.CustomerName = userInfo.Name
req.CustomerID = strconv.FormatUint(userInfo.ID, 10)
req.Source = 2
//req.SignedTime = common.GetBeijingTime()
//req.ExpirationDate = expirationDate
req.AddPriceOptionsList = addPriceList
req.OrderUUID = orderRecordResp.OrderRecord.Uuid
// 当前 未将 签名 写入合同中 todo 购买增值服务取消签约合同
//signContract, signContractErr := logic.SignContractV2(req.CustomerNum, bundleDetail.Bundle.Contract, totalAmount, expirationDate)
//if signContractErr != nil {
// service.Error(c, signContractErr)
// return
//}
//req.SignContract = signContract
// 创建增值服务订单记录
res, err := service.BundleProvider.CreateOrderAddRecord(context.Background(), &req)
if err != nil {
service.Error(c, err)
return
}
service.Success(c, res)
}
// 计算截止日期辅助函数
func calculateExpirationDate(startDate time.Time, num int32, unit string) string {
//now := time.Now()
switch unit {
case "天":
return startDate.AddDate(0, 0, int(num)).Format("2006-01-02")
case "月":
return startDate.AddDate(0, int(num), 0).Format("2006-01-02")
case "年":
return startDate.AddDate(int(num), 0, 0).Format("2006-01-02")
default:
return ""
}
}
func CreateBundleOrderSignature(c *gin.Context) { func CreateBundleOrderSignature(c *gin.Context) {
var req bundle.OrderRecord var req bundle.OrderCreateRecord
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil { if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
service.Error(c, err) service.Error(c, err)
@ -32,16 +202,34 @@ func CreateBundleOrderSignature(c *gin.Context) {
service.Error(c, errors.New(common.MissBundleUUID)) service.Error(c, errors.New(common.MissBundleUUID))
return return
} }
if req.Language == "" {
req.Language = c.GetHeader("Accept-Language")
if req.Language == "" {
service.Error(c, errors.New(common.MissLanguageTypes))
return
}
}
// 不去校验 签名 // 不去校验 签名
/*if req.Signature == "" { /*if req.Signature == "" {
service.Error(c, errors.New(common.MissOrderSignature)) service.Error(c, errors.New(common.MissOrderSignature))
return return
}*/ }*/
statusMessages := map[int32]string{
1: common.Unnamed,
2: common.UnderReview,
3: common.ReviewFailed,
}
// 获取 用户信息 // 获取 用户信息
userInfo := login.GetUserInfoFromC(c) userInfo := login.GetUserInfoFromC(c)
if userInfo.Status != 4 {
if msg, exists := statusMessages[userInfo.Status]; exists {
service.Error(c, errors.New(msg))
return
} else {
service.Error(c, errors.New(common.UnknownStatus))
return
}
}
// 校验 当前用户只能买一次套餐 // 校验 当前用户只能买一次套餐
orderRecordsListReq := bundle.OrderRecordsRequest{ orderRecordsListReq := bundle.OrderRecordsRequest{
CustomerID: strconv.FormatUint(userInfo.ID, 10), CustomerID: strconv.FormatUint(userInfo.ID, 10),
@ -51,10 +239,14 @@ func CreateBundleOrderSignature(c *gin.Context) {
service.Error(c, orderRecordsListErr) service.Error(c, orderRecordsListErr)
return return
} }
//有套餐并且套餐未过期
if orderRecordsList.OrderRecords != nil { if orderRecordsList.OrderRecords != nil {
for _, order := range orderRecordsList.OrderRecords { for _, orderInfo := range orderRecordsList.OrderRecords {
if order.CustomerID == strconv.FormatUint(userInfo.ID, 10) { if orderInfo.CustomerID == strconv.FormatUint(userInfo.ID, 10) && orderInfo.Status == 1 {
service.Error(c, errors.New(common.ThereAreOutstandingOrders))
return
}
if orderInfo.CustomerID == strconv.FormatUint(userInfo.ID, 10) && orderInfo.ExpirationTime > time.Now().Format("2006-01-02 15:04:05") {
service.Error(c, errors.New(common.HadOrder)) service.Error(c, errors.New(common.HadOrder))
return return
} }
@ -71,84 +263,89 @@ func CreateBundleOrderSignature(c *gin.Context) {
service.Error(c, lastOrderRecordErr) service.Error(c, lastOrderRecordErr)
return return
} }
lastContractNo := "" lastContractNo := ""
if lastOrderRecord.OrderRecords != nil { if lastOrderRecord.OrderRecords != nil {
for _, lastOrder := range lastOrderRecord.OrderRecords { for _, lastOrder := range lastOrderRecord.OrderRecords {
lastContractNo = lastOrder.ContractNo lastContractNo = lastOrder.ContractNo
} }
} }
req.CustomerNum = userInfo.SubNum
req.CustomerName = userInfo.Name
req.CustomerID = strconv.FormatUint(userInfo.ID, 10)
// 获取 套餐信息 // 获取 套餐信息
bundleDetailReq := &bundle.BundleDetailRequest{ bundleDetailReq := &bundle.BundleDetailRequest{
Uuid: req.BundleUuid, Uuid: req.BundleUuid,
Language: req.Language,
} }
bundleDetail, detailErr := service.BundleProvider.BundleDetail(context.Background(), bundleDetailReq) bundleDetail, detailErr := service.BundleProvider.BundleLangDetailV2(context.Background(), bundleDetailReq)
if detailErr != nil { if detailErr != nil {
service.Error(c, detailErr) service.Error(c, detailErr)
return return
} }
//获取过期时间和增值服务金额
//获取增值套餐信息 var addRecords []*bundle.OrderCreateAddRecord
if req.ValueAddBundleUuid != "" { var addTotalPrice float32
valueAddBundleDetail, err := service.BundleProvider.ValueAddBundleDetail(context.Background(), &bundle.ValueAddBundleDetailRequest{ var expirationDay string
Uuid: req.ValueAddBundleUuid, for _, i := range req.AddRecords {
price, err := service.BundleProvider.CalculatePrice(context.Background(), &bundle.CalculatePriceRequest{
Uuid: i.ValueUid,
Num: i.Num,
Language: req.Language,
}) })
if err != nil { if err != nil {
service.Error(c, err) service.Error(c, err)
return return
} }
addTotalPrice += price.Price
req.ValueAddBundleUuid = valueAddBundleDetail.Data.Uuid addService, err := service.BundleProvider.ValueAddServiceLangByUuidAndLanguage(context.Background(), &bundle.ValueAddServiceDetailRequest{
req.ValueAddOriginalPrice = valueAddBundleDetail.Data.OriginalPrice Uuid: i.ValueUid,
req.ValueAddDiscountPrice = valueAddBundleDetail.Data.DiscountPrice Language: req.Language,
req.AddBundleCommonUid = valueAddBundleDetail.Data.AddBundleCommonUid })
if err != nil {
if valueAddBundleDetail.Data.Choose { // 可选条数 service.Error(c, err)
req.ValueAddBundleAmount = valueAddBundleDetail.Data.DiscountPrice * float32(req.Num) return
discount, _ := new(big.Float).Sub(big.NewFloat(float64(valueAddBundleDetail.Data.OriginalPrice)), big.NewFloat(float64(valueAddBundleDetail.Data.DiscountPrice))).Float32() }
req.ValueAddSavedAmount = discount * float32(req.Num) addRecords = append(addRecords, &bundle.OrderCreateAddRecord{
} else { // 固定条数 ServiceType: addService.ServiceType,
req.ValueAddBundleAmount = valueAddBundleDetail.Data.TotalPrice ValueUid: i.ValueUid,
req.ValueAddSavedAmount = valueAddBundleDetail.Data.SavedAmount CurrencyType: addService.PriceType,
Amount: price.Price,
Num: i.Num,
Unit: addService.Unit,
Source: 1,
PaymentStatus: 1,
})
//服务类型为时长 计算
if addService.ServiceType == 5 {
expirationDay = calculateExpirationDate(time.Now(), i.Num, addService.Unit)
} else {
expirationDay = time.Now().AddDate(0, 0, 7).Format("2006-01-02")
} }
req.TotalAmount, _ = new(big.Float).Add(big.NewFloat(float64(req.ValueAddBundleAmount)), big.NewFloat(float64(bundleDetail.Bundle.Price))).Float32()
} }
// 当前 未将 签名 写入合同中 todo 金额和有效时间待修改
req.BundleName = bundleDetail.Bundle.Name signContract, signContractErr := logic.SignContractV2(req.CustomerNum, bundleDetail.Contract, addTotalPrice, expirationDay)
req.Amount = bundleDetail.Bundle.Price
req.AmountType = bundleDetail.Bundle.PriceType
req.BundleCommonUid = bundleDetail.Bundle.BundleCommonUid
req.TotalAmount = req.Amount + req.ValueAddBundleAmount
req.PayType = 1 // 默认 人民币
req.ContractNo = common.GenerateContractNo(lastContractNo)
// 当前 未将 签名 写入合同中
signContract, signContractErr := logic.SignContractV2(req.CustomerNum, bundleDetail.Bundle.Contract, req.TotalAmount, bundleDetail.Bundle.ContractDuration)
if signContractErr != nil { if signContractErr != nil {
service.Error(c, signContractErr) service.Error(c, signContractErr)
return return
} }
req.CustomerNum = userInfo.SubNum
req.CustomerName = userInfo.Name
req.CustomerID = strconv.FormatUint(userInfo.ID, 10)
req.BundleName = bundleDetail.Name
req.Amount = bundleDetail.Price
req.AmountType = bundleDetail.PriceType
//req.BundleCommonUid = bundleDetail.BundleCommonUid
req.TotalAmount = bundleDetail.Price + addTotalPrice
req.ContractNo = common.GenerateContractNo(lastContractNo)
req.SignContract = signContract req.SignContract = signContract
req.SignedTime = common.GetBeijingTime() req.SignedTime = common.GetBeijingTime()
req.Status = bundleModel.OrderSigned req.Status = bundleModel.OrderSigned
req.AddRecords = addRecords
//req.ExpirationTime = expirationDay //过期日期取消 在完成支付是更新
req.PayType = 1
res, err := service.BundleProvider.CreateOrderRecord(context.Background(), &req) res, err := service.BundleProvider.CreateOrderRecord(context.Background(), &req)
if err != nil { if err != nil {
service.Error(c, err) service.Error(c, err)
return return
} }
service.Success(c, res) service.Success(c, res)
} }
@ -230,7 +427,266 @@ func UpdateBundleOrderStatusPaid(c *gin.Context) {
service.Success(c, nil) service.Success(c, nil)
} }
func OrderRecordsListV2(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 {
// 收集订单里的所有用户ID
userIdSet := make(map[int64]struct{})
for _, i := range orderList.BundleInfo {
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 orderList.BundleInfo {
if u, ok := userMap[item.CustomerId]; ok {
item.CustomerName = u.Name
item.TelNum = u.TelNum
}
}
}
service.Success(c, orderList)
}
func OrderRecordsListDownload(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 {
// 收集订单里的所有用户ID
userIdSet := make(map[int64]struct{})
for _, i := range orderList.BundleInfo {
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 orderList.BundleInfo {
if u, ok := userMap[item.CustomerId]; ok {
item.CustomerName = u.Name
item.TelNum = u.TelNum
}
}
}
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) {
f := excelize.NewFile()
sheetName := "Sheet1"
f.SetSheetName("Sheet1", sheetName)
headers := []string{
"套餐订单号", "套餐类型", "套餐付款状态", "艺人手机号", "艺人", "套餐订单创建时间", "套餐支付时间", "套餐金额",
"增值服务订单号", "增值税服务金额", "结算金额", "币种", "手续费", "增值订单创建时间", "增值付款状态",
}
for i, h := range headers {
cell := fmt.Sprintf("%s%d", string(rune('A'+i)), 1)
f.SetCellValue(sheetName, cell, h)
}
rowIndex := 2
for _, bundleInfo := range orderList {
addCount := len(bundleInfo.AddBundleInfo)
mergeRows := 1
if addCount > 1 {
mergeRows = addCount
}
// 写入主订单信息并合并单元格
for i := 0; i < 7; i++ {
col := string(rune('A' + i))
startCell := fmt.Sprintf("%s%d", col, rowIndex)
endCell := fmt.Sprintf("%s%d", col, rowIndex+mergeRows-1)
if mergeRows > 1 {
f.MergeCell(sheetName, startCell, endCell)
}
}
f.SetCellValue(sheetName, fmt.Sprintf("A%d", rowIndex), bundleInfo.OrderNo)
f.SetCellValue(sheetName, fmt.Sprintf("B%d", rowIndex), bundleInfo.BundleName)
f.SetCellValue(sheetName, fmt.Sprintf("C%d", rowIndex), GetPayStatusText(bundleInfo.PayStatus))
f.SetCellValue(sheetName, fmt.Sprintf("D%d", rowIndex), bundleInfo.TelNum)
f.SetCellValue(sheetName, fmt.Sprintf("E%d", rowIndex), bundleInfo.CustomerName)
f.SetCellValue(sheetName, fmt.Sprintf("F%d", rowIndex), bundleInfo.BundleCreateAt)
f.SetCellValue(sheetName, fmt.Sprintf("G%d", rowIndex), bundleInfo.PayTime)
f.SetCellValue(sheetName, fmt.Sprintf("H%d", rowIndex), bundleInfo.Amount)
if addCount > 0 {
for i, add := range bundleInfo.AddBundleInfo {
r := rowIndex + i
f.SetCellValue(sheetName, fmt.Sprintf("I%d", r), add.OrderAddNo)
f.SetCellValue(sheetName, fmt.Sprintf("J%d", r), add.Amount)
f.SetCellValue(sheetName, fmt.Sprintf("K%d", r), add.SettlementAmount)
f.SetCellValue(sheetName, fmt.Sprintf("L%d", r), GetCurrencyTypeText(add.CurrencyType))
f.SetCellValue(sheetName, fmt.Sprintf("M%d", r), add.HandlingFee)
//f.SetCellValue(sheetName, fmt.Sprintf("N%d", r), add.ExchangeRate)
f.SetCellValue(sheetName, fmt.Sprintf("N%d", r), add.OrderAddCreateAt)
f.SetCellValue(sheetName, fmt.Sprintf("O%d", r), GetPayStatusText(add.AddPayStatus))
}
} else {
for i := 8; i <= 15; i++ {
col := string(rune('A' + i))
f.SetCellValue(sheetName, fmt.Sprintf("%s%d", col, rowIndex), "")
}
}
rowIndex += mergeRows
}
return f, nil
}
func GetPayStatusText(status int32) string {
switch status {
case 1:
return "未支付"
case 2:
return "已支付"
default:
return strconv.Itoa(int(status))
}
}
// 辅助函数:获取货币类型文本
func GetCurrencyTypeText(currencyType int32) string {
switch currencyType {
case 1:
return "人民币"
case 2:
return "美元"
default:
return strconv.Itoa(int(currencyType))
}
}
func OrderRecordsList(c *gin.Context) { func OrderRecordsList(c *gin.Context) {
var req bundle.OrderRecordsRequest var req bundle.OrderRecordsRequest
@ -286,10 +742,10 @@ func OrderRecordsDetail(c *gin.Context) {
return return
} }
/*// 获取 用户信息 // 获取 用户信息
userInfo := login.GetUserInfoFromC(c) userInfo := login.GetUserInfoFromC(c)
req.CustomerID = strconv.FormatUint(userInfo.ID, 10)*/ req.CustomerID = strconv.FormatUint(userInfo.ID, 10)
res, err := service.BundleProvider.OrderRecordsDetail(context.Background(), &req) res, err := service.BundleProvider.OrderRecordsDetail(context.Background(), &req)
if err != nil { if err != nil {
@ -426,8 +882,93 @@ func ExportOrderInfo(c *gin.Context) {
} }
} }
var exportUrl = strings.Replace(strings.Replace(filePath, ".", fmt.Sprintf("%s://%s", httpType, c.Request.Host), 1), "runtime", "api/static", 1) var exportUrl = strings.Replace(strings.Replace(filePath, ".", fmt.Sprintf("%s://%s", httpType, c.Request.Host), 1), "runtime", "api/fiee/static", 1)
//var exportUrl = fmt.Sprintf("%s%s/%s", httpType, c.Request.Host, dirPath + path) //var exportUrl = fmt.Sprintf("%s%s/%s", httpType, c.Request.Host, dirPath + path)
fmt.Println("exportUrl : ", exportUrl) fmt.Println("exportUrl : ", exportUrl)
service.Success(c, &bundleModel.ExportResponse{ExportUrl: exportUrl}) service.Success(c, &bundleModel.ExportResponse{ExportUrl: exportUrl})
} }
func ExportOrderInfoOss(c *gin.Context) {
var req bundle.OrderRecordsRequest
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
service.Error(c, err)
return
}
res, err := service.BundleProvider.OrderRecordsList(context.Background(), &req)
if err != nil {
service.Error(c, err)
return
}
rows := make([][]interface{}, 0)
for _, orderRecord := range res.OrderRecords {
if orderRecord.CustomerID != "" {
var userID uint64
userID, err = strconv.ParseUint(orderRecord.CustomerID, 10, 64)
if err != nil {
err = nil
continue
}
userInfo, _ := service.AccountFieeProvider.Info(context.Background(), &accountFiee.InfoRequest{
Domain: "app",
ID: userID,
})
if userInfo != nil {
orderRecord.Sex = userInfo.Sex
orderRecord.Nationality = userInfo.Nationality
orderRecord.TelNum = userInfo.TelNum
}
}
status := ""
if orderRecord.Status == bundleModel.OrderSigned {
status = "未支付"
} else if orderRecord.Status == bundleModel.OrderPaid {
status = "已支付"
}
financialConfirmation := ""
if orderRecord.FinancialConfirmation == bundleModel.UnConfirm {
financialConfirmation = "未确认"
} else if orderRecord.FinancialConfirmation == bundleModel.Confirmed {
financialConfirmation = "已确认"
}
rows = append(rows, []interface{}{
orderRecord.OrderNo,
orderRecord.CustomerNum,
orderRecord.CustomerName,
orderRecord.Sex,
orderRecord.TelNum,
orderRecord.Nationality,
orderRecord.BundleName,
orderRecord.SignedTime,
orderRecord.Amount,
orderRecord.Num,
orderRecord.ValueAddBundleAmount,
orderRecord.TotalAmount,
status,
orderRecord.PayTime,
financialConfirmation,
})
}
dirPath := "./runtime"
filePath, err := logic.WriteToExcel(dirPath, rows)
if err != nil {
service.Error(c, err)
return
}
exportUrl, err := upload.PutBos(filePath, "excel", true)
if err != nil {
service.Error(c, err)
return
}
service.Success(c, &bundleModel.ExportResponse{ExportUrl: exportUrl})
}

View File

@ -4,6 +4,7 @@ import (
"context" "context"
"fonchain-fiee/api/bundle" "fonchain-fiee/api/bundle"
"fonchain-fiee/pkg/service" "fonchain-fiee/pkg/service"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/gin-gonic/gin/binding" "github.com/gin-gonic/gin/binding"
) )
@ -76,3 +77,98 @@ func BundleList(c *gin.Context) {
service.Success(c, res) service.Success(c, res)
} }
func SaveBundleV2(c *gin.Context) {
var req bundle.BundleProfile
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
service.Error(c, err)
return
}
res, err := service.BundleProvider.SaveBundle(context.Background(), &req)
if err != nil {
service.Error(c, err)
return
}
service.Success(c, res)
}
func BundleListV2(c *gin.Context) {
var req bundle.BundleListRequest
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
service.Error(c, err)
return
}
res, err := service.BundleProvider.BundleListV2(context.Background(), &req)
if err != nil {
service.Error(c, err)
return
}
service.Success(c, res)
}
func BundleDetailV2(c *gin.Context) {
var req bundle.BundleDetailRequest
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
service.Error(c, err)
return
}
language := c.GetHeader("Accept-Language")
req.Language = language
res, err := service.BundleProvider.BundleDetailV2(context.Background(), &req)
if err != nil {
service.Error(c, err)
return
}
service.Success(c, res)
}
func HandShelf(c *gin.Context) {
var req bundle.HandShelfRequest
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
service.Error(c, err)
return
}
res, err := service.BundleProvider.HandShelf(context.Background(), &req)
if err != nil {
service.Error(c, err)
return
}
service.Success(c, res)
}
func OnlyAddValueListByOrderNo(c *gin.Context) {
var req bundle.OnlyAddValueListByOrderNoRequest
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
service.Error(c, err)
return
}
res, err := service.BundleProvider.OnlyAddValueListByOrderNo(context.Background(), &req)
if err != nil {
service.Error(c, err)
return
}
service.Success(c, res)
}
func BundleListH5V2(c *gin.Context) {
var req bundle.BundleListRequest
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
service.Error(c, err)
return
}
res, err := service.BundleProvider.BundleListH5V2(context.Background(), &req)
if err != nil {
service.Error(c, err)
return
}
service.Success(c, res)
}

View File

@ -9,18 +9,28 @@ const (
// 订单 // 订单
const ( const (
MissOrderNo = "缺少订单号" MissOrderNo = "缺少订单号"
MissOrderUUID = "缺少订单信息" MissOrderUUID = "缺少订单信息"
MissLanguageTypes = "缺少语言类型"
NotMatchOrderInfo = "非当前用户订单信息不可操作" NotMatchOrderInfo = "非当前用户订单信息不可操作"
InvalidOrderAmount = "订单金额错误" InvalidOrderAmount = "订单金额错误"
HadPay = "订单已支付" HadPay = "订单已支付"
ThereAreOutstandingOrders = "您还有未支付的订单,无法再次购买"
HadOrder = "您已购买过套餐,无法再次购买" HadOrder = "您已购买过套餐,无法再次购买"
InvalidValueAddBundleNum = "套餐数量无效" InvalidValueAddBundleNum = "套餐数量无效"
ThePackageHasExpired = "当前套餐已过期"
ErrorPermanentPackage = "永久套餐无需购买"
) )
const (
OrderTypePackage = 1 // 套餐
OrderTypeAddon = 2 // 增值服务
TimeUnitDay = 1
TimeUnitMonth = 2
TimeUnitYear = 3
)
const ( const (
ErrorExportOrderInfo = "导出订单信息失败" ErrorExportOrderInfo = "导出订单信息失败"
) )
@ -34,6 +44,12 @@ const (
ErrorDownloadFile = "下载文件失败" ErrorDownloadFile = "下载文件失败"
ErrorUploadFile = "上传文件失败" ErrorUploadFile = "上传文件失败"
) )
const (
Unnamed = "请先实名"
UnderReview = "实名审核中"
ReviewFailed = "实名审核失败"
UnknownStatus = "未知实名状态"
)
/*var EnMessages = map[string]string{ /*var EnMessages = map[string]string{
"创建套餐信息失败": "Failed to create bundle information", "创建套餐信息失败": "Failed to create bundle information",

View File

@ -14,7 +14,7 @@ import (
"time" "time"
) )
func SignContractV2(customerNum, contract string, price float32, contractDuration int64) (outputUrl string, err error) { func SignContractV2(customerNum, contract string, price float32, expirationDate 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 {
@ -31,7 +31,7 @@ func SignContractV2(customerNum, contract string, price float32, contractDuratio
return outputUrl, errors.New(common.ErrorInsertSignature) return outputUrl, errors.New(common.ErrorInsertSignature)
}*/ }*/
signErr := InsertSignatureV2(filePath, signFile, price, contractDuration) signErr := InsertSignatureV2(filePath, signFile, price, expirationDate)
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)
@ -46,7 +46,11 @@ func SignContractV2(customerNum, contract string, price float32, contractDuratio
return outputUrl, nil return outputUrl, nil
} }
func InsertSignatureV2(templatePath, outputPath string, price float32, contractDuration int64) error { func InsertSignatureV2(templatePath, outputPath string, price float32, expirationDate string) error {
fmt.Println("================================templatePath:", templatePath)
fmt.Println("================================outputPath:", outputPath)
fmt.Println("================================price:", price)
fmt.Println("================================expirationDate:", expirationDate)
pdf := gopdf.GoPdf{} pdf := gopdf.GoPdf{}
pdf.Start(gopdf.Config{PageSize: *gopdf.PageSizeA4}) pdf.Start(gopdf.Config{PageSize: *gopdf.PageSizeA4})
@ -90,22 +94,28 @@ func InsertSignatureV2(templatePath, outputPath string, price float32, contractD
pdf.SetPage(limitTimePage) pdf.SetPage(limitTimePage)
// 英文格式的时间 // 英文格式的时间
t := time.Now().AddDate(int(contractDuration), 0, 0) parsedTime, err := time.Parse("2006-01-02", expirationDate)
if err != nil {
panic("日期格式错误!")
}
year := parsedTime.Format("2006") // "2006"
month := parsedTime.Format("01") // "01"
day := parsedTime.Format("02") // "02"
pdf.SetX(160) pdf.SetX(160)
pdf.SetY(387) pdf.SetY(387)
pdf.Cell(nil, t.Format("2006-01-02")) pdf.Cell(nil, expirationDate)
pdf.SetX(330) pdf.SetX(330)
pdf.SetY(403) pdf.SetY(403)
pdf.Cell(nil, t.Format("2006")) pdf.Cell(nil, year)
pdf.SetX(396) pdf.SetX(396)
pdf.SetY(403) pdf.SetY(403)
pdf.Cell(nil, t.Format("01")) pdf.Cell(nil, month)
pdf.SetX(443) pdf.SetX(443)
pdf.SetY(403) pdf.SetY(403)
pdf.Cell(nil, t.Format("02")) pdf.Cell(nil, day)
// 生成新的 PDF // 生成新的 PDF
if err = pdf.WritePdf(outputPath); err != nil { if err = pdf.WritePdf(outputPath); err != nil {

View File

@ -2,9 +2,11 @@ package bundle
import ( import (
"context" "context"
"dubbo.apache.org/dubbo-go/v3/common/logger"
"encoding/json" "encoding/json"
"errors" "errors"
"fmt" "fmt"
"fonchain-fiee/api/accountFiee"
"fonchain-fiee/api/bundle" "fonchain-fiee/api/bundle"
"fonchain-fiee/api/order" "fonchain-fiee/api/order"
"fonchain-fiee/api/payment" "fonchain-fiee/api/payment"
@ -140,74 +142,292 @@ func CreateAntomPay(c *gin.Context) {
// 获取 用户信息 // 获取 用户信息
userInfo := login.GetUserInfoFromC(c) userInfo := login.GetUserInfoFromC(c)
// 检查 订单信息 // outTradeNo就是orderNo根据这个去查询子表的source,如果是2就时单独的子套餐如果是1就是主套餐
detail, detailErr := service.BundleProvider.OrderRecordsDetail(context.Background(), &bundle.OrderRecordsDetailRequest{ orderLimit, err := service.BundleProvider.OrderListByOrderNo(context.Background(), &bundle.OrderInfoByOrderNoRequest{
OrderNo: req.OutTradeNo, OrderNo: req.OutTradeNo,
}) })
if err != nil {
if detailErr != nil { fmt.Println("=============== antom创建支付查询订单source报错", err)
service.Error(c, detailErr) logger.Errorf("=============== antom创建支付查询订单source报错", err)
service.Error(c, err)
return return
} }
fmt.Println("detail.OrderRecord.CustomerID :", detail.OrderRecord.CustomerID) currencyType := 0
if req.ProductPriceCurrency == "cny" || req.ProductPriceCurrency == "CNY" {
// 判断 是否是 本人操作 currencyType = 1
if strconv.FormatUint(userInfo.ID, 10) != detail.OrderRecord.CustomerID { }
service.Error(c, errors.New(common.NotMatchOrderInfo)) if req.ProductPriceCurrency == "usd" || req.ProductPriceCurrency == "USD" {
return currencyType = 2
} }
fmt.Println("detail.OrderRecord.TotalAmount :", detail.OrderRecord.TotalAmount) bundleName := "" // 套餐名称
fmt.Println("req.ProductAllPrice :", req.ProductAllPrice)
fmt.Println("detail.OrderRecord.TotalAmount*100 :", detail.OrderRecord.TotalAmount*100)
//金额校验 if orderLimit != nil && orderLimit.Type == 1 { // 这儿的type实际就是source
orderAmountInCents := int64(math.Round(float64(detail.OrderRecord.TotalAmount * 100))) // 检查 订单信息 type是1说明既有主套餐又有增值服务
reqAmountInCents := int64(math.Round(float64(req.ProductAllPrice))) detail, detailErr := service.BundleProvider.OrderRecordsDetail(context.Background(), &bundle.OrderRecordsDetailRequest{
if orderAmountInCents != reqAmountInCents { OrderNo: req.OutTradeNo,
fmt.Println("111111111111111111111111111111111111")
service.Error(c, errors.New(common.InvalidOrderAmount))
return
}
fmt.Println("detail.OrderRecord.Status :", detail.OrderRecord.Status)
fmt.Println("detail.OrderRecord.CheckoutSessionId :", detail.OrderRecord.CheckoutSessionId)
fmt.Println("detail.OrderRecord.PayTime :", detail.OrderRecord.PayTime)
// 如果 当前订单 是 已签未支付 且 存在 checkoutSessionId 需要 查询 支付结果
if detail.OrderRecord.Status == bundleModel.OrderSigned && detail.OrderRecord.CheckoutSessionId != "" && detail.OrderRecord.PayTime == "" {
// 查询支付结果
stripeInfosRes, stripeInfosErr := service.PaymentProvider.QueryAntomPayByCheckoutSessionId(context.Background(), &payment.AntomPayQueryRequest{
CheckoutSessionIds: []string{detail.OrderRecord.CheckoutSessionId},
}) })
if detailErr != nil {
if stripeInfosErr != nil { fmt.Println("=============== antom创建支付查询主订单信息报错", detailErr)
service.Error(c, errors.New(common.ErrorQueryStripeInfo)) logger.Errorf("=============== antom创建支付查询主订单信息报错", detailErr)
service.Error(c, detailErr)
return return
} }
if stripeInfosRes != nil && len(stripeInfosRes.Infos) > 0 { fmt.Println("detail.OrderRecord.Status :", detail.OrderRecord.Status)
for _, info := range stripeInfosRes.Infos { fmt.Println("detail.OrderRecord.CheckoutSessionId :", detail.OrderRecord.CheckoutSessionId)
if info.OutTradeNo == detail.OrderRecord.OrderNo && info.Status == "paid" { fmt.Println("detail.OrderRecord.PayTime :", detail.OrderRecord.PayTime)
_, updateOrderRecordErr := service.BundleProvider.UpdateOrderRecord(context.Background(), &bundle.OrderRecord{
Uuid: detail.OrderRecord.Uuid, bundleName = detail.OrderRecord.BundleName
Status: bundleModel.OrderPaid,
PayTime: common.GetBeijingTime(), // 主套餐
}) // 如果 当前订单 是 已签未支付 且 存在 checkoutSessionId 需要 查询 支付结果
fmt.Println("detail.OrderRecord.Uuid :", detail.OrderRecord.Uuid) if detail.OrderRecord.Status == bundleModel.OrderSigned && detail.OrderRecord.CheckoutSessionId != "" && detail.OrderRecord.PayTime == "" {
if updateOrderRecordErr != nil { // 查询支付结果
service.Error(c, detailErr) stripeInfosRes, stripeInfosErr := service.PaymentProvider.QueryAntomPayByCheckoutSessionId(context.Background(), &payment.AntomPayQueryRequest{
CheckoutSessionIds: []string{detail.OrderRecord.CheckoutSessionId},
})
if stripeInfosErr != nil {
service.Error(c, errors.New(common.ErrorQueryStripeInfo))
return
}
if stripeInfosRes != nil && len(stripeInfosRes.Infos) > 0 {
for _, info := range stripeInfosRes.Infos {
if info.OutTradeNo == detail.OrderRecord.OrderNo && info.Status == "paid" {
// 更新主套餐和子套餐 TODO
// 更新子套餐TODO
_, updateStatusErr := service.BundleProvider.UpdateOrderRecordByOrderNo(context.Background(), &bundle.OrderRecord{
OrderNo: req.OutTradeNo,
PayTime: common.GetBeijingTime(),
Status: bundleModel.OrderPaid,
})
fmt.Println("detail.OrderRecord.Uuid :", detail.OrderRecord.Uuid)
if updateStatusErr != nil {
fmt.Println("=============== antom创建支付更新主套餐和子套餐支付状态报错", updateStatusErr)
logger.Errorf("=============== antom创建支付更新主套餐和子套餐支付状态报错", updateStatusErr)
service.Error(c, updateStatusErr)
return
}
service.Success(c, &service.Response{
Msg: common.HadPay,
Code: 0,
})
return return
} }
service.Success(c, &service.Response{
Msg: common.HadPay,
Code: 0,
})
return
} }
} }
} }
fmt.Println("detail.OrderRecord.CustomerID :", detail.OrderRecord.CustomerID)
// 判断 是否是 本人操作
if strconv.FormatUint(userInfo.ID, 10) != detail.OrderRecord.CustomerID {
service.Error(c, errors.New(common.NotMatchOrderInfo))
return
}
fmt.Println("detail.OrderRecord.TotalAmount :", detail.OrderRecord.TotalAmount)
fmt.Println("req.ProductAllPrice :", req.ProductAllPrice)
fmt.Println("detail.OrderRecord.TotalAmount*100 :", detail.OrderRecord.TotalAmount*100)
//金额校验
orderAmountInCents := int64(math.Round(float64(detail.OrderRecord.TotalAmount) * 100))
reqAmountInCents := req.ProductAllPrice
if orderAmountInCents != reqAmountInCents {
fmt.Println("111111111111111111111111111111111111")
service.Error(c, errors.New(common.InvalidOrderAmount))
return
}
}
if orderLimit != nil && orderLimit.Type == 2 {
res, listErr := service.BundleProvider.OnlyAddValueListByOrderNo(context.Background(), &bundle.OnlyAddValueListByOrderNoRequest{
OrderNo: req.OutTradeNo,
})
if listErr != nil {
fmt.Println("=============== antom创建支付查询单独增值服务列表报错", listErr)
logger.Errorf("=============== antom创建支付查询单独增值服务列表报错", listErr)
service.Error(c, listErr)
return
}
if res != nil && len(res.AddBundleInfos) > 0 {
firstAddBundle := res.AddBundleInfos[0]
// 如果 当前订单 是 已签未支付 且 存在 checkoutSessionId 需要 查询 支付结果
if firstAddBundle.PaymentStatus == bundleModel.OrderSigned && firstAddBundle.CheckOutSessionId != "" {
// 查询支付结果
stripeInfosRes, stripeInfosErr := service.PaymentProvider.QueryAntomPayByCheckoutSessionId(context.Background(), &payment.AntomPayQueryRequest{
CheckoutSessionIds: []string{firstAddBundle.CheckOutSessionId},
})
if stripeInfosErr != nil {
service.Error(c, errors.New(common.ErrorQueryStripeInfo))
return
}
if stripeInfosRes != nil && len(stripeInfosRes.Infos) > 0 {
for _, info := range stripeInfosRes.Infos {
if info.OutTradeNo == firstAddBundle.OrderNo && info.Status == "paid" {
// 更新子套餐TODO
_, updateStatusErr := service.BundleProvider.UpdateOrderRecordByOrderNo(context.Background(), &bundle.OrderRecord{
OrderNo: req.OutTradeNo,
PayTime: common.GetBeijingTime(),
Status: bundleModel.OrderPaid,
})
fmt.Println("req.OutTradeNo :", req.OutTradeNo)
if updateStatusErr != nil {
fmt.Println("=============== antom创建支付更新子套餐支付状态报错", updateStatusErr)
logger.Errorf("=============== antom创建支付更新子套餐支付状态报错", updateStatusErr)
service.Error(c, updateStatusErr)
return
}
service.Success(c, &service.Response{
Msg: common.HadPay,
Code: 0,
})
return
}
}
}
}
fmt.Println("firstAddBundle.CustomerID :", firstAddBundle.CustomerID)
// 判断 是否是 本人操作
if strconv.FormatUint(userInfo.ID, 10) != firstAddBundle.CustomerID {
service.Error(c, errors.New(common.NotMatchOrderInfo))
return
}
orderAmountInCents := int64(0.0)
for _, info := range res.AddBundleInfos {
temp := int64(math.Round(float64(info.Amount) * 100))
orderAmountInCents += temp
}
fmt.Println("orderAmountInCents :", orderAmountInCents)
fmt.Println("req.ProductAllPrice :", req.ProductAllPrice)
//金额校验
reqAmountInCents := req.ProductAllPrice
if orderAmountInCents != reqAmountInCents {
fmt.Println("111111111111111111111111111111111111")
service.Error(c, errors.New(common.InvalidOrderAmount))
return
}
}
}
if req.ProductAllPrice == 0 {
////创建对账单 todo 待修改
_, err = service.BundleProvider.CreateReconciliation(context.Background(), &bundle.ReconciliationInfo{
BundleOrderOn: req.OutTradeNo,
BundleAddOrderOn: req.OutTradeNo,
UserName: userInfo.Name,
UserTel: userInfo.TelNum,
BundleName: bundleName,
PayAmount: float32(req.ProductAllPrice),
CurrencyType: int32(currencyType),
PayStatus: 2,
PayTime: common.GetBeijingTime(),
UserID: userInfo.ID,
SerialNumber: "zero-price-serial-number",
})
if err != nil {
fmt.Println("=============== antom创建支付创建对账单报错", err)
logger.Errorf("=============== antom创建支付创建对账单报错", err)
service.Error(c, err)
return
}
_, updateStatusErr := service.BundleProvider.UpdateOrderRecordByOrderNo(context.Background(), &bundle.OrderRecord{
OrderNo: req.OutTradeNo,
PayTime: common.GetBeijingTime(),
Status: bundleModel.OrderPaid,
})
if updateStatusErr != nil {
fmt.Println("=============== antom创建支付更新订单报错", updateStatusErr)
logger.Errorf("=============== antom创建支付更新订单报错", updateStatusErr)
service.Error(c, updateStatusErr)
return
}
switch orderLimit.Type {
case common.OrderTypePackage:
//如果是购买套餐 1:创建新的余量信息CreateBundleBalance 2 添加扩展记录BundleExtend
_, err = service.BundleProvider.CreateBundleBalance(context.Background(), &bundle.CreateBundleBalanceReq{
UserId: int32(orderLimit.UserId),
OrderUUID: orderLimit.OrderUUID,
//AccountNumber: orderLimit.AccountNumber,
//VideoNumber: orderLimit.VideoNumber,
//ImageNumber: orderLimit.ImageNumber,
//DataAnalysisNumber: orderLimit.DataNumber,
ExpansionPacksNumber: 1,
})
if err != nil {
fmt.Println("=============== antom创建支付OrderTypePackage报错", err)
logger.Errorf("=============== antom创建支付OrderTypePackage报错", err)
service.Error(c, err)
return
}
case common.OrderTypeAddon:
//如果是购买增值服务 1:修改余量信息AddBundleBalance 2 添加扩展记录BundleExtend
//_, err = service.BundleProvider.AddBundleBalance(context.Background(), &bundle.AddBundleBalanceReq{
// UserId: int32(orderLimit.UserId),
// OrderUUID: orderLimit.OrderUUID,
// AccountNumber: orderLimit.AccountNumber,
// VideoNumber: orderLimit.VideoNumber,
// ImageNumber: orderLimit.ImageNumber,
// DataAnalysisNumber: orderLimit.DataNumber,
// ExpansionPacksNumber: 1,
//})
//if err != nil {
// fmt.Println("=============== antom创建支付OrderTypePackage报错", err)
// logger.Errorf("=============== antom创建支付OrderTypePackage报错", err)
// service.Error(c, err)
// return
//}
default:
fmt.Println("=============== antom创建支付无效的订单类型", err)
logger.Errorf("=============== antom创建支付无效的订单类型", err)
service.Error(c, errors.New("无效的订单类型"))
return
}
var timeUnit uint32
switch orderLimit.Unit {
case "天":
timeUnit = common.TimeUnitDay
case "月":
timeUnit = common.TimeUnitMonth
case "年":
timeUnit = common.TimeUnitYear
default:
timeUnit = 0
}
_, err = service.BundleProvider.BundleExtend(context.Background(), &bundle.BundleExtendRequest{
UserId: int64(orderLimit.UserId),
AccountAdditional: uint32(orderLimit.AccountNumber),
VideoAdditional: uint32(orderLimit.VideoNumber),
ImagesAdditional: uint32(orderLimit.ImageNumber),
DataAdditional: uint32(orderLimit.DataNumber),
AvailableDurationAdditional: uint32(orderLimit.Duration),
TimeUnit: timeUnit,
AssociatedorderNumber: req.OutTradeNo, //增值服务订单号
Type: 2, //自行购买
OperatorName: orderLimit.UserName,
OperatorId: orderLimit.UserId,
})
if err != nil {
service.Error(c, err)
return
}
service.Success(c)
return
} }
var antomReq payment.CreatePayRequest var antomReq payment.CreatePayRequest
@ -232,9 +452,9 @@ func CreateAntomPay(c *gin.Context) {
fmt.Println("result.CheckoutSessionId :", result.CheckoutSessionId) fmt.Println("result.CheckoutSessionId :", result.CheckoutSessionId)
fmt.Println("result.Url :", result.Url) fmt.Println("result.Url :", result.Url)
//更新订单状态 //更新订单url和checkSessionId
_, updateOrderRecordErr := service.BundleProvider.UpdateOrderRecord(context.Background(), &bundle.OrderRecord{ _, updateStatusErr := service.BundleProvider.UpdateOrderRecordByOrderNo(context.Background(), &bundle.OrderRecord{
Uuid: detail.OrderRecord.Uuid, OrderNo: req.OutTradeNo,
CheckoutSessionId: result.CheckoutSessionId, CheckoutSessionId: result.CheckoutSessionId,
CheckoutSessionUrl: result.Url, CheckoutSessionUrl: result.Url,
}) })
@ -242,11 +462,32 @@ func CreateAntomPay(c *gin.Context) {
resp := &order.CreateStripeCheckoutSessionResponse{} resp := &order.CreateStripeCheckoutSessionResponse{}
resp.CheckoutSessionUrl = result.Url resp.CheckoutSessionUrl = result.Url
resp.CheckoutSessionId = result.CheckoutSessionId resp.CheckoutSessionId = result.CheckoutSessionId
fmt.Println("req.OutTradeNo :", req.OutTradeNo)
if updateStatusErr != nil {
fmt.Println("=============== antom创建支付更新订单的请求id报错", updateStatusErr)
logger.Errorf("=============== antom创建支付更新订单的请求id报错", updateStatusErr)
service.Error(c, updateStatusErr)
return
}
fmt.Println("resp:", resp) fmt.Println("resp:", resp)
if updateOrderRecordErr != nil { ////创建对账单 todo 待修改
fmt.Println("有更新报错:", updateOrderRecordErr) _, err = service.BundleProvider.CreateReconciliation(context.Background(), &bundle.ReconciliationInfo{
service.Error(c, updateOrderRecordErr) BundleOrderOn: req.OutTradeNo,
BundleAddOrderOn: req.OutTradeNo,
UserName: userInfo.Name,
UserTel: userInfo.TelNum,
BundleName: bundleName,
PayAmount: float32(req.ProductAllPrice) / 100, // 以后别用float存钱无语
CurrencyType: int32(currencyType),
PayStatus: 1,
UserID: userInfo.ID,
SerialNumber: result.CheckoutSessionId,
})
if err != nil {
fmt.Println("=============== antom创建支付创建对账单报错", err)
logger.Errorf("=============== antom创建支付创建对账单报错", err)
service.Error(c, err)
return return
} }
@ -362,7 +603,150 @@ func AntomWebhook(c *gin.Context) {
service.Error(c, err) service.Error(c, err)
return return
} }
// 更新对账单
_, err = service.BundleProvider.UpdateReconciliationStatusBySerialNumber(context.Background(), &bundle.UpdateStatusAndPayTimeBySerialNumber{
PayTime: paymentTime,
PaymentStatus: 2,
SerialNumber: requestId,
})
if err != nil {
fmt.Println("=============== antom回调更新对账单报错", err)
logger.Errorf("=============== antom回调更新对账单报错", err)
service.Error(c, err)
return
}
//添加余额
orderLimit, err := service.BundleProvider.OrderListByOrderNo(context.Background(), &bundle.OrderInfoByOrderNoRequest{
OrderNo: resp.OutTradeNo,
})
if err != nil {
service.Error(c, err)
return
}
//购买套餐
switch orderLimit.Type {
case common.OrderTypePackage:
//如果是购买套餐 1:创建新的余量信息CreateBundleBalance 2 添加扩展记录BundleExtend
_, err = service.BundleProvider.CreateBundleBalance(context.Background(), &bundle.CreateBundleBalanceReq{
UserId: int32(orderLimit.UserId),
OrderUUID: orderLimit.OrderUUID,
//AccountNumber: orderLimit.AccountNumber,
//VideoNumber: orderLimit.VideoNumber,
//ImageNumber: orderLimit.ImageNumber,
//DataAnalysisNumber: orderLimit.DataNumber,
ExpansionPacksNumber: 1,
})
if err != nil {
service.Error(c, err)
return
}
case common.OrderTypeAddon:
//如果是购买增值服务 1:修改余量信息AddBundleBalance 2 添加扩展记录BundleExtend
//_, err = service.BundleProvider.AddBundleBalance(context.Background(), &bundle.AddBundleBalanceReq{
// UserId: int32(orderLimit.UserId),
// OrderUUID: orderLimit.OrderUUID,
// AccountNumber: orderLimit.AccountNumber,
// VideoNumber: orderLimit.VideoNumber,
// ImageNumber: orderLimit.ImageNumber,
// DataAnalysisNumber: orderLimit.DataNumber,
// ExpansionPacksNumber: 1,
//})
//if err != nil {
// service.Error(c, err)
// return
//}
default:
service.Error(c, errors.New("无效的订单类型"))
return
}
var timeUnit uint32
switch orderLimit.Unit {
case "天":
timeUnit = common.TimeUnitDay
case "月":
timeUnit = common.TimeUnitMonth
case "年":
timeUnit = common.TimeUnitYear
default:
timeUnit = 0
}
_, err = service.BundleProvider.BundleExtend(context.Background(), &bundle.BundleExtendRequest{
UserId: int64(orderLimit.UserId),
AccountAdditional: uint32(orderLimit.AccountNumber),
VideoAdditional: uint32(orderLimit.VideoNumber),
ImagesAdditional: uint32(orderLimit.ImageNumber),
DataAdditional: uint32(orderLimit.DataNumber),
AvailableDurationAdditional: uint32(orderLimit.Duration),
TimeUnit: timeUnit,
AssociatedorderNumber: resp.OutTradeNo, //增值服务订单号
Type: 2, //自行购买
OperatorName: orderLimit.UserName,
OperatorId: orderLimit.UserId,
})
if err != nil {
service.Error(c, err)
return
}
} }
service.Success(c) service.Success(c)
} }
func HomePageRoll(c *gin.Context) {
//var req order.HomePageRollRequest
res, err := service.BundleProvider.OrderRecordsListV2(context.Background(), &bundle.OrderRecordsRequestV2{
Page: 1,
PageSize: 5,
})
if err != nil {
service.Error(c, err)
return
}
if len(res.BundleInfo) == 0 {
service.Success(c, nil)
return
}
type Roll struct {
Tel string `json:"tel"`
Name string `json:"name"`
}
var userIds []int64
for _, i := range res.BundleInfo {
userIds = append(userIds, i.CustomerId)
}
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
}
var roll []Roll
for _, i := range res.BundleInfo {
tel := ""
name := i.BundleName // Use bundle name as fallback
if userInfo, exists := userMap[i.CustomerId]; exists && userInfo != nil {
tel = userInfo.TelNum
if len(tel) >= 2 {
masked := ""
for j := 0; j < len(tel)-2; j++ {
masked += "*"
}
tel = masked + tel[len(tel)-2:]
}
}
roll = append(roll, Roll{
Tel: tel,
Name: name,
})
}
service.Success(c, roll)
return
}

View File

@ -0,0 +1,75 @@
package bundle
import (
"context"
"fonchain-fiee/api/bundle"
"fonchain-fiee/pkg/service"
"fonchain-fiee/pkg/utils"
"github.com/gin-gonic/gin"
"github.com/gin-gonic/gin/binding"
)
func GetReconciliationList(c *gin.Context) {
var req bundle.GetReconciliationListReq
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
service.Error(c, err)
return
}
detail, detailErr := service.BundleProvider.GetReconciliationList(context.Background(), &req)
if detailErr != nil {
service.Error(c, detailErr)
return
}
service.Success(c, detail)
return
}
func GetReconciliationListDownload(c *gin.Context) {
var req bundle.GetReconciliationListReq
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
service.Error(c, err)
return
}
detail, detailErr := service.BundleProvider.GetReconciliationList(context.Background(), &req)
if detailErr != nil {
service.Error(c, detailErr)
return
}
titleList := []string{
"关联套餐订单号", "关联增值服务订单号", "对账单创建时间", "艺人", "艺人手机号", "套餐", "支付金额", "币种", "支付渠道", "支付时间", "支付状态", "流水号",
}
var dataList []interface{}
for _, i := range detail.List {
payStatus := GetPayStatusText(i.PayStatus)
currencyType := GetCurrencyTypeText(i.CurrencyType)
payChannel := "未知"
if i.PayChannel == 1 {
payChannel = "支付宝"
}
data := []any{
i.BundleOrderOn,
i.BundleAddOrderOn,
i.CreationTime,
i.UserName,
i.UserTel,
i.BundleName,
i.PayAmount,
currencyType,
payChannel,
i.PayTime,
payStatus,
i.SerialNumber,
}
dataList = append(dataList, &data)
}
content, err := utils.ToExcelByType(titleList, dataList, "slice", "")
if err != nil {
service.Error(c, err)
return
}
utils.ResponseXls(c, content, "对账单")
return
}

View File

@ -67,3 +67,65 @@ func ValueAddBundleDetail(c *gin.Context) {
service.Success1(c, res.Msg, res) service.Success1(c, res.Msg, res)
} }
func SaveValueAddService(c *gin.Context) {
var req bundle.ValueAddServiceLang
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
service.Error1(c, err)
return
}
res, err := service.BundleProvider.SaveValueAddService(context.Background(), &req)
if err != nil {
service.Error(c, err)
return
}
service.Success(c, res)
}
func ValueAddServiceList(c *gin.Context) {
var req bundle.ValueAddServiceListRequest
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
service.Error1(c, err)
return
}
res, err := service.BundleProvider.ValueAddServiceList(context.Background(), &req)
if err != nil {
service.Error(c, err)
return
}
service.Success(c, res)
}
func ValueAddServiceDetail(c *gin.Context) {
var req bundle.ValueAddServiceDetailRequest
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
service.Error1(c, err)
return
}
res, err := service.BundleProvider.ValueAddServiceDetail(context.Background(), &req)
if err != nil {
service.Error(c, err)
return
}
service.Success(c, res)
}
func ValueAddServiceLangDetail(c *gin.Context) {
var req bundle.ValueAddServiceDetailRequest
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
service.Error1(c, err)
return
}
language := c.GetHeader("Accept-Language")
req.Language = language
res, err := service.BundleProvider.ValueAddServiceLangByUuidAndLanguage(context.Background(), &req)
if err != nil {
service.Error(c, err)
return
}
service.Success(c, res)
}

View File

@ -0,0 +1,45 @@
package cast
import (
"encoding/json"
"errors"
"fmt"
"fonchain-fiee/cmd/config"
"fonchain-fiee/pkg/e"
modelCast "fonchain-fiee/pkg/model/cast"
"fonchain-fiee/pkg/utils"
)
type CastService struct {
}
func (c *CastService) ApprovalDetail(approvalIds []int) (data map[int]modelCast.Item, err error) {
type ApprovalDetailRequest struct {
ID []int `json:"ID"`
}
req := ApprovalDetailRequest{
ID: approvalIds,
}
idsBytes, _ := json.Marshal(req)
var respBody string
url := fmt.Sprintf(config.AppConfig.System.FieeHost + "/approval/list/ex")
respBody, err = utils.Post(url, string(idsBytes))
if err != nil {
return
}
var respDetail modelCast.ApprovalDetailResponse
if err = json.Unmarshal([]byte(respBody), &respDetail); err != nil {
err = errors.New(e.GetMsg(e.JsonUnmarshal))
return
}
if respDetail.Status == 0 && len(respDetail.Data.Data) > 0 {
data = make(map[int]modelCast.Item, len(respDetail.Data.Data))
for _, v := range respDetail.Data.Data {
data[v.ID] = v
}
} else {
err = errors.New(e.GetMsg(e.ErrorHttp))
return
}
return
}

203
pkg/service/cast/media.go Normal file
View File

@ -0,0 +1,203 @@
package cast
import (
"context"
"errors"
"fonchain-fiee/api/accountFiee"
"fonchain-fiee/api/bundle"
"fonchain-fiee/api/cast"
"fonchain-fiee/cmd/config"
"fonchain-fiee/pkg/e"
modelCast "fonchain-fiee/pkg/model/cast"
"fonchain-fiee/pkg/service"
"github.com/gin-gonic/gin"
"go.uber.org/zap"
"strconv"
)
func MediaUserList(ctx *gin.Context) {
var req *cast.MediaUserListReq
var err error
if err = ctx.ShouldBind(&req); err != nil {
service.Error(ctx, err)
return
}
if err = req.Validate(); err != nil {
service.Error(ctx, err)
return
}
resp, err := service.CastProvider.MediaUserList(ctx, req)
if err != nil {
service.Error(ctx, err)
return
}
service.Success(ctx, resp)
return
}
func UnbindManager(ctx *gin.Context) {
var req *cast.UnbindManagerReq
var resp *cast.UnbindManagerResp
var err error
if err = ctx.ShouldBind(&req); err != nil {
service.Error(ctx, err)
return
}
if err = req.Validate(); err != nil {
service.Error(ctx, err)
return
}
resp, err = service.CastProvider.UnbindManager(ctx, req)
if err != nil {
service.Error(ctx, err)
return
}
zap.L().Info("UnbindManager resp", zap.Any("resp", resp))
if resp.OldBindArtistUuid != "" {
userID, _ := strconv.ParseInt(resp.OldBindArtistUuid, 10, 64)
_, err = service.BundleProvider.AddBundleBalance(context.Background(), &bundle.AddBundleBalanceReq{
UserId: int32(userID),
AccountConsumptionNumber: -1,
})
if err != nil {
service.Error(ctx, err)
//FIXME 进行回滚
return
}
}
service.Success(ctx, nil)
return
}
func BindManager(ctx *gin.Context) {
var req *cast.BindManagerReq
var err error
if err = ctx.ShouldBind(&req); err != nil {
service.Error(ctx, err)
return
}
if err = req.Validate(); err != nil {
service.Error(ctx, err)
return
}
_, err = service.CastProvider.BindManager(ctx, req)
if err != nil {
service.Error(ctx, err)
return
}
service.Success(ctx, nil)
return
}
func UpdateMediaAccount(ctx *gin.Context) {
var req *cast.UpdateMediaAccountReq
var infoResp *accountFiee.UserInfoResponse
var err error
if err = ctx.ShouldBind(&req); err != nil {
service.Error(ctx, err)
return
}
if err = req.Validate(); err != nil {
service.Error(ctx, err)
return
}
// 查询艺人的信息
// 字符串转整型
artistID, err := strconv.ParseUint(req.ArtistUuid, 10, 64)
if config.AppConfig.System.AppMode != "dev" {
infoResp, err = service.AccountFieeProvider.Info(context.Background(), &accountFiee.InfoRequest{
ID: artistID,
Domain: "app",
})
if err != nil {
service.Error(ctx, err)
return
}
} else {
infoResp = &accountFiee.UserInfoResponse{
Name: "小波",
TelNum: "18288888888",
}
}
req.ArtistName = infoResp.Name
req.ArtistPhone = infoResp.TelNum
req.ArtistPhoneAreaCode = infoResp.TelAreaCode
if _, ok := cast.PlatformIDENUM_name[int32(req.PlatformID)]; !ok {
service.Error(ctx, errors.New(e.GetMsg(e.InvalidParams)))
return
}
userID, _ := strconv.ParseInt(req.ArtistUuid, 10, 64)
if req.MediaAccountUuid == "" {
if err = CheckUserBundleBalance(int32(userID), modelCast.BalanceTypeAccountValue); err != nil {
service.Error(ctx, err)
return
}
_, err = service.BundleProvider.AddBundleBalance(context.Background(), &bundle.AddBundleBalanceReq{
UserId: int32(userID),
AccountConsumptionNumber: 1,
})
if err != nil {
service.Error(ctx, err)
return
}
}
resp, err := service.CastProvider.UpdateMediaAccount(ctx, req)
if err != nil {
service.Error(ctx, err)
if req.MediaAccountUuid == "" {
_, err = service.BundleProvider.AddBundleBalance(context.Background(), &bundle.AddBundleBalanceReq{
UserId: int32(userID),
AccountConsumptionNumber: -1,
})
if err != nil {
service.Error(ctx, err)
return
}
}
return
}
service.Success(ctx, resp)
return
}
func OAuthUrl(ctx *gin.Context) {
var req *cast.OAuthYoutubeUrlReq
var resp *cast.OAuthYoutubeUrlResp
var err error
if err = ctx.ShouldBind(&req); err != nil {
service.Error(ctx, err)
return
}
if err = req.Validate(); err != nil {
service.Error(ctx, err)
return
}
if resp, err = service.CastProvider.OAuthYoutubeUrl(ctx, req); err != nil {
service.Error(ctx, err)
return
}
service.Success(ctx, resp)
return
}
func OAuth2Callback(ctx *gin.Context) {
code := ctx.Query("code")
state := ctx.Query("state")
//scope := ctx.Query("scope")
resp, err := service.CastProvider.OAuthYoutubeToken(ctx, &cast.OAuthYoutubeTokenReq{
MediaAccountUuid: state,
Code: code,
//scope: scope,
})
if err != nil {
service.Error(ctx, err)
return
}
service.Success(ctx, resp)
return
}
func Test(ctx *gin.Context) {
service.Success(ctx, nil)
return
}

View File

@ -0,0 +1 @@
package cast

29
pkg/service/cast/user.go Normal file
View File

@ -0,0 +1,29 @@
package cast
import (
"context"
"dubbo.apache.org/dubbo-go/v3/common/constant"
"fmt"
"fonchain-fiee/cmd/config"
"fonchain-fiee/pkg/model/login"
"github.com/gin-gonic/gin"
)
func NewCtxWithUserInfo(ctx *gin.Context) (newCtx context.Context) {
var userInfo = login.Info{}
if config.AppConfig.System.AppMode != "dev" {
userInfo = login.GetUserInfoFromC(ctx)
} else {
userInfo = login.Info{
ID: 61,
Name: "小波",
TelNum: "18288888888",
}
}
var mm = make(map[string]interface{}, 3)
mm["userid"] = fmt.Sprintf("%d", userInfo.ID)
mm["name"] = userInfo.Name
mm["phone"] = userInfo.TelNum
newCtx = context.WithValue(context.Background(), constant.DubboCtxKey("attachment"), mm)
return
}

363
pkg/service/cast/work.go Normal file
View File

@ -0,0 +1,363 @@
package cast
import (
"context"
"errors"
"fmt"
"fonchain-fiee/api/accountFiee"
"fonchain-fiee/api/bundle"
"fonchain-fiee/api/cast"
"fonchain-fiee/cmd/config"
"fonchain-fiee/pkg/e"
modelCast "fonchain-fiee/pkg/model/cast"
"fonchain-fiee/pkg/service"
"github.com/gin-gonic/gin"
"go.uber.org/zap"
"strconv"
)
func UpdateWorkImage(ctx *gin.Context) {
var req *cast.UpdateWorkImageReq
var infoResp *accountFiee.UserInfoResponse
var err error
if err = ctx.ShouldBind(&req); err != nil {
service.Error(ctx, err)
return
}
if config.AppConfig.System.AppMode != "dev" {
artistId, _ := strconv.ParseUint(req.ArtistUuid, 10, 64)
infoResp, err = service.AccountFieeProvider.Info(context.Background(), &accountFiee.InfoRequest{
ID: artistId,
Domain: "app",
})
if err != nil {
service.Error(ctx, err)
return
}
} else {
infoResp = &accountFiee.UserInfoResponse{
Name: "小波",
TelNum: "18288888888",
TelAreaCode: "86",
}
}
req.ArtistName = infoResp.Name
req.ArtistPhone = infoResp.TelNum
req.ArtistPhoneAreaCode = infoResp.TelAreaCode
artistID, _ := strconv.ParseUint(req.ArtistUuid, 10, 64)
if err = CheckUserBundleBalance(int32(artistID), modelCast.BalanceTypeImageValue); err != nil {
service.Error(ctx, err)
return
}
newCtx := NewCtxWithUserInfo(ctx)
resp, err := service.CastProvider.UpdateWorkImage(newCtx, req)
if err != nil {
service.Error(ctx, err)
return
}
service.Success(ctx, resp)
return
}
func UpdateWorkVideo(ctx *gin.Context) {
var req *cast.UpdateWorkVideoReq
var infoResp *accountFiee.UserInfoResponse
var err error
if err = ctx.ShouldBind(&req); err != nil {
service.Error(ctx, err)
return
}
if config.AppConfig.System.AppMode != "dev" {
artistId, _ := strconv.ParseUint(req.ArtistUuid, 10, 64)
infoResp, err = service.AccountFieeProvider.Info(context.Background(), &accountFiee.InfoRequest{
ID: artistId,
Domain: "app",
})
if err != nil {
service.Error(ctx, err)
return
}
} else {
infoResp = &accountFiee.UserInfoResponse{
Name: "小波",
TelNum: "18288888888",
TelAreaCode: "86",
}
}
artistID, _ := strconv.ParseUint(req.ArtistUuid, 10, 64)
if err = 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 := NewCtxWithUserInfo(ctx)
resp, err := service.CastProvider.UpdateWorkVideo(newCtx, req)
if err != nil {
service.Error(ctx, err)
return
}
service.Success(ctx, resp)
return
}
func UpdateApproval(ctx *gin.Context) {
var req *cast.UpdateStatusReq
var err error
if err = ctx.ShouldBind(&req); err != nil {
service.Error(ctx, err)
return
}
req.WorkAction = cast.WorkActionENUM_APPROVAL
newCtx := NewCtxWithUserInfo(ctx)
resp, err := service.CastProvider.UpdateStatus(newCtx, req)
if err != nil {
service.Error(ctx, err)
return
}
service.Success(ctx, resp)
return
}
func WorkList(ctx *gin.Context) {
var (
req *cast.WorkListReq
resp *cast.WorkListResp
)
var err error
if err = ctx.ShouldBind(&req); err != nil {
service.Error(ctx, err)
return
}
newCtx := NewCtxWithUserInfo(ctx)
resp, err = service.CastProvider.WorkList(newCtx, req)
if err != nil {
service.Error(ctx, err)
return
}
if len(resp.Data) > 0 {
var workUuidApprovalIDMap = make(map[int]string)
for _, v := range resp.Data {
if v.WorkStatus == 2 && v.ApprovalID != "" {
approvalID, _ := strconv.ParseUint(v.ApprovalID, 10, 64)
workUuidApprovalIDMap[int(approvalID)] = v.WorkUuid
}
}
if len(workUuidApprovalIDMap) > 0 {
_ = RefreshWorkApprovalStatus(ctx, workUuidApprovalIDMap)
}
}
service.Success(ctx, resp)
return
}
func WorkDetail(ctx *gin.Context) {
var (
req *cast.WorkDetailReq
resp *cast.WorkDetailResp
)
var err error
if err = ctx.ShouldBind(&req); err != nil {
service.Error(ctx, err)
return
}
newCtx := NewCtxWithUserInfo(ctx)
resp, err = service.CastProvider.WorkDetail(newCtx, req)
if err != nil {
service.Error(ctx, err)
return
}
service.Success(ctx, resp)
return
}
func CheckUserBundleBalance(userID int32, balanceType modelCast.BalanceTypeEnum) (err error) {
resp, err := service.BundleProvider.GetBundleBalanceByUserId(context.Background(), &bundle.GetBundleBalanceByUserIdReq{UserId: userID})
if err != nil {
return
}
zap.L().Info("CheckUserBundleBalance", zap.Any("resp", resp))
fmt.Println("CheckUserBundleBalance resp", resp)
switch balanceType {
case modelCast.BalanceTypeAccountValue:
if resp.AccountNumber-resp.AccountConsumptionNumber <= 0 {
err = errors.New(e.ErrorBalanceInsufficient)
return
}
case modelCast.BalanceTypeImageValue:
if resp.ImageNumber-resp.ImageConsumptionNumber <= 0 {
err = errors.New(e.ErrorBalanceInsufficient)
return
}
case modelCast.BalanceTypeVideoValue:
if resp.VideoNumber-resp.VideoConsumptionNumber <= 0 {
err = errors.New(e.ErrorBalanceInsufficient)
return
}
}
return
}
func RePublish(ctx *gin.Context) {
var (
req *cast.RePublishReq
resp *cast.RePublishResp
)
var err error
if err = ctx.ShouldBind(&req); err != nil {
service.Error(ctx, err)
return
}
newCtx := NewCtxWithUserInfo(ctx)
resp, err = service.CastProvider.RePublish(newCtx, req)
if err != nil {
service.Error(ctx, err)
return
}
artistID, _ := strconv.ParseUint(resp.ArtistUuid, 10, 64)
balanceReq := &bundle.AddBundleBalanceReq{
UserId: int32(artistID),
}
if resp.WorkCategory == 1 {
balanceReq.ImageConsumptionNumber = 1
}
if resp.WorkCategory == 2 {
balanceReq.VideoConsumptionNumber = 1
}
_, err = service.BundleProvider.AddBundleBalance(context.Background(), balanceReq)
if err != nil {
service.Error(ctx, err)
//FIXME 进行回滚
return
}
service.Success(ctx, nil)
return
}
//修改余量我还需要调用吗
func UserBundleBalanceCost() {
service.BundleProvider.AddBundleBalance(context.Background(), &bundle.AddBundleBalanceReq{})
}
func RefreshWorkApprovalStatus(ctx *gin.Context, approvalIDWorkUuidMap map[int]string) (err error) {
var castS = new(CastService)
var data = make(map[int]modelCast.Item)
var approvalIDs []int
for approvalId, _ := range approvalIDWorkUuidMap {
approvalIDs = append(approvalIDs, approvalId)
}
if len(approvalIDs) == 0 {
return
}
data, err = castS.ApprovalDetail(approvalIDs)
// status: 1待审批 2审批通过 3审批不通过 6撤销发其中 7撤销完成
var newData = make(map[int]modelCast.Item, len(approvalIDs))
for _, v := range approvalIDs {
newData[v] = data[v]
}
newCtx := NewCtxWithUserInfo(ctx)
if len(newData) > 0 {
for approvalId, v := range newData {
if v.ID == 0 {
_, _ = service.CastProvider.UpdateStatus(newCtx, &cast.UpdateStatusReq{
WorkAction: cast.WorkActionENUM_APPROVAL_DELETE,
WorkUuid: approvalIDWorkUuidMap[approvalId],
ApprovalID: fmt.Sprint(approvalId),
ApprovalReply: "",
})
continue
}
var workAction cast.WorkActionENUM
if v.Status == 2 {
workAction = cast.WorkActionENUM_APPROVAL_PASS
} else if v.Status == 3 {
workAction = cast.WorkActionENUM_APPROVAL_REJECT
} else {
continue
}
_, _ = service.CastProvider.UpdateStatus(newCtx, &cast.UpdateStatusReq{
WorkAction: workAction,
WorkUuid: approvalIDWorkUuidMap[approvalId],
ApprovalID: fmt.Sprint(approvalId),
ApprovalReply: v.Reply,
})
}
}
return
}
func DelWork(ctx *gin.Context) {
var req *cast.DelWorkReq
var err error
if err = ctx.ShouldBind(&req); err != nil {
service.Error(ctx, err)
return
}
newCtx := NewCtxWithUserInfo(ctx)
_, err = service.CastProvider.DelWork(newCtx, req)
if err != nil {
service.Error(ctx, err)
return
}
service.Success(ctx, nil)
return
}
func Remind(ctx *gin.Context) {
var req *cast.WorkInfoReq
var err error
var workInfo *cast.WorkInfoResp
if err = ctx.ShouldBind(&req); err != nil {
service.Error(ctx, err)
return
}
workInfo, err = service.CastProvider.WorkInfo(context.Background(), req)
if err != nil {
service.Error(ctx, err)
return
}
if workInfo.WorkStatus != modelCast.WorkStatusArtistConfirming {
service.Error(ctx, errors.New(e.InvalidStatus))
return
}
if workInfo.ArtistPhoneAreaCode == "" {
workInfo.ArtistPhoneAreaCode = "86"
}
artistID, _ := strconv.ParseUint(workInfo.ArtistUuid, 10, 64)
infoResp, err := service.AccountFieeProvider.Info(context.Background(), &accountFiee.InfoRequest{
ID: artistID,
Domain: "app",
})
if err != nil {
service.Error(ctx, err)
return
}
if workInfo.ArtistPhoneAreaCode == "86" {
_, err = service.AccountFieeProvider.OnlySendMsg(context.Background(), &accountFiee.SendMsgRequest{
Domain: "app",
TelNum: infoResp.TelNum,
Project: "fiee",
SignNo: 0,
MId: 277385,
Scope: "",
Zone: infoResp.TelAreaCode,
NonceStr: "",
})
} else {
_, err = service.AccountFieeProvider.SendNationTemplateMsg(context.Background(), &accountFiee.SendNationMsgRequest{
Domain: "app",
TelNum: fmt.Sprintf("%s%s", infoResp.TelAreaCode, infoResp.TelNum),
Project: "fiee",
SignNo: 0,
MId: 108375,
Scope: "",
})
}
if err != nil {
service.Error(ctx, err)
return
}
service.Success(ctx, nil)
return
}

280
pkg/service/file/file.go Normal file
View File

@ -0,0 +1,280 @@
package file
import (
"bytes"
"errors"
"fmt"
"fonchain-fiee/api/files"
"fonchain-fiee/pkg/service"
"io"
"net/http"
"net/url"
"strconv"
"strings"
"time"
"github.com/gin-gonic/gin"
)
func Raw(ctx *gin.Context) {
r := ctx.Request
w := ctx.Writer
w.Header().Add("Content-Security-Policy", `script-src 'none';`)
w.Header().Set("Cache-Control", "private")
rs, err := newGrpcReaderSeeker(getUserSpacePath(ctx), ctx.Param("path"))
if err != nil {
service.Error(ctx, err)
return
}
if r.URL.Query().Get("inline") == "true" {
w.Header().Set("Content-Disposition", "inline")
} else {
// As per RFC6266 section 4.3
w.Header().Set("Content-Disposition", "attachment; filename*=utf-8''"+rs.FileName)
}
http.ServeContent(ctx.Writer, r, rs.FileName, time.Now(), rs)
}
func List(ctx *gin.Context) {
path := ctx.DefaultQuery("path", "/")
sortBy := ctx.DefaultQuery("sortBy", "name")
sortAsc, _ := strconv.ParseBool(ctx.DefaultQuery("sortAsc", "true"))
resp, err := service.FilesProvider.List(ctx, &files.FileListReq{
Path: path,
UserSpacePath: getUserSpacePath(ctx),
Sorting: &files.Sorting{
By: sortBy,
Asc: sortAsc,
},
})
if err != nil {
service.Error(ctx, err)
return
}
service.Success(ctx, resp)
}
func Usage(ctx *gin.Context) {
path := ctx.DefaultQuery("path", "/")
resp, err := service.FilesProvider.Usage(ctx, &files.UsageReq{
Path: path,
UserSpacePath: getUserSpacePath(ctx),
})
if err != nil {
service.Error(ctx, err)
return
}
service.Success(ctx, resp)
}
func Info(ctx *gin.Context) {
resp, err := service.FilesProvider.Info(ctx, &files.FileInfoReq{
Path: ctx.DefaultQuery("path", "/"),
UserSpacePath: getUserSpacePath(ctx),
})
if err != nil {
service.Error(ctx, err)
return
}
service.Success(ctx, resp)
}
func Create(ctx *gin.Context) {
var req files.CreateReq
if err := ctx.ShouldBindJSON(&req); err != nil {
service.Error(ctx, err)
return
}
req.UserSpacePath = getUserSpacePath(ctx)
resp, err := service.FilesProvider.Create(ctx, &req)
if err != nil {
service.Error(ctx, err)
return
}
service.Success(ctx, resp)
}
func Delete(ctx *gin.Context) {
resp, err := service.FilesProvider.Delete(ctx, &files.DeleteReq{
Path: ctx.DefaultQuery("path", "/"),
UserSpacePath: getUserSpacePath(ctx),
})
if err != nil {
service.Error(ctx, err)
return
}
service.Success(ctx, resp)
}
func Search(ctx *gin.Context) {
resp, err := service.FilesProvider.Search(ctx, &files.SearchReq{
UserSpacePath: getUserSpacePath(ctx),
Path: ctx.Query("path"),
Query: ctx.Query("query"),
})
if err != nil {
service.Error(ctx, err)
return
}
service.Success(ctx, resp)
}
func Upload(ctx *gin.Context) {
path, ok := ctx.GetQuery("path")
if !ok {
service.Error(ctx, errors.New("缺失参数路径"))
return
}
b, err := io.ReadAll(ctx.Request.Body)
if !ok {
service.Error(ctx, err)
return
}
resp, err := service.FilesProvider.Upload(ctx, &files.UploadReq{
Path: path,
UserSpacePath: getUserSpacePath(ctx),
Content: b,
})
if err != nil {
service.Error(ctx, err)
return
}
service.Success(ctx, resp)
}
func TusCreate(ctx *gin.Context) {
var req files.TusCreateReq
if err := ctx.ShouldBindJSON(&req); err != nil {
service.Error(ctx, err)
return
}
req.UserSpacePath = getUserSpacePath(ctx)
resp, err := service.FilesProvider.TusCreate(ctx, &req)
if err != nil {
service.Error(ctx, err)
return
}
service.Success(ctx, resp)
}
func TusUpload(ctx *gin.Context) {
path, ok := ctx.GetQuery("path")
if !ok {
service.Error(ctx, errors.New("文件路径缺失"))
return
}
uploadOffset, err := getUploadOffset(ctx.Request)
if err != nil {
service.Error(ctx, fmt.Errorf("invalid upload offset: %w", err))
return
}
mf, err := ctx.MultipartForm()
if err != nil {
service.Error(ctx, fmt.Errorf("invalid upload offset: %w", err))
return
}
f, err := mf.File["file"][0].Open()
if err != nil {
service.Error(ctx, fmt.Errorf("invalid upload offset: %w", err))
return
}
defer f.Close()
b, err := io.ReadAll(f)
// b, err := io.ReadAll(ctx.Request.Body)
if !ok {
service.Error(ctx, err)
return
}
resp, err := service.FilesProvider.TusUpload(ctx, &files.TusUploadReq{
Path: path,
UploadOffset: uploadOffset,
Content: b,
UserSpacePath: getUserSpacePath(ctx),
})
if err != nil {
service.Error(ctx, err)
return
}
ctx.Writer.Header().Set("Upload-Offset", strconv.FormatInt(resp.UploadOffset, 10))
service.Success(ctx, nil)
}
func Preview(ctx *gin.Context) {
var size int
size, err := strconv.Atoi(ctx.Param("size"))
if err != nil {
size = 1
}
resp, err := service.FilesProvider.Preview(ctx, &files.PreviewReq{
Path: ctx.Param("path"),
UserSpacePath: getUserSpacePath(ctx),
Size: uint32(size),
})
if err != nil {
service.Error(ctx, err)
return
}
ctx.Writer.Header().Set("Cache-Control", "private")
http.ServeContent(ctx.Writer, ctx.Request, resp.FileName, time.UnixMilli(resp.ModTime), bytes.NewReader(resp.Content))
}
func Action(ctx *gin.Context) {
var req files.ActionReq
if err := ctx.ShouldBindJSON(&req); err != nil {
service.Error(ctx, err)
return
}
req.UserSpacePath = getUserSpacePath(ctx)
resp, err := service.FilesProvider.Action(ctx, &req)
if err != nil {
service.Error(ctx, err)
return
}
service.Success(ctx, resp)
}
func DirDownload(ctx *gin.Context) {
path := ctx.Query("path")
fileList := strings.Split(ctx.Query("files"), ",")
algo := ctx.Query("algo")
stream, err := service.FilesProvider.DirDownload(ctx, &files.DirDownloadReq{
Algo: algo,
Files: fileList,
Path: path,
UserSpacePath: getUserSpacePath(ctx),
})
if err != nil {
service.Error(ctx, err)
return
}
header, err := stream.Header()
if err != nil {
service.Error(ctx, err)
return
}
ctx.Writer.Header().Set("Content-Disposition", "attachment; filename*=utf-8''"+url.PathEscape(header.Get("filename")[0]))
for {
recvMsg, err := stream.Recv()
if err != nil {
break
}
ctx.Writer.Write(recvMsg.Content)
}
}
func getUploadOffset(r *http.Request) (int64, error) {
uploadOffset, err := strconv.ParseInt(r.Header.Get("Upload-Offset"), 10, 64)
if err != nil {
return 0, fmt.Errorf("invalid upload offset: %w", err)
}
return uploadOffset, nil
}
func getUserSpacePath(ctx *gin.Context) string {
// user := login.GetUserInfoFromC(ctx)
// return strconv.Itoa(int(user.ID))
return ""
}

View File

@ -0,0 +1,91 @@
package file
import (
"context"
"errors"
"fonchain-fiee/api/files"
"fonchain-fiee/pkg/service"
"io"
)
type grpcReaderSeeker struct {
io.Reader
io.Seeker
path string
userSpacePath string
cursor int64
length int64
FileName string
}
func (g *grpcReaderSeeker) Seek(offset int64, whence int) (int64, error) {
var abs int64
switch whence {
case io.SeekStart:
abs = offset
case io.SeekCurrent:
abs = g.cursor + offset
case io.SeekEnd:
abs = g.length + offset
default:
return 0, errors.New("grpc.Reader.Seek: invalid whence")
}
if abs < 0 {
return 0, errors.New("grpc.Reader.Seek: negative position")
}
g.cursor = abs
return abs, nil
}
func (g *grpcReaderSeeker) Read(b []byte) (n int, err error) {
if g.cursor >= g.length {
return 0, io.EOF
}
data, err := g.getBytesData(len(b))
if err != nil {
return 0, err
}
n = copy(b, data)
g.cursor += int64(n)
return
}
// 通过grpc获取到bytes数据
func (g *grpcReaderSeeker) getBytesData(len int) ([]byte, error) {
resp, err := service.FilesProvider.ResumableTransfer(context.TODO(), &files.ResumableTransferReq{
UserSpacePath: g.userSpacePath,
Path: g.path,
Offset: g.cursor,
Length: int64(len),
})
if err != nil {
return nil, err
}
return resp.Content, nil
}
// grpc 获取到文件信息
func (g *grpcReaderSeeker) initInfo() error {
resp, err := service.FilesProvider.Info(context.TODO(), &files.FileInfoReq{
UserSpacePath: g.userSpacePath,
Path: g.path,
})
if err != nil {
return nil
}
g.FileName = resp.Name
g.length = resp.Size
return err
}
func newGrpcReaderSeeker(userSpacePath string, path string) (*grpcReaderSeeker, error) {
g := new(grpcReaderSeeker)
g.userSpacePath = userSpacePath
g.path = path
err := g.initInfo()
if err != nil {
return nil, err
}
return g, nil
}

View File

@ -0,0 +1,84 @@
package governance
import (
"github.com/gin-gonic/gin"
"fonchain-fiee/api/governance"
"fonchain-fiee/pkg/model/login"
"fonchain-fiee/pkg/service"
)
func Create(ctx *gin.Context) {
var req governance.CreateReq
if err := ctx.ShouldBindJSON(&req); err != nil {
service.Error(ctx, err)
return
}
user := login.GetUserInfoFromC(ctx)
// user := login.Info{
// Name: "test" + strconv.Itoa(rand.Intn(10)),
// ID: uint64(rand.Intn(10)),
// }
req.Operator = user.Name
req.OperatorId = int32(user.ID)
resp, err := service.GovernanceProvider.Create(ctx, &req)
if err != nil {
service.Error(ctx, err)
return
}
service.Success(ctx, resp)
}
func Delete(ctx *gin.Context) {
var req governance.DeleteReq
if err := ctx.ShouldBindJSON(&req); err != nil {
service.Error(ctx, err)
return
}
resp, err := service.GovernanceProvider.Delete(ctx, &req)
if err != nil {
service.Error(ctx, err)
return
}
service.Success(ctx, resp)
}
func Display(ctx *gin.Context) {
resp, err := service.GovernanceProvider.Display(ctx, &governance.DisplayReq{})
if err != nil {
service.Error(ctx, err)
return
}
service.Success(ctx, resp)
}
func List(ctx *gin.Context) {
var req governance.ListReq
if err := ctx.ShouldBindJSON(&req); err != nil {
service.Error(ctx, err)
return
}
resp, err := service.GovernanceProvider.List(ctx, &req)
if err != nil {
service.Error(ctx, err)
return
}
service.Success(ctx, resp)
}
func Edit(ctx *gin.Context) {
var req governance.EditReq
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.Edit(ctx, &req)
if err != nil {
service.Error(ctx, err)
return
}
service.Success(ctx, resp)
}

View File

@ -1,17 +1,23 @@
package service package service
import ( import (
"dubbo.apache.org/dubbo-go/v3/common/constant"
"dubbo.apache.org/dubbo-go/v3/config"
_ "dubbo.apache.org/dubbo-go/v3/imports"
"fmt" "fmt"
"fonchain-fiee/api/account" "fonchain-fiee/api/account"
"fonchain-fiee/api/accountFiee" "fonchain-fiee/api/accountFiee"
"fonchain-fiee/api/bundle" "fonchain-fiee/api/bundle"
"fonchain-fiee/api/cast"
"fonchain-fiee/api/files"
"fonchain-fiee/api/governance"
"fonchain-fiee/api/order" "fonchain-fiee/api/order"
"fonchain-fiee/api/payment" "fonchain-fiee/api/payment"
"fonchain-fiee/api/pressreleases"
"fonchain-fiee/api/secFilings"
pkConfig "fonchain-fiee/pkg/config" pkConfig "fonchain-fiee/pkg/config"
"os" "os"
"dubbo.apache.org/dubbo-go/v3/common/constant"
"dubbo.apache.org/dubbo-go/v3/config"
_ "dubbo.apache.org/dubbo-go/v3/imports"
) )
var AccountProvider = new(account.AccountClientImpl) var AccountProvider = new(account.AccountClientImpl)
@ -19,7 +25,12 @@ var AccountFieeProvider = new(accountFiee.AccountFieeClientImpl)
var BundleProvider = new(bundle.BundleClientImpl) var BundleProvider = new(bundle.BundleClientImpl)
var OrderProvider = new(order.OrderClientImpl) var OrderProvider = new(order.OrderClientImpl)
var FilesProvider = new(files.FileClientImpl)
var PaymentProvider = new(payment.PaymentCentClientImpl) var PaymentProvider = new(payment.PaymentCentClientImpl)
var CastProvider = new(cast.CastClientImpl)
var GovernanceProvider = new(governance.GovernanceClientImpl)
var PressReleasesProvider = new(pressreleases.PressReleasesClientImpl)
var SecFilingProvider = new(secFilings.SecFilingsClientImpl)
func init() { func init() {
config.SetConsumerService(BundleProvider) config.SetConsumerService(BundleProvider)
@ -27,6 +38,11 @@ func init() {
config.SetConsumerService(AccountProvider) config.SetConsumerService(AccountProvider)
config.SetConsumerService(PaymentProvider) config.SetConsumerService(PaymentProvider)
config.SetConsumerService(AccountFieeProvider) config.SetConsumerService(AccountFieeProvider)
config.SetConsumerService(CastProvider)
config.SetConsumerService(FilesProvider)
config.SetConsumerService(GovernanceProvider)
config.SetConsumerService(PressReleasesProvider)
config.SetConsumerService(SecFilingProvider)
if err := config.Load(); err != nil { if err := config.Load(); err != nil {
panic(err) panic(err)

View File

@ -0,0 +1,103 @@
package pressreleases
import (
"strconv"
"github.com/gin-gonic/gin"
"fonchain-fiee/api/pressreleases"
"fonchain-fiee/pkg/model/login"
"fonchain-fiee/pkg/service"
)
func Create(ctx *gin.Context) {
var req pressreleases.CreateReq
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.PressReleasesProvider.Create(ctx, &req)
if err != nil {
service.Error(ctx, err)
return
}
service.Success(ctx, resp)
}
func Delete(ctx *gin.Context) {
var req pressreleases.DeleteReq
if err := ctx.ShouldBindJSON(&req); err != nil {
service.Error(ctx, err)
return
}
resp, err := service.PressReleasesProvider.Delete(ctx, &req)
if err != nil {
service.Error(ctx, err)
return
}
service.Success(ctx, resp)
}
func Display(ctx *gin.Context) {
var req pressreleases.DisplayReq
if err := ctx.ShouldBindJSON(&req); err != nil {
service.Error(ctx, err)
return
}
resp, err := service.PressReleasesProvider.Display(ctx, &req)
if err != nil {
service.Error(ctx, err)
return
}
service.Success(ctx, resp)
}
func List(ctx *gin.Context) {
var req pressreleases.ListReq
if err := ctx.ShouldBindJSON(&req); err != nil {
service.Error(ctx, err)
return
}
resp, err := service.PressReleasesProvider.List(ctx, &req)
if err != nil {
service.Error(ctx, err)
return
}
service.Success(ctx, resp)
}
func Edit(ctx *gin.Context) {
var req pressreleases.EditReq
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.PressReleasesProvider.Edit(ctx, &req)
if err != nil {
service.Error(ctx, err)
return
}
service.Success(ctx, resp)
}
func Get(ctx *gin.Context) {
id, err := strconv.Atoi(ctx.Query("id"))
if err != nil {
service.Error(ctx, err)
return
}
resp, err := service.PressReleasesProvider.Get(ctx, &pressreleases.GetReq{
Id: int64(id),
})
if err != nil {
service.Error(ctx, err)
return
}
service.Success(ctx, resp)
}

View File

@ -0,0 +1,235 @@
package secfilings
import (
"encoding/json"
"errors"
"fmt"
"fonchain-fiee/api/secFilings"
"fonchain-fiee/pkg/model/login"
"fonchain-fiee/pkg/service"
"net/http"
"net/url"
"strconv"
"github.com/gin-gonic/gin"
"github.com/gin-gonic/gin/binding"
)
func CreateSecFiling(c *gin.Context) {
var req secFilings.CreateSecFilingReq
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
service.Error(c, err)
return
}
userInfo := login.GetUserInfoFromC(c)
req.Operator = userInfo.Name
req.OperatorId = int32(userInfo.ID)
res, err := service.SecFilingProvider.CreateSecFiling(c, &req)
if err != nil {
service.Error(c, err)
return
}
service.Success(c, res)
}
func UpdateSecFiling(c *gin.Context) {
var req secFilings.UpdateSecFilingReq
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
service.Error(c, err)
return
}
userInfo := login.GetUserInfoFromC(c)
req.Operator = userInfo.Name
req.OperatorId = int32(userInfo.ID)
res, err := service.SecFilingProvider.UpdateSecFiling(c, &req)
if err != nil {
service.Error(c, err)
return
}
service.Success(c, res)
}
func UpdateSecFilingStatus(c *gin.Context) {
var req secFilings.UpdateSecFilingStatusReq
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
service.Error(c, err)
return
}
userInfo := login.GetUserInfoFromC(c)
req.Operator = userInfo.Name
req.OperatorId = int32(userInfo.ID)
res, err := service.SecFilingProvider.UpdateSecFilingStatus(c, &req)
if err != nil {
service.Error(c, err)
return
}
service.Success(c, res)
}
func ListSecFiling(c *gin.Context) {
var req secFilings.ListSecFilingReq
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
service.Error(c, err)
return
}
res, err := service.SecFilingProvider.ListSecFiling(c, &req)
if err != nil {
service.Error(c, err)
return
}
service.Success(c, res)
}
func DetailSecFiling(c *gin.Context) {
var req secFilings.DetailSecFilingReq
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
service.Error(c, err)
return
}
res, err := service.SecFilingProvider.DetailSecFiling(c, &req)
if err != nil {
service.Error(c, err)
return
}
service.Success(c, res)
}
func DeleteSecFiling(c *gin.Context) {
var req secFilings.DeleteSecFilingReq
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
service.Error(c, err)
return
}
userInfo := login.GetUserInfoFromC(c)
req.Operator = userInfo.Name
req.OperatorId = int32(userInfo.ID)
res, err := service.SecFilingProvider.DeleteSecFiling(c, &req)
if err != nil {
service.Error(c, err)
return
}
service.Success(c, res)
}
type GetSecFilingsReq struct {
FilingDate string `json:"filingDate"`
Page int `json:"page"`
PageSize int `json:"pageSize"`
}
type GetSecFilingsData struct {
Symbol string `json:"symbol"`
Cik string `json:"cik"`
FilingDate string `json:"filingDate"`
AcceptedDate string `json:"acceptedDate"`
FormType string `json:"formType"`
Link string `json:"link"`
FinalLink string `json:"finalLink"`
IsSelect bool `json:"isSelect"`
}
type GetSecFilingsResp struct {
Total int `json:"total"`
Data []*GetSecFilingsResult `json:"data"`
}
type GetSecFilingsResult struct {
//Symbol string `json:"symbol"`
//Cik string `json:"cik"`
FilingDate string `json:"filingDate"`
Form string `json:"form"`
//Description string `json:"description"`
//FormDescription string `json:"formDescription"`
FileLink string `json:"fileLink"`
IsSelect bool `json:"isSelect"`
}
func GetSecFilings(c *gin.Context) {
var req GetSecFilingsReq
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
service.Error(c, err)
return
}
if req.FilingDate == "" {
service.Error(c, errors.New("filing_date is empty"))
return
}
fmt.Println(req.FilingDate)
symbol := "MINM"
beginDate := req.FilingDate
endDate := req.FilingDate
page := 0
pageSize := 100
if req.Page != 0 && req.PageSize != 0 {
page = req.Page - 1
pageSize = req.PageSize
}
baseURL := "https://financialmodelingprep.com/stable/sec-filings-search/symbol"
params := url.Values{}
params.Add("symbol", symbol)
params.Add("from", beginDate)
params.Add("to", endDate)
params.Add("page", strconv.Itoa(page))
params.Add("limit", strconv.Itoa(pageSize))
params.Add("apikey", "lBQWUwdjRmfHVZ7e3I1trWe4jw0ZtDct")
fullURL := fmt.Sprintf("%s?%s", baseURL, params.Encode())
resp, err := http.Get(fullURL)
if err != nil {
service.Error(c, err)
return
}
defer resp.Body.Close()
if resp.StatusCode != http.StatusOK {
service.Error(c, fmt.Errorf("http status code is not 200"))
return
}
var result []GetSecFilingsData
err = json.NewDecoder(resp.Body).Decode(&result)
if err != nil {
service.Error(c, err)
return
}
var data = GetSecFilingsResp{
Total: 0,
Data: make([]*GetSecFilingsResult, 0),
}
for _, v := range result {
res, err := service.SecFilingProvider.IsSecFilingExist(c, &secFilings.IsSecFilingExistReq{
FilingDate: req.FilingDate,
Form: v.FormType,
FinalLink: v.FinalLink,
})
if err != nil {
service.Error(c, err)
return
}
data.Data = append(data.Data, &GetSecFilingsResult{
FilingDate: req.FilingDate,
Form: v.FormType,
FileLink: v.FinalLink,
IsSelect: res.Exist,
})
data.Total++
}
service.Success(c, data)
}
func GetFormList(c *gin.Context) {
var req secFilings.ListFormTypeReq
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
service.Error(c, err)
return
}
res, err := service.SecFilingProvider.ListFormType(c, &req)
if err != nil {
service.Error(c, err)
return
}
service.Success(c, res)
}
func WebListSecFiling(c *gin.Context) {
var req secFilings.WebListSecFilingReq
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
service.Error(c, err)
return
}
res, err := service.SecFilingProvider.WebListSecFiling(c, &req)
if err != nil {
service.Error(c, err)
return
}
service.Success(c, res)
}

34
pkg/utils/http.go Normal file
View File

@ -0,0 +1,34 @@
package utils
import (
"bytes"
"io/ioutil"
"net/http"
)
func Post(url, data string) (string, error) {
reader := bytes.NewReader([]byte(data))
request, err := http.NewRequest("POST", url, reader)
if err != nil {
return "", err
}
defer request.Body.Close() //程序在使用完回复后必须关闭回复的主体
request.Header.Set("Content-Type", "application/json;charset=UTF-8")
//必须设定该参数,POST参数才能正常提交意思是以json串提交数据
client := http.Client{}
resp, err := client.Do(request) //Do 方法发送请求,返回 HTTP 回复
if err != nil {
return "", err
}
respBytes, err := ioutil.ReadAll(resp.Body)
if err != nil {
return "", err
}
//byte数组直接转成string优化内存
// str := (*string)(unsafe.Pointer(&respBytes))
return string(respBytes), nil
}

View File

@ -5,7 +5,10 @@ import (
"crypto/sha256" "crypto/sha256"
"encoding/hex" "encoding/hex"
"errors" "errors"
"fmt"
"fonchain-fiee/pkg/e" "fonchain-fiee/pkg/e"
"github.com/gin-gonic/gin"
"github.com/tealeg/xlsx"
"io" "io"
"io/ioutil" "io/ioutil"
"net/http" "net/http"
@ -78,3 +81,50 @@ func CheckDirPath(path string, create bool) (exists bool, err error) {
exists = true exists = true
return return
} }
// ToExcelByType 转成Excel类型
func ToExcelByType(titleList []string, dataList []interface{}, dataType string, filePath string) (content io.ReadSeeker, err error) {
// 生成一个新的文件
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()
if dataType == "struct" {
row.WriteStruct(v, -1)
} else if dataType == "slice" {
row.WriteSlice(v, -1)
}
}
var buffer bytes.Buffer
_ = file.Write(&buffer)
if filePath != "" {
if err = file.Save(filePath); err != nil {
return
}
} else {
content = bytes.NewReader(buffer.Bytes())
}
return
}
// ResponseXls content 为上面生成的io.ReadSeeker fileTag 为返回前端的文件名
func ResponseXls(c *gin.Context, content io.ReadSeeker, fileTag string) {
fileName := fmt.Sprintf("%s.%s", fileTag, ExcelPrefix)
// 返回 Excel 文件流给前端
c.Header("Content-Type", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")
c.Header("Content-Disposition", fmt.Sprintf(`attachment; filename="%s"`, fileName))
c.Header("File-Name", fmt.Sprintf("%s", fileName))
c.Header("Access-Control-Expose-Headers", "File-Name")
//_ = c.Writer(c.Writer)
//c.Writer.Header().Add("Content-Disposition", fmt.Sprintf(`attachment; filename="%s"`, fileName))
//c.Writer.Header().Add("Content-Type", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")
http.ServeContent(c.Writer, c.Request, fileName, time.Now(), content)
}