合并分支 'test' 到 'master'
Test 查看合并请求 !54
正在显示
69 个修改的文件
包含
4146 行增加
和
38 行删除
.DS_Store
0 → 100644
不能预览此文件类型
.idea/.gitignore
0 → 100644
.idea/allied-creation-cooperation.iml
0 → 100644
1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
2 | +<module type="WEB_MODULE" version="4"> | ||
3 | + <component name="Go" enabled="true" /> | ||
4 | + <component name="NewModuleRootManager"> | ||
5 | + <content url="file://$MODULE_DIR$" /> | ||
6 | + <orderEntry type="inheritedJdk" /> | ||
7 | + <orderEntry type="sourceFolder" forTests="false" /> | ||
8 | + </component> | ||
9 | +</module> |
.idea/codestream.xml
0 → 100644
1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
2 | +<project version="4"> | ||
3 | + <component name="CodeStream"> | ||
4 | + <option name="webViewContext" value="{"chatProviderAccess":"strict","currentTeamId":"","currentStreamId":"","pullRequestCheckoutBranch":false,"isRepositioning":false,"onboardStep":0,"panelStack":["landing-redirect"],"hasFocus":false,"channelFilter":"all","channelsMuteAll":false,"codemarkFileFilter":"all","codemarkTypeFilter":"all","codemarkTagFilter":"all","codemarkBranchFilter":"all","codemarkAuthorFilter":"all","codemarksFileViewStyle":"inline","codemarksShowArchived":false,"codemarksShowResolved":false,"codemarksWrapComments":false,"showFeedbackSmiley":true,"route":{"name":"newUserEntry","params":{}},"spatialViewShowPRComments":false}" /> | ||
5 | + </component> | ||
6 | +</project> |
.idea/modules.xml
0 → 100644
1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
2 | +<project version="4"> | ||
3 | + <component name="ProjectModuleManager"> | ||
4 | + <modules> | ||
5 | + <module fileurl="file://$PROJECT_DIR$/.idea/allied-creation-cooperation.iml" filepath="$PROJECT_DIR$/.idea/allied-creation-cooperation.iml" /> | ||
6 | + </modules> | ||
7 | + </component> | ||
8 | +</project> |
.idea/vcs.xml
0 → 100644
.idea/watcherTasks.xml
0 → 100644
.run/Docker for Mac.run.xml
0 → 100644
1 | +<component name="ProjectRunConfigurationManager"> | ||
2 | + <configuration default="false" name="Docker for Mac" type="docker-deploy" factoryName="dockerfile" server-name="Docker"> | ||
3 | + <deployment type="dockerfile"> | ||
4 | + <settings> | ||
5 | + <option name="imageTag" value="latest" /> | ||
6 | + <option name="containerName" value="allied-creation-cooperation" /> | ||
7 | + <option name="envVars"> | ||
8 | + <list> | ||
9 | + <DockerEnvVarImpl> | ||
10 | + <option name="name" value="POSTGRESQL_HOST" /> | ||
11 | + <option name="value" value="114.55.200.59" /> | ||
12 | + </DockerEnvVarImpl> | ||
13 | + <DockerEnvVarImpl> | ||
14 | + <option name="name" value="POSTGRESQL_DB_NAME" /> | ||
15 | + <option name="value" value="allied_creation_cooperation_dev" /> | ||
16 | + </DockerEnvVarImpl> | ||
17 | + <DockerEnvVarImpl> | ||
18 | + <option name="name" value="POSTGRESQL_PORT" /> | ||
19 | + <option name="value" value="31543" /> | ||
20 | + </DockerEnvVarImpl> | ||
21 | + <DockerEnvVarImpl> | ||
22 | + <option name="name" value="POSTGRESQL_PASSWORD" /> | ||
23 | + <option name="value" value="eagle1010" /> | ||
24 | + </DockerEnvVarImpl> | ||
25 | + </list> | ||
26 | + </option> | ||
27 | + <option name="portBindings"> | ||
28 | + <list> | ||
29 | + <DockerPortBindingImpl> | ||
30 | + <option name="containerPort" value="8082" /> | ||
31 | + <option name="hostPort" value="8082" /> | ||
32 | + </DockerPortBindingImpl> | ||
33 | + </list> | ||
34 | + </option> | ||
35 | + <option name="sourceFilePath" value="Dockerfile" /> | ||
36 | + </settings> | ||
37 | + </deployment> | ||
38 | + <method v="2" /> | ||
39 | + </configuration> | ||
40 | +</component> |
Dockerfile
0 → 100644
1 | +FROM 192.168.0.243:5000/mmm/allied-creation-cooperation:20210908 | ||
2 | +#FROM golang:latest | ||
3 | +MAINTAINER 陈志颖 <steve.d.chan@qq.com> | ||
4 | +ENV APP_DIR $GOPATH/src/allied-creation-cooperation-20210909 | ||
5 | +RUN mkdir -p $APP_DIR | ||
6 | +WORKDIR $APP_DIR/ | ||
7 | +COPY ./pkg pkg | ||
8 | +COPY ./config config | ||
9 | +COPY ./go.mod go.mod | ||
10 | +COPY ./go.sum go.sum | ||
11 | +COPY ./main.go main.go | ||
12 | +RUN ["ln","-sf","/usr/share/zoneinfo/Asia/Shanghai","/etc/localtime"] | ||
13 | +ENV GO111MODULE on | ||
14 | +ENV GOPROXY https://goproxy.cn | ||
15 | +RUN ["go","mod","tidy"] | ||
16 | +RUN ["ls"] | ||
17 | +RUN ["go","build"] | ||
18 | +ENTRYPOINT ["./allied-creation-cooperation"] | ||
19 | + | ||
20 | +############################## | ||
21 | +### STEP 1 build executable binary | ||
22 | +############################## | ||
23 | +#FROM golang:latest AS builder | ||
24 | +#MAINTAINER 陈志颖 <steve.d.chan@qq.com> | ||
25 | +#RUN mkdir /app | ||
26 | +#WORKDIR /app | ||
27 | +#COPY . /app | ||
28 | +#RUN ["ln","-sf","/usr/share/zoneinfo/Asia/Shanghai","/etc/localtime"] | ||
29 | +#RUN GO111MODULE="on" GOPROXY="https://goproxy.cn" CGO_ENABLED=0 GOOS=linux go build -o allied-creation-cooperation | ||
30 | +# | ||
31 | +############################## | ||
32 | +### STEP 2 build a small image | ||
33 | +############################# | ||
34 | +#FROM scratch as final | ||
35 | +#COPY --from=builder /app/allied-creation-cooperation /app/allied-creation-cooperation | ||
36 | +#ENTRYPOINT ["./app/allied-creation-cooperation"] |
1 | # 天联共创 | 1 | # 天联共创 |
2 | 2 | ||
3 | +## 项目架构 | ||
4 | +- 基于REST Full的微服务架构 | ||
5 | + | ||
3 | ## 代码仓库及相关文档 | 6 | ## 代码仓库及相关文档 |
4 | -- [仓库地址](http://gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation.git) | ||
5 | -- [项目原型svn](svn://220.250.41.79/repo/标准产品文件) | 7 | +- [代码仓库地址](http://gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation.git) |
8 | +- [DSL文件仓库地址](http://gitlab.fjmaimaimai.com/allied-creation/document) | ||
9 | +- [标准产品文件svn](svn://220.250.41.79/repo/标准产品文件) | ||
6 | - [天联共创API(APP)](http://47.97.5.102:36666/project/342/interface/api) | 10 | - [天联共创API(APP)](http://47.97.5.102:36666/project/342/interface/api) |
11 | +- [APP端原型地址](https://9cnuol.axshare.com/) | ||
12 | +- [WEB端原型地址](https://eq4yc2.axshare.com/) | ||
7 | 13 | ||
8 | ## 项目规范 | 14 | ## 项目规范 |
9 | - 领域描述语言文档位置:document/allied-creation-cooperation/ | 15 | - 领域描述语言文档位置:document/allied-creation-cooperation/ |
10 | - GIT流程:里程碑->问题->功能分支->代码审查->合并分支 | 16 | - GIT流程:里程碑->问题->功能分支->代码审查->合并分支 |
11 | - 开发分支命名规范:dev-姓名全拼 | 17 | - 开发分支命名规范:dev-姓名全拼 |
12 | - 接口规范:[API交互规范](https://doc-press.fjmaimaimai.com/standard/api.html) | 18 | - 接口规范:[API交互规范](https://doc-press.fjmaimaimai.com/standard/api.html) |
13 | -- 接口版本号:v2 | 19 | +- 接口版本号:v1 |
14 | - 数据交互规范:[数据交互格式标准](https://doc-press.fjmaimaimai.com/team/frontend/overview/http.html) | 20 | - 数据交互规范:[数据交互格式标准](https://doc-press.fjmaimaimai.com/team/frontend/overview/http.html) |
15 | 21 | ||
16 | ## 项目使用框架 | 22 | ## 项目使用框架 |
@@ -86,6 +92,8 @@ | @@ -86,6 +92,8 @@ | ||
86 | 92 | ||
87 | ### DTO模块开发 | 93 | ### DTO模块开发 |
88 | 94 | ||
95 | +### REST集成限界上下文 | ||
96 | + | ||
89 | ## 标准产品组工具使用 | 97 | ## 标准产品组工具使用 |
90 | - 设置全局变量(替换YOUR-USER-PATH为你真实的项目路径) | 98 | - 设置全局变量(替换YOUR-USER-PATH为你真实的项目路径) |
91 | 99 | ||
@@ -119,12 +127,12 @@ | @@ -119,12 +127,12 @@ | ||
119 | 127 | ||
120 | 5.生成Http协议接口 | 128 | 5.生成Http协议接口 |
121 | 129 | ||
122 | -- Tips | 130 | +- 调试技巧 |
123 | 131 | ||
124 | 1.代码生成器服务端500错误调试技巧 | 132 | 1.代码生成器服务端500错误调试技巧 |
125 | 133 | ||
126 | - 在任务管理其中关闭由标准化平台带起的eggcode.exe,在命令行通过命令eggcode.exe http -p 9099启动生成器服务,这样就可以打印出生成器500错误的具体信息,关键还是在编写dsl时要细心,不需要的配置整体删干净,需要的配置写完整,注意属性名不要和golang的关键字或者保留字冲突,例如:type、no | 134 | + 在任务管理其中关闭由标准化平台启动的eggcode.exe(需要debug版本才能查看日志),在命令行通过命令eggcode.exe http -p 9099启动生成器服务,这样就可以打印出生成器500错误的具体信息,关键还是在编写dsl时要细心,不需要的配置整体删干净,需要的配置写完整,注意属性名不要和golang的关键字或者保留字冲突,例如:type、no |
127 | 135 | ||
128 | - 2.集成调试技巧 | 136 | + 2.集成测试技巧 |
129 | 137 | ||
130 | Describe前面添加F可以针对当前用例进行测试,同样的It前面增加F也可以针对一个Describe中的不同IT进行测试,F的意思为Focus,另外还有其他标记如:P(Pending) or X,详情 [参考](https://onsi.github.io/ginkgo/) Ginkgo官方文档The Spec Runner章节 | 138 | Describe前面添加F可以针对当前用例进行测试,同样的It前面增加F也可以针对一个Describe中的不同IT进行测试,F的意思为Focus,另外还有其他标记如:P(Pending) or X,详情 [参考](https://onsi.github.io/ginkgo/) Ginkgo官方文档The Spec Runner章节 |
config/fjmaimaimai.com.key
0 → 100644
1 | +-----BEGIN RSA PRIVATE KEY----- | ||
2 | +MIIEpQIBAAKCAQEAy0OxRf+NheQG9epxbrudwnrzqVgqK5zCuRAkLUgaSMATVXEA | ||
3 | +iDzJN39om+Q49MmtEk4pXGzKUyzkFJG96PA8tJq0E+bSDtSK3n+2mjZb6pChmgHw | ||
4 | +KEX7T8ZVLqJBSrfrI4Z2BJDNEC+3wvVW3zpog1RlfKgft6NYUzNLUqE5Mxzq7lpD | ||
5 | +eRsq+FhzM1sOeEb2dAmUlDDs+7HcR3Kj0ttKeg+hKqIottQ/H6Tq4c8deEQGnO0+ | ||
6 | +RN3CygyETbYmLuWttI/sUltulWJALIuU81Yr6uCOq5MSt2WsU8CTuhRwGXSvcQCO | ||
7 | +FLYppYktoMDOGIBQffmJc/DdT1d35fvdpKbm+QIDAQABAoIBAQC8X7+qX2uI6gqJ | ||
8 | +XPxC4x0RX2DxUAPE50KOv6bHUEsLoPZJ+K/Fko/oHuuTja47Lax3inhKb4gSDUhS | ||
9 | +x754YivgNH8u8ns5wz/vc+yGflowyFj7oVAwAqslA2luDnD0Df6crcAx+wAQQCjN | ||
10 | +RRF9T2QMUeq73BOI3Ji+gosLyN55vms2KadrwpPQwYN7qhdrerE7vPqCZeswzs1/ | ||
11 | +A5M9PVGBG+simNea5kv+tVJUdLi6ckGAB5KabyhpG779ckwzV/aZy3wIj4SvUvCd | ||
12 | +bewH0xPHx5TqnMOXtzHgktClmL7hIYxy9sL14Dn0KVHbyolQ7IqmJtjXYqG84Fmx | ||
13 | +AfyDfeABAoGBAPP820tKElrfTuZ+Z19kJBTp6I5iax2Ph10glUHLlLqJ82clI/Gl | ||
14 | +CbMtnGmD72HfnJei82xqoVLsUkN9Sp+TSNJALh4N8rHkAtwq5kWToiAWZydwxVsp | ||
15 | +x5OWEN3+QFIdjVW6fhg6jZSK5HHIqMdZOVvbfKP+Cv9fWWzlS7/WVTlJAoGBANVF | ||
16 | +kol+KojM4DEASrw0s1mfPr0XvUFvKJ2TgVGR3HxAk4r0e0WwJdSfwGiB/ePcc6g5 | ||
17 | +D5dxBe8W5g3+V0DaC0f1DDNXg2MjYWoByWrurbm14FRnpMnx/UfZLo7rq8T9YrUT | ||
18 | +Bd/y0/JasndN27bIfd60n233IYMqhV2+wBwqD3AxAoGAE2/wdHYJMk4Z9gjZ6WKL | ||
19 | +8VKVIUq759X4XbXrzhsO1TGKP4xY6bZRKIIYtNs65dwvmHD13Yw9H+MNxqyjlkTg | ||
20 | +h0dvpRtNW1ij1bBhOefCAbZnL2AviMyyRpKs81J/A0uxZ8P8qad4gf3ypxHqSD9W | ||
21 | +b3fz3QivDZsl/6Pgvf6wOWkCgYEA1Cv9x5lj2WrxEu62axyG3P9nHBm055cdsf5g | ||
22 | +JfVVg6t+3TuyM7c1O52efpnsKrdTvKTf1QrVG3INdxh0V4lUtcac16sVhBhbvml+ | ||
23 | +p0pCPMIrJe1ibKG5F7SB9B+TaEuo2nnNW2mp367JY5VqoyI8zsWk4nJ8vZAc1BGD | ||
24 | +78EMUNECgYEAtV0pta3GuHKOLX1HMRsUsYuWjLqAbahnciF6MnjNWSonEK3VjMhI | ||
25 | +g+krP/9sWoC3cFOG+4s96ubjDTWImvQvCrPaENdvlNwgp035bn51eFRv00QchM2H | ||
26 | +VCS9Nhoqj5BIHl1G7Q13+tYTzjUWtteG902nWDVhgSlNLJf1rbTn34g= | ||
27 | +-----END RSA PRIVATE KEY----- |
config/fjmaimaimai.com_bundle.crt
0 → 100644
1 | +-----BEGIN CERTIFICATE----- | ||
2 | +MIIGazCCBVOgAwIBAgIQZBwijHoFToh2kjGwQ1E6bjANBgkqhkiG9w0BAQsFADBc | ||
3 | +MQswCQYDVQQGEwJDTjEaMBgGA1UEChMRV29UcnVzIENBIExpbWl0ZWQxMTAvBgNV | ||
4 | +BAMMKFdvVHJ1cyBPViBTZXJ2ZXIgQ0EgIFtSdW4gYnkgdGhlIElzc3Vlcl0wHhcN | ||
5 | +MjEwMjA0MDAwMDAwWhcNMjIwMzA2MjM1OTU5WjCB0TELMAkGA1UEBhMCQ04xDzAN | ||
6 | +BgNVBBETBjM1MDAxNTESMBAGA1UEBwwJ56aP5bee5biCMU8wTQYDVQQJDEbpqazl | ||
7 | +sL7ljLrmuZbph4zot68yN+WPtzEj5qW85LqU5qW8NTEw44CBNTEx5a6k77yI6Ieq | ||
8 | +6LS46K+V6aqM5Yy65YaF77yJMTAwLgYDVQQKDCfnpo/lu7rkubDkubDkubDkv6Hm | ||
9 | +ga/np5HmioDmnInpmZDlhazlj7gxGjAYBgNVBAMMESouZmptYWltYWltYWkuY29t | ||
10 | +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAy0OxRf+NheQG9epxbrud | ||
11 | +wnrzqVgqK5zCuRAkLUgaSMATVXEAiDzJN39om+Q49MmtEk4pXGzKUyzkFJG96PA8 | ||
12 | +tJq0E+bSDtSK3n+2mjZb6pChmgHwKEX7T8ZVLqJBSrfrI4Z2BJDNEC+3wvVW3zpo | ||
13 | +g1RlfKgft6NYUzNLUqE5Mxzq7lpDeRsq+FhzM1sOeEb2dAmUlDDs+7HcR3Kj0ttK | ||
14 | +eg+hKqIottQ/H6Tq4c8deEQGnO0+RN3CygyETbYmLuWttI/sUltulWJALIuU81Yr | ||
15 | +6uCOq5MSt2WsU8CTuhRwGXSvcQCOFLYppYktoMDOGIBQffmJc/DdT1d35fvdpKbm | ||
16 | ++QIDAQABo4ICsTCCAq0wHwYDVR0jBBgwFoAUDUmPFTN7wE+2+zo4Cfw0Fdpg3RQw | ||
17 | +HQYDVR0OBBYEFMGZEgzwtp+UhpTAS9nmSxlo9tIlMA4GA1UdDwEB/wQEAwIFoDAM | ||
18 | +BgNVHRMBAf8EAjAAMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjBJBgNV | ||
19 | +HSAEQjBAMDQGCysGAQQBsjEBAgIWMCUwIwYIKwYBBQUHAgEWF2h0dHBzOi8vc2Vj | ||
20 | +dGlnby5jb20vQ1BTMAgGBmeBDAECAjA9BgNVHR8ENjA0MDKgMKAuhixodHRwOi8v | ||
21 | +Y3JsLmNybG9jc3AuY24vV29UcnVzT1ZTZXJ2ZXJDQV8yLmNybDBsBggrBgEFBQcB | ||
22 | +AQRgMF4wOAYIKwYBBQUHMAKGLGh0dHA6Ly9haWEuY3Jsb2NzcC5jbi9Xb1RydXNP | ||
23 | +VlNlcnZlckNBXzIuY3J0MCIGCCsGAQUFBzABhhZodHRwOi8vb2NzcC5jcmxvY3Nw | ||
24 | +LmNuMIIBBQYKKwYBBAHWeQIEAgSB9gSB8wDxAHcARqVV63X6kSAwtaKJafTzfREs | ||
25 | +QXS+/Um4havy/HD+bUcAAAF3brV9qAAABAMASDBGAiEAjrXS+1JJW9jag/XfW+kY | ||
26 | +oL4sGGDNvcZgV35E0EcGQVACIQCjQh8k5oSFtqo7Qrbx2k3OISjfPSYRXNNsG4Ba | ||
27 | +MyDmRwB2AN+lXqtogk8fbK3uuF9OPlrqzaISpGpejjsSwCBEXCpzAAABd261fdAA | ||
28 | +AAQDAEcwRQIgcPQQJ3rkCFaQPKwT3rtfQkr0taPzw0KW7yqu+MtmBH0CIQChKeMk | ||
29 | +v7Xs0z7J47lM6HTPOU+xXL2riC69LC1KCOS6GTAtBgNVHREEJjAkghEqLmZqbWFp | ||
30 | +bWFpbWFpLmNvbYIPZmptYWltYWltYWkuY29tMA0GCSqGSIb3DQEBCwUAA4IBAQBn | ||
31 | ++jDy7sZS0gZzwMR4hnZHWqFYcJR3wnk77xr+5Yu2ifhlxaLHE3rEY3xTR9LsPwfW | ||
32 | +pdg2McinPCI6vs009NYIpeTiHzVDPzKu2BaUfKj+EHLwZQGfXkNhp3cpqZMiTkr/ | ||
33 | +YNqf25GXsBa+spwzyHh9MBXXCfWRfdHX7JlH5zyoLNztTp8unxaRYldjghHDA3Q7 | ||
34 | +8Fyz6OncY3I4U4KKBSq2/TTxveDW6NxTTuJTPOg3/qSIkwdOBLuIzuhxmF4D9wpl | ||
35 | +LMHmne2CilVeg73/GAzQt/w7FzmdvaHPAOVYWzdaTNALiXJxbi7EyO8q/uNK0GqY | ||
36 | +hljMsnA1hApG+/2sOP/P | ||
37 | +-----END CERTIFICATE----- | ||
38 | +-----BEGIN CERTIFICATE----- | ||
39 | +MIIF4TCCA8mgAwIBAgIQHQgpVDhMv3SvabmRFpvwLTANBgkqhkiG9w0BAQwFADCB | ||
40 | +iDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0pl | ||
41 | +cnNleSBDaXR5MR4wHAYDVQQKExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNV | ||
42 | +BAMTJVVTRVJUcnVzdCBSU0EgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMjAw | ||
43 | +MTA4MDAwMDAwWhcNMzAwMTA3MjM1OTU5WjBcMQswCQYDVQQGEwJDTjEaMBgGA1UE | ||
44 | +ChMRV29UcnVzIENBIExpbWl0ZWQxMTAvBgNVBAMMKFdvVHJ1cyBPViBTZXJ2ZXIg | ||
45 | +Q0EgIFtSdW4gYnkgdGhlIElzc3Vlcl0wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw | ||
46 | +ggEKAoIBAQCARFLq6kqQRZ4SdFMPdd3XJTcOdVVT5bvZZx0VVDrkw3TmSAloQVFf | ||
47 | +RhqDOSXg4CsIaa64qFSrC3a5sc8LgRhx7AUdvoUdfvdxIY1uoyxRWpoWO8oTUkSn | ||
48 | +EXjEPf+zrcU5cWTOi32xWL9vklYds7iOQwgsKAHDzt4an8MLGvcLxAHciyiKcDEh | ||
49 | +HZOGUHO5bKaCq+kP2rJCfVSlNvdyl1B8q+aGWXoi0gXGVL7WX4pcWj+DGuITbLB2 | ||
50 | +MzMytse4MjLJ84zaXh0UD4STlyD8tu/fakdxIwQ7K3/pP3RoGj1R9CvMWXUU+fZm | ||
51 | +KNLW5565hd9Bh3Wkz8b4ApgMD9o3RUjTAgMBAAGjggFwMIIBbDAfBgNVHSMEGDAW | ||
52 | +gBRTeb9aqitKz1SA4dibwJ3ysgNmyzAdBgNVHQ4EFgQUDUmPFTN7wE+2+zo4Cfw0 | ||
53 | +Fdpg3RQwDgYDVR0PAQH/BAQDAgGGMBIGA1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0l | ||
54 | +BBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMCIGA1UdIAQbMBkwDQYLKwYBBAGyMQEC | ||
55 | +AhYwCAYGZ4EMAQICMFAGA1UdHwRJMEcwRaBDoEGGP2h0dHA6Ly9jcmwudXNlcnRy | ||
56 | +dXN0LmNvbS9VU0VSVHJ1c3RSU0FDZXJ0aWZpY2F0aW9uQXV0aG9yaXR5LmNybDBx | ||
57 | +BggrBgEFBQcBAQRlMGMwOgYIKwYBBQUHMAKGLmh0dHA6Ly9jcnQudXNlcnRydXN0 | ||
58 | +LmNvbS9VU0VSVHJ1c3RSU0FBQUFDQS5jcnQwJQYIKwYBBQUHMAGGGWh0dHA6Ly9v | ||
59 | +Y3NwLnVzZXJ0cnVzdC5jb20wDQYJKoZIhvcNAQEMBQADggIBAA5G7XA+fNKyj7Fy | ||
60 | +uotoII38/32eZ4UrC1vGFPEtDyd0yzOrr7SvQUoO2GLxFzIQ0SsgMNXJ4UAhMkTD | ||
61 | +yz1OA0tx0g0GjOQXBGA/yfRR7SgitRJAdbqkPfppMn+dtKXCHHx35ohTL0PklRdb | ||
62 | +mXacvR7rXUIiJMdsvZZqYwc+DpGJ+Zv0sRJZEL7pm1oZv6EV+UzjAlOnLe6yrnyD | ||
63 | +c99Kk1H/RFPUzduUWjiVR2aMDT1oMiwYeB2Zq60Sb201jqZPNQj5E+TkDD5BPFVc | ||
64 | +kLeRi3LyXBUuBvXPsdLtBNlr+LExtCDd66kjeUe2/YbTHF4ai5PZPraQxgbOJJyc | ||
65 | +gizGl/JOgrIQPUOLSQvXlxpKEqS+0z6KqV52bco2PNrC0f8ILKuw0nsfhgcGy46d | ||
66 | +Su8fmU9+FT6e61i2nteKvt8qkkSkAJKQxRUWYduN24mG/OOIkoeOPdYHi+qEfbyI | ||
67 | +qxiiqcH9cZgLK9AVuJoKtt7vg21OyrWi7S5T/WbTfTz9XL7QGe8ZODZZx6d50uo/ | ||
68 | +lDOmXm3p/kdGApvUF1UrL+og22jBLi0Ns6xzCfzrI3SpC9abvU8E9EnxQABuu/gM | ||
69 | +/B63dbaZzSsMVFxeECD9nMWv7IH+/rqyGmjqEJzgKdPGvXhqpebQ1HhWrV+j+ipc | ||
70 | +jplXB1j3GCozDFsninXG102N6wC8 | ||
71 | +-----END CERTIFICATE----- | ||
72 | +-----BEGIN CERTIFICATE----- | ||
73 | +MIIFgTCCBGmgAwIBAgIQOXJEOvkit1HX02wQ3TE1lTANBgkqhkiG9w0BAQwFADB7 | ||
74 | +MQswCQYDVQQGEwJHQjEbMBkGA1UECAwSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYD | ||
75 | +VQQHDAdTYWxmb3JkMRowGAYDVQQKDBFDb21vZG8gQ0EgTGltaXRlZDEhMB8GA1UE | ||
76 | +AwwYQUFBIENlcnRpZmljYXRlIFNlcnZpY2VzMB4XDTE5MDMxMjAwMDAwMFoXDTI4 | ||
77 | +MTIzMTIzNTk1OVowgYgxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpOZXcgSmVyc2V5 | ||
78 | +MRQwEgYDVQQHEwtKZXJzZXkgQ2l0eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBO | ||
79 | +ZXR3b3JrMS4wLAYDVQQDEyVVU0VSVHJ1c3QgUlNBIENlcnRpZmljYXRpb24gQXV0 | ||
80 | +aG9yaXR5MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAgBJlFzYOw9sI | ||
81 | +s9CsVw127c0n00ytUINh4qogTQktZAnczomfzD2p7PbPwdzx07HWezcoEStH2jnG | ||
82 | +vDoZtF+mvX2do2NCtnbyqTsrkfjib9DsFiCQCT7i6HTJGLSR1GJk23+jBvGIGGqQ | ||
83 | +Ijy8/hPwhxR79uQfjtTkUcYRZ0YIUcuGFFQ/vDP+fmyc/xadGL1RjjWmp2bIcmfb | ||
84 | +IWax1Jt4A8BQOujM8Ny8nkz+rwWWNR9XWrf/zvk9tyy29lTdyOcSOk2uTIq3XJq0 | ||
85 | +tyA9yn8iNK5+O2hmAUTnAU5GU5szYPeUvlM3kHND8zLDU+/bqv50TmnHa4xgk97E | ||
86 | +xwzf4TKuzJM7UXiVZ4vuPVb+DNBpDxsP8yUmazNt925H+nND5X4OpWaxKXwyhGNV | ||
87 | +icQNwZNUMBkTrNN9N6frXTpsNVzbQdcS2qlJC9/YgIoJk2KOtWbPJYjNhLixP6Q5 | ||
88 | +D9kCnusSTJV882sFqV4Wg8y4Z+LoE53MW4LTTLPtW//e5XOsIzstAL81VXQJSdhJ | ||
89 | +WBp/kjbmUZIO8yZ9HE0XvMnsQybQv0FfQKlERPSZ51eHnlAfV1SoPv10Yy+xUGUJ | ||
90 | +5lhCLkMaTLTwJUdZ+gQek9QmRkpQgbLevni3/GcV4clXhB4PY9bpYrrWX1Uu6lzG | ||
91 | +KAgEJTm4Diup8kyXHAc/DVL17e8vgg8CAwEAAaOB8jCB7zAfBgNVHSMEGDAWgBSg | ||
92 | +EQojPpbxB+zirynvgqV/0DCktDAdBgNVHQ4EFgQUU3m/WqorSs9UgOHYm8Cd8rID | ||
93 | +ZsswDgYDVR0PAQH/BAQDAgGGMA8GA1UdEwEB/wQFMAMBAf8wEQYDVR0gBAowCDAG | ||
94 | +BgRVHSAAMEMGA1UdHwQ8MDowOKA2oDSGMmh0dHA6Ly9jcmwuY29tb2RvY2EuY29t | ||
95 | +L0FBQUNlcnRpZmljYXRlU2VydmljZXMuY3JsMDQGCCsGAQUFBwEBBCgwJjAkBggr | ||
96 | +BgEFBQcwAYYYaHR0cDovL29jc3AuY29tb2RvY2EuY29tMA0GCSqGSIb3DQEBDAUA | ||
97 | +A4IBAQAYh1HcdCE9nIrgJ7cz0C7M7PDmy14R3iJvm3WOnnL+5Nb+qh+cli3vA0p+ | ||
98 | +rvSNb3I8QzvAP+u431yqqcau8vzY7qN7Q/aGNnwU4M309z/+3ri0ivCRlv79Q2R+ | ||
99 | +/czSAaF9ffgZGclCKxO/WIu6pKJmBHaIkU4MiRTOok3JMrO66BQavHHxW/BBC5gA | ||
100 | +CiIDEOUMsfnNkjcZ7Tvx5Dq2+UUTJnWvu6rvP3t3O9LEApE9GQDTF1w52z97GA1F | ||
101 | +zZOFli9d31kWTz9RvdVFGD/tSo7oBmF0Ixa1DVBzJ0RHfxBdiSprhTEUxOipakyA | ||
102 | +vGp4z7h/jnZymQyd/teRCBaho1+V | ||
103 | +-----END CERTIFICATE----- |
1 | +apiVersion: v1 | ||
2 | +kind: Service | ||
3 | +metadata: | ||
4 | + name: allied-creation-cooperation | ||
5 | + namespace: mmm-suplus-dev | ||
6 | + labels: | ||
7 | + k8s-app: allied-creation-cooperation | ||
8 | +spec: | ||
9 | + ports: | ||
10 | + - name: "http" | ||
11 | + port: 80 | ||
12 | + targetPort: 8082 | ||
13 | + selector: | ||
14 | + k8s-app: allied-creation-cooperation | ||
15 | +--- | ||
16 | +apiVersion: extensions/v1beta1 | ||
17 | +kind: Deployment | ||
18 | +metadata: | ||
19 | + name: allied-creation-cooperation | ||
20 | + namespace: mmm-suplus-dev | ||
21 | + labels: | ||
22 | + k8s-app: allied-creation-cooperation | ||
23 | +spec: | ||
24 | + replicas: 1 | ||
25 | + template: | ||
26 | + metadata: | ||
27 | + labels: | ||
28 | + k8s-app: allied-creation-cooperation | ||
29 | + spec: | ||
30 | + affinity: | ||
31 | + nodeAffinity: | ||
32 | + preferredDuringSchedulingIgnoredDuringExecution: | ||
33 | + - preference: {} | ||
34 | + weight: 100 | ||
35 | + requiredDuringSchedulingIgnoredDuringExecution: | ||
36 | + nodeSelectorTerms: | ||
37 | + - matchExpressions: | ||
38 | + - key: kubernetes.io/hostname | ||
39 | + operator: In | ||
40 | + values: | ||
41 | + - cn-hangzhou.i-bp1djh1xn7taumbue1ze | ||
42 | + - cn-hangzhou.i-bp1djh1xn7taumbue1zd | ||
43 | + - cn-hangzhou.i-bp1euf5u1ph9kbhtndhb | ||
44 | + - cn-hangzhou.i-bp1hyp5oips9cdwxxgxy | ||
45 | + containers: | ||
46 | + - name: allied-creation-cooperation | ||
47 | + image: 192.168.0.243:5000/mmm/allied-creation-cooperation:dev | ||
48 | + imagePullPolicy: Always | ||
49 | + ports: | ||
50 | + - containerPort: 8082 | ||
51 | + volumeMounts: | ||
52 | + - mountPath: /opt/logs | ||
53 | + name: accesslogs | ||
54 | + env: | ||
55 | + - name: LOG_LEVEL | ||
56 | + value: "debug" | ||
57 | + - name: LOG_FRAMEWORK | ||
58 | + value: "beego" | ||
59 | + - name: LOG_TYPE | ||
60 | + value: "file" | ||
61 | + - name: ERROR_BASE_CODE | ||
62 | + value: "1" | ||
63 | + - name: ERROR_BASE_CODE_MULTIPLE | ||
64 | + value: "1000" | ||
65 | + - name: ENABLE_KAFKA_LOG | ||
66 | + value: "false" | ||
67 | + - name: USER_MODULE_HOST | ||
68 | + value: "http://allied-creation-user-dev.fjmaimaimai.com" | ||
69 | + - name: REDIS_HOST | ||
70 | + valueFrom: | ||
71 | + configMapKeyRef: | ||
72 | + name: suplus-config | ||
73 | + key: redis.ip | ||
74 | + - name: REDIS_PORT | ||
75 | + valueFrom: | ||
76 | + configMapKeyRef: | ||
77 | + name: suplus-config | ||
78 | + key: redis.port | ||
79 | + - name: POSTGRESQL_DB_NAME | ||
80 | + valueFrom: | ||
81 | + configMapKeyRef: | ||
82 | + name: suplus-config | ||
83 | + key: postgresqlalliedcreationcooperation.dbname | ||
84 | + - name: POSTGRESQL_USER | ||
85 | + valueFrom: | ||
86 | + configMapKeyRef: | ||
87 | + name: suplus-config | ||
88 | + key: postgresql.user | ||
89 | + - name: POSTGRESQL_PASSWORD | ||
90 | + valueFrom: | ||
91 | + configMapKeyRef: | ||
92 | + name: suplus-config | ||
93 | + key: postgresql.password | ||
94 | + - name: POSTGRESQL_HOST | ||
95 | + valueFrom: | ||
96 | + configMapKeyRef: | ||
97 | + name: suplus-config | ||
98 | + key: postgresql.host | ||
99 | + - name: POSTGRESQL_PORT | ||
100 | + valueFrom: | ||
101 | + configMapKeyRef: | ||
102 | + name: suplus-config | ||
103 | + key: postgresql.port | ||
104 | + volumes: | ||
105 | + - name: accesslogs | ||
106 | + emptyDir: {} |
deploy/k8s/dev/install.sh
0 → 100644
1 | +#!/bin/bash | ||
2 | +export PATH=/root/local/bin:$PATH | ||
3 | +kubectl -n mmm-suplus-dev get pods | grep -q allied-creation-cooperation | ||
4 | +if [ "$?" == "1" ];then | ||
5 | + kubectl create -f /tmp/dev/allied-creation-cooperation/allied-creation-cooperation.yaml --record | ||
6 | + kubectl -n mmm-suplus-dev get svc | grep -q allied-creation-cooperation | ||
7 | + if [ "$?" == "0" ];then | ||
8 | + echo "allied-creation-cooperation service install success!" | ||
9 | + else | ||
10 | + echo "allied-creation-cooperation service install fail!" | ||
11 | + fi | ||
12 | + kubectl -n mmm-suplus-dev get pods | grep -q allied-creation-cooperation | ||
13 | + if [ "$?" == "0" ];then | ||
14 | + echo "allied-creation-cooperation deployment install success!" | ||
15 | + else | ||
16 | + echo "allied-creation-cooperation deployment install fail!" | ||
17 | + fi | ||
18 | +else | ||
19 | + kubectl delete -f /tmp/dev/allied-creation-cooperation/allied-creation-cooperation.yaml | ||
20 | + kubectl -n mmm-suplus-dev get svc | grep -q allied-creation-cooperation | ||
21 | + while [ "$?" == "0" ] | ||
22 | + do | ||
23 | + kubectl -n mmm-suplus-dev get svc | grep -q allied-creation-cooperation | ||
24 | + done | ||
25 | + kubectl -n mmm-suplus-dev get pods | grep -q allied-creation-cooperation | ||
26 | + while [ "$?" == "0" ] | ||
27 | + do | ||
28 | + kubectl -n mmm-suplus-dev get pods | grep -q allied-creation-cooperation | ||
29 | + done | ||
30 | + kubectl create -f /tmp/dev/allied-creation-cooperation/allied-creation-cooperation.yaml --record | ||
31 | + kubectl -n mmm-suplus-dev get svc | grep -q allied-creation-cooperation | ||
32 | + if [ "$?" == "0" ];then | ||
33 | + echo "allied-creation-cooperation service update success!" | ||
34 | + else | ||
35 | + echo "allied-creation-cooperation service update fail!" | ||
36 | + fi | ||
37 | + kubectl -n mmm-suplus-dev get pods | grep -q allied-creation-cooperation | ||
38 | + if [ "$?" == "0" ];then | ||
39 | + echo "allied-creation-cooperation deployment update success!" | ||
40 | + else | ||
41 | + echo "allied-creation-cooperation deployment update fail!" | ||
42 | + fi | ||
43 | +fi |
1 | +apiVersion: v1 | ||
2 | +kind: Service | ||
3 | +metadata: | ||
4 | + name: allied-creation-cooperation | ||
5 | + namespace: <replace-your-k8s-namespace> | ||
6 | + labels: | ||
7 | + k8s-app: allied-creation-cooperation | ||
8 | +spec: | ||
9 | + ports: | ||
10 | + - name: "http" | ||
11 | + port: 80 | ||
12 | + targetPort: 8082 | ||
13 | + selector: | ||
14 | + k8s-app: allied-creation-cooperation | ||
15 | +--- | ||
16 | +apiVersion: extensions/v1beta1 | ||
17 | +kind: Deployment | ||
18 | +metadata: | ||
19 | + name: allied-creation-cooperation | ||
20 | + namespace: <replace-your-k8s-namespace> | ||
21 | + labels: | ||
22 | + k8s-app: allied-creation-cooperation | ||
23 | +spec: | ||
24 | + replicas: 1 | ||
25 | + template: | ||
26 | + metadata: | ||
27 | + labels: | ||
28 | + k8s-app: allied-creation-cooperation | ||
29 | + spec: | ||
30 | + affinity: | ||
31 | + nodeAffinity: | ||
32 | + preferredDuringSchedulingIgnoredDuringExecution: | ||
33 | + - preference: {} | ||
34 | + weight: 100 | ||
35 | + requiredDuringSchedulingIgnoredDuringExecution: | ||
36 | + nodeSelectorTerms: | ||
37 | + - matchExpressions: | ||
38 | + - key: kubernetes.io/hostname | ||
39 | + operator: In | ||
40 | + values: | ||
41 | + - cn-hangzhou.i-bp1djh1xn7taumbue1ze | ||
42 | + - cn-hangzhou.i-bp1djh1xn7taumbue1zd | ||
43 | + - cn-hangzhou.i-bp1euf5u1ph9kbhtndhb | ||
44 | + - cn-hangzhou.i-bp1hyp5oips9cdwxxgxy | ||
45 | + containers: | ||
46 | + - name: allied-creation-cooperation | ||
47 | + image: 192.168.0.243:5000/mmm/allied-creation-cooperation:dev | ||
48 | + imagePullPolicy: Always | ||
49 | + ports: | ||
50 | + - containerPort: 8082 | ||
51 | + volumeMounts: | ||
52 | + - mountPath: /opt/logs | ||
53 | + name: accesslogs | ||
54 | + env: | ||
55 | + - name: LOG_LEVEL | ||
56 | + value: "debug" | ||
57 | + - name: ERROR_BASE_CODE | ||
58 | + value: "1" | ||
59 | + - name: ERROR_BASE_CODE_MULTIPLE | ||
60 | + value: "1000" | ||
61 | + volumes: | ||
62 | + - name: accesslogs | ||
63 | + emptyDir: {} |
deploy/k8s/prd/install.sh
0 → 100644
1 | +#!/bin/bash | ||
2 | +export PATH=/root/local/bin:$PATH | ||
3 | +kubectl -n <replace-your-k8s-namespace> get pods | grep -q allied-creation-cooperation | ||
4 | +if [ "$?" == "1" ];then | ||
5 | + kubectl create -f /tmp/dev/allied-creation-cooperation/allied-creation-cooperation.yaml --record | ||
6 | + kubectl -n <replace-your-k8s-namespace> get svc | grep -q allied-creation-cooperation | ||
7 | + if [ "$?" == "0" ];then | ||
8 | + echo "allied-creation-cooperation service install success!" | ||
9 | + else | ||
10 | + echo "allied-creation-cooperation service install fail!" | ||
11 | + fi | ||
12 | + kubectl -n <replace-your-k8s-namespace> get pods | grep -q allied-creation-cooperation | ||
13 | + if [ "$?" == "0" ];then | ||
14 | + echo "allied-creation-cooperation deployment install success!" | ||
15 | + else | ||
16 | + echo "allied-creation-cooperation deployment install fail!" | ||
17 | + fi | ||
18 | +else | ||
19 | + kubectl delete -f /tmp/dev/allied-creation-cooperation/allied-creation-cooperation.yaml | ||
20 | + kubectl -n <replace-your-k8s-namespace> get svc | grep -q allied-creation-cooperation | ||
21 | + while [ "$?" == "0" ] | ||
22 | + do | ||
23 | + kubectl -n <replace-your-k8s-namespace> get svc | grep -q allied-creation-cooperation | ||
24 | + done | ||
25 | + kubectl -n <replace-your-k8s-namespace> get pods | grep -q allied-creation-cooperation | ||
26 | + while [ "$?" == "0" ] | ||
27 | + do | ||
28 | + kubectl -n <replace-your-k8s-namespace> get pods | grep -q allied-creation-cooperation | ||
29 | + done | ||
30 | + kubectl create -f /tmp/dev/allied-creation-cooperation/allied-creation-cooperation.yaml --record | ||
31 | + kubectl -n <replace-your-k8s-namespace> get svc | grep -q allied-creation-cooperation | ||
32 | + if [ "$?" == "0" ];then | ||
33 | + echo "allied-creation-cooperation service update success!" | ||
34 | + else | ||
35 | + echo "allied-creation-cooperation service update fail!" | ||
36 | + fi | ||
37 | + kubectl -n <replace-your-k8s-namespace> get pods | grep -q allied-creation-cooperation | ||
38 | + if [ "$?" == "0" ];then | ||
39 | + echo "allied-creation-cooperation deployment update success!" | ||
40 | + else | ||
41 | + echo "allied-creation-cooperation deployment update fail!" | ||
42 | + fi | ||
43 | +fi |
1 | +apiVersion: v1 | ||
2 | +kind: Service | ||
3 | +metadata: | ||
4 | + name: allied-creation-cooperation | ||
5 | + namespace: mmm-suplus-test | ||
6 | + labels: | ||
7 | + k8s-app: allied-creation-cooperation | ||
8 | +spec: | ||
9 | + ports: | ||
10 | + - name: "http" | ||
11 | + port: 80 | ||
12 | + targetPort: 8082 | ||
13 | + - name: "https" | ||
14 | + port: 443 | ||
15 | + targetPort: 443 | ||
16 | + selector: | ||
17 | + k8s-app: allied-creation-cooperation | ||
18 | +--- | ||
19 | +apiVersion: extensions/v1beta1 | ||
20 | +kind: Deployment | ||
21 | +metadata: | ||
22 | + name: allied-creation-cooperation | ||
23 | + namespace: mmm-suplus-test | ||
24 | + labels: | ||
25 | + k8s-app: allied-creation-cooperation | ||
26 | +spec: | ||
27 | + replicas: 1 | ||
28 | + template: | ||
29 | + metadata: | ||
30 | + labels: | ||
31 | + k8s-app: allied-creation-cooperation | ||
32 | + spec: | ||
33 | + affinity: | ||
34 | + nodeAffinity: | ||
35 | + preferredDuringSchedulingIgnoredDuringExecution: | ||
36 | + - preference: {} | ||
37 | + weight: 100 | ||
38 | + requiredDuringSchedulingIgnoredDuringExecution: | ||
39 | + nodeSelectorTerms: | ||
40 | + - matchExpressions: | ||
41 | + - key: kubernetes.io/hostname | ||
42 | + operator: In | ||
43 | + values: | ||
44 | + - cn-hangzhou.i-bp1djh1xn7taumbue1ze | ||
45 | + - cn-hangzhou.i-bp1djh1xn7taumbue1zd | ||
46 | + - cn-hangzhou.i-bp1euf5u1ph9kbhtndhb | ||
47 | + - cn-hangzhou.i-bp1hyp5oips9cdwxxgxy | ||
48 | + containers: | ||
49 | + - name: allied-creation-cooperation | ||
50 | + image: 192.168.0.243:5000/mmm/allied-creation-cooperation:test | ||
51 | + imagePullPolicy: Always | ||
52 | + ports: | ||
53 | + - containerPort: 8082 | ||
54 | + - containerPort: 443 | ||
55 | + volumeMounts: | ||
56 | + - mountPath: /opt/logs | ||
57 | + name: accesslogs | ||
58 | + env: | ||
59 | + - name: LOG_LEVEL | ||
60 | + value: "debug" | ||
61 | + - name: LOG_FRAMEWORK | ||
62 | + value: "beego" | ||
63 | + - name: LOG_TYPE | ||
64 | + value: "file" | ||
65 | + - name: ERROR_BASE_CODE | ||
66 | + value: "1" | ||
67 | + - name: ERROR_BASE_CODE_MULTIPLE | ||
68 | + value: "1000" | ||
69 | + - name: ENABLE_KAFKA_LOG | ||
70 | + value: "false" | ||
71 | + - name: USER_MODULE_HOST | ||
72 | + value: "http://allied-creation-user-test.fjmaimaimai.com" | ||
73 | + - name: REDIS_HOST | ||
74 | + valueFrom: | ||
75 | + configMapKeyRef: | ||
76 | + name: suplus-config | ||
77 | + key: redis.ip | ||
78 | + - name: REDIS_PORT | ||
79 | + valueFrom: | ||
80 | + configMapKeyRef: | ||
81 | + name: suplus-config | ||
82 | + key: redis.port | ||
83 | + - name: POSTGRESQL_DB_NAME | ||
84 | + valueFrom: | ||
85 | + configMapKeyRef: | ||
86 | + name: suplus-config | ||
87 | + key: postgresqlalliedcreationcooperation.dbname | ||
88 | + - name: POSTGRESQL_USER | ||
89 | + valueFrom: | ||
90 | + configMapKeyRef: | ||
91 | + name: suplus-config | ||
92 | + key: postgresql.user | ||
93 | + - name: POSTGRESQL_PASSWORD | ||
94 | + valueFrom: | ||
95 | + configMapKeyRef: | ||
96 | + name: suplus-config | ||
97 | + key: postgresql.password | ||
98 | + - name: POSTGRESQL_HOST | ||
99 | + valueFrom: | ||
100 | + configMapKeyRef: | ||
101 | + name: suplus-config | ||
102 | + key: postgresql.host | ||
103 | + - name: POSTGRESQL_PORT | ||
104 | + valueFrom: | ||
105 | + configMapKeyRef: | ||
106 | + name: suplus-config | ||
107 | + key: postgresql.port | ||
108 | + volumes: | ||
109 | + - name: accesslogs | ||
110 | + emptyDir: {} |
deploy/k8s/test/install.sh
0 → 100644
1 | +#!/bin/bash | ||
2 | +export PATH=/root/local/bin:$PATH | ||
3 | +kubectl -n mmm-suplus-test get pods | grep -q allied-creation-cooperation | ||
4 | +if [ "$?" == "1" ];then | ||
5 | + kubectl create -f /tmp/test/allied-creation-cooperation/allied-creation-cooperation.yaml --record | ||
6 | + kubectl -n mmm-suplus-test get svc | grep -q allied-creation-cooperation | ||
7 | + if [ "$?" == "0" ];then | ||
8 | + echo "allied-creation-cooperation service install success!" | ||
9 | + else | ||
10 | + echo "allied-creation-cooperation service install fail!" | ||
11 | + fi | ||
12 | + kubectl -n mmm-suplus-test get pods | grep -q allied-creation-cooperation | ||
13 | + if [ "$?" == "0" ];then | ||
14 | + echo "allied-creation-cooperation deployment install success!" | ||
15 | + else | ||
16 | + echo "allied-creation-cooperation deployment install fail!" | ||
17 | + fi | ||
18 | +else | ||
19 | + kubectl delete -f /tmp/test/allied-creation-cooperation/allied-creation-cooperation.yaml | ||
20 | + kubectl -n mmm-suplus-test get svc | grep -q allied-creation-cooperation | ||
21 | + while [ "$?" == "0" ] | ||
22 | + do | ||
23 | + kubectl -n mmm-suplus-test get svc | grep -q allied-creation-cooperation | ||
24 | + done | ||
25 | + kubectl -n mmm-suplus-test get pods | grep -q allied-creation-cooperation | ||
26 | + while [ "$?" == "0" ] | ||
27 | + do | ||
28 | + kubectl -n mmm-suplus-test get pods | grep -q allied-creation-cooperation | ||
29 | + done | ||
30 | + kubectl create -f /tmp/test/allied-creation-cooperation/allied-creation-cooperation.yaml --record | ||
31 | + kubectl -n mmm-suplus-test get svc | grep -q allied-creation-cooperation | ||
32 | + if [ "$?" == "0" ];then | ||
33 | + echo "allied-creation-cooperation service update success!" | ||
34 | + else | ||
35 | + echo "allied-creation-cooperation service update fail!" | ||
36 | + fi | ||
37 | + kubectl -n mmm-suplus-test get pods | grep -q allied-creation-cooperation | ||
38 | + if [ "$?" == "0" ];then | ||
39 | + echo "allied-creation-cooperation deployment update success!" | ||
40 | + else | ||
41 | + echo "allied-creation-cooperation deployment update fail!" | ||
42 | + fi | ||
43 | +fi |
不能预览此文件类型
document/openapi/swagger-v1.0.json
0 → 100644
此 diff 太大无法显示。
document/openapi/swagger-v1.0.yaml
0 → 100644
此 diff 太大无法显示。
document/openapi/swagger-v1.1.json
0 → 100644
此 diff 太大无法显示。
document/openapi/swagger-v1.1.yaml
0 → 100644
此 diff 太大无法显示。
document/openapi/swagger-v1.2.json
0 → 100644
此 diff 太大无法显示。
document/openapi/swagger-v1.2.yaml
0 → 100644
此 diff 太大无法显示。
document/openapi/swagger-v1.3.json
0 → 100644
此 diff 太大无法显示。
document/openapi/swagger-v1.3.yaml
0 → 100644
此 diff 太大无法显示。
document/openapi/swagger.yaml
0 → 100644
此 diff 太大无法显示。
go.mod
0 → 100644
1 | +module gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation | ||
2 | + | ||
3 | +go 1.16 | ||
4 | + | ||
5 | +require ( | ||
6 | + github.com/Shopify/sarama v1.25.0 | ||
7 | + github.com/ajg/form v1.5.1 // indirect | ||
8 | + github.com/beego/beego/v2 v2.0.1 | ||
9 | + github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072 // indirect | ||
10 | + github.com/fatih/structs v1.1.0 // indirect | ||
11 | + github.com/gavv/httpexpect v2.0.0+incompatible | ||
12 | + github.com/go-pg/pg/v10 v10.7.7 | ||
13 | + github.com/google/go-cmp v0.5.6 // indirect | ||
14 | + github.com/google/go-querystring v1.1.0 // indirect | ||
15 | + github.com/google/uuid v1.1.2 // indirect | ||
16 | + github.com/gorilla/websocket v1.4.2 // indirect | ||
17 | + github.com/imkira/go-interpol v1.1.0 // indirect | ||
18 | + github.com/linmadan/egglib-go v0.0.0-20210527091316-06b0732fb5f6 | ||
19 | + github.com/mattn/go-colorable v0.1.8 // indirect | ||
20 | + github.com/moul/http2curl v1.0.0 // indirect | ||
21 | + github.com/onsi/ginkgo v1.14.2 | ||
22 | + github.com/onsi/gomega v1.10.3 | ||
23 | + github.com/sergi/go-diff v1.2.0 // indirect | ||
24 | + github.com/shopspring/decimal v1.2.0 | ||
25 | + github.com/sirupsen/logrus v1.8.1 // indirect | ||
26 | + github.com/smartystreets/assertions v1.1.1 // indirect | ||
27 | + github.com/smartystreets/goconvey v1.6.4 // indirect | ||
28 | + github.com/valyala/fasthttp v1.28.0 // indirect | ||
29 | + github.com/xeipuuv/gojsonschema v1.2.0 // indirect | ||
30 | + github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0 // indirect | ||
31 | + github.com/yudai/gojsondiff v1.0.0 // indirect | ||
32 | + github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82 // indirect | ||
33 | + github.com/yudai/pp v2.0.1+incompatible // indirect | ||
34 | + golang.org/x/net v0.0.0-20210614182718-04defd469f4e // indirect | ||
35 | +) |
go.sum
0 → 100644
1 | +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= | ||
2 | +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= | ||
3 | +github.com/Knetic/govaluate v3.0.0+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= | ||
4 | +github.com/Shopify/sarama v1.25.0 h1:ch1ywjRLjfJtU+EaiJ+l0rWffQ6TRpyYmW4DX7Cb2SU= | ||
5 | +github.com/Shopify/sarama v1.25.0/go.mod h1:y/CFFTO9eaMTNriwu/Q+W4eioLqiDMGkA1W+gmdfj8w= | ||
6 | +github.com/Shopify/toxiproxy v2.1.4+incompatible h1:TKdv8HiTLgE5wdJuEML90aBgNWsokNbMijUGhmcoBJc= | ||
7 | +github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= | ||
8 | +github.com/ajg/form v1.5.1 h1:t9c7v8JUKu/XxOGBU0yjNpaMloxGEJhUkqFRq0ibGeU= | ||
9 | +github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= | ||
10 | +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= | ||
11 | +github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= | ||
12 | +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= | ||
13 | +github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= | ||
14 | +github.com/alicebob/gopher-json v0.0.0-20180125190556-5a6b3ba71ee6/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= | ||
15 | +github.com/alicebob/miniredis v2.5.0+incompatible/go.mod h1:8HZjEj4yU0dwhYHky+DxYx+6BMjkBbe5ONFIF1MXffk= | ||
16 | +github.com/andybalholm/brotli v1.0.2 h1:JKnhI/XQ75uFBTiuzXpzFrUriDPiZjlOSzh6wXogP0E= | ||
17 | +github.com/andybalholm/brotli v1.0.2/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y= | ||
18 | +github.com/beego/beego/v2 v2.0.1 h1:07a7Z0Ok5vbqyqh+q53sDPl9LdhKh0ZDy3gbyGrhFnE= | ||
19 | +github.com/beego/beego/v2 v2.0.1/go.mod h1:8zyHi1FnWO1mZLwTn62aKRIZF/aIKvkCBB2JYs+eqQI= | ||
20 | +github.com/beego/goyaml2 v0.0.0-20130207012346-5545475820dd/go.mod h1:1b+Y/CofkYwXMUU0OhQqGvsY2Bvgr4j6jfT699wyZKQ= | ||
21 | +github.com/beego/x2j v0.0.0-20131220205130-a0352aadc542/go.mod h1:kSeGC/p1AbBiEp5kat81+DSQrZenVBZXklMLaELspWU= | ||
22 | +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= | ||
23 | +github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= | ||
24 | +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= | ||
25 | +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= | ||
26 | +github.com/bradfitz/gomemcache v0.0.0-20180710155616-bc664df96737/go.mod h1:PmM6Mmwb0LSuEubjR8N7PtNe1KxZLtOUHtbeikc5h60= | ||
27 | +github.com/casbin/casbin v1.7.0/go.mod h1:c67qKN6Oum3UF5Q1+BByfFxkwKvhwW57ITjqwtzR1KE= | ||
28 | +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= | ||
29 | +github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= | ||
30 | +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= | ||
31 | +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= | ||
32 | +github.com/cloudflare/golz4 v0.0.0-20150217214814-ef862a3cdc58/go.mod h1:EOBUe0h4xcZ5GoxqC5SDxFQ8gwyZPKQoEzownBlhI80= | ||
33 | +github.com/coreos/etcd v3.3.25+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= | ||
34 | +github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= | ||
35 | +github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= | ||
36 | +github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= | ||
37 | +github.com/couchbase/go-couchbase v0.0.0-20200519150804-63f3cdb75e0d/go.mod h1:TWI8EKQMs5u5jLKW/tsb9VwauIrMIxQG1r5fMsswK5U= | ||
38 | +github.com/couchbase/gomemcached v0.0.0-20200526233749-ec430f949808/go.mod h1:srVSlQLB8iXBVXHgnqemxUXqN6FCvClgCMPCsjBDR7c= | ||
39 | +github.com/couchbase/goutils v0.0.0-20180530154633-e865a1461c8a/go.mod h1:BQwMFlJzDjFDG3DJUdU0KORxn88UlsOULuxLExMh3Hs= | ||
40 | +github.com/cupcake/rdb v0.0.0-20161107195141-43ba34106c76/go.mod h1:vYwsqCOLxGiisLwp9rITslkFNpZD5rz43tf41QFkTWY= | ||
41 | +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= | ||
42 | +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= | ||
43 | +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= | ||
44 | +github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= | ||
45 | +github.com/eapache/go-resiliency v1.1.0 h1:1NtRmCAqadE2FN4ZcN6g90TP3uk8cg9rn9eNK2197aU= | ||
46 | +github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= | ||
47 | +github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21 h1:YEetp8/yCZMuEPMUDHG0CW/brkkEp8mzqk2+ODEitlw= | ||
48 | +github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= | ||
49 | +github.com/eapache/queue v1.1.0 h1:YOEu7KNc61ntiQlcEeUIoDTJ2o8mQznoNvUhiigpIqc= | ||
50 | +github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= | ||
51 | +github.com/edsrzf/mmap-go v0.0.0-20170320065105-0bce6a688712/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= | ||
52 | +github.com/elastic/go-elasticsearch/v6 v6.8.5 h1:U2HtkBseC1FNBmDr0TR2tKltL6FxoY+niDAlj5M8TK8= | ||
53 | +github.com/elastic/go-elasticsearch/v6 v6.8.5/go.mod h1:UwaDJsD3rWLM5rKNFzv9hgox93HoX8utj1kxD9aFUcI= | ||
54 | +github.com/elazarl/go-bindata-assetfs v1.0.0 h1:G/bYguwHIzWq9ZoyUQqrjTmJbbYn3j3CKKpKinvZLFk= | ||
55 | +github.com/elazarl/go-bindata-assetfs v1.0.0/go.mod h1:v+YaWX3bdea5J/mo8dSETolEo7R71Vk1u8bnjau5yw4= | ||
56 | +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= | ||
57 | +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= | ||
58 | +github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072 h1:DddqAaWDpywytcG8w/qoQ5sAN8X12d3Z3koB0C3Rxsc= | ||
59 | +github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8= | ||
60 | +github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= | ||
61 | +github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= | ||
62 | +github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= | ||
63 | +github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= | ||
64 | +github.com/frankban/quicktest v1.4.1 h1:Wv2VwvNn73pAdFIVUQRXYDFp31lXKbqblIXo/Q5GPSg= | ||
65 | +github.com/frankban/quicktest v1.4.1/go.mod h1:36zfPVQyHxymz4cH7wlDmVwDrJuljRB60qkgn7rorfQ= | ||
66 | +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= | ||
67 | +github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= | ||
68 | +github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= | ||
69 | +github.com/gavv/httpexpect v2.0.0+incompatible h1:1X9kcRshkSKEjNJJxX9Y9mQ5BRfbxU5kORdjhlA1yX8= | ||
70 | +github.com/gavv/httpexpect v2.0.0+incompatible/go.mod h1:x+9tiU1YnrOvnB725RkpoLv1M62hOWzwo5OXotisrKc= | ||
71 | +github.com/glendc/gopher-json v0.0.0-20170414221815-dc4743023d0c/go.mod h1:Gja1A+xZ9BoviGJNA2E9vFkPjjsl+CoJxSXiQM1UXtw= | ||
72 | +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= | ||
73 | +github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= | ||
74 | +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= | ||
75 | +github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= | ||
76 | +github.com/go-pg/pg/v10 v10.7.7 h1:jPooLMqrVVV5Ejpcxpwxv9R2gECT/+UEpz+qIzOUJ9A= | ||
77 | +github.com/go-pg/pg/v10 v10.7.7/go.mod h1:d0w17Xw5x2DtbD/UgB9rnZg3FAck3eDHXff0Srrzuuk= | ||
78 | +github.com/go-pg/zerochecker v0.2.0 h1:pp7f72c3DobMWOb2ErtZsnrPaSvHd2W4o9//8HtF4mU= | ||
79 | +github.com/go-pg/zerochecker v0.2.0/go.mod h1:NJZ4wKL0NmTtz0GKCoJ8kym6Xn/EQzXRl2OnAe7MmDo= | ||
80 | +github.com/go-redis/redis v6.14.2+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= | ||
81 | +github.com/go-redis/redis/v7 v7.4.0/go.mod h1:JDNMw23GTyLNC4GZu9njt15ctBQVn7xjRfnwdHj/Dcg= | ||
82 | +github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs= | ||
83 | +github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= | ||
84 | +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= | ||
85 | +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= | ||
86 | +github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= | ||
87 | +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= | ||
88 | +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= | ||
89 | +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= | ||
90 | +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= | ||
91 | +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= | ||
92 | +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= | ||
93 | +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= | ||
94 | +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= | ||
95 | +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= | ||
96 | +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= | ||
97 | +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= | ||
98 | +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= | ||
99 | +github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM= | ||
100 | +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= | ||
101 | +github.com/golang/snappy v0.0.0-20170215233205-553a64147049/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= | ||
102 | +github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= | ||
103 | +github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= | ||
104 | +github.com/golang/snappy v0.0.3 h1:fHPg5GQYlCeLIPB9BZqMVR5nR9A+IM5zcgeTdjMYmLA= | ||
105 | +github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= | ||
106 | +github.com/gomodule/redigo v2.0.0+incompatible/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= | ||
107 | +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= | ||
108 | +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= | ||
109 | +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= | ||
110 | +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= | ||
111 | +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= | ||
112 | +github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= | ||
113 | +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= | ||
114 | +github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= | ||
115 | +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= | ||
116 | +github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= | ||
117 | +github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= | ||
118 | +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= | ||
119 | +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= | ||
120 | +github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= | ||
121 | +github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= | ||
122 | +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= | ||
123 | +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= | ||
124 | +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= | ||
125 | +github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= | ||
126 | +github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= | ||
127 | +github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= | ||
128 | +github.com/hashicorp/go-uuid v1.0.1 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE= | ||
129 | +github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= | ||
130 | +github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= | ||
131 | +github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= | ||
132 | +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= | ||
133 | +github.com/imkira/go-interpol v1.1.0 h1:KIiKr0VSG2CUW1hl1jpiyuzuJeKUUpC8iM1AIE7N1Vk= | ||
134 | +github.com/imkira/go-interpol v1.1.0/go.mod h1:z0h2/2T3XF8kyEPpRgJ3kmNv+C43p+I/CoI+jC3w2iA= | ||
135 | +github.com/jcmturner/gofork v0.0.0-20190328161633-dc7c13fece03 h1:FUwcHNlEqkqLjLBdCp5PRlCFijNjvcYANOZXzCfXwCM= | ||
136 | +github.com/jcmturner/gofork v0.0.0-20190328161633-dc7c13fece03/go.mod h1:MK8+TM0La+2rjBD4jE12Kj1pCCxK7d2LK/UM3ncEo0o= | ||
137 | +github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= | ||
138 | +github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= | ||
139 | +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= | ||
140 | +github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= | ||
141 | +github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= | ||
142 | +github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= | ||
143 | +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= | ||
144 | +github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= | ||
145 | +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= | ||
146 | +github.com/klauspost/compress v1.9.7/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= | ||
147 | +github.com/klauspost/compress v1.12.2 h1:2KCfW3I9M7nSc5wOqXAlW2v2U6v+w6cbjvbfp+OykW8= | ||
148 | +github.com/klauspost/compress v1.12.2/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= | ||
149 | +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= | ||
150 | +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= | ||
151 | +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= | ||
152 | +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= | ||
153 | +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= | ||
154 | +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= | ||
155 | +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= | ||
156 | +github.com/ledisdb/ledisdb v0.0.0-20200510135210-d35789ec47e6/go.mod h1:n931TsDuKuq+uX4v1fulaMbA/7ZLLhjc85h7chZGBCQ= | ||
157 | +github.com/lib/pq v1.0.0 h1:X5PMW56eZitiTeO7tKzZxFCSpbFZJtkMMooicw2us9A= | ||
158 | +github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= | ||
159 | +github.com/linmadan/egglib-go v0.0.0-20210527091316-06b0732fb5f6 h1:nyhVnOIXsESuhZ95Ak6VRSF+0fHeKlYWq0EvHByt5RU= | ||
160 | +github.com/linmadan/egglib-go v0.0.0-20210527091316-06b0732fb5f6/go.mod h1:ZZuSWicGxpgN0OulARhuKwFJuJ9we0otaPVAJtz10yk= | ||
161 | +github.com/magefile/mage v1.10.0/go.mod h1:z5UZb/iS3GoOSn0JgWuiw7dxlurVYTu+/jHXqQg881A= | ||
162 | +github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8= | ||
163 | +github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= | ||
164 | +github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= | ||
165 | +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= | ||
166 | +github.com/mattn/go-sqlite3 v2.0.3+incompatible h1:gXHsfypPkaMZrKbD5209QV9jbUTJKjyR5WD3HYQSd+U= | ||
167 | +github.com/mattn/go-sqlite3 v2.0.3+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= | ||
168 | +github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= | ||
169 | +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= | ||
170 | +github.com/mitchellh/mapstructure v1.3.3 h1:SzB1nHZ2Xi+17FP0zVQBHIZqvwRN9408fJO8h+eeNA8= | ||
171 | +github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= | ||
172 | +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= | ||
173 | +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= | ||
174 | +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= | ||
175 | +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= | ||
176 | +github.com/moul/http2curl v1.0.0 h1:dRMWoAtb+ePxMlLkrCbAqh4TlPHXvoGUSQ323/9Zahs= | ||
177 | +github.com/moul/http2curl v1.0.0/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOAZ3H0fQ= | ||
178 | +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= | ||
179 | +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= | ||
180 | +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= | ||
181 | +github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= | ||
182 | +github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= | ||
183 | +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= | ||
184 | +github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= | ||
185 | +github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg= | ||
186 | +github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= | ||
187 | +github.com/onsi/ginkgo v1.14.2 h1:8mVmC9kjFFmA8H4pKMUhcblgifdkOIXPvbhN1T36q1M= | ||
188 | +github.com/onsi/ginkgo v1.14.2/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= | ||
189 | +github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= | ||
190 | +github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= | ||
191 | +github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= | ||
192 | +github.com/onsi/gomega v1.10.3 h1:gph6h/qe9GSUw1NhH1gp+qb+h8rXD8Cy60Z32Qw3ELA= | ||
193 | +github.com/onsi/gomega v1.10.3/go.mod h1:V9xEwhxec5O8UDM77eCW8vLymOMltsqPVYWrpDsH8xc= | ||
194 | +github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= | ||
195 | +github.com/pelletier/go-toml v1.0.1/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= | ||
196 | +github.com/pelletier/go-toml v1.8.1/go.mod h1:T2/BmBdy8dvIRq1a/8aqjN41wvWlN4lrapLU/GW4pbc= | ||
197 | +github.com/peterh/liner v1.0.1-0.20171122030339-3681c2a91233/go.mod h1:xIteQHvHuaLYG9IFj6mSxM0fCKrs34IrEQUhOYuGPHc= | ||
198 | +github.com/pierrec/lz4 v2.2.6+incompatible h1:6aCX4/YZ9v8q69hTyiR7dNLnTA3fgtKHVVW5BCd5Znw= | ||
199 | +github.com/pierrec/lz4 v2.2.6+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= | ||
200 | +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= | ||
201 | +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= | ||
202 | +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= | ||
203 | +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= | ||
204 | +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= | ||
205 | +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= | ||
206 | +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= | ||
207 | +github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= | ||
208 | +github.com/prometheus/client_golang v1.7.0 h1:wCi7urQOGBsYcQROHqpUUX4ct84xp40t9R9JX0FuA/U= | ||
209 | +github.com/prometheus/client_golang v1.7.0/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= | ||
210 | +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= | ||
211 | +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= | ||
212 | +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= | ||
213 | +github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= | ||
214 | +github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= | ||
215 | +github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= | ||
216 | +github.com/prometheus/common v0.10.0 h1:RyRA7RzGXQZiW+tGMr7sxa85G1z0yOpM1qq5c8lNawc= | ||
217 | +github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= | ||
218 | +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= | ||
219 | +github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= | ||
220 | +github.com/prometheus/procfs v0.1.3 h1:F0+tqvhOksq22sc6iCHF5WGlWjdwj92p0udFh1VFBS8= | ||
221 | +github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= | ||
222 | +github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a h1:9ZKAASQSHhDYGoxY8uLVpewe1GDZ2vu2Tr/vTdVAkFQ= | ||
223 | +github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= | ||
224 | +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= | ||
225 | +github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= | ||
226 | +github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= | ||
227 | +github.com/shiena/ansicolor v0.0.0-20151119151921-a422bbe96644 h1:X+yvsM2yrEktyI+b2qND5gpH8YhURn0k8OCaeRnkINo= | ||
228 | +github.com/shiena/ansicolor v0.0.0-20151119151921-a422bbe96644/go.mod h1:nkxAfR/5quYxwPZhyDxgasBMnRtBZd0FCEpawpjMUFg= | ||
229 | +github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ= | ||
230 | +github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= | ||
231 | +github.com/siddontang/go v0.0.0-20170517070808-cb568a3e5cc0/go.mod h1:3yhqj7WBBfRhbBlzyOC3gUxftwsU0u8gqevxwIHQpMw= | ||
232 | +github.com/siddontang/goredis v0.0.0-20150324035039-760763f78400/go.mod h1:DDcKzU3qCuvj/tPnimWSsZZzvk9qvkvrIL5naVBPh5s= | ||
233 | +github.com/siddontang/rdb v0.0.0-20150307021120-fc89ed2e418d/go.mod h1:AMEsy7v5z92TR1JKMkLLoaOQk++LVnOKL3ScbJ8GNGA= | ||
234 | +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= | ||
235 | +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= | ||
236 | +github.com/sirupsen/logrus v1.8.0/go.mod h1:4GuYW9TZmE769R5STWrRakJc4UqQ3+QQ95fyz7ENv1A= | ||
237 | +github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= | ||
238 | +github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= | ||
239 | +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= | ||
240 | +github.com/smartystreets/assertions v1.1.1 h1:T/YLemO5Yp7KPzS+lVtu+WsHn8yoSwTfItdAd1r3cck= | ||
241 | +github.com/smartystreets/assertions v1.1.1/go.mod h1:tcbTF8ujkAEcZ8TElKY+i30BzYlVhC/LOxJk7iOWnoo= | ||
242 | +github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= | ||
243 | +github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= | ||
244 | +github.com/ssdb/gossdb v0.0.0-20180723034631-88f6b59b84ec/go.mod h1:QBvMkMya+gXctz3kmljlUCu/yB3GZ6oee+dUozsezQE= | ||
245 | +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= | ||
246 | +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= | ||
247 | +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= | ||
248 | +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= | ||
249 | +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= | ||
250 | +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= | ||
251 | +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= | ||
252 | +github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= | ||
253 | +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= | ||
254 | +github.com/syndtr/goleveldb v0.0.0-20160425020131-cfa635847112/go.mod h1:Z4AUp2Km+PwemOoO/VB5AOx9XSsIItzFjoJlOSiYmn0= | ||
255 | +github.com/syndtr/goleveldb v0.0.0-20181127023241-353a9fca669c/go.mod h1:Z4AUp2Km+PwemOoO/VB5AOx9XSsIItzFjoJlOSiYmn0= | ||
256 | +github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc h1:9lRDQMhESg+zvGYmW5DyG0UqvY96Bu5QYsTLvCHdrgo= | ||
257 | +github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc/go.mod h1:bciPuU6GHm1iF1pBvUfxfsH0Wmnc2VbpgvbI9ZWuIRs= | ||
258 | +github.com/ugorji/go v0.0.0-20171122102828-84cb69a8af83/go.mod h1:hnLbHMwcvSihnDhEfx2/BzKp2xb0Y+ErdfYcrs9tkJQ= | ||
259 | +github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= | ||
260 | +github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= | ||
261 | +github.com/valyala/fasthttp v1.28.0 h1:ruVmTmZaBR5i67NqnjvvH5gEv0zwHfWtbjoyW98iho4= | ||
262 | +github.com/valyala/fasthttp v1.28.0/go.mod h1:cmWIqlu99AO/RKcp1HWaViTqc57FswJOfYYdPJBl8BA= | ||
263 | +github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc= | ||
264 | +github.com/vmihailenco/bufpool v0.1.11 h1:gOq2WmBrq0i2yW5QJ16ykccQ4wH9UyEsgLm6czKAd94= | ||
265 | +github.com/vmihailenco/bufpool v0.1.11/go.mod h1:AFf/MOy3l2CFTKbxwt0mp2MwnqjNEs5H/UxrkA5jxTQ= | ||
266 | +github.com/vmihailenco/msgpack/v5 v5.2.0 h1:ZhIAtVUP1mme8GIlpiAnmTzjSWMexA/uNF2We85DR0w= | ||
267 | +github.com/vmihailenco/msgpack/v5 v5.2.0/go.mod h1:fEM7KuHcnm0GvDCztRpw9hV0PuoO2ciTismP6vjggcM= | ||
268 | +github.com/vmihailenco/tagparser v0.1.2 h1:gnjoVuB/kljJ5wICEEOpx98oXMWPLj22G67Vbd1qPqc= | ||
269 | +github.com/vmihailenco/tagparser v0.1.2/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= | ||
270 | +github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g= | ||
271 | +github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= | ||
272 | +github.com/wendal/errors v0.0.0-20130201093226-f66c77a7882b/go.mod h1:Q12BUT7DqIlHRmgv3RskH+UCM/4eqVMgI0EMmlSpAXc= | ||
273 | +github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I= | ||
274 | +github.com/xdg/stringprep v1.0.0/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= | ||
275 | +github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f h1:J9EGpcZtP0E/raorCMxlFGSTBrsSlaDGf3jU/qvAE2c= | ||
276 | +github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= | ||
277 | +github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0= | ||
278 | +github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= | ||
279 | +github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74= | ||
280 | +github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= | ||
281 | +github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0 h1:6fRhSjgLCkTD3JnJxvaJ4Sj+TYblw757bqYgZaOq5ZY= | ||
282 | +github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0/go.mod h1:/LWChgwKmvncFJFHJ7Gvn9wZArjbV5/FppcK2fKk/tI= | ||
283 | +github.com/yudai/gojsondiff v1.0.0 h1:27cbfqXLVEJ1o8I6v3y9lg8Ydm53EKqHXAOMxEGlCOA= | ||
284 | +github.com/yudai/gojsondiff v1.0.0/go.mod h1:AY32+k2cwILAkW1fbgxQ5mUmMiZFgLIV+FBNExI05xg= | ||
285 | +github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82 h1:BHyfKlQyqbsFN5p3IfnEUduWvb9is428/nNb5L3U01M= | ||
286 | +github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82/go.mod h1:lgjkn3NuSvDfVJdfcVVdX+jpBxNmX4rDAzaS45IcYoM= | ||
287 | +github.com/yudai/pp v2.0.1+incompatible h1:Q4//iY4pNF6yPLZIigmvcl7k/bPgrcTPIFIcmawg5bI= | ||
288 | +github.com/yudai/pp v2.0.1+incompatible/go.mod h1:PuxR/8QJ7cyCkFp/aUDS+JY727OFEZkTdatxwunjIkc= | ||
289 | +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= | ||
290 | +github.com/yuin/gopher-lua v0.0.0-20171031051903-609c9cd26973/go.mod h1:aEV29XrmTYFr3CiRxZeGHpkvbwq+prZduBqMaascyCU= | ||
291 | +go.etcd.io/etcd v3.3.25+incompatible/go.mod h1:yaeTdrJi5lOmYerz05bd8+V7KubZs8YSFZfzsF9A6aI= | ||
292 | +go.opentelemetry.io/otel v0.17.0 h1:6MKOu8WY4hmfpQ4oQn34u6rYhnf2sWf1LXYO/UFm71U= | ||
293 | +go.opentelemetry.io/otel v0.17.0/go.mod h1:Oqtdxmf7UtEvL037ohlgnaYa1h7GtMh0NcSd9eqkC9s= | ||
294 | +go.opentelemetry.io/otel/metric v0.17.0 h1:t+5EioN8YFXQ2EH+1j6FHCKMUj+57zIDSnSGr/mWuug= | ||
295 | +go.opentelemetry.io/otel/metric v0.17.0/go.mod h1:hUz9lH1rNXyEwWAhIWCMFWKhYtpASgSnObJFnU26dJ0= | ||
296 | +go.opentelemetry.io/otel/oteltest v0.17.0 h1:TyAihUowTDLqb4+m5ePAsR71xPJaTBJl4KDArIdi9k4= | ||
297 | +go.opentelemetry.io/otel/oteltest v0.17.0/go.mod h1:JT/LGFxPwpN+nlsTiinSYjdIx3hZIGqHCpChcIZmdoE= | ||
298 | +go.opentelemetry.io/otel/trace v0.17.0 h1:SBOj64/GAOyWzs5F680yW1ITIfJkm6cJWL2YAvuL9xY= | ||
299 | +go.opentelemetry.io/otel/trace v0.17.0/go.mod h1:bIujpqg6ZL6xUTubIUgziI1jSaUPthmabA/ygf/6Cfg= | ||
300 | +go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= | ||
301 | +go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= | ||
302 | +go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= | ||
303 | +go.uber.org/zap v1.15.0/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= | ||
304 | +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= | ||
305 | +golang.org/x/crypto v0.0.0-20180910181607-0e37d006457b/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= | ||
306 | +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= | ||
307 | +golang.org/x/crypto v0.0.0-20190404164418-38d8ce5564a5/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= | ||
308 | +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= | ||
309 | +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= | ||
310 | +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= | ||
311 | +golang.org/x/crypto v0.0.0-20210218145215-b8e89b74b9df/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= | ||
312 | +golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a h1:kr2P4QFmQr29mSLA43kwrOcgcReGTfbE9N577tCTuBc= | ||
313 | +golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= | ||
314 | +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= | ||
315 | +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= | ||
316 | +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= | ||
317 | +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= | ||
318 | +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= | ||
319 | +golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= | ||
320 | +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= | ||
321 | +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= | ||
322 | +golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4= | ||
323 | +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= | ||
324 | +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= | ||
325 | +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= | ||
326 | +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= | ||
327 | +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= | ||
328 | +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= | ||
329 | +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= | ||
330 | +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= | ||
331 | +golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= | ||
332 | +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= | ||
333 | +golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= | ||
334 | +golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= | ||
335 | +golang.org/x/net v0.0.0-20201006153459-a7d1128ccaa0/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= | ||
336 | +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= | ||
337 | +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= | ||
338 | +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= | ||
339 | +golang.org/x/net v0.0.0-20210510120150-4163338589ed/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= | ||
340 | +golang.org/x/net v0.0.0-20210614182718-04defd469f4e h1:XpT3nA5TvE525Ne3hInMh6+GETgn27Zfm9dxsThnX2Q= | ||
341 | +golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= | ||
342 | +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= | ||
343 | +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= | ||
344 | +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= | ||
345 | +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= | ||
346 | +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= | ||
347 | +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= | ||
348 | +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= | ||
349 | +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= | ||
350 | +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= | ||
351 | +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= | ||
352 | +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= | ||
353 | +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= | ||
354 | +golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||
355 | +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||
356 | +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||
357 | +golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||
358 | +golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||
359 | +golang.org/x/sys v0.0.0-20191010194322-b09406accb47/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||
360 | +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||
361 | +golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||
362 | +golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||
363 | +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||
364 | +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||
365 | +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||
366 | +golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||
367 | +golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||
368 | +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||
369 | +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||
370 | +golang.org/x/sys v0.0.0-20210218155724-8ebf48af031b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||
371 | +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||
372 | +golang.org/x/sys v0.0.0-20210514084401-e8d321eab015 h1:hZR0X1kPW+nwyJ9xRxqZk1vx5RUObAPBdKVvXPDUH/E= | ||
373 | +golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= | ||
374 | +golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= | ||
375 | +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= | ||
376 | +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= | ||
377 | +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= | ||
378 | +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= | ||
379 | +golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= | ||
380 | +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= | ||
381 | +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= | ||
382 | +golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= | ||
383 | +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= | ||
384 | +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= | ||
385 | +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= | ||
386 | +golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= | ||
387 | +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= | ||
388 | +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= | ||
389 | +golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= | ||
390 | +golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= | ||
391 | +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= | ||
392 | +golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= | ||
393 | +golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= | ||
394 | +golang.org/x/tools v0.0.0-20201211185031-d93e913c1a58 h1:1Bs6RVeBFtLZ8Yi1Hk07DiOqzvwLD/4hln4iahvFlag= | ||
395 | +golang.org/x/tools v0.0.0-20201211185031-d93e913c1a58/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= | ||
396 | +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= | ||
397 | +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= | ||
398 | +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= | ||
399 | +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= | ||
400 | +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= | ||
401 | +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= | ||
402 | +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= | ||
403 | +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= | ||
404 | +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= | ||
405 | +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= | ||
406 | +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= | ||
407 | +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= | ||
408 | +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= | ||
409 | +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= | ||
410 | +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= | ||
411 | +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= | ||
412 | +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= | ||
413 | +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= | ||
414 | +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= | ||
415 | +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= | ||
416 | +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= | ||
417 | +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= | ||
418 | +google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= | ||
419 | +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= | ||
420 | +gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= | ||
421 | +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= | ||
422 | +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= | ||
423 | +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= | ||
424 | +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= | ||
425 | +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= | ||
426 | +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= | ||
427 | +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= | ||
428 | +gopkg.in/jcmturner/aescts.v1 v1.0.1 h1:cVVZBK2b1zY26haWB4vbBiZrfFQnfbTVrE3xZq6hrEw= | ||
429 | +gopkg.in/jcmturner/aescts.v1 v1.0.1/go.mod h1:nsR8qBOg+OucoIW+WMhB3GspUQXq9XorLnQb9XtvcOo= | ||
430 | +gopkg.in/jcmturner/dnsutils.v1 v1.0.1 h1:cIuC1OLRGZrld+16ZJvvZxVJeKPsvd5eUIvxfoN5hSM= | ||
431 | +gopkg.in/jcmturner/dnsutils.v1 v1.0.1/go.mod h1:m3v+5svpVOhtFAP/wSz+yzh4Mc0Fg7eRhxkJMWSIz9Q= | ||
432 | +gopkg.in/jcmturner/goidentity.v3 v3.0.0 h1:1duIyWiTaYvVx3YX2CYtpJbUFd7/UuPYCfgXtQ3VTbI= | ||
433 | +gopkg.in/jcmturner/goidentity.v3 v3.0.0/go.mod h1:oG2kH0IvSYNIu80dVAyu/yoefjq1mNfM5bm88whjWx4= | ||
434 | +gopkg.in/jcmturner/gokrb5.v7 v7.2.3 h1:hHMV/yKPwMnJhPuPx7pH2Uw/3Qyf+thJYlisUc44010= | ||
435 | +gopkg.in/jcmturner/gokrb5.v7 v7.2.3/go.mod h1:l8VISx+WGYp+Fp7KRbsiUuXTTOnxIc3Tuvyavf11/WM= | ||
436 | +gopkg.in/jcmturner/rpc.v1 v1.1.0 h1:QHIUxTX1ISuAv9dD2wJ9HWQVuWDX/Zc0PfeC2tjc4rU= | ||
437 | +gopkg.in/jcmturner/rpc.v1 v1.1.0/go.mod h1:YIdkC4XfD6GXbzje11McwsDuOlZQSb9W4vfLvuNnlv8= | ||
438 | +gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= | ||
439 | +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= | ||
440 | +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= | ||
441 | +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= | ||
442 | +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= | ||
443 | +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= | ||
444 | +gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= | ||
445 | +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= | ||
446 | +gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= | ||
447 | +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= | ||
448 | +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= | ||
449 | +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= | ||
450 | +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= | ||
451 | +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= | ||
452 | +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= | ||
453 | +honnef.co/go/tools v0.0.1-2020.1.5/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= | ||
454 | +mellium.im/sasl v0.2.1 h1:nspKSRg7/SyO0cRGY71OkfHab8tf9kCts6a6oTDut0w= | ||
455 | +mellium.im/sasl v0.2.1/go.mod h1:ROaEDLQNuf9vjKqE1SrAfnsobm2YKXT1gnN1uDp1PjQ= |
main.go
0 → 100644
1 | +package main | ||
2 | + | ||
3 | +import ( | ||
4 | + "fmt" | ||
5 | + "github.com/beego/beego/v2/server/web" | ||
6 | + "github.com/linmadan/egglib-go/log/logrus" | ||
7 | + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/constant" | ||
8 | + _ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/constant" | ||
9 | + _ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/pg" | ||
10 | + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/log" | ||
11 | + _ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/log" | ||
12 | + _ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/port/beego" | ||
13 | +) | ||
14 | + | ||
15 | +func main() { | ||
16 | + // web主服务 | ||
17 | + if constant.ENABLE_KAFKA_LOG { | ||
18 | + w, err := logrus.NewKafkaWriter(constant.KAFKA_HOSTS, constant.TOPIC_LOG_STASH, false) | ||
19 | + if err != nil { | ||
20 | + log.Logger.Error(err.Error()) | ||
21 | + } | ||
22 | + log.Logger.AddHook(w) | ||
23 | + } | ||
24 | + | ||
25 | + fmt.Printf("Server running at:%d\n", web.BConfig.Listen.HTTPPort) | ||
26 | + | ||
27 | + web.Run() | ||
28 | +} |
pkg/application/contractUndertakerFeedback/command/create_contract_undertaker_feedback.go
0 → 100644
1 | +package command | ||
2 | + | ||
3 | +import ( | ||
4 | + "fmt" | ||
5 | + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/domain" | ||
6 | + "reflect" | ||
7 | + "strings" | ||
8 | + | ||
9 | + "github.com/beego/beego/v2/core/validation" | ||
10 | +) | ||
11 | + | ||
12 | +type CreateContractUndertakerFeedbackCommand struct { | ||
13 | + // 合约承接方反馈内容附件 | ||
14 | + FeedbackAttachment []*domain.Attachment `cname:"合约承接方反馈内容附件" json:"feedbackAttachment,omitempty"` | ||
15 | + // 合约承接方反馈内容 | ||
16 | + FeedbackContent string `cname:"合约承接方反馈内容" json:"feedbackContent" valid:"Required"` | ||
17 | + // 共创合约编号 | ||
18 | + CooperationContractNumber string `cname:"共创合约编号" json:"cooperationContractNumber" valid:"Required"` | ||
19 | + // 承接人uid | ||
20 | + UnderTakerUid string `cname:"承接人uid" json:"underTakerUid,omitempty"` | ||
21 | + // 公司ID,通过集成REST上下文获取 | ||
22 | + CompanyId int64 `cname:"公司ID" json:"companyId" valid:"Required"` | ||
23 | + // 组织机构ID | ||
24 | + OrgId int64 `cname:"组织机构ID" json:"orgId" valid:"Required"` | ||
25 | + // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员 | ||
26 | + UserId int64 `cname:"用户ID" json:"userId" valid:"Required"` | ||
27 | + // 用户基础数据id | ||
28 | + UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId" valid:"Required"` | ||
29 | +} | ||
30 | + | ||
31 | +func (createContractUndertakerFeedbackCommand *CreateContractUndertakerFeedbackCommand) Valid(validation *validation.Validation) { | ||
32 | + //validation.SetError("CustomValid", "未实现的自定义认证") | ||
33 | +} | ||
34 | + | ||
35 | +func (createContractUndertakerFeedbackCommand *CreateContractUndertakerFeedbackCommand) ValidateCommand() error { | ||
36 | + valid := validation.Validation{} | ||
37 | + b, err := valid.Valid(createContractUndertakerFeedbackCommand) | ||
38 | + if err != nil { | ||
39 | + return err | ||
40 | + } | ||
41 | + if !b { | ||
42 | + elem := reflect.TypeOf(createContractUndertakerFeedbackCommand).Elem() | ||
43 | + for _, validErr := range valid.Errors { | ||
44 | + field, isExist := elem.FieldByName(validErr.Field) | ||
45 | + if isExist { | ||
46 | + return fmt.Errorf(strings.Replace(validErr.Message, validErr.Field, field.Tag.Get("cname"), -1)) | ||
47 | + } else { | ||
48 | + return fmt.Errorf(validErr.Message) | ||
49 | + } | ||
50 | + } | ||
51 | + } | ||
52 | + return nil | ||
53 | +} |
pkg/application/contractUndertakerFeedback/command/remove_contract_undertaker_feedback.go
0 → 100644
1 | +package command | ||
2 | + | ||
3 | +import ( | ||
4 | + "fmt" | ||
5 | + "reflect" | ||
6 | + "strings" | ||
7 | + | ||
8 | + "github.com/beego/beego/v2/core/validation" | ||
9 | +) | ||
10 | + | ||
11 | +type RemoveContractUndertakerFeedbackCommand struct { | ||
12 | + // 合约承接方反馈记录ID | ||
13 | + FeedbackId string `cname:"合约承接方反馈记录ID" json:"feedbackId" valid:"Required"` | ||
14 | + // 承接人uid | ||
15 | + UnderTakerUid string `cname:"承接人UID" json:"underTakerUid,omitempty"` | ||
16 | + // 公司ID,通过集成REST上下文获取 | ||
17 | + CompanyId int64 `cname:"公司ID" json:"companyId" valid:"Required"` | ||
18 | + // 组织机构ID | ||
19 | + OrgId int64 `cname:"组织机构ID" json:"orgId" valid:"Required"` | ||
20 | + // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员 | ||
21 | + UserId int64 `cname:"用户ID" json:"userId" valid:"Required"` | ||
22 | + // 用户基础数据id | ||
23 | + UserBaseId int64 `cname:"用户基础数据" json:"userBaseId" valid:"Required"` | ||
24 | +} | ||
25 | + | ||
26 | +func (removeContractUndertakerFeedbackCommand *RemoveContractUndertakerFeedbackCommand) Valid(validation *validation.Validation) { | ||
27 | + //validation.SetError("CustomValid", "未实现的自定义认证") | ||
28 | +} | ||
29 | + | ||
30 | +func (removeContractUndertakerFeedbackCommand *RemoveContractUndertakerFeedbackCommand) ValidateCommand() error { | ||
31 | + valid := validation.Validation{} | ||
32 | + b, err := valid.Valid(removeContractUndertakerFeedbackCommand) | ||
33 | + if err != nil { | ||
34 | + return err | ||
35 | + } | ||
36 | + if !b { | ||
37 | + elem := reflect.TypeOf(removeContractUndertakerFeedbackCommand).Elem() | ||
38 | + for _, validErr := range valid.Errors { | ||
39 | + field, isExist := elem.FieldByName(validErr.Field) | ||
40 | + if isExist { | ||
41 | + return fmt.Errorf(strings.Replace(validErr.Message, validErr.Field, field.Tag.Get("cname"), -1)) | ||
42 | + } else { | ||
43 | + return fmt.Errorf(validErr.Message) | ||
44 | + } | ||
45 | + } | ||
46 | + } | ||
47 | + return nil | ||
48 | +} |
pkg/application/contractUndertakerFeedback/command/update_contract_undertaker_feedback.go
0 → 100644
1 | +package command | ||
2 | + | ||
3 | +import ( | ||
4 | + "fmt" | ||
5 | + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/domain" | ||
6 | + "reflect" | ||
7 | + "strings" | ||
8 | + | ||
9 | + "github.com/beego/beego/v2/core/validation" | ||
10 | +) | ||
11 | + | ||
12 | +type UpdateContractUndertakerFeedbackCommand struct { | ||
13 | + // 合约承接方信息反馈id | ||
14 | + FeedbackId string `cname:"合约承接方反馈信息ID" json:"feedbackId" valid:"Required"` | ||
15 | + // 合约承接方反馈内容附件 | ||
16 | + FeedbackAttachment []*domain.Attachment `cname:"合约承接方反馈内容附件" json:"feedbackAttachment" valid:"Required"` | ||
17 | + // 合约承接方反馈内容 | ||
18 | + FeedbackContent string `cname:"合约承接方反馈内容" json:"feedbackContent" valid:"Required"` | ||
19 | + // 共创合约编号 | ||
20 | + CooperationContractNumber string `cname:"共创合约编号" json:"cooperationContractNumber" valid:"Required"` | ||
21 | + // 承接人用户uid | ||
22 | + UnderTakerUid string `cname:"承接人用户UID" json:"underTakerUid,omitempty"` | ||
23 | + // 公司ID,通过集成REST上下文获取 | ||
24 | + CompanyId int64 `cname:"公司ID" json:"companyId" valid:"Required"` | ||
25 | + // 组织机构ID | ||
26 | + OrgId int64 `cname:"组织机构ID" json:"orgId" valid:"Required"` | ||
27 | + // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员 | ||
28 | + UserId int64 `cname:"用户ID" json:"userId" valid:"Required"` | ||
29 | + // 用户基础数据id | ||
30 | + UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId" valid:"Required"` | ||
31 | +} | ||
32 | + | ||
33 | +func (updateContractUndertakerFeedbackCommand *UpdateContractUndertakerFeedbackCommand) Valid(validation *validation.Validation) { | ||
34 | + //validation.SetError("CustomValid", "未实现的自定义认证") | ||
35 | +} | ||
36 | + | ||
37 | +func (updateContractUndertakerFeedbackCommand *UpdateContractUndertakerFeedbackCommand) ValidateCommand() error { | ||
38 | + valid := validation.Validation{} | ||
39 | + b, err := valid.Valid(updateContractUndertakerFeedbackCommand) | ||
40 | + if err != nil { | ||
41 | + return err | ||
42 | + } | ||
43 | + if !b { | ||
44 | + elem := reflect.TypeOf(updateContractUndertakerFeedbackCommand).Elem() | ||
45 | + for _, validErr := range valid.Errors { | ||
46 | + field, isExist := elem.FieldByName(validErr.Field) | ||
47 | + if isExist { | ||
48 | + return fmt.Errorf(strings.Replace(validErr.Message, validErr.Field, field.Tag.Get("cname"), -1)) | ||
49 | + } else { | ||
50 | + return fmt.Errorf(validErr.Message) | ||
51 | + } | ||
52 | + } | ||
53 | + } | ||
54 | + return nil | ||
55 | +} |
1 | +package query | ||
2 | + | ||
3 | +import ( | ||
4 | + "fmt" | ||
5 | + "reflect" | ||
6 | + "strings" | ||
7 | + | ||
8 | + "github.com/beego/beego/v2/core/validation" | ||
9 | +) | ||
10 | + | ||
11 | +type GetContractUndertakerFeedbackQuery struct { | ||
12 | + // 合约承接方反馈记录ID | ||
13 | + FeedbackId string `cname:"合约承接方反馈记录ID" json:"feedbackId" valid:"Required"` | ||
14 | + // 承接人uid | ||
15 | + UnderTakerUid string `cname:"承接人UID" json:"underTakerUid,omitempty"` | ||
16 | + // 公司ID,通过集成REST上下文获取 | ||
17 | + CompanyId int64 `cname:"公司ID" json:"companyId" valid:"Required"` | ||
18 | + // 组织机构ID | ||
19 | + OrgId int64 `cname:"组织机构ID" json:"orgId"` | ||
20 | + // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员 | ||
21 | + UserId int64 `cname:"用户ID" json:"userId"` | ||
22 | + // 用户基础数据id | ||
23 | + UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId"` | ||
24 | +} | ||
25 | + | ||
26 | +func (getContractUndertakerFeedbackQuery *GetContractUndertakerFeedbackQuery) Valid(validation *validation.Validation) { | ||
27 | + //validation.SetError("CustomValid", "未实现的自定义认证") | ||
28 | +} | ||
29 | + | ||
30 | +func (getContractUndertakerFeedbackQuery *GetContractUndertakerFeedbackQuery) ValidateQuery() error { | ||
31 | + valid := validation.Validation{} | ||
32 | + b, err := valid.Valid(getContractUndertakerFeedbackQuery) | ||
33 | + if err != nil { | ||
34 | + return err | ||
35 | + } | ||
36 | + if !b { | ||
37 | + elem := reflect.TypeOf(getContractUndertakerFeedbackQuery).Elem() | ||
38 | + for _, validErr := range valid.Errors { | ||
39 | + field, isExist := elem.FieldByName(validErr.Field) | ||
40 | + if isExist { | ||
41 | + return fmt.Errorf(strings.Replace(validErr.Message, validErr.Field, field.Tag.Get("cname"), -1)) | ||
42 | + } else { | ||
43 | + return fmt.Errorf(validErr.Message) | ||
44 | + } | ||
45 | + } | ||
46 | + } | ||
47 | + return nil | ||
48 | +} |
1 | +package query | ||
2 | + | ||
3 | +import ( | ||
4 | + "fmt" | ||
5 | + "reflect" | ||
6 | + "strings" | ||
7 | + | ||
8 | + "github.com/beego/beego/v2/core/validation" | ||
9 | +) | ||
10 | + | ||
11 | +type ListContractUndertakerFeedbackQuery struct { | ||
12 | + // 页面大小 | ||
13 | + PageNumber int64 `cname:"页码" json:"pageNumber,omitempty"` | ||
14 | + // 页面大小 | ||
15 | + PageSize int64 `cname:"页面大小" json:"pageSize,omitempty"` | ||
16 | + // 承接人uid | ||
17 | + UnderTakerUid string `cname:"承接人UID" json:"underTakerUid,omitempty"` | ||
18 | + // 公司ID,通过集成REST上下文获取 | ||
19 | + CompanyId int64 `cname:"公司ID" json:"companyId" valid:"Required"` | ||
20 | + // 组织机构ID | ||
21 | + OrgId int64 `cname:"组织机构ID" json:"orgId"` | ||
22 | + // 关联的组织机构ID列表 | ||
23 | + OrgIds []int64 `cname:"关联的组织机构ID列表" json:"orgIds"` | ||
24 | + // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员 | ||
25 | + UserId int64 `cname:"用户ID" json:"userId"` | ||
26 | + // 用户基础数据id | ||
27 | + UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId"` | ||
28 | +} | ||
29 | + | ||
30 | +func (listContractUndertakerFeedbackQuery *ListContractUndertakerFeedbackQuery) Valid(validation *validation.Validation) { | ||
31 | + //validation.SetError("CustomValid", "未实现的自定义认证") | ||
32 | +} | ||
33 | + | ||
34 | +func (listContractUndertakerFeedbackQuery *ListContractUndertakerFeedbackQuery) ValidateQuery() error { | ||
35 | + valid := validation.Validation{} | ||
36 | + b, err := valid.Valid(listContractUndertakerFeedbackQuery) | ||
37 | + if err != nil { | ||
38 | + return err | ||
39 | + } | ||
40 | + if !b { | ||
41 | + elem := reflect.TypeOf(listContractUndertakerFeedbackQuery).Elem() | ||
42 | + for _, validErr := range valid.Errors { | ||
43 | + field, isExist := elem.FieldByName(validErr.Field) | ||
44 | + if isExist { | ||
45 | + return fmt.Errorf(strings.Replace(validErr.Message, validErr.Field, field.Tag.Get("cname"), -1)) | ||
46 | + } else { | ||
47 | + return fmt.Errorf(validErr.Message) | ||
48 | + } | ||
49 | + } | ||
50 | + } | ||
51 | + return nil | ||
52 | +} |
1 | +package query | ||
2 | + | ||
3 | +import ( | ||
4 | + "fmt" | ||
5 | + "reflect" | ||
6 | + "strings" | ||
7 | + | ||
8 | + "github.com/beego/beego/v2/core/validation" | ||
9 | +) | ||
10 | + | ||
11 | +type SearchContractUndertakerFeedbackQuery struct { | ||
12 | + // 公司ID,通过集成REST上下文获取 | ||
13 | + CompanyId int64 `cname:"公司ID" json:"companyId"` | ||
14 | + // 组织机构ID | ||
15 | + OrgId int64 `cname:"组织机构ID" json:"orgId"` | ||
16 | + // 关联的组织机构ID列表 | ||
17 | + OrgIds []int64 `cname:"关联的组织机构ID列表" json:"orgIds"` | ||
18 | + // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员 | ||
19 | + UserId int64 `cname:"用户ID" json:"userId"` | ||
20 | + // 用户基础数据id | ||
21 | + UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId"` | ||
22 | + // 共创合约名称 | ||
23 | + CooperationContractName string `cname:"共创合约名称" json:"cooperationContractName,omitempty"` | ||
24 | + // 承接人姓名 | ||
25 | + UndertakerName string `cname:"承接人姓名" json:"undertakerName,omitempty"` | ||
26 | + // 查询关键词 | ||
27 | + MatchWord string `cname:"查询关键词" json:"matchWord,omitempty"` | ||
28 | + // 页面大小 | ||
29 | + PageNumber int64 `cname:"页码" json:"pageNumber,omitempty"` | ||
30 | + // 页面大小 | ||
31 | + PageSize int64 `cname:"页面大小" json:"pageSize,omitempty"` | ||
32 | +} | ||
33 | + | ||
34 | +func (searchContractUndertakerFeedbackQuery *SearchContractUndertakerFeedbackQuery) Valid(validation *validation.Validation) { | ||
35 | + //validation.SetError("CustomValid", "未实现的自定义认证") | ||
36 | +} | ||
37 | + | ||
38 | +func (searchContractUndertakerFeedbackQuery *SearchContractUndertakerFeedbackQuery) ValidateQuery() error { | ||
39 | + valid := validation.Validation{} | ||
40 | + b, err := valid.Valid(searchContractUndertakerFeedbackQuery) | ||
41 | + if err != nil { | ||
42 | + return err | ||
43 | + } | ||
44 | + if !b { | ||
45 | + elem := reflect.TypeOf(searchContractUndertakerFeedbackQuery).Elem() | ||
46 | + for _, validErr := range valid.Errors { | ||
47 | + field, isExist := elem.FieldByName(validErr.Field) | ||
48 | + if isExist { | ||
49 | + return fmt.Errorf(strings.Replace(validErr.Message, validErr.Field, field.Tag.Get("cname"), -1)) | ||
50 | + } else { | ||
51 | + return fmt.Errorf(validErr.Message) | ||
52 | + } | ||
53 | + } | ||
54 | + } | ||
55 | + return nil | ||
56 | +} |
1 | +package service | ||
2 | + | ||
3 | +import ( | ||
4 | + "fmt" | ||
5 | + "github.com/linmadan/egglib-go/core/application" | ||
6 | + "github.com/linmadan/egglib-go/utils/tool_funs" | ||
7 | + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/application/contractUndertakerFeedback/command" | ||
8 | + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/application/contractUndertakerFeedback/query" | ||
9 | + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/application/factory" | ||
10 | + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/domain" | ||
11 | + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/domain/service" | ||
12 | + "time" | ||
13 | +) | ||
14 | + | ||
15 | +// ContractUndertakerFeedbackService 共创合约反馈服务 | ||
16 | +type ContractUndertakerFeedbackService struct { | ||
17 | +} | ||
18 | + | ||
19 | +// CreateContractUndertakerFeedback 创建共创合约反馈服务 | ||
20 | +func (contractUndertakerFeedbackService *ContractUndertakerFeedbackService) CreateContractUndertakerFeedback(createContractUndertakerFeedbackCommand *command.CreateContractUndertakerFeedbackCommand) (interface{}, error) { | ||
21 | + if err := createContractUndertakerFeedbackCommand.ValidateCommand(); err != nil { | ||
22 | + return nil, application.ThrowError(application.ARG_ERROR, err.Error()) | ||
23 | + } | ||
24 | + transactionContext, err := factory.CreateTransactionContext(nil) | ||
25 | + if err != nil { | ||
26 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | ||
27 | + } | ||
28 | + if err := transactionContext.StartTransaction(); err != nil { | ||
29 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | ||
30 | + } | ||
31 | + defer func() { | ||
32 | + _ = transactionContext.RollbackTransaction() | ||
33 | + }() | ||
34 | + | ||
35 | + // 用户REST服务初始化 | ||
36 | + var userService service.UserService | ||
37 | + if value, err := factory.CreateUserService(map[string]interface{}{}); err != nil { | ||
38 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
39 | + } else { | ||
40 | + userService = value | ||
41 | + } | ||
42 | + | ||
43 | + // 获取承接人 | ||
44 | + var undertaker *domain.Undertaker | ||
45 | + if data, err := userService.UndertakerFrom(createContractUndertakerFeedbackCommand.CompanyId, createContractUndertakerFeedbackCommand.OrgId, createContractUndertakerFeedbackCommand.UserId); err != nil { | ||
46 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
47 | + } else { | ||
48 | + undertaker = data | ||
49 | + } | ||
50 | + | ||
51 | + // 公司REST服务初始化 | ||
52 | + var companyService service.CompanyService | ||
53 | + if value, err := factory.CreateCompanyService(map[string]interface{}{}); err != nil { | ||
54 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
55 | + } else { | ||
56 | + companyService = value | ||
57 | + } | ||
58 | + | ||
59 | + // 获取公司信息 | ||
60 | + var company *domain.Company | ||
61 | + if data, err := companyService.CompanyFrom(createContractUndertakerFeedbackCommand.CompanyId); err != nil { | ||
62 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
63 | + } else { | ||
64 | + company = data | ||
65 | + } | ||
66 | + | ||
67 | + // 组织机构REST服务初始化 | ||
68 | + var organizationService service.OrgService | ||
69 | + if value, err := factory.CreateOrganizationService(map[string]interface{}{}); err != nil { | ||
70 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
71 | + } else { | ||
72 | + organizationService = value | ||
73 | + } | ||
74 | + | ||
75 | + // 获取组织机构信息 | ||
76 | + var organization *domain.Org | ||
77 | + if data, err := organizationService.OrgFrom(createContractUndertakerFeedbackCommand.CompanyId, createContractUndertakerFeedbackCommand.OrgId); err != nil { | ||
78 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
79 | + } else { | ||
80 | + organization = data | ||
81 | + } | ||
82 | + | ||
83 | + var cooperationContractRepository domain.CooperationContractRepository | ||
84 | + if value, err := factory.CreateCooperationContractRepository(map[string]interface{}{ | ||
85 | + "transactionContext": transactionContext, | ||
86 | + }); err != nil { | ||
87 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
88 | + } else { | ||
89 | + cooperationContractRepository = value | ||
90 | + } | ||
91 | + | ||
92 | + // 获取项目合约信息 | ||
93 | + cooperationContract, err := cooperationContractRepository.FindOne(map[string]interface{}{ | ||
94 | + "cooperationContractNumber": createContractUndertakerFeedbackCommand.CooperationContractNumber, | ||
95 | + "companyId": createContractUndertakerFeedbackCommand.CompanyId, | ||
96 | + "orgId": createContractUndertakerFeedbackCommand.OrgId, | ||
97 | + }) | ||
98 | + if err != nil { | ||
99 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "共创合约不存在") | ||
100 | + } | ||
101 | + if cooperationContract == nil { | ||
102 | + return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", createContractUndertakerFeedbackCommand.CooperationContractNumber)) | ||
103 | + } else { | ||
104 | + newContractUndertakerFeedback := &domain.ContractUndertakerFeedback{ | ||
105 | + FeedbackAttachment: createContractUndertakerFeedbackCommand.FeedbackAttachment, | ||
106 | + FeedbackContent: createContractUndertakerFeedbackCommand.FeedbackContent, | ||
107 | + CooperationContractNumber: createContractUndertakerFeedbackCommand.CooperationContractNumber, | ||
108 | + CooperationContractName: cooperationContract.CooperationContractName, | ||
109 | + CooperationModeName: cooperationContract.CooperationMode.CooperationModeName, | ||
110 | + ContractUndertaker: undertaker, | ||
111 | + Company: company, | ||
112 | + Org: organization, | ||
113 | + UpdatedAt: time.Time{}, | ||
114 | + DeletedAt: time.Time{}, | ||
115 | + CreatedAt: time.Now(), | ||
116 | + } | ||
117 | + | ||
118 | + var contractUndertakerFeedbackRepository domain.ContractUndertakerFeedbackRepository | ||
119 | + if value, err := factory.CreateContractUndertakerFeedbackRepository(map[string]interface{}{ | ||
120 | + "transactionContext": transactionContext, | ||
121 | + }); err != nil { | ||
122 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
123 | + } else { | ||
124 | + contractUndertakerFeedbackRepository = value | ||
125 | + } | ||
126 | + if contractUndertakerFeedback, err := contractUndertakerFeedbackRepository.Save(newContractUndertakerFeedback); err != nil { | ||
127 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
128 | + } else { | ||
129 | + if err := transactionContext.CommitTransaction(); err != nil { | ||
130 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | ||
131 | + } | ||
132 | + return contractUndertakerFeedback, nil | ||
133 | + } | ||
134 | + } | ||
135 | +} | ||
136 | + | ||
137 | +// GetContractUndertakerFeedback 返回共创合约反馈服务 | ||
138 | +func (contractUndertakerFeedbackService *ContractUndertakerFeedbackService) GetContractUndertakerFeedback(getContractUndertakerFeedbackQuery *query.GetContractUndertakerFeedbackQuery) (interface{}, error) { | ||
139 | + if err := getContractUndertakerFeedbackQuery.ValidateQuery(); err != nil { | ||
140 | + return nil, application.ThrowError(application.ARG_ERROR, err.Error()) | ||
141 | + } | ||
142 | + transactionContext, err := factory.CreateTransactionContext(nil) | ||
143 | + if err != nil { | ||
144 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | ||
145 | + } | ||
146 | + if err := transactionContext.StartTransaction(); err != nil { | ||
147 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | ||
148 | + } | ||
149 | + defer func() { | ||
150 | + _ = transactionContext.RollbackTransaction() | ||
151 | + }() | ||
152 | + var contractUndertakerFeedbackRepository domain.ContractUndertakerFeedbackRepository | ||
153 | + if value, err := factory.CreateContractUndertakerFeedbackRepository(map[string]interface{}{ | ||
154 | + "transactionContext": transactionContext, | ||
155 | + }); err != nil { | ||
156 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
157 | + } else { | ||
158 | + contractUndertakerFeedbackRepository = value | ||
159 | + } | ||
160 | + contractUndertakerFeedback, err := contractUndertakerFeedbackRepository.FindOne(map[string]interface{}{"contractUndertakerFeedbackId": getContractUndertakerFeedbackQuery.FeedbackId}) | ||
161 | + if err != nil { | ||
162 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "合约反馈信息不存在") | ||
163 | + } | ||
164 | + if contractUndertakerFeedback == nil { | ||
165 | + return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", string(getContractUndertakerFeedbackQuery.FeedbackId))) | ||
166 | + } else { | ||
167 | + if err := transactionContext.CommitTransaction(); err != nil { | ||
168 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | ||
169 | + } | ||
170 | + return contractUndertakerFeedback, nil | ||
171 | + } | ||
172 | +} | ||
173 | + | ||
174 | +// ListContractUndertakerFeedback 返回共创合约反馈服务列表 | ||
175 | +func (contractUndertakerFeedbackService *ContractUndertakerFeedbackService) ListContractUndertakerFeedback(listContractUndertakerFeedbackQuery *query.ListContractUndertakerFeedbackQuery) (interface{}, error) { | ||
176 | + if err := listContractUndertakerFeedbackQuery.ValidateQuery(); err != nil { | ||
177 | + return nil, application.ThrowError(application.ARG_ERROR, err.Error()) | ||
178 | + } | ||
179 | + transactionContext, err := factory.CreateTransactionContext(nil) | ||
180 | + if err != nil { | ||
181 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | ||
182 | + } | ||
183 | + if err := transactionContext.StartTransaction(); err != nil { | ||
184 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | ||
185 | + } | ||
186 | + defer func() { | ||
187 | + _ = transactionContext.RollbackTransaction() | ||
188 | + }() | ||
189 | + var contractUndertakerFeedbackRepository domain.ContractUndertakerFeedbackRepository | ||
190 | + if value, err := factory.CreateContractUndertakerFeedbackRepository(map[string]interface{}{ | ||
191 | + "transactionContext": transactionContext, | ||
192 | + }); err != nil { | ||
193 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
194 | + } else { | ||
195 | + contractUndertakerFeedbackRepository = value | ||
196 | + } | ||
197 | + if count, contractUndertakerFeedbacks, err := contractUndertakerFeedbackRepository.Find(tool_funs.SimpleStructToMap(listContractUndertakerFeedbackQuery)); err != nil { | ||
198 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
199 | + } else { | ||
200 | + if err := transactionContext.CommitTransaction(); err != nil { | ||
201 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | ||
202 | + } | ||
203 | + return map[string]interface{}{ | ||
204 | + "grid": map[string]interface{}{ | ||
205 | + "total": count, | ||
206 | + "list": contractUndertakerFeedbacks, | ||
207 | + }, | ||
208 | + }, nil | ||
209 | + } | ||
210 | +} | ||
211 | + | ||
212 | +// RemoveContractUndertakerFeedback 移除共创合约反馈服务 | ||
213 | +func (contractUndertakerFeedbackService *ContractUndertakerFeedbackService) RemoveContractUndertakerFeedback(removeContractUndertakerFeedbackCommand *command.RemoveContractUndertakerFeedbackCommand) (interface{}, error) { | ||
214 | + if err := removeContractUndertakerFeedbackCommand.ValidateCommand(); err != nil { | ||
215 | + return nil, application.ThrowError(application.ARG_ERROR, err.Error()) | ||
216 | + } | ||
217 | + transactionContext, err := factory.CreateTransactionContext(nil) | ||
218 | + if err != nil { | ||
219 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | ||
220 | + } | ||
221 | + if err := transactionContext.StartTransaction(); err != nil { | ||
222 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | ||
223 | + } | ||
224 | + defer func() { | ||
225 | + _ = transactionContext.RollbackTransaction() | ||
226 | + }() | ||
227 | + var contractUndertakerFeedbackRepository domain.ContractUndertakerFeedbackRepository | ||
228 | + if value, err := factory.CreateContractUndertakerFeedbackRepository(map[string]interface{}{ | ||
229 | + "transactionContext": transactionContext, | ||
230 | + }); err != nil { | ||
231 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
232 | + } else { | ||
233 | + contractUndertakerFeedbackRepository = value | ||
234 | + } | ||
235 | + contractUndertakerFeedback, err := contractUndertakerFeedbackRepository.FindOne(map[string]interface{}{"contractUndertakerFeedbackId": removeContractUndertakerFeedbackCommand.FeedbackId}) | ||
236 | + if err != nil { | ||
237 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "反馈信息不存在") | ||
238 | + } | ||
239 | + if contractUndertakerFeedback == nil { | ||
240 | + return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", string(removeContractUndertakerFeedbackCommand.FeedbackId))) | ||
241 | + } | ||
242 | + if contractUndertakerFeedback, err := contractUndertakerFeedbackRepository.Remove(contractUndertakerFeedback); err != nil { | ||
243 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
244 | + } else { | ||
245 | + if err := transactionContext.CommitTransaction(); err != nil { | ||
246 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | ||
247 | + } | ||
248 | + return contractUndertakerFeedback, nil | ||
249 | + } | ||
250 | +} | ||
251 | + | ||
252 | +// SearchContractUndertakerFeedback 查询共创承接方反馈信息 | ||
253 | +func (contractUndertakerFeedbackService *ContractUndertakerFeedbackService) SearchContractUndertakerFeedback(searchContractUndertakerFeedbackQuery *query.SearchContractUndertakerFeedbackQuery) (interface{}, error) { | ||
254 | + if err := searchContractUndertakerFeedbackQuery.ValidateQuery(); err != nil { | ||
255 | + return nil, application.ThrowError(application.ARG_ERROR, err.Error()) | ||
256 | + } | ||
257 | + transactionContext, err := factory.CreateTransactionContext(nil) | ||
258 | + if err != nil { | ||
259 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | ||
260 | + } | ||
261 | + if err := transactionContext.StartTransaction(); err != nil { | ||
262 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | ||
263 | + } | ||
264 | + defer func() { | ||
265 | + _ = transactionContext.RollbackTransaction() | ||
266 | + }() | ||
267 | + var contractUndertakerFeedbackRepository domain.ContractUndertakerFeedbackRepository | ||
268 | + if value, err := factory.CreateContractUndertakerFeedbackRepository(map[string]interface{}{ | ||
269 | + "transactionContext": transactionContext, | ||
270 | + }); err != nil { | ||
271 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
272 | + } else { | ||
273 | + contractUndertakerFeedbackRepository = value | ||
274 | + } | ||
275 | + if count, contractUndertakerFeedbacks, err := contractUndertakerFeedbackRepository.Find(tool_funs.SimpleStructToMap(searchContractUndertakerFeedbackQuery)); err != nil { | ||
276 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
277 | + } else { | ||
278 | + if err := transactionContext.CommitTransaction(); err != nil { | ||
279 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | ||
280 | + } | ||
281 | + return map[string]interface{}{ | ||
282 | + "grid": map[string]interface{}{ | ||
283 | + "total": count, | ||
284 | + "list": contractUndertakerFeedbacks, | ||
285 | + }, | ||
286 | + }, nil | ||
287 | + } | ||
288 | +} | ||
289 | + | ||
290 | +// UpdateContractUndertakerFeedback 更新共创合约反馈服务 | ||
291 | +func (contractUndertakerFeedbackService *ContractUndertakerFeedbackService) UpdateContractUndertakerFeedback(updateContractUndertakerFeedbackCommand *command.UpdateContractUndertakerFeedbackCommand) (interface{}, error) { | ||
292 | + if err := updateContractUndertakerFeedbackCommand.ValidateCommand(); err != nil { | ||
293 | + return nil, application.ThrowError(application.ARG_ERROR, err.Error()) | ||
294 | + } | ||
295 | + transactionContext, err := factory.CreateTransactionContext(nil) | ||
296 | + if err != nil { | ||
297 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | ||
298 | + } | ||
299 | + if err := transactionContext.StartTransaction(); err != nil { | ||
300 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | ||
301 | + } | ||
302 | + defer func() { | ||
303 | + _ = transactionContext.RollbackTransaction() | ||
304 | + }() | ||
305 | + var contractUndertakerFeedbackRepository domain.ContractUndertakerFeedbackRepository | ||
306 | + if value, err := factory.CreateContractUndertakerFeedbackRepository(map[string]interface{}{ | ||
307 | + "transactionContext": transactionContext, | ||
308 | + }); err != nil { | ||
309 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
310 | + } else { | ||
311 | + contractUndertakerFeedbackRepository = value | ||
312 | + } | ||
313 | + contractUndertakerFeedback, err := contractUndertakerFeedbackRepository.FindOne(map[string]interface{}{"contractUndertakerFeedbackId": updateContractUndertakerFeedbackCommand.FeedbackId}) | ||
314 | + if err != nil { | ||
315 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "反馈信息不存在") | ||
316 | + } | ||
317 | + if contractUndertakerFeedback == nil { | ||
318 | + return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", string(updateContractUndertakerFeedbackCommand.FeedbackId))) | ||
319 | + } | ||
320 | + if err := contractUndertakerFeedback.Update(tool_funs.SimpleStructToMap(updateContractUndertakerFeedbackCommand)); err != nil { | ||
321 | + return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) | ||
322 | + } | ||
323 | + if contractUndertakerFeedback, err := contractUndertakerFeedbackRepository.Save(contractUndertakerFeedback); err != nil { | ||
324 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
325 | + } else { | ||
326 | + if err := transactionContext.CommitTransaction(); err != nil { | ||
327 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | ||
328 | + } | ||
329 | + return contractUndertakerFeedback, nil | ||
330 | + } | ||
331 | +} | ||
332 | + | ||
333 | +func NewContractUndertakerFeedbackService(options map[string]interface{}) *ContractUndertakerFeedbackService { | ||
334 | + newContractUndertakerFeedbackService := &ContractUndertakerFeedbackService{} | ||
335 | + return newContractUndertakerFeedbackService | ||
336 | +} |
1 | +package command | ||
2 | + | ||
3 | +import ( | ||
4 | + "fmt" | ||
5 | + "github.com/beego/beego/v2/core/validation" | ||
6 | + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/domain" | ||
7 | + "reflect" | ||
8 | + "strings" | ||
9 | +) | ||
10 | + | ||
11 | +type ApplyForCooperationCommand struct { | ||
12 | + // 共创申请描述附件 | ||
13 | + CooperationApplicationAttachment []*domain.Attachment `cname:"共创申请描述附件" json:"cooperationApplicationAttachment"` | ||
14 | + // 共创申请描述 | ||
15 | + CooperationApplicationDescription string `cname:"共创申请描述" json:"cooperationApplicationDescription,omitempty"` | ||
16 | + // 申请人ID | ||
17 | + UserId int64 `cname:"申请人ID" json:"userId"` | ||
18 | + // 用户基本id | ||
19 | + UserBaseId int64 `cname:"用户基本数据ID" json:"userBaseId"` | ||
20 | + // 组织机构ID | ||
21 | + OrgId int64 `cname:"组织机构ID" json:"orgId"` | ||
22 | + // 公司ID,通过集成REST上下文获取 | ||
23 | + CompanyId int64 `cname:"公司ID" json:"companyId"` | ||
24 | + // 共创项目ID | ||
25 | + CooperationProjectId int64 `cname:"共创项目ID" json:"cooperationProjectId" valid:"Required"` | ||
26 | +} | ||
27 | + | ||
28 | +func (applyForCooperationCommand *ApplyForCooperationCommand) Valid(validation *validation.Validation) { | ||
29 | +} | ||
30 | + | ||
31 | +func (applyForCooperationCommand *ApplyForCooperationCommand) ValidateCommand() error { | ||
32 | + valid := validation.Validation{} | ||
33 | + b, err := valid.Valid(applyForCooperationCommand) | ||
34 | + if err != nil { | ||
35 | + return err | ||
36 | + } | ||
37 | + if !b { | ||
38 | + elem := reflect.TypeOf(applyForCooperationCommand).Elem() | ||
39 | + for _, validErr := range valid.Errors { | ||
40 | + field, isExist := elem.FieldByName(validErr.Field) | ||
41 | + if isExist { | ||
42 | + return fmt.Errorf(strings.Replace(validErr.Message, validErr.Field, field.Tag.Get("cname"), -1)) | ||
43 | + } else { | ||
44 | + return fmt.Errorf(validErr.Message) | ||
45 | + } | ||
46 | + } | ||
47 | + } | ||
48 | + return nil | ||
49 | +} |
1 | +package command | ||
2 | + | ||
3 | +import ( | ||
4 | + "fmt" | ||
5 | + "reflect" | ||
6 | + "strings" | ||
7 | + | ||
8 | + "github.com/beego/beego/v2/core/validation" | ||
9 | +) | ||
10 | + | ||
11 | +type ApprovalCooperationApplicationCommand struct { | ||
12 | + // 共创申请ID | ||
13 | + CooperationApplicationId string `cname:"共创申请ID" json:"cooperationApplicationId" valid:"Required"` | ||
14 | + // 共创申请审核描述 | ||
15 | + CooperationApplicationVerifyDescription string `cname:"共创申请审核描述" json:"cooperationApplicationVerifyDescription,omitempty"` | ||
16 | + // 公司ID,通过集成REST上下文获取 | ||
17 | + CompanyId int64 `cname:"公司ID" json:"companyId" valid:"Required"` | ||
18 | + // 组织机构id | ||
19 | + OrgId int64 `cname:"组织机构ID" json:"orgId" valid:"Required"` | ||
20 | + // 菜单编码,APP端必须 | ||
21 | + Code string `cname:"菜单编码" json:"code" valid:"Required"` | ||
22 | + // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员 | ||
23 | + UserId int64 `cname:"用户ID" json:"userId" valid:"Required"` | ||
24 | + // 用户基础数据id | ||
25 | + UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId" valid:"Required"` | ||
26 | + // 审核动作,1同意,2拒绝 | ||
27 | + Action int32 `cname:"审核动作" json:"action" valid:"Required"` | ||
28 | +} | ||
29 | + | ||
30 | +func (approvalCooperationApplicationCommand *ApprovalCooperationApplicationCommand) Valid(validation *validation.Validation) { | ||
31 | + //validation.SetError("CustomValid", "未实现的自定义认证") | ||
32 | +} | ||
33 | + | ||
34 | +func (approvalCooperationApplicationCommand *ApprovalCooperationApplicationCommand) ValidateCommand() error { | ||
35 | + valid := validation.Validation{} | ||
36 | + b, err := valid.Valid(approvalCooperationApplicationCommand) | ||
37 | + if err != nil { | ||
38 | + return err | ||
39 | + } | ||
40 | + if !b { | ||
41 | + elem := reflect.TypeOf(approvalCooperationApplicationCommand).Elem() | ||
42 | + for _, validErr := range valid.Errors { | ||
43 | + field, isExist := elem.FieldByName(validErr.Field) | ||
44 | + if isExist { | ||
45 | + return fmt.Errorf(strings.Replace(validErr.Message, validErr.Field, field.Tag.Get("cname"), -1)) | ||
46 | + } else { | ||
47 | + return fmt.Errorf(validErr.Message) | ||
48 | + } | ||
49 | + } | ||
50 | + } | ||
51 | + return nil | ||
52 | +} |
1 | +package command | ||
2 | + | ||
3 | +import ( | ||
4 | + "fmt" | ||
5 | + "github.com/beego/beego/v2/core/validation" | ||
6 | + "reflect" | ||
7 | + "strings" | ||
8 | +) | ||
9 | + | ||
10 | +type BatchApprovalCooperationApplicationCommand struct { | ||
11 | + // 共创申请ID数组 | ||
12 | + CooperationApplicationIds []string `cname:"共创申请ID" json:"cooperationApplicationIds" valid:"Required"` | ||
13 | + // 共创申请审核描述 | ||
14 | + CooperationApplicationVerifyDescription string `cname:"共创申请审核描述" json:"cooperationApplicationVerifyDescription,omitempty"` | ||
15 | + // 公司ID,通过集成REST上下文获取 | ||
16 | + CompanyId int64 `cname:"公司ID" json:"companyId" valid:"Required"` | ||
17 | + // 组织机构id | ||
18 | + OrgId int64 `cname:"组织机构ID" json:"orgId" valid:"Required"` | ||
19 | + // 菜单编码,APP端必须 | ||
20 | + Code string `cname:"菜单编码" json:"code" valid:"Required"` | ||
21 | + // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员 | ||
22 | + UserId int64 `cname:"用户ID" json:"userId" valid:"Required"` | ||
23 | + // 用户基础数据id | ||
24 | + UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId" valid:"Required"` | ||
25 | + // 审核动作,1同意,2拒绝 | ||
26 | + Action int32 `cname:"审核动作" json:"action" valid:"Required"` | ||
27 | +} | ||
28 | + | ||
29 | +func (batchApprovalCooperationApplicationCommand *BatchApprovalCooperationApplicationCommand) Valid(validation *validation.Validation) { | ||
30 | + //validation.SetError("CustomValid", "未实现的自定义认证") | ||
31 | +} | ||
32 | + | ||
33 | +func (batchApprovalCooperationApplicationCommand *BatchApprovalCooperationApplicationCommand) ValidateCommand() error { | ||
34 | + valid := validation.Validation{} | ||
35 | + b, err := valid.Valid(batchApprovalCooperationApplicationCommand) | ||
36 | + if err != nil { | ||
37 | + return err | ||
38 | + } | ||
39 | + if !b { | ||
40 | + elem := reflect.TypeOf(batchApprovalCooperationApplicationCommand).Elem() | ||
41 | + for _, validErr := range valid.Errors { | ||
42 | + field, isExist := elem.FieldByName(validErr.Field) | ||
43 | + if isExist { | ||
44 | + return fmt.Errorf(strings.Replace(validErr.Message, validErr.Field, field.Tag.Get("cname"), -1)) | ||
45 | + } else { | ||
46 | + return fmt.Errorf(validErr.Message) | ||
47 | + } | ||
48 | + } | ||
49 | + } | ||
50 | + return nil | ||
51 | +} |
1 | +package command | ||
2 | + | ||
3 | +import ( | ||
4 | + "fmt" | ||
5 | + "github.com/beego/beego/v2/core/validation" | ||
6 | + "reflect" | ||
7 | + "strings" | ||
8 | +) | ||
9 | + | ||
10 | +type CancelCooperationApplicationCommand struct { | ||
11 | + // 共创申请ID | ||
12 | + CooperationApplicationId string `cname:"共创申请ID" json:"cooperationApplicationId" valid:"Required"` | ||
13 | + // 公司ID,通过集成REST上下文获取 | ||
14 | + CompanyId int64 `cname:"公司ID" json:"companyId" valid:"Required"` | ||
15 | + // 组织机构id | ||
16 | + OrgId int64 `cname:"组织机构ID" json:"orgId" valid:"Required"` | ||
17 | + // 菜单编码,APP端必须 | ||
18 | + Code string `cname:"菜单编码" json:"code" valid:"Required"` | ||
19 | + // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员 | ||
20 | + UserId int64 `cname:"用户ID" json:"userId" valid:"Required"` | ||
21 | + // 用户基础数据id | ||
22 | + UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId" valid:"Required"` | ||
23 | +} | ||
24 | + | ||
25 | +func (cancelCooperationApplicationCommand *CancelCooperationApplicationCommand) Valid(validation *validation.Validation) { | ||
26 | + //validation.SetError("CustomValid", "未实现的自定义认证") | ||
27 | +} | ||
28 | + | ||
29 | +func (cancelCooperationApplicationCommand *CancelCooperationApplicationCommand) ValidateCommand() error { | ||
30 | + valid := validation.Validation{} | ||
31 | + b, err := valid.Valid(cancelCooperationApplicationCommand) | ||
32 | + if err != nil { | ||
33 | + return err | ||
34 | + } | ||
35 | + if !b { | ||
36 | + elem := reflect.TypeOf(cancelCooperationApplicationCommand).Elem() | ||
37 | + for _, validErr := range valid.Errors { | ||
38 | + field, isExist := elem.FieldByName(validErr.Field) | ||
39 | + if isExist { | ||
40 | + return fmt.Errorf(strings.Replace(validErr.Message, validErr.Field, field.Tag.Get("cname"), -1)) | ||
41 | + } else { | ||
42 | + return fmt.Errorf(validErr.Message) | ||
43 | + } | ||
44 | + } | ||
45 | + } | ||
46 | + return nil | ||
47 | +} |
1 | +package command | ||
2 | + | ||
3 | +import ( | ||
4 | + "fmt" | ||
5 | + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/domain" | ||
6 | + "reflect" | ||
7 | + "strings" | ||
8 | + | ||
9 | + "github.com/beego/beego/v2/core/validation" | ||
10 | +) | ||
11 | + | ||
12 | +type CreateCooperationApplicationCommand struct { | ||
13 | + // 共创申请人uid | ||
14 | + ApplicantUid string `cname:"共创申请人uid" json:"applicantUid" valid:"Required"` | ||
15 | + // 共创申请描述 | ||
16 | + CooperationApplicationDescription string `cname:"共创申请描述" json:"cooperationApplicationDescription,omitempty"` | ||
17 | + // 共创申请描述附件 | ||
18 | + CooperationApplicationAttachment []*domain.Attachment `cname:"共创申请描述附件" json:"cooperationApplicationAttachment,omitempty"` | ||
19 | + // 关联的共创项目编号 | ||
20 | + CooperationProjectNumber string `cname:"关联的共创项目编号" json:"cooperationProjectNumber" valid:"Required"` | ||
21 | + // 公司ID,通过集成REST上下文获取 | ||
22 | + CompanyId int64 `cname:"公司ID" json:"companyId" valid:"Required"` | ||
23 | + // 组织机构ID | ||
24 | + OrgId int64 `cname:"组织机构ID" json:"orgId" valid:"Required"` | ||
25 | + // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员 | ||
26 | + UserId int64 `cname:"用户ID" json:"userId" valid:"Required"` | ||
27 | + // 用户基础数据id | ||
28 | + UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId" valid:"Required"` | ||
29 | +} | ||
30 | + | ||
31 | +func (createCooperationApplicationCommand *CreateCooperationApplicationCommand) Valid(validation *validation.Validation) { | ||
32 | + //validation.SetError("CustomValid", "未实现的自定义认证") | ||
33 | +} | ||
34 | + | ||
35 | +func (createCooperationApplicationCommand *CreateCooperationApplicationCommand) ValidateCommand() error { | ||
36 | + valid := validation.Validation{} | ||
37 | + b, err := valid.Valid(createCooperationApplicationCommand) | ||
38 | + if err != nil { | ||
39 | + return err | ||
40 | + } | ||
41 | + if !b { | ||
42 | + elem := reflect.TypeOf(createCooperationApplicationCommand).Elem() | ||
43 | + for _, validErr := range valid.Errors { | ||
44 | + field, isExist := elem.FieldByName(validErr.Field) | ||
45 | + if isExist { | ||
46 | + return fmt.Errorf(strings.Replace(validErr.Message, validErr.Field, field.Tag.Get("cname"), -1)) | ||
47 | + } else { | ||
48 | + return fmt.Errorf(validErr.Message) | ||
49 | + } | ||
50 | + } | ||
51 | + } | ||
52 | + return nil | ||
53 | +} |
pkg/application/cooperationApplication/command/oneclick_approval_cooperation_application.go
0 → 100644
1 | +package command | ||
2 | + | ||
3 | +import ( | ||
4 | + "fmt" | ||
5 | + "github.com/beego/beego/v2/core/validation" | ||
6 | + "reflect" | ||
7 | + "strings" | ||
8 | +) | ||
9 | + | ||
10 | +type OneClickApprovalCooperationApplicationCommand struct { | ||
11 | + // 共创申请审核描述 | ||
12 | + CooperationApplicationVerifyDescription string `cname:"共创申请审核描述" json:"cooperationApplicationVerifyDescription,omitempty"` | ||
13 | + // 公司ID,通过集成REST上下文获取 | ||
14 | + CompanyId int64 `cname:"公司ID" json:"companyId" valid:"Required"` | ||
15 | + // 组织机构id | ||
16 | + OrgId int64 `cname:"组织机构ID" json:"orgId" valid:"Required"` | ||
17 | + // 菜单编码,APP端必须 | ||
18 | + Code string `cname:"菜单编码" json:"code" valid:"Required"` | ||
19 | + // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员 | ||
20 | + UserId int64 `cname:"用户ID" json:"userId" valid:"Required"` | ||
21 | + // 用户基础数据id | ||
22 | + UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId" valid:"Required"` | ||
23 | + // 审核动作,1同意,2拒绝 | ||
24 | + Action int32 `cname:"审核动作" json:"action" valid:"Required"` | ||
25 | + // 审核状态 | ||
26 | + CooperationApplicationStatus int32 `cname:"共创申请审核状态" json:"cooperationApplicationStatus"` | ||
27 | +} | ||
28 | + | ||
29 | +func (oneClickApprovalCooperationApplicationCommand *OneClickApprovalCooperationApplicationCommand) Valid(validation *validation.Validation) { | ||
30 | + //validation.SetError("CustomValid", "未实现的自定义认证") | ||
31 | +} | ||
32 | + | ||
33 | +func (oneClickApprovalCooperationApplicationCommand *OneClickApprovalCooperationApplicationCommand) ValidateCommand() error { | ||
34 | + valid := validation.Validation{} | ||
35 | + b, err := valid.Valid(oneClickApprovalCooperationApplicationCommand) | ||
36 | + if err != nil { | ||
37 | + return err | ||
38 | + } | ||
39 | + if !b { | ||
40 | + elem := reflect.TypeOf(oneClickApprovalCooperationApplicationCommand).Elem() | ||
41 | + for _, validErr := range valid.Errors { | ||
42 | + field, isExist := elem.FieldByName(validErr.Field) | ||
43 | + if isExist { | ||
44 | + return fmt.Errorf(strings.Replace(validErr.Message, validErr.Field, field.Tag.Get("cname"), -1)) | ||
45 | + } else { | ||
46 | + return fmt.Errorf(validErr.Message) | ||
47 | + } | ||
48 | + } | ||
49 | + } | ||
50 | + return nil | ||
51 | +} |
1 | +package command | ||
2 | + | ||
3 | +import ( | ||
4 | + "fmt" | ||
5 | + "reflect" | ||
6 | + "strings" | ||
7 | + | ||
8 | + "github.com/beego/beego/v2/core/validation" | ||
9 | +) | ||
10 | + | ||
11 | +type RemoveCooperationApplicationCommand struct { | ||
12 | + // 共创申请ID | ||
13 | + CooperationApplicationId int64 `cname:"共创申请ID" json:"cooperationApplicationId" valid:"Required"` | ||
14 | + // 公司ID,通过集成REST上下文获取 | ||
15 | + CompanyId int64 `cname:"公司ID" json:"companyId" valid:"Required"` | ||
16 | + // 组织机构ID | ||
17 | + OrgId int64 `cname:"组织机构ID" json:"orgId" valid:"Required"` | ||
18 | + // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员 | ||
19 | + UserId int64 `cname:"用户ID" json:"userId" valid:"Required"` | ||
20 | + // 用户基础数据id | ||
21 | + UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId" valid:"Required"` | ||
22 | +} | ||
23 | + | ||
24 | +func (removeCooperationApplicationCommand *RemoveCooperationApplicationCommand) Valid(validation *validation.Validation) { | ||
25 | + //validation.SetError("CustomValid", "未实现的自定义认证") | ||
26 | +} | ||
27 | + | ||
28 | +func (removeCooperationApplicationCommand *RemoveCooperationApplicationCommand) ValidateCommand() error { | ||
29 | + valid := validation.Validation{} | ||
30 | + b, err := valid.Valid(removeCooperationApplicationCommand) | ||
31 | + if err != nil { | ||
32 | + return err | ||
33 | + } | ||
34 | + if !b { | ||
35 | + elem := reflect.TypeOf(removeCooperationApplicationCommand).Elem() | ||
36 | + for _, validErr := range valid.Errors { | ||
37 | + field, isExist := elem.FieldByName(validErr.Field) | ||
38 | + if isExist { | ||
39 | + return fmt.Errorf(strings.Replace(validErr.Message, validErr.Field, field.Tag.Get("cname"), -1)) | ||
40 | + } else { | ||
41 | + return fmt.Errorf(validErr.Message) | ||
42 | + } | ||
43 | + } | ||
44 | + } | ||
45 | + return nil | ||
46 | +} |
1 | +package command | ||
2 | + | ||
3 | +import ( | ||
4 | + "fmt" | ||
5 | + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/domain" | ||
6 | + "reflect" | ||
7 | + "strings" | ||
8 | + | ||
9 | + "github.com/beego/beego/v2/core/validation" | ||
10 | +) | ||
11 | + | ||
12 | +type UpdateCooperationApplicationCommand struct { | ||
13 | + // 共创申请id | ||
14 | + CooperationApplicationId int64 `cname:"共创申请ID" json:"cooperationApplicationId" valid:"Required"` | ||
15 | + // 共创申请人uid | ||
16 | + ApplicantUid string `cname:"共创申请人UID" json:"applicantUid" valid:"Required"` | ||
17 | + // 共创申请描述 | ||
18 | + CooperationApplicationDescription string `cname:"共创申请描述" json:"cooperationApplicationDescription,omitempty"` | ||
19 | + // 共创申请描述附件 | ||
20 | + CooperationApplicationAttachment []*domain.Attachment `cname:"共创申请描述附件" json:"cooperationApplicationAttachment,omitempty"` | ||
21 | + // 关联的共创项目编号 | ||
22 | + CooperationProjectNumber string `cname:"关联的共创项目编号" json:"cooperationProjectNumber" valid:"Required"` | ||
23 | + // 公司ID,通过集成REST上下文获取 | ||
24 | + CompanyId int64 `cname:"公司ID" json:"companyId" valid:"Required"` | ||
25 | + // 组织机构ID | ||
26 | + OrgId int64 `cname:"组织机构ID" json:"orgId" valid:"Required"` | ||
27 | + // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员 | ||
28 | + UserId int64 `cname:"用户ID" json:"userId" valid:"Required"` | ||
29 | + // 用户基础数据id | ||
30 | + UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId" valid:"Required"` | ||
31 | +} | ||
32 | + | ||
33 | +func (updateCooperationApplicationCommand *UpdateCooperationApplicationCommand) Valid(validation *validation.Validation) { | ||
34 | + //validation.SetError("CustomValid", "未实现的自定义认证") | ||
35 | +} | ||
36 | + | ||
37 | +func (updateCooperationApplicationCommand *UpdateCooperationApplicationCommand) ValidateCommand() error { | ||
38 | + valid := validation.Validation{} | ||
39 | + b, err := valid.Valid(updateCooperationApplicationCommand) | ||
40 | + if err != nil { | ||
41 | + return err | ||
42 | + } | ||
43 | + if !b { | ||
44 | + elem := reflect.TypeOf(updateCooperationApplicationCommand).Elem() | ||
45 | + for _, validErr := range valid.Errors { | ||
46 | + field, isExist := elem.FieldByName(validErr.Field) | ||
47 | + if isExist { | ||
48 | + return fmt.Errorf(strings.Replace(validErr.Message, validErr.Field, field.Tag.Get("cname"), -1)) | ||
49 | + } else { | ||
50 | + return fmt.Errorf(validErr.Message) | ||
51 | + } | ||
52 | + } | ||
53 | + } | ||
54 | + return nil | ||
55 | +} |
1 | +package dto | ||
2 | + | ||
3 | +import ( | ||
4 | + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/domain" | ||
5 | +) | ||
6 | + | ||
7 | +type CooperationApplicationDto struct { | ||
8 | + // 共创申请ID | ||
9 | + CooperationApplicationId int64 `json:"cooperationApplicationId,string"` | ||
10 | + // 共创申请人 | ||
11 | + CooperationApplicationApplicant *User `json:"cooperationApplicationApplicant"` | ||
12 | + // 共创申请描述附件 | ||
13 | + CooperationApplicationAttachment []*domain.Attachment `json:"cooperationApplicationAttachment"` | ||
14 | + // 共创申请描述 | ||
15 | + CooperationApplicationDescription string `json:"cooperationApplicationDescription"` | ||
16 | + // 共创申请审核状态,1待审核,2已同意,3已拒绝 | ||
17 | + CooperationApplicationStatus int32 `json:"cooperationApplicationStatus"` | ||
18 | + // 共创申请审核人 | ||
19 | + CooperationApplicationVerifier *User `json:"cooperationApplicationVerifier"` | ||
20 | + // 共创申请审核描述 | ||
21 | + CooperationApplicationVerifyDescription string `json:"cooperationApplicationVerifyDescription"` | ||
22 | + // 共创申请审核时间 | ||
23 | + CooperationApplicationVerifyTime int64 `json:"cooperationApplicationVerifyTime"` | ||
24 | + // 共创申请时间 | ||
25 | + CooperationApplyTime int64 `json:"cooperationApplyTime"` | ||
26 | + // 共创项目 | ||
27 | + CooperationProject *CooperationProject `json:"cooperationProject"` | ||
28 | + // 数据所属组织机构 | ||
29 | + Org *Org `json:"org"` | ||
30 | + // 是否被取消标志位 | ||
31 | + IsCanceled bool `json:"isCanceled"` | ||
32 | + // 公司 | ||
33 | + Company *Company `json:"company"` | ||
34 | +} | ||
35 | + | ||
36 | +// User 用户第三方服务防腐模型 | ||
37 | +type User struct { | ||
38 | + // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员 | ||
39 | + UserId int64 `json:"userId"` | ||
40 | + // 冗余字段,jsonb格式,不限制存放内容 | ||
41 | + UserInfo *domain.UserInfo `json:"userInfo,omitempty"` | ||
42 | + // 用户所属的部门 | ||
43 | + Department *Department `json:"department"` | ||
44 | +} | ||
45 | + | ||
46 | +type Company struct { | ||
47 | + // 公司ID,通过集成REST上下文获取 | ||
48 | + CompanyId int64 `json:"companyId"` | ||
49 | + // 公司logo | ||
50 | + CompanyLogo string `json:"companyLogo"` | ||
51 | + // 公司名称 | ||
52 | + CompanyName string `json:"companyName"` | ||
53 | +} | ||
54 | + | ||
55 | +// Org 组织机构值对象 | ||
56 | +type Org struct { | ||
57 | + // 组织机构ID | ||
58 | + OrgId int64 `json:"orgId"` | ||
59 | + // 组织名称 | ||
60 | + OrgName string `json:"orgName"` | ||
61 | + // 公司 | ||
62 | + //Company *Company `json:"company"` | ||
63 | +} | ||
64 | + | ||
65 | +// Department 部门值对象 | ||
66 | +type Department struct { | ||
67 | + // 部门ID,通过REST集成上下文获取 | ||
68 | + DepartmentId int64 `json:"departmentId"` | ||
69 | + // 部门名称 | ||
70 | + DepartmentName string `json:"departmentName"` | ||
71 | +} | ||
72 | + | ||
73 | +// CooperationProject 共创项目实体 | ||
74 | +type CooperationProject struct { | ||
75 | + // 共创项目ID | ||
76 | + CooperationProjectId int64 `json:"cooperationProjectId"` | ||
77 | + // 共创项目编号 | ||
78 | + CooperationProjectNumber string `json:"cooperationProjectNumber"` | ||
79 | + // 共创项目描述 | ||
80 | + CooperationProjectDescription string `json:"cooperationProjectDescription"` | ||
81 | + // 共创项目名称 | ||
82 | + CooperationProjectName string `json:"cooperationProjectName"` | ||
83 | + // 图片附件 | ||
84 | + Attachment []*domain.Attachment `json:"attachment"` | ||
85 | + // 共创模式 | ||
86 | + CooperationMode *domain.CooperationMode `json:"cooperationMode"` | ||
87 | +} | ||
88 | + | ||
89 | +func (data *CooperationApplicationDto) LoadDto(a *domain.CooperationApplication) { | ||
90 | + data.CooperationApplicationId = a.CooperationApplicationId | ||
91 | + data.CooperationApplicationApplicant = data.LoadUser(a.CooperationApplicationApplicant) | ||
92 | + data.CooperationApplicationAttachment = a.CooperationApplicationAttachment | ||
93 | + data.CooperationApplicationDescription = a.CooperationApplicationDescription | ||
94 | + data.CooperationApplicationStatus = a.CooperationApplicationStatus | ||
95 | + data.CooperationApplicationVerifier = data.LoadUser(a.CooperationApplicationVerifier) | ||
96 | + data.CooperationApplicationVerifyDescription = a.CooperationApplicationVerifyDescription | ||
97 | + data.CooperationApplicationVerifyTime = a.CooperationApplicationVerifyTime.Unix() * 1000 | ||
98 | + data.CooperationApplyTime = a.CooperationApplyTime.Unix() * 1000 | ||
99 | + data.CooperationProject = data.LoadCooperationProject(a.CooperationProject) | ||
100 | + data.Org = data.LoadOrg(a.Org) | ||
101 | + if a.IsCanceled == 1 { | ||
102 | + data.IsCanceled = false | ||
103 | + } else { | ||
104 | + data.IsCanceled = true | ||
105 | + } | ||
106 | + data.Company = data.LoadCompany(a.Company) | ||
107 | +} | ||
108 | + | ||
109 | +func (data *CooperationApplicationDto) LoadUser(v *domain.User) *User { | ||
110 | + if v == nil { | ||
111 | + return &User{} | ||
112 | + } | ||
113 | + result := User{ | ||
114 | + UserId: v.UserId, | ||
115 | + UserInfo: v.UserInfo, | ||
116 | + } | ||
117 | + if v.Department != nil { | ||
118 | + result.Department = &Department{ | ||
119 | + DepartmentId: v.Department.DepartmentId, | ||
120 | + DepartmentName: v.Department.DepartmentName, | ||
121 | + } | ||
122 | + } | ||
123 | + | ||
124 | + return &result | ||
125 | +} | ||
126 | + | ||
127 | +func (data *CooperationApplicationDto) LoadCompany(v *domain.Company) *Company { | ||
128 | + return &Company{ | ||
129 | + CompanyId: v.CompanyId, | ||
130 | + CompanyName: v.CompanyName, | ||
131 | + } | ||
132 | +} | ||
133 | + | ||
134 | +func (data *CooperationApplicationDto) LoadOrg(v *domain.Org) *Org { | ||
135 | + return &Org{ | ||
136 | + OrgId: v.OrgId, | ||
137 | + OrgName: v.OrgName, | ||
138 | + } | ||
139 | +} | ||
140 | + | ||
141 | +func (data *CooperationApplicationDto) LoadDepartment(v *domain.Org) *Department { | ||
142 | + return &Department{ | ||
143 | + DepartmentId: v.OrgId, | ||
144 | + DepartmentName: v.OrgName, | ||
145 | + } | ||
146 | +} | ||
147 | + | ||
148 | +func (data *CooperationApplicationDto) LoadCooperationProject(v *domain.CooperationProject) *CooperationProject { | ||
149 | + return &CooperationProject{ | ||
150 | + CooperationProjectId: v.CooperationProjectId, | ||
151 | + CooperationProjectNumber: v.CooperationProjectNumber, | ||
152 | + CooperationProjectDescription: v.CooperationProjectDescription, | ||
153 | + CooperationProjectName: v.CooperationProjectName, | ||
154 | + Attachment: v.Attachment, | ||
155 | + CooperationMode: v.CooperationMode, | ||
156 | + } | ||
157 | +} |
1 | +package query | ||
2 | + | ||
3 | +import ( | ||
4 | + "fmt" | ||
5 | + "reflect" | ||
6 | + "strings" | ||
7 | + | ||
8 | + "github.com/beego/beego/v2/core/validation" | ||
9 | +) | ||
10 | + | ||
11 | +type GetCooperationApplicationQuery struct { | ||
12 | + // 共创申请ID | ||
13 | + CooperationApplicationId int64 `cname:"共创申请ID" json:"cooperationApplicationId" valid:"Required"` | ||
14 | + // 公司ID,通过集成REST上下文获取 | ||
15 | + CompanyId int64 `cname:"公司ID" json:"companyId" valid:"Required"` | ||
16 | + // 组织机构ID | ||
17 | + OrgId int64 `cname:"组织机构ID" json:"orgId" valid:"Required"` | ||
18 | + // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员 | ||
19 | + UserId int64 `cname:"用户ID" json:"userId" valid:"Required"` | ||
20 | + // 用户基础数据id | ||
21 | + UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId" valid:"Required"` | ||
22 | +} | ||
23 | + | ||
24 | +func (getCooperationApplicationQuery *GetCooperationApplicationQuery) Valid(validation *validation.Validation) { | ||
25 | + //validation.SetError("CustomValid", "未实现的自定义认证") | ||
26 | +} | ||
27 | + | ||
28 | +func (getCooperationApplicationQuery *GetCooperationApplicationQuery) ValidateQuery() error { | ||
29 | + valid := validation.Validation{} | ||
30 | + b, err := valid.Valid(getCooperationApplicationQuery) | ||
31 | + if err != nil { | ||
32 | + return err | ||
33 | + } | ||
34 | + if !b { | ||
35 | + elem := reflect.TypeOf(getCooperationApplicationQuery).Elem() | ||
36 | + for _, validErr := range valid.Errors { | ||
37 | + field, isExist := elem.FieldByName(validErr.Field) | ||
38 | + if isExist { | ||
39 | + return fmt.Errorf(strings.Replace(validErr.Message, validErr.Field, field.Tag.Get("cname"), -1)) | ||
40 | + } else { | ||
41 | + return fmt.Errorf(validErr.Message) | ||
42 | + } | ||
43 | + } | ||
44 | + } | ||
45 | + return nil | ||
46 | +} |
1 | +package query | ||
2 | + | ||
3 | +import ( | ||
4 | + "fmt" | ||
5 | + "reflect" | ||
6 | + "strings" | ||
7 | + | ||
8 | + "github.com/beego/beego/v2/core/validation" | ||
9 | +) | ||
10 | + | ||
11 | +type ListCooperationApplicationQuery struct { | ||
12 | + // 页面大小 | ||
13 | + PageNumber int64 `cname:"页码" json:"pageNumber,omitempty"` | ||
14 | + // 页面大小 | ||
15 | + PageSize int64 `cname:"页面大小" json:"pageSize,omitempty"` | ||
16 | + // 公司ID,通过集成REST上下文获取 | ||
17 | + CompanyId int64 `cname:"公司ID" json:"companyId"` | ||
18 | + // 组织机构ID | ||
19 | + OrgId int64 `cname:"组织机构ID" json:"orgId"` | ||
20 | + // 关联的组织机构ID列表 | ||
21 | + OrgIds []int64 `cname:"关联的组织机构ID列表" json:"orgIds"` | ||
22 | + // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员 | ||
23 | + UserId int64 `cname:"用户ID" json:"userId"` | ||
24 | + // 用户基础数据id | ||
25 | + UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId"` | ||
26 | +} | ||
27 | + | ||
28 | +func (listCooperationApplicationQuery *ListCooperationApplicationQuery) Valid(validation *validation.Validation) { | ||
29 | + //validation.SetError("CustomValid", "未实现的自定义认证") | ||
30 | +} | ||
31 | + | ||
32 | +func (listCooperationApplicationQuery *ListCooperationApplicationQuery) ValidateQuery() error { | ||
33 | + valid := validation.Validation{} | ||
34 | + b, err := valid.Valid(listCooperationApplicationQuery) | ||
35 | + if err != nil { | ||
36 | + return err | ||
37 | + } | ||
38 | + if !b { | ||
39 | + elem := reflect.TypeOf(listCooperationApplicationQuery).Elem() | ||
40 | + for _, validErr := range valid.Errors { | ||
41 | + field, isExist := elem.FieldByName(validErr.Field) | ||
42 | + if isExist { | ||
43 | + return fmt.Errorf(strings.Replace(validErr.Message, validErr.Field, field.Tag.Get("cname"), -1)) | ||
44 | + } else { | ||
45 | + return fmt.Errorf(validErr.Message) | ||
46 | + } | ||
47 | + } | ||
48 | + } | ||
49 | + return nil | ||
50 | +} |
1 | +package query | ||
2 | + | ||
3 | +import ( | ||
4 | + "fmt" | ||
5 | + "reflect" | ||
6 | + "strings" | ||
7 | + | ||
8 | + "github.com/beego/beego/v2/core/validation" | ||
9 | +) | ||
10 | + | ||
11 | +type SearchCooperationApplicationQuery struct { | ||
12 | + // 共创项目编号 | ||
13 | + CooperationProjectNumber string `cname:"共创项目编号" json:"cooperationProjectNumber,omitempty"` | ||
14 | + // 共创项目名称 | ||
15 | + CooperationProjectName string `cname:"共创项目名称" json:"cooperationProjectName,omitempty"` | ||
16 | + // 申请人姓名 | ||
17 | + ApplicantName string `cname:"申请人姓名" json:"applicantName,omitempty"` | ||
18 | + // 共创申请审核状态,1待审核,2已同意,3已拒绝 | ||
19 | + CooperationApplicationStatus int32 `cname:"共创申请审核状态" json:"cooperationApplicationStatus,omitempty"` | ||
20 | + // 是否被取消标记 1正常,2取消,3所有 | ||
21 | + IsCanceled int32 `cname:"取消状态" json:"isCanceled,omitempty"` | ||
22 | + // 页面大小 | ||
23 | + PageSize int64 `cname:"页面大小" json:"pageSize,omitempty"` | ||
24 | + // 页面大小 | ||
25 | + PageNumber int64 `cname:"页码" json:"pageNumber,omitempty"` | ||
26 | + // 公司ID,通过集成REST上下文获取 | ||
27 | + CompanyId int64 `cname:"公司ID" json:"companyId"` | ||
28 | + // 组织机构ID | ||
29 | + OrgId int64 `cname:"组织机构ID" json:"orgId"` | ||
30 | + // 关联的组织机构ID列表 | ||
31 | + OrgIds []int64 `cname:"关联的组织机构ID列表" json:"orgIds"` | ||
32 | + // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员 | ||
33 | + UserId int64 `cname:"用户ID" json:"userId"` | ||
34 | + // 用户基础数据id | ||
35 | + UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId"` | ||
36 | +} | ||
37 | + | ||
38 | +func (searchCooperationApplicationQuery *SearchCooperationApplicationQuery) Valid(validation *validation.Validation) { | ||
39 | + //validation.SetError("CustomValid", "未实现的自定义认证") | ||
40 | +} | ||
41 | + | ||
42 | +func (searchCooperationApplicationQuery *SearchCooperationApplicationQuery) ValidateQuery() error { | ||
43 | + valid := validation.Validation{} | ||
44 | + b, err := valid.Valid(searchCooperationApplicationQuery) | ||
45 | + if err != nil { | ||
46 | + return err | ||
47 | + } | ||
48 | + if !b { | ||
49 | + elem := reflect.TypeOf(searchCooperationApplicationQuery).Elem() | ||
50 | + for _, validErr := range valid.Errors { | ||
51 | + field, isExist := elem.FieldByName(validErr.Field) | ||
52 | + if isExist { | ||
53 | + return fmt.Errorf(strings.Replace(validErr.Message, validErr.Field, field.Tag.Get("cname"), -1)) | ||
54 | + } else { | ||
55 | + return fmt.Errorf(validErr.Message) | ||
56 | + } | ||
57 | + } | ||
58 | + } | ||
59 | + return nil | ||
60 | +} |
1 | +package service | ||
2 | + | ||
3 | +import ( | ||
4 | + "fmt" | ||
5 | + "github.com/linmadan/egglib-go/core/application" | ||
6 | + "github.com/linmadan/egglib-go/utils/tool_funs" | ||
7 | + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/application/cooperationApplication/command" | ||
8 | + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/application/cooperationApplication/dto" | ||
9 | + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/application/cooperationApplication/query" | ||
10 | + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/application/factory" | ||
11 | + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/domain" | ||
12 | + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/domain/service" | ||
13 | + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/dao" | ||
14 | + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/utils" | ||
15 | + "strconv" | ||
16 | + "time" | ||
17 | +) | ||
18 | + | ||
19 | +// CooperationApplicationService 共创申请服务 | ||
20 | +type CooperationApplicationService struct { | ||
21 | +} | ||
22 | + | ||
23 | +// ApplyForCooperation 申请共创 | ||
24 | +func (cooperationApplicationService *CooperationApplicationService) ApplyForCooperation(applyForCooperationCommand *command.ApplyForCooperationCommand) (interface{}, error) { | ||
25 | + if err := applyForCooperationCommand.ValidateCommand(); err != nil { | ||
26 | + return nil, application.ThrowError(application.ARG_ERROR, err.Error()) | ||
27 | + } | ||
28 | + transactionContext, err := factory.CreateTransactionContext(nil) | ||
29 | + if err != nil { | ||
30 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | ||
31 | + } | ||
32 | + if err := transactionContext.StartTransaction(); err != nil { | ||
33 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | ||
34 | + } | ||
35 | + defer func() { | ||
36 | + _ = transactionContext.RollbackTransaction() | ||
37 | + }() | ||
38 | + | ||
39 | + // 共创项目仓储初始化 | ||
40 | + var cooperationProjectRepository domain.CooperationProjectRepository | ||
41 | + if value, err := factory.CreateCooperationProjectRepository(map[string]interface{}{ | ||
42 | + "transactionContext": transactionContext, | ||
43 | + }); err != nil { | ||
44 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
45 | + } else { | ||
46 | + cooperationProjectRepository = value | ||
47 | + } | ||
48 | + | ||
49 | + // 用户REST服务初始化 | ||
50 | + var userService service.UserService | ||
51 | + if value, err := factory.CreateUserService(map[string]interface{}{}); err != nil { | ||
52 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
53 | + } else { | ||
54 | + userService = value | ||
55 | + } | ||
56 | + | ||
57 | + // 公司REST服务初始化 | ||
58 | + var companyService service.CompanyService | ||
59 | + if value, err := factory.CreateCompanyService(map[string]interface{}{}); err != nil { | ||
60 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
61 | + } else { | ||
62 | + companyService = value | ||
63 | + } | ||
64 | + | ||
65 | + // 组织机构REST服务初始化 | ||
66 | + var organizationService service.OrgService | ||
67 | + if value, err := factory.CreateOrganizationService(map[string]interface{}{}); err != nil { | ||
68 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
69 | + } else { | ||
70 | + organizationService = value | ||
71 | + } | ||
72 | + | ||
73 | + // 共创申请仓储初始化 | ||
74 | + var cooperationApplicationRepository domain.CooperationApplicationRepository | ||
75 | + if value, err := factory.CreateCooperationApplicationRepository(map[string]interface{}{ | ||
76 | + "transactionContext": transactionContext, | ||
77 | + }); err != nil { | ||
78 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
79 | + } else { | ||
80 | + cooperationApplicationRepository = value | ||
81 | + } | ||
82 | + | ||
83 | + // 共创申请DAO初始化 | ||
84 | + var cooperationApplicationDao *dao.CooperationApplicationDao | ||
85 | + if value, err := factory.CreateCooperationApplicationDao(map[string]interface{}{ | ||
86 | + "transactionContext": transactionContext, | ||
87 | + }); err != nil { | ||
88 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | ||
89 | + } else { | ||
90 | + cooperationApplicationDao = value | ||
91 | + } | ||
92 | + | ||
93 | + // 获取共创项目 | ||
94 | + cooperationProject, err := cooperationProjectRepository.FindOne(map[string]interface{}{"cooperationProjectId": applyForCooperationCommand.CooperationProjectId}) | ||
95 | + if err != nil { | ||
96 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "共创项目不存在") | ||
97 | + } | ||
98 | + if cooperationProject == nil { | ||
99 | + return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", strconv.FormatInt(applyForCooperationCommand.CooperationProjectId, 10))) | ||
100 | + } | ||
101 | + | ||
102 | + var newCooperationApplication *domain.CooperationApplication | ||
103 | + | ||
104 | + if applyForCooperationCommand.CompanyId == 0 && applyForCooperationCommand.OrgId == 0 && applyForCooperationCommand.UserId == 0 && applyForCooperationCommand.UserBaseId != 0 { // 游客操作 | ||
105 | + // 获取申请人信息 | ||
106 | + var applicant *domain.User | ||
107 | + if data, err := userService.VisitorFrom(applyForCooperationCommand.CompanyId, applyForCooperationCommand.OrgId, applyForCooperationCommand.UserBaseId); err != nil { | ||
108 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取申请人失败") | ||
109 | + } else { | ||
110 | + applicant = data | ||
111 | + } | ||
112 | + | ||
113 | + // 校验:同一个用户,不能多次申请同一个项目 | ||
114 | + applicationExist, _ := cooperationApplicationDao.CheckApplicationExist(map[string]interface{}{ | ||
115 | + "visitorUserBaseId": applicant.UserBaseId, | ||
116 | + "companyId": cooperationProject.Company.CompanyId, | ||
117 | + "orgId": cooperationProject.Org.OrgId, | ||
118 | + "cooperationProjectNumber": cooperationProject.CooperationProjectNumber, | ||
119 | + }) | ||
120 | + if applicationExist { | ||
121 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, "抱歉,您已经申请过该项目") | ||
122 | + } | ||
123 | + | ||
124 | + // 校验:判断用户类型是否属于承接对象 | ||
125 | + typeExist := false | ||
126 | + if !utils.IsContain(cooperationProject.CooperationProjectUndertakerTypes, 3) { // 非公开类型校验 | ||
127 | + for _, userType := range cooperationProject.CooperationProjectUndertakerTypes { | ||
128 | + if utils.IsContain(cooperationProject.CooperationProjectUndertakerTypes, applicant.UserType&userType) { | ||
129 | + typeExist = true | ||
130 | + } | ||
131 | + } | ||
132 | + if !typeExist { | ||
133 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "抱歉,您不属于当前项目的承接对象") | ||
134 | + | ||
135 | + } | ||
136 | + } | ||
137 | + | ||
138 | + newCooperationApplication = &domain.CooperationApplication{ | ||
139 | + CooperationApplicationApplicant: applicant, | ||
140 | + CooperationApplicationAttachment: applyForCooperationCommand.CooperationApplicationAttachment, | ||
141 | + CooperationApplicationDescription: applyForCooperationCommand.CooperationApplicationDescription, | ||
142 | + CooperationApplicationStatus: 1, | ||
143 | + CooperationApplicationVerifier: nil, | ||
144 | + CooperationApplicationVerifyDescription: "", | ||
145 | + CooperationApplicationVerifyTime: time.Time{}, | ||
146 | + CooperationApplyTime: time.Now(), | ||
147 | + CooperationProject: cooperationProject, | ||
148 | + Org: cooperationProject.Org, | ||
149 | + IsCanceled: 1, | ||
150 | + Company: cooperationProject.Company, | ||
151 | + CreatedAt: time.Now(), | ||
152 | + DeletedAt: time.Time{}, | ||
153 | + UpdatedAt: time.Time{}, | ||
154 | + } | ||
155 | + } else { | ||
156 | + // 获取申请人 | ||
157 | + var applicant *domain.User | ||
158 | + if data, err := userService.UserFrom(applyForCooperationCommand.CompanyId, applyForCooperationCommand.OrgId, applyForCooperationCommand.UserId); err != nil { | ||
159 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取申请人失败") | ||
160 | + } else { | ||
161 | + applicant = data | ||
162 | + } | ||
163 | + | ||
164 | + // 获取公司信息 | ||
165 | + var company *domain.Company | ||
166 | + if data, err := companyService.CompanyFrom(applyForCooperationCommand.CompanyId); err != nil { | ||
167 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取公司信息失败") | ||
168 | + } else { | ||
169 | + company = data | ||
170 | + } | ||
171 | + | ||
172 | + // 获取组织机构信息 | ||
173 | + var organization *domain.Org | ||
174 | + if data, err := organizationService.OrgFrom(applyForCooperationCommand.CompanyId, applyForCooperationCommand.OrgId); err != nil { | ||
175 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取组织机构数据失败") | ||
176 | + } else { | ||
177 | + organization = data | ||
178 | + } | ||
179 | + | ||
180 | + // 校验:同一个用户,不能多次申请同一个项目 | ||
181 | + applicationExist, _ := cooperationApplicationDao.CheckApplicationExist(map[string]interface{}{ | ||
182 | + "companyId": applyForCooperationCommand.CompanyId, | ||
183 | + "orgId": applyForCooperationCommand.OrgId, | ||
184 | + "applicantId": applicant.UserId, | ||
185 | + "cooperationProjectNumber": cooperationProject.CooperationProjectNumber, | ||
186 | + }) | ||
187 | + if applicationExist { | ||
188 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, "当前项目申请已提交") | ||
189 | + } | ||
190 | + | ||
191 | + // 校验:判断用户类型是否属于承接对象 | ||
192 | + typeExist := false | ||
193 | + if !utils.IsContain(cooperationProject.CooperationProjectUndertakerTypes, 3) { // 非公开类型校验 | ||
194 | + for _, userType := range cooperationProject.CooperationProjectUndertakerTypes { | ||
195 | + if utils.IsContain(cooperationProject.CooperationProjectUndertakerTypes, applicant.UserType&userType) { | ||
196 | + typeExist = true | ||
197 | + } | ||
198 | + } | ||
199 | + if !typeExist { | ||
200 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "抱歉,您不属于当前项目的承接对象") | ||
201 | + } | ||
202 | + } | ||
203 | + | ||
204 | + newCooperationApplication = &domain.CooperationApplication{ | ||
205 | + CooperationApplicationApplicant: applicant, | ||
206 | + CooperationApplicationAttachment: applyForCooperationCommand.CooperationApplicationAttachment, | ||
207 | + CooperationApplicationDescription: applyForCooperationCommand.CooperationApplicationDescription, | ||
208 | + CooperationApplicationStatus: 1, | ||
209 | + CooperationApplicationVerifier: nil, | ||
210 | + CooperationApplicationVerifyDescription: "", | ||
211 | + CooperationApplicationVerifyTime: time.Time{}, | ||
212 | + CooperationApplyTime: time.Now(), | ||
213 | + CooperationProject: cooperationProject, | ||
214 | + Org: organization, | ||
215 | + IsCanceled: 1, | ||
216 | + Company: company, | ||
217 | + CreatedAt: time.Now(), | ||
218 | + DeletedAt: time.Time{}, | ||
219 | + UpdatedAt: time.Time{}, | ||
220 | + } | ||
221 | + } | ||
222 | + | ||
223 | + // 保存共创申请 | ||
224 | + if cooperationApplication, err := cooperationApplicationRepository.Save(newCooperationApplication); err != nil { | ||
225 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
226 | + } else { | ||
227 | + // 更新共创项目申请人计数 | ||
228 | + cooperationProject.ApplicantCount = cooperationProject.ApplicantCount + 1 | ||
229 | + if _, err := cooperationProjectRepository.Save(cooperationProject); err != nil { | ||
230 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
231 | + } | ||
232 | + if err := transactionContext.CommitTransaction(); err != nil { | ||
233 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | ||
234 | + } | ||
235 | + return cooperationApplication, nil | ||
236 | + } | ||
237 | +} | ||
238 | + | ||
239 | +// ApprovalCooperationApplication 审核共创申请 | ||
240 | +func (cooperationApplicationService *CooperationApplicationService) ApprovalCooperationApplication(approvalCooperationApplicationCommand *command.ApprovalCooperationApplicationCommand) (interface{}, error) { | ||
241 | + if err := approvalCooperationApplicationCommand.ValidateCommand(); err != nil { | ||
242 | + return nil, application.ThrowError(application.ARG_ERROR, err.Error()) | ||
243 | + } | ||
244 | + transactionContext, err := factory.CreateTransactionContext(nil) | ||
245 | + if err != nil { | ||
246 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | ||
247 | + } | ||
248 | + if err := transactionContext.StartTransaction(); err != nil { | ||
249 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | ||
250 | + } | ||
251 | + defer func() { | ||
252 | + _ = transactionContext.RollbackTransaction() | ||
253 | + }() | ||
254 | + | ||
255 | + // 共创申请仓储初始化 | ||
256 | + var cooperationApplicationRepository domain.CooperationApplicationRepository | ||
257 | + if value, err := factory.CreateCooperationApplicationRepository(map[string]interface{}{ | ||
258 | + "transactionContext": transactionContext, | ||
259 | + }); err != nil { | ||
260 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
261 | + } else { | ||
262 | + cooperationApplicationRepository = value | ||
263 | + } | ||
264 | + | ||
265 | + // 用户REST服务初始化 | ||
266 | + var userService service.UserService | ||
267 | + if value, err := factory.CreateUserService(map[string]interface{}{}); err != nil { | ||
268 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
269 | + } else { | ||
270 | + userService = value | ||
271 | + } | ||
272 | + | ||
273 | + // 获取审核人 | ||
274 | + var verifier *domain.User | ||
275 | + if data, err := userService.UserFrom(approvalCooperationApplicationCommand.CompanyId, approvalCooperationApplicationCommand.OrgId, approvalCooperationApplicationCommand.UserId); err != nil { | ||
276 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取申请人失败") | ||
277 | + } else { | ||
278 | + verifier = data | ||
279 | + } | ||
280 | + | ||
281 | + // 共创申请ID转换 | ||
282 | + cooperationApplicationId, err := strconv.ParseInt(approvalCooperationApplicationCommand.CooperationApplicationId, 10, 64) | ||
283 | + if err != nil { | ||
284 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "共创申请ID类型错误") | ||
285 | + } | ||
286 | + | ||
287 | + // 获取共创申请 | ||
288 | + cooperationApplication, err := cooperationApplicationRepository.FindOne(map[string]interface{}{"cooperationApplicationId": approvalCooperationApplicationCommand.CooperationApplicationId}) | ||
289 | + if err != nil { | ||
290 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "共创申请不存在") | ||
291 | + } | ||
292 | + if cooperationApplication == nil { | ||
293 | + return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", strconv.FormatInt(cooperationApplicationId, 10))) | ||
294 | + } | ||
295 | + | ||
296 | + // 校验共创申请是否已经审核过 | ||
297 | + if cooperationApplication.CooperationApplicationStatus != 1 { | ||
298 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "改申请已经审核过") | ||
299 | + } | ||
300 | + | ||
301 | + if approvalCooperationApplicationCommand.Action == 1 { | ||
302 | + cooperationApplication.CooperationApplicationStatus = 2 | ||
303 | + } else if approvalCooperationApplicationCommand.Action == 2 { | ||
304 | + cooperationApplication.CooperationApplicationStatus = 3 | ||
305 | + } | ||
306 | + | ||
307 | + cooperationApplication.CooperationApplicationVerifier = verifier | ||
308 | + cooperationApplication.CooperationApplicationVerifyTime = time.Now() | ||
309 | + | ||
310 | + if err := cooperationApplication.Update(tool_funs.SimpleStructToMap(approvalCooperationApplicationCommand)); err != nil { | ||
311 | + return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) | ||
312 | + } | ||
313 | + if cooperationApplicationSaved, err := cooperationApplicationRepository.Save(cooperationApplication); err != nil { | ||
314 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
315 | + } else { | ||
316 | + if err := transactionContext.CommitTransaction(); err != nil { | ||
317 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | ||
318 | + } | ||
319 | + return cooperationApplicationSaved, nil | ||
320 | + } | ||
321 | +} | ||
322 | + | ||
323 | +// BatchApprovalCooperationApplication 批量审核共创申请 | ||
324 | +func (cooperationApplicationService *CooperationApplicationService) BatchApprovalCooperationApplication(batchApprovalCooperationApplicationCommand *command.BatchApprovalCooperationApplicationCommand) (interface{}, error) { | ||
325 | + if err := batchApprovalCooperationApplicationCommand.ValidateCommand(); err != nil { | ||
326 | + return nil, application.ThrowError(application.ARG_ERROR, err.Error()) | ||
327 | + } | ||
328 | + transactionContext, err := factory.CreateTransactionContext(nil) | ||
329 | + if err != nil { | ||
330 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | ||
331 | + } | ||
332 | + if err := transactionContext.StartTransaction(); err != nil { | ||
333 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | ||
334 | + } | ||
335 | + defer func() { | ||
336 | + _ = transactionContext.RollbackTransaction() | ||
337 | + }() | ||
338 | + | ||
339 | + // 共创申请仓储初始化 | ||
340 | + var cooperationApplicationRepository domain.CooperationApplicationRepository | ||
341 | + if value, err := factory.CreateCooperationApplicationRepository(map[string]interface{}{ | ||
342 | + "transactionContext": transactionContext, | ||
343 | + }); err != nil { | ||
344 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
345 | + } else { | ||
346 | + cooperationApplicationRepository = value | ||
347 | + } | ||
348 | + | ||
349 | + // 共创申请ID类型转换 | ||
350 | + cooperationApplicationIds, err := utils.SliceAtoi(batchApprovalCooperationApplicationCommand.CooperationApplicationIds) | ||
351 | + if err != nil { | ||
352 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "共创申请ID列表类型错误") | ||
353 | + } | ||
354 | + | ||
355 | + // 用户REST服务初始化 | ||
356 | + var userService service.UserService | ||
357 | + if value, err := factory.CreateUserService(map[string]interface{}{}); err != nil { | ||
358 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
359 | + } else { | ||
360 | + userService = value | ||
361 | + } | ||
362 | + | ||
363 | + // 获取审核人 | ||
364 | + var verifier *domain.User | ||
365 | + if data, err := userService.UserFrom(batchApprovalCooperationApplicationCommand.CompanyId, batchApprovalCooperationApplicationCommand.OrgId, batchApprovalCooperationApplicationCommand.UserId); err != nil { | ||
366 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取申请人失败") | ||
367 | + } else { | ||
368 | + verifier = data | ||
369 | + } | ||
370 | + | ||
371 | + // 获取共创申请 | ||
372 | + if count, cooperationApplications, err := cooperationApplicationRepository.Find(map[string]interface{}{ | ||
373 | + "cooperationApplicationIds": cooperationApplicationIds, | ||
374 | + }); err != nil { | ||
375 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
376 | + } else { | ||
377 | + if count > 0 { | ||
378 | + for i, cooperationApplication := range cooperationApplications { | ||
379 | + // 校验共创申请是否已经审核过 | ||
380 | + if cooperationApplication.CooperationApplicationStatus != 1 { | ||
381 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "改申请已经审核过") | ||
382 | + } | ||
383 | + // 更新共创申请数据 | ||
384 | + cooperationApplications[i].CooperationApplicationVerifyDescription = batchApprovalCooperationApplicationCommand.CooperationApplicationVerifyDescription | ||
385 | + if batchApprovalCooperationApplicationCommand.Action == 1 { // 同意 | ||
386 | + cooperationApplications[i].CooperationApplicationStatus = 2 | ||
387 | + } else if batchApprovalCooperationApplicationCommand.Action == 2 { // 拒绝 | ||
388 | + cooperationApplications[i].CooperationApplicationStatus = 3 | ||
389 | + } | ||
390 | + cooperationApplications[i].CooperationApplicationVerifier = verifier | ||
391 | + cooperationApplications[i].CooperationApplicationVerifyTime = time.Now() | ||
392 | + cooperationApplications[i].IsCanceled = 1 | ||
393 | + } | ||
394 | + cooperationApplicationsApproved, err := cooperationApplicationRepository.UpdateMany(cooperationApplications) | ||
395 | + if err != nil { | ||
396 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | ||
397 | + } | ||
398 | + if err := transactionContext.CommitTransaction(); err != nil { | ||
399 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | ||
400 | + } | ||
401 | + return map[string]interface{}{ | ||
402 | + "cooperationApplications": cooperationApplicationsApproved, | ||
403 | + }, nil | ||
404 | + } else { | ||
405 | + return map[string]interface{}{}, nil | ||
406 | + } | ||
407 | + } | ||
408 | +} | ||
409 | + | ||
410 | +// OneClickApprovalCooperationApplication 一键审核共创申请 | ||
411 | +func (cooperationApplicationService *CooperationApplicationService) OneClickApprovalCooperationApplication(oneClickApprovalCooperationApplicationCommand *command.OneClickApprovalCooperationApplicationCommand) (interface{}, error) { | ||
412 | + if err := oneClickApprovalCooperationApplicationCommand.ValidateCommand(); err != nil { | ||
413 | + return nil, application.ThrowError(application.ARG_ERROR, err.Error()) | ||
414 | + } | ||
415 | + transactionContext, err := factory.CreateTransactionContext(nil) | ||
416 | + if err != nil { | ||
417 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | ||
418 | + } | ||
419 | + if err := transactionContext.StartTransaction(); err != nil { | ||
420 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | ||
421 | + } | ||
422 | + defer func() { | ||
423 | + _ = transactionContext.RollbackTransaction() | ||
424 | + }() | ||
425 | + | ||
426 | + // 共创申请仓储初始化 | ||
427 | + var cooperationApplicationRepository domain.CooperationApplicationRepository | ||
428 | + if value, err := factory.CreateCooperationApplicationRepository(map[string]interface{}{ | ||
429 | + "transactionContext": transactionContext, | ||
430 | + }); err != nil { | ||
431 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
432 | + } else { | ||
433 | + cooperationApplicationRepository = value | ||
434 | + } | ||
435 | + | ||
436 | + // 用户REST服务初始化 | ||
437 | + var userService service.UserService | ||
438 | + if value, err := factory.CreateUserService(map[string]interface{}{}); err != nil { | ||
439 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
440 | + } else { | ||
441 | + userService = value | ||
442 | + } | ||
443 | + | ||
444 | + // 获取审核人 | ||
445 | + var verifier *domain.User | ||
446 | + if data, err := userService.UserFrom(oneClickApprovalCooperationApplicationCommand.CompanyId, oneClickApprovalCooperationApplicationCommand.OrgId, oneClickApprovalCooperationApplicationCommand.UserId); err != nil { | ||
447 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取申请人失败") | ||
448 | + } else { | ||
449 | + verifier = data | ||
450 | + } | ||
451 | + | ||
452 | + // 查询共创申请 | ||
453 | + oneClickApprovalCooperationApplicationCommand.CooperationApplicationStatus = 1 // 待审核 | ||
454 | + if count, cooperationApplications, err := cooperationApplicationRepository.Find(tool_funs.SimpleStructToMap(oneClickApprovalCooperationApplicationCommand)); err != nil { | ||
455 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
456 | + } else { | ||
457 | + if count > 0 { | ||
458 | + for i, cooperationApplication := range cooperationApplications { | ||
459 | + // 校验共创申请是否已经审核过 | ||
460 | + if cooperationApplication.CooperationApplicationStatus != 1 { | ||
461 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "改申请已经审核过") | ||
462 | + } | ||
463 | + // 更新共创申请 | ||
464 | + if oneClickApprovalCooperationApplicationCommand.Action == 1 { | ||
465 | + cooperationApplications[i].CooperationApplicationStatus = 2 | ||
466 | + } else if oneClickApprovalCooperationApplicationCommand.Action == 2 { | ||
467 | + cooperationApplications[i].CooperationApplicationStatus = 3 | ||
468 | + } | ||
469 | + cooperationApplications[i].CooperationApplicationVerifyDescription = oneClickApprovalCooperationApplicationCommand.CooperationApplicationVerifyDescription | ||
470 | + cooperationApplications[i].CooperationApplicationVerifier = verifier | ||
471 | + cooperationApplications[i].CooperationApplicationVerifyTime = time.Now() | ||
472 | + } | ||
473 | + cooperationApplicationsApproved, err := cooperationApplicationRepository.UpdateMany(cooperationApplications) | ||
474 | + if err != nil { | ||
475 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | ||
476 | + } | ||
477 | + if err := transactionContext.CommitTransaction(); err != nil { | ||
478 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | ||
479 | + } | ||
480 | + return map[string]interface{}{ | ||
481 | + "cooperationApplications": cooperationApplicationsApproved, | ||
482 | + }, nil | ||
483 | + } else { | ||
484 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "未找到待审核的共创申请") | ||
485 | + } | ||
486 | + } | ||
487 | +} | ||
488 | + | ||
489 | +// CreateCooperationApplication 创建共创申请服务 | ||
490 | +func (cooperationApplicationService *CooperationApplicationService) CreateCooperationApplication(createCooperationApplicationCommand *command.CreateCooperationApplicationCommand) (interface{}, error) { | ||
491 | + if err := createCooperationApplicationCommand.ValidateCommand(); err != nil { | ||
492 | + return nil, application.ThrowError(application.ARG_ERROR, err.Error()) | ||
493 | + } | ||
494 | + transactionContext, err := factory.CreateTransactionContext(nil) | ||
495 | + if err != nil { | ||
496 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | ||
497 | + } | ||
498 | + if err := transactionContext.StartTransaction(); err != nil { | ||
499 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | ||
500 | + } | ||
501 | + defer func() { | ||
502 | + _ = transactionContext.RollbackTransaction() | ||
503 | + }() | ||
504 | + | ||
505 | + var cooperationProjectRepository domain.CooperationProjectRepository | ||
506 | + if value, err := factory.CreateCooperationProjectRepository(map[string]interface{}{ | ||
507 | + "transactionContext": transactionContext, | ||
508 | + }); err != nil { | ||
509 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
510 | + } else { | ||
511 | + cooperationProjectRepository = value | ||
512 | + } | ||
513 | + cooperationProject, err := cooperationProjectRepository.FindOne(map[string]interface{}{"cooperationProjectNumber": createCooperationApplicationCommand.CooperationProjectNumber}) | ||
514 | + if err != nil { | ||
515 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "共创项目不存在") | ||
516 | + } | ||
517 | + if cooperationProject == nil { | ||
518 | + return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", createCooperationApplicationCommand.CooperationProjectNumber)) | ||
519 | + } | ||
520 | + | ||
521 | + // 用户REST服务初始化 | ||
522 | + var userService service.UserService | ||
523 | + if value, err := factory.CreateUserService(map[string]interface{}{}); err != nil { | ||
524 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
525 | + } else { | ||
526 | + userService = value | ||
527 | + } | ||
528 | + | ||
529 | + // 获取申请人 | ||
530 | + var applicant *domain.User | ||
531 | + if data, err := userService.UserFrom(createCooperationApplicationCommand.CompanyId, createCooperationApplicationCommand.OrgId, createCooperationApplicationCommand.UserId); err != nil { | ||
532 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
533 | + } else { | ||
534 | + applicant = data | ||
535 | + } | ||
536 | + | ||
537 | + // 公司REST服务初始化 | ||
538 | + var companyService service.CompanyService | ||
539 | + if value, err := factory.CreateCompanyService(map[string]interface{}{}); err != nil { | ||
540 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
541 | + } else { | ||
542 | + companyService = value | ||
543 | + } | ||
544 | + | ||
545 | + // 获取公司信息 | ||
546 | + var company *domain.Company | ||
547 | + if data, err := companyService.CompanyFrom(createCooperationApplicationCommand.CompanyId); err != nil { | ||
548 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
549 | + } else { | ||
550 | + company = data | ||
551 | + } | ||
552 | + | ||
553 | + // 组织机构REST服务初始化 | ||
554 | + var organizationService service.OrgService | ||
555 | + if value, err := factory.CreateOrganizationService(map[string]interface{}{}); err != nil { | ||
556 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
557 | + } else { | ||
558 | + organizationService = value | ||
559 | + } | ||
560 | + | ||
561 | + // 获取组织机构信息 | ||
562 | + var organization *domain.Org | ||
563 | + if data, err := organizationService.OrgFrom(createCooperationApplicationCommand.CompanyId, createCooperationApplicationCommand.OrgId); err != nil { | ||
564 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
565 | + } else { | ||
566 | + organization = data | ||
567 | + } | ||
568 | + | ||
569 | + newCooperationApplication := &domain.CooperationApplication{ | ||
570 | + CooperationApplicationApplicant: applicant, | ||
571 | + CooperationApplicationAttachment: createCooperationApplicationCommand.CooperationApplicationAttachment, | ||
572 | + CooperationApplicationDescription: createCooperationApplicationCommand.CooperationApplicationDescription, | ||
573 | + CooperationApplicationStatus: 1, | ||
574 | + CooperationApplicationVerifier: nil, | ||
575 | + CooperationApplicationVerifyDescription: "", | ||
576 | + CooperationApplicationVerifyTime: time.Time{}, | ||
577 | + CooperationApplyTime: time.Now(), | ||
578 | + CooperationProject: cooperationProject, | ||
579 | + Org: organization, | ||
580 | + IsCanceled: 1, | ||
581 | + Company: company, | ||
582 | + CreatedAt: time.Now(), | ||
583 | + DeletedAt: time.Time{}, | ||
584 | + UpdatedAt: time.Time{}, | ||
585 | + } | ||
586 | + | ||
587 | + var cooperationApplicationRepository domain.CooperationApplicationRepository | ||
588 | + if value, err := factory.CreateCooperationApplicationRepository(map[string]interface{}{ | ||
589 | + "transactionContext": transactionContext, | ||
590 | + }); err != nil { | ||
591 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
592 | + } else { | ||
593 | + cooperationApplicationRepository = value | ||
594 | + } | ||
595 | + if cooperationApplication, err := cooperationApplicationRepository.Save(newCooperationApplication); err != nil { | ||
596 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
597 | + } else { | ||
598 | + if err := transactionContext.CommitTransaction(); err != nil { | ||
599 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | ||
600 | + } | ||
601 | + return cooperationApplication, nil | ||
602 | + } | ||
603 | +} | ||
604 | + | ||
605 | +// GetCooperationApplication 返回共创申请服务 | ||
606 | +func (cooperationApplicationService *CooperationApplicationService) GetCooperationApplication(getCooperationApplicationQuery *query.GetCooperationApplicationQuery) (interface{}, error) { | ||
607 | + if err := getCooperationApplicationQuery.ValidateQuery(); err != nil { | ||
608 | + return nil, application.ThrowError(application.ARG_ERROR, err.Error()) | ||
609 | + } | ||
610 | + transactionContext, err := factory.CreateTransactionContext(nil) | ||
611 | + if err != nil { | ||
612 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | ||
613 | + } | ||
614 | + if err := transactionContext.StartTransaction(); err != nil { | ||
615 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | ||
616 | + } | ||
617 | + defer func() { | ||
618 | + _ = transactionContext.RollbackTransaction() | ||
619 | + }() | ||
620 | + var cooperationApplicationRepository domain.CooperationApplicationRepository | ||
621 | + if value, err := factory.CreateCooperationApplicationRepository(map[string]interface{}{ | ||
622 | + "transactionContext": transactionContext, | ||
623 | + }); err != nil { | ||
624 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
625 | + } else { | ||
626 | + cooperationApplicationRepository = value | ||
627 | + } | ||
628 | + cooperationApplication, err := cooperationApplicationRepository.FindOne(map[string]interface{}{"cooperationApplicationId": getCooperationApplicationQuery.CooperationApplicationId}) | ||
629 | + if err != nil { | ||
630 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "共创申请不存在") | ||
631 | + } | ||
632 | + if cooperationApplication == nil { | ||
633 | + return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", strconv.FormatInt(getCooperationApplicationQuery.CooperationApplicationId, 10))) | ||
634 | + } else { | ||
635 | + if err := transactionContext.CommitTransaction(); err != nil { | ||
636 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | ||
637 | + } | ||
638 | + coProjectDto := &dto.CooperationApplicationDto{} | ||
639 | + coProjectDto.LoadDto(cooperationApplication) | ||
640 | + return coProjectDto, nil | ||
641 | + } | ||
642 | +} | ||
643 | + | ||
644 | +// ListCooperationApplication 返回共创申请服务列表 | ||
645 | +func (cooperationApplicationService *CooperationApplicationService) ListCooperationApplication(listCooperationApplicationQuery *query.ListCooperationApplicationQuery) (interface{}, error) { | ||
646 | + if err := listCooperationApplicationQuery.ValidateQuery(); err != nil { | ||
647 | + return nil, application.ThrowError(application.ARG_ERROR, err.Error()) | ||
648 | + } | ||
649 | + transactionContext, err := factory.CreateTransactionContext(nil) | ||
650 | + if err != nil { | ||
651 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | ||
652 | + } | ||
653 | + if err := transactionContext.StartTransaction(); err != nil { | ||
654 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | ||
655 | + } | ||
656 | + defer func() { | ||
657 | + _ = transactionContext.RollbackTransaction() | ||
658 | + }() | ||
659 | + // 共创申请仓储初始化 | ||
660 | + var cooperationApplicationRepository domain.CooperationApplicationRepository | ||
661 | + if value, err := factory.CreateCooperationApplicationRepository(map[string]interface{}{ | ||
662 | + "transactionContext": transactionContext, | ||
663 | + }); err != nil { | ||
664 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
665 | + } else { | ||
666 | + cooperationApplicationRepository = value | ||
667 | + } | ||
668 | + // 获取共创申请 | ||
669 | + if count, cooperationApplications, err := cooperationApplicationRepository.Find(tool_funs.SimpleStructToMap(listCooperationApplicationQuery)); err != nil { | ||
670 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
671 | + } else { | ||
672 | + if err := transactionContext.CommitTransaction(); err != nil { | ||
673 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | ||
674 | + } | ||
675 | + return map[string]interface{}{ | ||
676 | + "grid": map[string]interface{}{ | ||
677 | + "total": count, | ||
678 | + "list": cooperationApplications, | ||
679 | + }, | ||
680 | + }, nil | ||
681 | + } | ||
682 | +} | ||
683 | + | ||
684 | +// RemoveCooperationApplication 移除共创申请服务 | ||
685 | +func (cooperationApplicationService *CooperationApplicationService) RemoveCooperationApplication(removeCooperationApplicationCommand *command.RemoveCooperationApplicationCommand) (interface{}, error) { | ||
686 | + if err := removeCooperationApplicationCommand.ValidateCommand(); err != nil { | ||
687 | + return nil, application.ThrowError(application.ARG_ERROR, err.Error()) | ||
688 | + } | ||
689 | + transactionContext, err := factory.CreateTransactionContext(nil) | ||
690 | + if err != nil { | ||
691 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | ||
692 | + } | ||
693 | + if err := transactionContext.StartTransaction(); err != nil { | ||
694 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | ||
695 | + } | ||
696 | + defer func() { | ||
697 | + _ = transactionContext.RollbackTransaction() | ||
698 | + }() | ||
699 | + var cooperationApplicationRepository domain.CooperationApplicationRepository | ||
700 | + if value, err := factory.CreateCooperationApplicationRepository(map[string]interface{}{ | ||
701 | + "transactionContext": transactionContext, | ||
702 | + }); err != nil { | ||
703 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
704 | + } else { | ||
705 | + cooperationApplicationRepository = value | ||
706 | + } | ||
707 | + cooperationApplication, err := cooperationApplicationRepository.FindOne(map[string]interface{}{"cooperationApplicationId": removeCooperationApplicationCommand.CooperationApplicationId}) | ||
708 | + if err != nil { | ||
709 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "共创申请不存在") | ||
710 | + } | ||
711 | + if cooperationApplication == nil { | ||
712 | + return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", strconv.FormatInt(removeCooperationApplicationCommand.CooperationApplicationId, 10))) | ||
713 | + } | ||
714 | + if cooperationApplication, err := cooperationApplicationRepository.Remove(cooperationApplication); err != nil { | ||
715 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
716 | + } else { | ||
717 | + if err := transactionContext.CommitTransaction(); err != nil { | ||
718 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | ||
719 | + } | ||
720 | + return cooperationApplication, nil | ||
721 | + } | ||
722 | +} | ||
723 | + | ||
724 | +// SearchCooperationApplication 查询共创申请 | ||
725 | +func (cooperationApplicationService *CooperationApplicationService) SearchCooperationApplication(searchCooperationApplicationQuery *query.SearchCooperationApplicationQuery) (interface{}, error) { | ||
726 | + if err := searchCooperationApplicationQuery.ValidateQuery(); err != nil { | ||
727 | + return nil, application.ThrowError(application.ARG_ERROR, err.Error()) | ||
728 | + } | ||
729 | + transactionContext, err := factory.CreateTransactionContext(nil) | ||
730 | + if err != nil { | ||
731 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | ||
732 | + } | ||
733 | + if err := transactionContext.StartTransaction(); err != nil { | ||
734 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | ||
735 | + } | ||
736 | + defer func() { | ||
737 | + _ = transactionContext.RollbackTransaction() | ||
738 | + }() | ||
739 | + var cooperationApplicationRepository domain.CooperationApplicationRepository | ||
740 | + if value, err := factory.CreateCooperationApplicationRepository(map[string]interface{}{ | ||
741 | + "transactionContext": transactionContext, | ||
742 | + }); err != nil { | ||
743 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
744 | + } else { | ||
745 | + cooperationApplicationRepository = value | ||
746 | + } | ||
747 | + if count, cooperationApplications, err := cooperationApplicationRepository.Find(tool_funs.SimpleStructToMap(searchCooperationApplicationQuery)); err != nil { | ||
748 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
749 | + } else { | ||
750 | + if err := transactionContext.CommitTransaction(); err != nil { | ||
751 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | ||
752 | + } | ||
753 | + var coProjectDtos []*dto.CooperationApplicationDto | ||
754 | + for i := range cooperationApplications { | ||
755 | + var coProjectDto = &dto.CooperationApplicationDto{} | ||
756 | + coProjectDto.LoadDto(cooperationApplications[i]) | ||
757 | + coProjectDtos = append(coProjectDtos, coProjectDto) | ||
758 | + } | ||
759 | + | ||
760 | + return map[string]interface{}{ | ||
761 | + "grid": map[string]interface{}{ | ||
762 | + "total": count, | ||
763 | + "list": coProjectDtos, | ||
764 | + }, | ||
765 | + }, nil | ||
766 | + } | ||
767 | +} | ||
768 | + | ||
769 | +// UpdateCooperationApplication 更新共创申请服务 | ||
770 | +func (cooperationApplicationService *CooperationApplicationService) UpdateCooperationApplication(updateCooperationApplicationCommand *command.UpdateCooperationApplicationCommand) (interface{}, error) { | ||
771 | + if err := updateCooperationApplicationCommand.ValidateCommand(); err != nil { | ||
772 | + return nil, application.ThrowError(application.ARG_ERROR, err.Error()) | ||
773 | + } | ||
774 | + transactionContext, err := factory.CreateTransactionContext(nil) | ||
775 | + if err != nil { | ||
776 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | ||
777 | + } | ||
778 | + if err := transactionContext.StartTransaction(); err != nil { | ||
779 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | ||
780 | + } | ||
781 | + defer func() { | ||
782 | + _ = transactionContext.RollbackTransaction() | ||
783 | + }() | ||
784 | + var cooperationApplicationRepository domain.CooperationApplicationRepository | ||
785 | + if value, err := factory.CreateCooperationApplicationRepository(map[string]interface{}{ | ||
786 | + "transactionContext": transactionContext, | ||
787 | + }); err != nil { | ||
788 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
789 | + } else { | ||
790 | + cooperationApplicationRepository = value | ||
791 | + } | ||
792 | + cooperationApplication, err := cooperationApplicationRepository.FindOne(map[string]interface{}{"cooperationApplicationId": updateCooperationApplicationCommand.CooperationApplicationId}) | ||
793 | + if err != nil { | ||
794 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "共创申请不存在") | ||
795 | + } | ||
796 | + if cooperationApplication == nil { | ||
797 | + return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", strconv.FormatInt(updateCooperationApplicationCommand.CooperationApplicationId, 10))) | ||
798 | + } | ||
799 | + if err := cooperationApplication.Update(tool_funs.SimpleStructToMap(updateCooperationApplicationCommand)); err != nil { | ||
800 | + return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) | ||
801 | + } | ||
802 | + if cooperationApplication, err := cooperationApplicationRepository.Save(cooperationApplication); err != nil { | ||
803 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
804 | + } else { | ||
805 | + if err := transactionContext.CommitTransaction(); err != nil { | ||
806 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | ||
807 | + } | ||
808 | + return cooperationApplication, nil | ||
809 | + } | ||
810 | +} | ||
811 | + | ||
812 | +// CancelCooperationApplication 取消共创申请 | ||
813 | +func (cooperationApplicationService *CooperationApplicationService) CancelCooperationApplication(cancelCooperationApplicationCommand *command.CancelCooperationApplicationCommand) (interface{}, error) { | ||
814 | + if err := cancelCooperationApplicationCommand.ValidateCommand(); err != nil { | ||
815 | + return nil, application.ThrowError(application.ARG_ERROR, err.Error()) | ||
816 | + } | ||
817 | + transactionContext, err := factory.CreateTransactionContext(nil) | ||
818 | + if err != nil { | ||
819 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | ||
820 | + } | ||
821 | + if err := transactionContext.StartTransaction(); err != nil { | ||
822 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | ||
823 | + } | ||
824 | + defer func() { | ||
825 | + _ = transactionContext.RollbackTransaction() | ||
826 | + }() | ||
827 | + | ||
828 | + //TODO 校验用户菜单模块权限 | ||
829 | + | ||
830 | + // 共创项目仓储初始化 | ||
831 | + var cooperationProjectRepository domain.CooperationProjectRepository | ||
832 | + if value, err := factory.CreateCooperationProjectRepository(map[string]interface{}{ | ||
833 | + "transactionContext": transactionContext, | ||
834 | + }); err != nil { | ||
835 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
836 | + } else { | ||
837 | + cooperationProjectRepository = value | ||
838 | + } | ||
839 | + | ||
840 | + // 共创申请仓储初始化 | ||
841 | + var cooperationApplicationRepository domain.CooperationApplicationRepository | ||
842 | + if value, err := factory.CreateCooperationApplicationRepository(map[string]interface{}{ | ||
843 | + "transactionContext": transactionContext, | ||
844 | + }); err != nil { | ||
845 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
846 | + } else { | ||
847 | + cooperationApplicationRepository = value | ||
848 | + } | ||
849 | + cooperationApplicationId, err := strconv.ParseInt(cancelCooperationApplicationCommand.CooperationApplicationId, 10, 64) | ||
850 | + if err != nil { | ||
851 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "共创申请ID错误") | ||
852 | + } | ||
853 | + cooperationApplication, err := cooperationApplicationRepository.FindOne(map[string]interface{}{"cooperationApplicationId": cooperationApplicationId}) | ||
854 | + if err != nil { | ||
855 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "共创申请不存在") | ||
856 | + } | ||
857 | + if cooperationApplication == nil { | ||
858 | + return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", strconv.FormatInt(cooperationApplicationId, 10))) | ||
859 | + } | ||
860 | + if err := cooperationApplication.Update(map[string]interface{}{ | ||
861 | + "isCanceled": int32(2), | ||
862 | + }); err != nil { | ||
863 | + return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) | ||
864 | + } | ||
865 | + if cooperationApplicationSaved, err := cooperationApplicationRepository.Save(cooperationApplication); err != nil { | ||
866 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
867 | + } else { | ||
868 | + // 获取共创项目 | ||
869 | + cooperationProject, err := cooperationProjectRepository.FindOne(map[string]interface{}{"cooperationProjectId": cooperationApplicationSaved.CooperationProject.CooperationProjectId}) | ||
870 | + if err != nil { | ||
871 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "共创项目不存在") | ||
872 | + } | ||
873 | + if cooperationProject == nil { | ||
874 | + return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("共创项目%s不存在", strconv.FormatInt(cooperationApplicationSaved.CooperationProject.CooperationProjectId, 10))) | ||
875 | + } | ||
876 | + // 更新共创项目申请统计 | ||
877 | + //cooperationProject.ApplicantCount = cooperationProject.ApplicantCount - 1 | ||
878 | + if _, err := cooperationProjectRepository.Save(cooperationProject); err != nil { | ||
879 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
880 | + } | ||
881 | + if err := transactionContext.CommitTransaction(); err != nil { | ||
882 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | ||
883 | + } | ||
884 | + return cooperationApplicationSaved, nil | ||
885 | + } | ||
886 | +} | ||
887 | + | ||
888 | +func NewCooperationApplicationService(options map[string]interface{}) *CooperationApplicationService { | ||
889 | + newCooperationApplicationService := &CooperationApplicationService{} | ||
890 | + return newCooperationApplicationService | ||
891 | +} |
1 | +package command | ||
2 | + | ||
3 | +import ( | ||
4 | + "fmt" | ||
5 | + "github.com/beego/beego/v2/core/validation" | ||
6 | + "reflect" | ||
7 | + "strings" | ||
8 | +) | ||
9 | + | ||
10 | +type BatchOperateCooperationContractCommand struct { | ||
11 | + // 共创合约id列表 | ||
12 | + CooperationContractIds []string `cname:"共创合约id" json:"cooperationContractIds" valid:"Required"` | ||
13 | + // 动作 | ||
14 | + Action int32 `cname:"操作" json:"action" valid:"Required"` | ||
15 | + // 公司ID,通过集成REST上下文获取 | ||
16 | + CompanyId int64 `cname:"公司ID" json:"companyId" valid:"Required"` | ||
17 | + // 组织机构ID | ||
18 | + OrgId int64 `cname:"组织机构ID" json:"orgId" valid:"Required"` | ||
19 | + // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员 | ||
20 | + UserId int64 `cname:"用户ID" json:"userId" valid:"Required"` | ||
21 | + // 用户基础数据id | ||
22 | + UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId" valid:"Required"` | ||
23 | +} | ||
24 | + | ||
25 | +func (batchOperateCooperationContractCommand *BatchOperateCooperationContractCommand) Valid(validation *validation.Validation) { | ||
26 | + //validation.SetError("CustomValid", "未实现的自定义认证") | ||
27 | +} | ||
28 | + | ||
29 | +func (batchOperateCooperationContractCommand *BatchOperateCooperationContractCommand) ValidateCommand() error { | ||
30 | + valid := validation.Validation{} | ||
31 | + b, err := valid.Valid(batchOperateCooperationContractCommand) | ||
32 | + if err != nil { | ||
33 | + return err | ||
34 | + } | ||
35 | + if !b { | ||
36 | + elem := reflect.TypeOf(batchOperateCooperationContractCommand).Elem() | ||
37 | + for _, validErr := range valid.Errors { | ||
38 | + field, isExist := elem.FieldByName(validErr.Field) | ||
39 | + if isExist { | ||
40 | + return fmt.Errorf(strings.Replace(validErr.Message, validErr.Field, field.Tag.Get("cname"), -1)) | ||
41 | + } else { | ||
42 | + return fmt.Errorf(validErr.Message) | ||
43 | + } | ||
44 | + } | ||
45 | + } | ||
46 | + return nil | ||
47 | +} |
1 | +package command | ||
2 | + | ||
3 | +import ( | ||
4 | + "fmt" | ||
5 | + "github.com/beego/beego/v2/core/validation" | ||
6 | + "reflect" | ||
7 | + "strings" | ||
8 | +) | ||
9 | + | ||
10 | +type BatchRemoveCooperationContractCommand struct { | ||
11 | + // 共创合约id列表 | ||
12 | + CooperationContractIds []string `cname:"共创合约id" json:"cooperationContractIds" valid:"Required"` | ||
13 | + // 公司ID,通过集成REST上下文获取 | ||
14 | + CompanyId int64 `cname:"公司ID" json:"companyId" valid:"Required"` | ||
15 | + // 组织机构ID | ||
16 | + OrgId int64 `cname:"组织机构ID" json:"orgId" valid:"Required"` | ||
17 | + // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员 | ||
18 | + UserId int64 `cname:"用户ID" json:"userId" valid:"Required"` | ||
19 | + // 用户基础数据id | ||
20 | + UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId" valid:"Required"` | ||
21 | +} | ||
22 | + | ||
23 | +func (batchRemoveCooperationContractCommand *BatchRemoveCooperationContractCommand) Valid(validation *validation.Validation) { | ||
24 | + //validation.SetError("CustomValid", "未实现的自定义认证") | ||
25 | +} | ||
26 | + | ||
27 | +func (batchRemoveCooperationContractCommand *BatchRemoveCooperationContractCommand) ValidateCommand() error { | ||
28 | + valid := validation.Validation{} | ||
29 | + b, err := valid.Valid(batchRemoveCooperationContractCommand) | ||
30 | + if err != nil { | ||
31 | + return err | ||
32 | + } | ||
33 | + if !b { | ||
34 | + elem := reflect.TypeOf(batchRemoveCooperationContractCommand).Elem() | ||
35 | + for _, validErr := range valid.Errors { | ||
36 | + field, isExist := elem.FieldByName(validErr.Field) | ||
37 | + if isExist { | ||
38 | + return fmt.Errorf(strings.Replace(validErr.Message, validErr.Field, field.Tag.Get("cname"), -1)) | ||
39 | + } else { | ||
40 | + return fmt.Errorf(validErr.Message) | ||
41 | + } | ||
42 | + } | ||
43 | + } | ||
44 | + return nil | ||
45 | +} |
1 | +package command | ||
2 | + | ||
3 | +import ( | ||
4 | + "fmt" | ||
5 | + "reflect" | ||
6 | + "strings" | ||
7 | + "time" | ||
8 | + | ||
9 | + "github.com/beego/beego/v2/core/validation" | ||
10 | +) | ||
11 | + | ||
12 | +// CreateDividendsIncentivesRulesCommand 业绩分红激励规则 | ||
13 | +type CreateDividendsIncentivesRulesCommand struct { | ||
14 | + // 分红激励规则ID | ||
15 | + DividendsIncentivesRuleId string `cname:"分红激励规则ID" json:"dividendsIncentivesRuleId,omitempty"` | ||
16 | + // 共创合约编号 | ||
17 | + CooperationContractNumber string `cname:"共创合约编号" json:"cooperationContractNumber,omitempty"` | ||
18 | + // 推荐人抽成 | ||
19 | + ReferrerPercentage float64 `cname:"推荐人抽成" json:"referrerPercentage"` | ||
20 | + // 业务员抽成 | ||
21 | + SalesmanPercentage float64 `cname:"业务员抽成" json:"salesmanPercentage"` | ||
22 | + // 分红规则激励百分点 | ||
23 | + DividendsIncentivesPercentage float64 `cname:"分红规则激励百分点" json:"dividendsIncentivesPercentage"` | ||
24 | + // 分红激励阶段 | ||
25 | + DividendsIncentivesStage int32 `cname:"分红激励阶段" json:"dividendsIncentivesStage"` | ||
26 | + // 业绩分红阶段开始时间 | ||
27 | + DividendsIncentivesStageStart time.Time `cname:"业绩分红阶段开始时间" json:"dividendsIncentivesStageStart"` | ||
28 | + // 业绩分红阶段结束时间 | ||
29 | + DividendsIncentivesStageEnd time.Time `cname:"业绩分红阶段结束时间" json:"dividendsIncentivesStageEnd"` | ||
30 | + // 说明 | ||
31 | + Remarks string `cname:"说明" json:"remarks"` | ||
32 | +} | ||
33 | + | ||
34 | +// CreateMoneyIncentivesRulesCommand 金额激励规则 | ||
35 | +type CreateMoneyIncentivesRulesCommand struct { | ||
36 | + // 金额激励规则ID | ||
37 | + MoneyIncentivesRuleId string `cname:"金额激励规则ID" json:"moneyIncentivesRuleId"` | ||
38 | + // 共创合约编号 | ||
39 | + CooperationContractNumber string `cname:"共创合约编号" json:"cooperationContractNumber"` | ||
40 | + // 激励金额 | ||
41 | + MoneyIncentivesAmount float64 `cname:"激励金额" json:"moneyIncentivesAmount"` | ||
42 | + // 金额激励阶段 | ||
43 | + MoneyIncentivesStage int32 `cname:"金额激励阶段" json:"moneyIncentivesStage"` | ||
44 | + // 金额激励结束时间 | ||
45 | + MoneyIncentivesStageEnd time.Time `cname:"金额激励结束时间" json:"moneyIncentivesStageEnd"` | ||
46 | + // 金额激励开始时间 | ||
47 | + MoneyIncentivesStageStart time.Time `cname:"金额激励开始时间" json:"moneyIncentivesStageStart"` | ||
48 | + // 金额激励时间 | ||
49 | + MoneyIncentivesTime time.Time `cname:"金额激励时间" json:"moneyIncentivesTime"` | ||
50 | + // 推荐人抽成 | ||
51 | + ReferrerPercentage float64 `cname:"推荐人抽成" json:"referrerPercentage"` | ||
52 | + // 业务员抽成 | ||
53 | + SalesmanPercentage float64 `cname:"业务员抽成" json:"salesmanPercentage"` | ||
54 | + // 说明 | ||
55 | + Remarks string `cname:"说明" json:"remarks"` | ||
56 | +} | ||
57 | + | ||
58 | +// CreateUndertakersCommand 承接人 | ||
59 | +type CreateUndertakersCommand struct { | ||
60 | + // 承接人ID | ||
61 | + UndertakerId string `cname:"承接人ID" json:"undertakerId"` | ||
62 | + // 承接人用户ID | ||
63 | + UserId string `cname:"承接人UID" json:"userId"` | ||
64 | + // 附件 | ||
65 | + ContractAttachment []struct { | ||
66 | + // 文件类型 | ||
67 | + FileType string `cname:"文件类型" json:"fileType"` | ||
68 | + // 文件名称 | ||
69 | + Name string `cname:"文件名称" json:"name"` | ||
70 | + // 文件路径 | ||
71 | + Url string `cname:"文件路径" json:"url"` | ||
72 | + // 文件大小 | ||
73 | + FileSize int64 `cname:"文件大小" json:"fileSize"` | ||
74 | + } `cname:"附件" json:"contractAttachment"` | ||
75 | + // 推荐人用户ID | ||
76 | + ReferrerId string `cname:"推荐UID" json:"referrerId"` | ||
77 | + // 业务员用户ID | ||
78 | + SalesmanId string `cname:"业务员UID" json:"salesmanId"` | ||
79 | +} | ||
80 | + | ||
81 | +type CreateCooperationContractCommand struct { | ||
82 | + // 共创合约描述 | ||
83 | + CooperationContractDescription string `cname:"共创合约描述" json:"cooperationContractDescription"` | ||
84 | + // 共创项目编号 | ||
85 | + CooperationProjectNumber string `cname:"共创项目编号" json:"cooperationProjectNumber,omitempty"` | ||
86 | + // 共创合约发起部门ID | ||
87 | + DepartmentId string `cname:"共创合约发起部门ID" json:"departmentId" valid:"Required"` | ||
88 | + // 共创合约承接对象,1员工,2共创用户,3公开 | ||
89 | + CooperationContractUndertakerTypes []int32 `cname:"共创合约承接对象" json:"cooperationContractUndertakerTypes" valid:"Required"` | ||
90 | + // 共创合约名称 | ||
91 | + CooperationContractName string `cname:"共创合约名称" json:"cooperationContractName" valid:"Required"` | ||
92 | + // 共创模式编码 | ||
93 | + CooperationModeNumber string `cname:"共创模式编码" json:"cooperationModeNumber" valid:"Required"` | ||
94 | + // 共创合约发起人uid | ||
95 | + SponsorUid string `cname:"共创合约发起人uid" json:"sponsorUid,omitempty"` | ||
96 | + // 业绩分红激励规则列表 | ||
97 | + DividendsIncentivesRules []*CreateDividendsIncentivesRulesCommand `cname:"业绩分红激励规则列表" json:"dividendsIncentivesRules,omitempty"` | ||
98 | + // 金额激励规则列表 | ||
99 | + MoneyIncentivesRules []*CreateMoneyIncentivesRulesCommand `cname:"金额激励规则列表" json:"moneyIncentivesRules,omitempty"` | ||
100 | + // 承接方列表 | ||
101 | + Undertakers []*CreateUndertakersCommand `cname:"承接方列表" json:"undertakers,omitempty"` | ||
102 | + // 相关人列表 | ||
103 | + RelevantIds []string `cname:"相关人列表" json:"relevantIds,omitempty"` | ||
104 | + // 公司ID,通过集成REST上下文获取 | ||
105 | + CompanyId int64 `cname:"公司ID" json:"companyId" valid:"Required"` | ||
106 | + // 组织机构ID | ||
107 | + OrgId int64 `cname:"组织机构ID" json:"orgId" valid:"Required"` | ||
108 | + // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员 | ||
109 | + UserId int64 `cname:"用户ID" json:"userId" valid:"Required"` | ||
110 | + // 用户基础数据id | ||
111 | + UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId" valid:"Required"` | ||
112 | +} | ||
113 | + | ||
114 | +func (createCooperationContractCommand *CreateCooperationContractCommand) Valid(validation *validation.Validation) { | ||
115 | + // 激励规则自定义校验 | ||
116 | + if len(createCooperationContractCommand.DividendsIncentivesRules) == 0 && len(createCooperationContractCommand.MoneyIncentivesRules) == 0 { | ||
117 | + validation.Error("激励规则不能为空") | ||
118 | + } | ||
119 | + // 承接人列表校验 | ||
120 | + if len(createCooperationContractCommand.Undertakers) == 0 { | ||
121 | + validation.Error("承接人不能为空") | ||
122 | + } | ||
123 | +} | ||
124 | + | ||
125 | +func (createCooperationContractCommand *CreateCooperationContractCommand) ValidateCommand() error { | ||
126 | + valid := validation.Validation{} | ||
127 | + b, err := valid.Valid(createCooperationContractCommand) | ||
128 | + if err != nil { | ||
129 | + return err | ||
130 | + } | ||
131 | + if !b { | ||
132 | + elem := reflect.TypeOf(createCooperationContractCommand).Elem() | ||
133 | + for _, validErr := range valid.Errors { | ||
134 | + field, isExist := elem.FieldByName(validErr.Field) | ||
135 | + if isExist { | ||
136 | + return fmt.Errorf(strings.Replace(validErr.Message, validErr.Field, field.Tag.Get("cname"), -1)) | ||
137 | + } else { | ||
138 | + return fmt.Errorf(validErr.Message) | ||
139 | + } | ||
140 | + } | ||
141 | + } | ||
142 | + return nil | ||
143 | +} |
1 | +package command | ||
2 | + | ||
3 | +import ( | ||
4 | + "fmt" | ||
5 | + "github.com/beego/beego/v2/core/validation" | ||
6 | + "reflect" | ||
7 | + "strings" | ||
8 | +) | ||
9 | + | ||
10 | +type OperateCooperationContractCommand struct { | ||
11 | + // 共创合约id | ||
12 | + CooperationContractId string `cname:"共创合约id" json:"cooperationContractId" valid:"Required"` | ||
13 | + // 操作,1暂停,2恢复 | ||
14 | + Action int32 `cname:"操作" json:"action" valid:"Required"` | ||
15 | + // 公司ID,通过集成REST上下文获取 | ||
16 | + CompanyId int64 `cname:"公司ID" json:"companyId" valid:"Required"` | ||
17 | + // 组织机构ID | ||
18 | + OrgId int64 `cname:"组织机构ID" json:"orgId" valid:"Required"` | ||
19 | + // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员 | ||
20 | + UserId int64 `cname:"用户ID" json:"userId" valid:"Required"` | ||
21 | + // 用户基础数据id | ||
22 | + UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId" valid:"Required"` | ||
23 | +} | ||
24 | + | ||
25 | +func (operateCooperationContractCommand *OperateCooperationContractCommand) Valid(validation *validation.Validation) { | ||
26 | + //validation.SetError("CustomValid", "未实现的自定义认证") | ||
27 | +} | ||
28 | + | ||
29 | +func (operateCooperationContractCommand *OperateCooperationContractCommand) ValidateCommand() error { | ||
30 | + valid := validation.Validation{} | ||
31 | + b, err := valid.Valid(operateCooperationContractCommand) | ||
32 | + if err != nil { | ||
33 | + return err | ||
34 | + } | ||
35 | + if !b { | ||
36 | + elem := reflect.TypeOf(operateCooperationContractCommand).Elem() | ||
37 | + for _, validErr := range valid.Errors { | ||
38 | + field, isExist := elem.FieldByName(validErr.Field) | ||
39 | + if isExist { | ||
40 | + return fmt.Errorf(strings.Replace(validErr.Message, validErr.Field, field.Tag.Get("cname"), -1)) | ||
41 | + } else { | ||
42 | + return fmt.Errorf(validErr.Message) | ||
43 | + } | ||
44 | + } | ||
45 | + } | ||
46 | + return nil | ||
47 | +} |
1 | +package command | ||
2 | + | ||
3 | +import ( | ||
4 | + "fmt" | ||
5 | + "reflect" | ||
6 | + "strings" | ||
7 | + | ||
8 | + "github.com/beego/beego/v2/core/validation" | ||
9 | +) | ||
10 | + | ||
11 | +type RemoveCooperationContractCommand struct { | ||
12 | + // 共创合约ID | ||
13 | + CooperationContractId int64 `cname:"共创合约ID" json:"cooperationContractId" valid:"Required"` | ||
14 | + // 公司ID,通过集成REST上下文获取 | ||
15 | + CompanyId int64 `cname:"公司ID" json:"companyId" valid:"Required"` | ||
16 | + // 组织机构ID | ||
17 | + OrgId int64 `cname:"组织机构ID" json:"orgId" valid:"Required"` | ||
18 | + // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员 | ||
19 | + UserId int64 `cname:"用户ID" json:"userId" valid:"Required"` | ||
20 | + // 用户基础数据id | ||
21 | + UserBaseId int64 `cname:"用户基础数据is" json:"userBaseId" valid:"Required"` | ||
22 | +} | ||
23 | + | ||
24 | +func (removeCooperationContractCommand *RemoveCooperationContractCommand) Valid(validation *validation.Validation) { | ||
25 | + //validation.SetError("CustomValid", "未实现的自定义认证") | ||
26 | +} | ||
27 | + | ||
28 | +func (removeCooperationContractCommand *RemoveCooperationContractCommand) ValidateCommand() error { | ||
29 | + valid := validation.Validation{} | ||
30 | + b, err := valid.Valid(removeCooperationContractCommand) | ||
31 | + if err != nil { | ||
32 | + return err | ||
33 | + } | ||
34 | + if !b { | ||
35 | + elem := reflect.TypeOf(removeCooperationContractCommand).Elem() | ||
36 | + for _, validErr := range valid.Errors { | ||
37 | + field, isExist := elem.FieldByName(validErr.Field) | ||
38 | + if isExist { | ||
39 | + return fmt.Errorf(strings.Replace(validErr.Message, validErr.Field, field.Tag.Get("cname"), -1)) | ||
40 | + } else { | ||
41 | + return fmt.Errorf(validErr.Message) | ||
42 | + } | ||
43 | + } | ||
44 | + } | ||
45 | + return nil | ||
46 | +} |
1 | +package command | ||
2 | + | ||
3 | +import ( | ||
4 | + "fmt" | ||
5 | + "reflect" | ||
6 | + "strings" | ||
7 | + | ||
8 | + "github.com/beego/beego/v2/core/validation" | ||
9 | +) | ||
10 | + | ||
11 | +type UpdateCooperationContractCommand struct { | ||
12 | + // 共创合约id | ||
13 | + CooperationContractId string `cname:"共创合约id" json:"cooperationContractId" valid:"Required"` | ||
14 | + // 共创合约描述 | ||
15 | + CooperationContractDescription string `cname:"共创合约描述" json:"cooperationContractDescription,omitempty"` | ||
16 | + // 共创项目编号 | ||
17 | + CooperationProjectNumber string `cname:"共创项目编号" json:"cooperationProjectNumber"` | ||
18 | + // 部门ID | ||
19 | + DepartmentId string `cname:"部门ID" json:"departmentId" valid:"Required"` | ||
20 | + // 共创合约承接对象,1员工,2共创用户,3公开 | ||
21 | + CooperationContractUndertakerTypes []int32 `cname:"共创合约承接对象" json:"cooperationContractUndertakerTypes" valid:"Required"` | ||
22 | + // 共创合约名称 | ||
23 | + CooperationContractName string `cname:"共创合约名称" json:"cooperationContractName" valid:"Required"` | ||
24 | + // 共创合约发起人uid | ||
25 | + SponsorUid string `cname:"共创合约发起人uid" json:"sponsorUid,omitempty"` | ||
26 | + // 业绩分红激励规则列表 | ||
27 | + DividendsIncentivesRules []*CreateDividendsIncentivesRulesCommand `cname:"业绩分红激励规则列表" json:"dividendsIncentivesRules,omitempty"` | ||
28 | + // 金额激励规则列表 | ||
29 | + MoneyIncentivesRules []*CreateMoneyIncentivesRulesCommand `cname:"金额激励规则列表" json:"moneyIncentivesRules,omitempty"` | ||
30 | + // 承接方列表 | ||
31 | + Undertakers []*CreateUndertakersCommand `cname:"承接方列表" json:"undertakers" valid:"Required"` | ||
32 | + // 相关人UID列表 | ||
33 | + RelevantIds []string `cname:"相关人列表" json:"relevantIds,omitempty"` | ||
34 | + // 公司ID,通过集成REST上下文获取 | ||
35 | + CompanyId int64 `cname:"公司ID" json:"companyId" valid:"Required"` | ||
36 | + // 组织机构ID | ||
37 | + OrgId int64 `cname:"组织机构ID" json:"orgId" valid:"Required"` | ||
38 | + // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员 | ||
39 | + UserId int64 `cname:"用户ID" json:"userId" valid:"Required"` | ||
40 | + // 用户基础数据id | ||
41 | + UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId" valid:"Required"` | ||
42 | +} | ||
43 | + | ||
44 | +func (updateCooperationContractCommand *UpdateCooperationContractCommand) Valid(validation *validation.Validation) { | ||
45 | + // 激励规则自定义校验 | ||
46 | + if len(updateCooperationContractCommand.DividendsIncentivesRules) < 1 && len(updateCooperationContractCommand.MoneyIncentivesRules) < 1 { | ||
47 | + validation.Error("激励规则不能为空") | ||
48 | + } else { | ||
49 | + for i, _ := range updateCooperationContractCommand.DividendsIncentivesRules { | ||
50 | + if updateCooperationContractCommand.DividendsIncentivesRules[i].DividendsIncentivesRuleId == "" { | ||
51 | + updateCooperationContractCommand.DividendsIncentivesRules[i].DividendsIncentivesRuleId = "0" | ||
52 | + } | ||
53 | + } | ||
54 | + for j, _ := range updateCooperationContractCommand.MoneyIncentivesRules { | ||
55 | + if updateCooperationContractCommand.MoneyIncentivesRules[j].MoneyIncentivesRuleId == "" { | ||
56 | + updateCooperationContractCommand.MoneyIncentivesRules[j].MoneyIncentivesRuleId = "0" | ||
57 | + } | ||
58 | + } | ||
59 | + } | ||
60 | + // 承接人列表校验 | ||
61 | + if len(updateCooperationContractCommand.Undertakers) < 1 { | ||
62 | + validation.Error("承接人不能为空") | ||
63 | + } else { | ||
64 | + for i, _ := range updateCooperationContractCommand.Undertakers { | ||
65 | + if updateCooperationContractCommand.Undertakers[i].UndertakerId == "" { | ||
66 | + updateCooperationContractCommand.Undertakers[i].UndertakerId = "0" | ||
67 | + } | ||
68 | + } | ||
69 | + } | ||
70 | +} | ||
71 | + | ||
72 | +func (updateCooperationContractCommand *UpdateCooperationContractCommand) ValidateCommand() error { | ||
73 | + valid := validation.Validation{} | ||
74 | + b, err := valid.Valid(updateCooperationContractCommand) | ||
75 | + if err != nil { | ||
76 | + return err | ||
77 | + } | ||
78 | + if !b { | ||
79 | + elem := reflect.TypeOf(updateCooperationContractCommand).Elem() | ||
80 | + for _, validErr := range valid.Errors { | ||
81 | + field, isExist := elem.FieldByName(validErr.Field) | ||
82 | + if isExist { | ||
83 | + return fmt.Errorf(strings.Replace(validErr.Message, validErr.Field, field.Tag.Get("cname"), -1)) | ||
84 | + } else { | ||
85 | + return fmt.Errorf(validErr.Message) | ||
86 | + } | ||
87 | + } | ||
88 | + } | ||
89 | + return nil | ||
90 | +} |
1 | +package dto | ||
2 | + | ||
3 | +import ( | ||
4 | + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/domain" | ||
5 | + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/pg/models" | ||
6 | +) | ||
7 | + | ||
8 | +type CooperationContractByUndertakerDto struct { | ||
9 | + // 承接人ID | ||
10 | + UndertakerId int64 `json:"undertakerId,string"` | ||
11 | + // 承接人编号 | ||
12 | + UndertakerCode string `json:"undertakerCode"` | ||
13 | + // 承接人姓名 | ||
14 | + UndertakerName string `json:"undertakerName"` | ||
15 | + // 承接人电话 | ||
16 | + UndertakerPhone string `json:"undertakerPhone"` | ||
17 | + // 项目合约编号 | ||
18 | + CooperationContractNumber string `json:"cooperationContractNumber"` | ||
19 | + // 项目合约名称 | ||
20 | + CooperationContractName string `json:"cooperationContractName"` | ||
21 | + // 项目合约状态 | ||
22 | + CooperationContractStatus int32 `json:"cooperationContractStatus"` | ||
23 | + // 共创描述 | ||
24 | + CooperationContractDescription string `json:"cooperationContractDescription"` | ||
25 | + // 合同附件 | ||
26 | + Attachment []*domain.Attachment `json:"attachment"` | ||
27 | + // 发起人姓名 | ||
28 | + SponsorName string `json:"sponsorName"` | ||
29 | + // 发起部门名称 | ||
30 | + DepartmentName string `json:"departmentName"` | ||
31 | + // 共创模式名称 | ||
32 | + CooperationModeName string `json:"cooperationModeName"` | ||
33 | + // 组织机构名称 | ||
34 | + OrgName string `json:"orgName"` | ||
35 | +} | ||
36 | + | ||
37 | +func (dto *CooperationContractByUndertakerDto) LoadDto(contractByUndertaker *models.CooperationContractByUndertaker) error { | ||
38 | + dto.UndertakerId = contractByUndertaker.CooperationContractUndertakerId | ||
39 | + dto.UndertakerCode = contractByUndertaker.UndertakerCode | ||
40 | + dto.UndertakerName = contractByUndertaker.UndertakerName | ||
41 | + dto.UndertakerPhone = contractByUndertaker.UndertakerPhone | ||
42 | + dto.CooperationContractNumber = contractByUndertaker.CooperationContractNumber | ||
43 | + dto.CooperationContractName = contractByUndertaker.CooperationContractName | ||
44 | + dto.CooperationContractStatus = contractByUndertaker.ContractStatus | ||
45 | + dto.CooperationContractDescription = contractByUndertaker.CooperationContractDescription | ||
46 | + dto.Attachment = contractByUndertaker.ContractAttachment | ||
47 | + dto.SponsorName = contractByUndertaker.CooperationContractSponsor.UserName | ||
48 | + if contractByUndertaker.Department != nil { | ||
49 | + dto.DepartmentName = contractByUndertaker.Department.DepartmentName | ||
50 | + } | ||
51 | + dto.CooperationModeName = contractByUndertaker.CooperationModeName | ||
52 | + if contractByUndertaker.Org != nil { | ||
53 | + dto.OrgName = contractByUndertaker.Org.OrgName | ||
54 | + } | ||
55 | + return nil | ||
56 | +} |
1 | +package dto | ||
2 | + | ||
3 | +import "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/domain" | ||
4 | + | ||
5 | +type CooperationContractDto struct { | ||
6 | + *domain.CooperationContract | ||
7 | + // 可以去除勾选的共创项目承接对象列表 | ||
8 | + UndertakerTypesUncheckedAvailable []int32 `json:"undertakerTypesUncheckedAvailable"` | ||
9 | +} | ||
10 | + | ||
11 | +func (dto *CooperationContractDto) LoadDto(contract *domain.CooperationContract, undertakerTypesUncheckedAvailable []int32) error { | ||
12 | + dto.CooperationContract = contract | ||
13 | + dto.UndertakerTypesUncheckedAvailable = undertakerTypesUncheckedAvailable | ||
14 | + return nil | ||
15 | +} |
1 | +package query | ||
2 | + | ||
3 | +import ( | ||
4 | + "fmt" | ||
5 | + "reflect" | ||
6 | + "strings" | ||
7 | + | ||
8 | + "github.com/beego/beego/v2/core/validation" | ||
9 | +) | ||
10 | + | ||
11 | +type GetCooperationContractQuery struct { | ||
12 | + // 共创合约ID | ||
13 | + CooperationContractId int64 `cname:"共创合约ID" json:"cooperationContractId" valid:"Required"` | ||
14 | + // 发起人uid | ||
15 | + SponsorUid string `cname:"发起人UID" json:"sponsorUid,omitempty"` | ||
16 | + // 公司ID,通过集成REST上下文获取 | ||
17 | + CompanyId int64 `cname:"公司ID" json:"companyId" valid:"Required"` | ||
18 | + // 组织机构ID | ||
19 | + OrgId int64 `cname:"组织机构ID" json:"orgId" valid:"Required"` | ||
20 | + // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员 | ||
21 | + UserId int64 `cname:"用户ID" json:"userId" valid:"Required"` | ||
22 | + // 用户基础数据id | ||
23 | + UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId" valid:"Required"` | ||
24 | +} | ||
25 | + | ||
26 | +func (getCooperationContractQuery *GetCooperationContractQuery) Valid(validation *validation.Validation) { | ||
27 | + //validation.SetError("CustomValid", "未实现的自定义认证") | ||
28 | +} | ||
29 | + | ||
30 | +func (getCooperationContractQuery *GetCooperationContractQuery) ValidateQuery() error { | ||
31 | + valid := validation.Validation{} | ||
32 | + b, err := valid.Valid(getCooperationContractQuery) | ||
33 | + if err != nil { | ||
34 | + return err | ||
35 | + } | ||
36 | + if !b { | ||
37 | + elem := reflect.TypeOf(getCooperationContractQuery).Elem() | ||
38 | + for _, validErr := range valid.Errors { | ||
39 | + field, isExist := elem.FieldByName(validErr.Field) | ||
40 | + if isExist { | ||
41 | + return fmt.Errorf(strings.Replace(validErr.Message, validErr.Field, field.Tag.Get("cname"), -1)) | ||
42 | + } else { | ||
43 | + return fmt.Errorf(validErr.Message) | ||
44 | + } | ||
45 | + } | ||
46 | + } | ||
47 | + return nil | ||
48 | +} |
1 | +package query | ||
2 | + | ||
3 | +import ( | ||
4 | + "fmt" | ||
5 | + "reflect" | ||
6 | + "strings" | ||
7 | + | ||
8 | + "github.com/beego/beego/v2/core/validation" | ||
9 | +) | ||
10 | + | ||
11 | +type ListCooperationContractQuery struct { | ||
12 | + // 页面大小 | ||
13 | + PageNumber int64 `cname:"页码" json:"pageNumber,omitempty"` | ||
14 | + // 页面大小 | ||
15 | + PageSize int64 `cname:"页面大小" json:"pageSize,omitempty"` | ||
16 | + // 公司ID,通过集成REST上下文获取 | ||
17 | + CompanyId int64 `cname:"公司ID" json:"companyId" valid:"Required"` | ||
18 | + // 组织机构ID | ||
19 | + OrgId int64 `cname:"组织机构ID" json:"orgId"` | ||
20 | + // 关联的组织机构ID列表 | ||
21 | + OrgIds []int64 `cname:"关联的组织机构ID列表" json:"orgIds"` | ||
22 | + // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员 | ||
23 | + UserId int64 `cname:"用户ID" json:"userId"` | ||
24 | + // 用户基础数据id | ||
25 | + UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId"` | ||
26 | +} | ||
27 | + | ||
28 | +func (listCooperationContractQuery *ListCooperationContractQuery) Valid(validation *validation.Validation) { | ||
29 | + //validation.SetError("CustomValid", "未实现的自定义认证") | ||
30 | +} | ||
31 | + | ||
32 | +func (listCooperationContractQuery *ListCooperationContractQuery) ValidateQuery() error { | ||
33 | + valid := validation.Validation{} | ||
34 | + b, err := valid.Valid(listCooperationContractQuery) | ||
35 | + if err != nil { | ||
36 | + return err | ||
37 | + } | ||
38 | + if !b { | ||
39 | + elem := reflect.TypeOf(listCooperationContractQuery).Elem() | ||
40 | + for _, validErr := range valid.Errors { | ||
41 | + field, isExist := elem.FieldByName(validErr.Field) | ||
42 | + if isExist { | ||
43 | + return fmt.Errorf(strings.Replace(validErr.Message, validErr.Field, field.Tag.Get("cname"), -1)) | ||
44 | + } else { | ||
45 | + return fmt.Errorf(validErr.Message) | ||
46 | + } | ||
47 | + } | ||
48 | + } | ||
49 | + return nil | ||
50 | +} |
1 | +package query | ||
2 | + | ||
3 | +import ( | ||
4 | + "fmt" | ||
5 | + "reflect" | ||
6 | + "strings" | ||
7 | + | ||
8 | + "github.com/beego/beego/v2/core/validation" | ||
9 | +) | ||
10 | + | ||
11 | +type SearchCooperationContractQuery struct { | ||
12 | + // 页面大小 | ||
13 | + PageSize int64 `cname:"页面大小" json:"pageSize,omitempty"` | ||
14 | + // 页面大小 | ||
15 | + PageNumber int64 `cname:"页码" json:"pageNumber,omitempty"` | ||
16 | + // 共创合约编号 | ||
17 | + CooperationContractNumber string `cname:"共创合约编号" json:"cooperationContractNumber,omitempty"` | ||
18 | + // 发起人姓名 | ||
19 | + SponsorName string `cname:"发起人姓名" json:"sponsorName,omitempty"` | ||
20 | + // 激励类型 | ||
21 | + IncentivesType int32 `cname:"激励类型" json:"incentivesType,omitempty"` | ||
22 | + // 合约状态 | ||
23 | + Status int32 `cname:"合约状态" json:"status,omitempty"` | ||
24 | + // 公司ID,通过集成REST上下文获取 | ||
25 | + CompanyId int64 `cname:"公司ID" json:"companyId"` | ||
26 | + // 组织机构ID | ||
27 | + OrgId int64 `cname:"组织机构ID" json:"orgId"` | ||
28 | + // 关联的组织机构ID列表 | ||
29 | + OrgIds []int64 `cname:"关联的组织机构ID列表" json:"orgIds"` | ||
30 | + // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员 | ||
31 | + UserId int64 `cname:"用户ID" json:"userId"` | ||
32 | + // 用户基础数据id | ||
33 | + UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId"` | ||
34 | +} | ||
35 | + | ||
36 | +func (searchCooperationContractQuery *SearchCooperationContractQuery) Valid(validation *validation.Validation) { | ||
37 | +} | ||
38 | + | ||
39 | +func (searchCooperationContractQuery *SearchCooperationContractQuery) ValidateQuery() error { | ||
40 | + valid := validation.Validation{} | ||
41 | + b, err := valid.Valid(searchCooperationContractQuery) | ||
42 | + if err != nil { | ||
43 | + return err | ||
44 | + } | ||
45 | + if !b { | ||
46 | + elem := reflect.TypeOf(searchCooperationContractQuery).Elem() | ||
47 | + for _, validErr := range valid.Errors { | ||
48 | + field, isExist := elem.FieldByName(validErr.Field) | ||
49 | + if isExist { | ||
50 | + return fmt.Errorf(strings.Replace(validErr.Message, validErr.Field, field.Tag.Get("cname"), -1)) | ||
51 | + } else { | ||
52 | + return fmt.Errorf(validErr.Message) | ||
53 | + } | ||
54 | + } | ||
55 | + } | ||
56 | + return nil | ||
57 | +} |
1 | +package query | ||
2 | + | ||
3 | +import ( | ||
4 | + "fmt" | ||
5 | + "reflect" | ||
6 | + "strings" | ||
7 | + | ||
8 | + "github.com/beego/beego/v2/core/validation" | ||
9 | +) | ||
10 | + | ||
11 | +type SearchCooperationContractByUndertakerQuery struct { | ||
12 | + // 共创合约名称 | ||
13 | + CooperationContractName string `cname:"共创合约名称" json:"cooperationContractName,omitempty"` | ||
14 | + // 项目发起人姓名 | ||
15 | + SponsorName string `cname:"项目发起人姓名" json:"sponsorName,omitempty"` | ||
16 | + // 公司ID,通过集成REST上下文获取 | ||
17 | + CompanyId int64 `cname:"公司ID" json:"companyId"` | ||
18 | + // 组织机构ID | ||
19 | + OrgId int64 `cname:"组织机构ID" json:"orgId"` | ||
20 | + // 关联的组织机构ID列表 | ||
21 | + OrgIds []int64 `cname:"关联的组织机构ID列表" json:"orgIds"` | ||
22 | + // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员 | ||
23 | + UserId int64 `cname:"用户ID" json:"userId"` | ||
24 | + // 用户基础数据id | ||
25 | + UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId"` | ||
26 | + // 页面大小 | ||
27 | + PageNumber int64 `cname:"页码" json:"pageNumber,omitempty"` | ||
28 | + // 页面大小 | ||
29 | + PageSize int64 `cname:"页面大小" json:"pageSize,omitempty"` | ||
30 | +} | ||
31 | + | ||
32 | +func (searchCooperationContractByUndertakerQuery *SearchCooperationContractByUndertakerQuery) Valid(validation *validation.Validation) { | ||
33 | + //validation.SetError("CustomValid", "未实现的自定义认证") | ||
34 | +} | ||
35 | + | ||
36 | +func (searchCooperationContractByUndertakerQuery *SearchCooperationContractByUndertakerQuery) ValidateQuery() error { | ||
37 | + valid := validation.Validation{} | ||
38 | + b, err := valid.Valid(searchCooperationContractByUndertakerQuery) | ||
39 | + if err != nil { | ||
40 | + return err | ||
41 | + } | ||
42 | + if !b { | ||
43 | + elem := reflect.TypeOf(searchCooperationContractByUndertakerQuery).Elem() | ||
44 | + for _, validErr := range valid.Errors { | ||
45 | + field, isExist := elem.FieldByName(validErr.Field) | ||
46 | + if isExist { | ||
47 | + return fmt.Errorf(strings.Replace(validErr.Message, validErr.Field, field.Tag.Get("cname"), -1)) | ||
48 | + } else { | ||
49 | + return fmt.Errorf(validErr.Message) | ||
50 | + } | ||
51 | + } | ||
52 | + } | ||
53 | + return nil | ||
54 | +} |
-
请 注册 或 登录 后发表评论