作者 Administrator

合并分支 'dev' 到 'test'

Dev



查看合并请求 !1
正在显示 67 个修改的文件 包含 3736 行增加38 行删除

要显示太多修改。

为保证性能只显示 67 of 67+ 个文件。

不能预览此文件类型
@@ -15,7 +15,7 @@ logrus.log @@ -15,7 +15,7 @@ logrus.log
15 *.local 15 *.local
16 *.dev 16 *.dev
17 *.test 17 *.test
18 -.idea 18 +#.idea
19 .vscode 19 .vscode
20 .log 20 .log
21 *.tmp 21 *.tmp
  1 +# Default ignored files
  2 +/shelf/
  3 +/workspace.xml
  4 +# Datasource local storage ignored files
  5 +/dataSources/
  6 +/dataSources.local.xml
  7 +# Editor-based HTTP Client requests
  8 +/httpRequests/
  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>
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<project version="4">
  3 + <component name="CodeStream">
  4 + <option name="webViewContext" value="{&quot;chatProviderAccess&quot;:&quot;strict&quot;,&quot;currentTeamId&quot;:&quot;&quot;,&quot;currentStreamId&quot;:&quot;&quot;,&quot;pullRequestCheckoutBranch&quot;:false,&quot;isRepositioning&quot;:false,&quot;onboardStep&quot;:0,&quot;panelStack&quot;:[&quot;landing-redirect&quot;],&quot;hasFocus&quot;:false,&quot;channelFilter&quot;:&quot;all&quot;,&quot;channelsMuteAll&quot;:false,&quot;codemarkFileFilter&quot;:&quot;all&quot;,&quot;codemarkTypeFilter&quot;:&quot;all&quot;,&quot;codemarkTagFilter&quot;:&quot;all&quot;,&quot;codemarkBranchFilter&quot;:&quot;all&quot;,&quot;codemarkAuthorFilter&quot;:&quot;all&quot;,&quot;codemarksFileViewStyle&quot;:&quot;inline&quot;,&quot;codemarksShowArchived&quot;:false,&quot;codemarksShowResolved&quot;:false,&quot;codemarksWrapComments&quot;:false,&quot;showFeedbackSmiley&quot;:true,&quot;route&quot;:{&quot;name&quot;:&quot;newUserEntry&quot;,&quot;params&quot;:{}},&quot;spatialViewShowPRComments&quot;:false}" />
  5 + </component>
  6 +</project>
  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>
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<project version="4">
  3 + <component name="VcsDirectoryMappings">
  4 + <mapping directory="$PROJECT_DIR$" vcs="Git" />
  5 + </component>
  6 +</project>
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<project version="4">
  3 + <component name="ProjectTasksOptions">
  4 + <enabled-global>
  5 + <option value="go fmt" />
  6 + </enabled-global>
  7 + </component>
  8 +</project>
  1 +<component name="ProjectRunConfigurationManager">
  2 + <configuration default="false" name="Docker for Mac" type="docker-deploy" factoryName="dockerfile" server-name="Docker for Mac">
  3 + <deployment type="dockerfile">
  4 + <settings>
  5 + <option name="imageTag" value="" />
  6 + <option name="containerName" value="allied-creation-cooperation" />
  7 + <option name="sourceFilePath" value="Dockerfile" />
  8 + </settings>
  9 + </deployment>
  10 + <method v="2" />
  11 + </configuration>
  12 +</component>
  1 +FROM golang:latest
  2 +MAINTAINER 陈志颖 <steve.d.chan@qq.com>
  3 +ENV APP_DIR $GOPATH/src/allied-creation-cooperation
  4 +RUN mkdir -p $APP_DIR
  5 +WORKDIR $APP_DIR/
  6 +COPY ./pkg pkg
  7 +# COPY ./conf conf
  8 +COPY ./go.mod go.mod
  9 +COPY ./go.sum go.sum
  10 +COPY ./main.go main.go
  11 +RUN ["ln","-sf","/usr/share/zoneinfo/Asia/Shanghai","/etc/localtime"]
  12 +ENV GO111MODULE on
  13 +ENV GOPROXY https://goproxy.io
  14 +RUN ["go","mod","tidy"]
  15 +RUN ["ls"]
  16 +RUN ["go","build"]
  17 +ENTRYPOINT ["./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章节
  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: ERROR_BASE_CODE
  58 + value: "1"
  59 + - name: ERROR_BASE_CODE_MULTIPLE
  60 + value: "1000"
  61 + - name: USER_MODULE_HOST
  62 + value: "http://allied-creation-user-dev.fjmaimaimai.com"
  63 + - name: REDIS_HOST
  64 + valueFrom:
  65 + configMapKeyRef:
  66 + name: suplus-config
  67 + key: redis.ip
  68 + - name: REDIS_PORT
  69 + valueFrom:
  70 + configMapKeyRef:
  71 + name: suplus-config
  72 + key: redis.port
  73 + - name: POSTGRESQL_DB_NAME
  74 + valueFrom:
  75 + configMapKeyRef:
  76 + name: suplus-config
  77 + key: postgresqlalliedcreationcooperation.dbname
  78 + - name: POSTGRESQL_USER
  79 + valueFrom:
  80 + configMapKeyRef:
  81 + name: suplus-config
  82 + key: postgresql.user
  83 + - name: POSTGRESQL_PASSWORD
  84 + valueFrom:
  85 + configMapKeyRef:
  86 + name: suplus-config
  87 + key: postgresql.password
  88 + - name: POSTGRESQL_HOST
  89 + valueFrom:
  90 + configMapKeyRef:
  91 + name: suplus-config
  92 + key: postgresql.host
  93 + - name: POSTGRESQL_PORT
  94 + valueFrom:
  95 + configMapKeyRef:
  96 + name: suplus-config
  97 + key: postgresql.port
  98 + volumes:
  99 + - name: accesslogs
  100 + emptyDir: {}
  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: {}
  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: <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: {}
  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/prd/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/prd/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/prd/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 -version: v1  
2 -kind: Attribute  
3 -metadata:  
4 - name: count  
5 - description: 匹配数目  
6 - type:  
7 - primitive: int64  
1 -version: v1  
2 -kind: Attribute  
3 -metadata:  
4 - name: limit  
5 - description: 查询限制  
6 - type:  
7 - primitive: int  
1 -version: v1  
2 -kind: Attribute  
3 -metadata:  
4 - name: offset  
5 - description: 查询偏离量  
6 - type:  
7 - primitive: int  
1 -version: v1  
2 -kind: Project  
3 -metadata:  
4 - name: allied-creation-cooperation  
5 - description: 天联共创  
6 - version: 0.0.1  
7 - repository: gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation  
8 - contact:  
9 - name: 陈志颖  
10 - email: steve.d.chan@qq.com  
此 diff 太大无法显示。
此 diff 太大无法显示。
此 diff 太大无法显示。
此 diff 太大无法显示。
此 diff 太大无法显示。
此 diff 太大无法显示。
此 diff 太大无法显示。
此 diff 太大无法显示。
此 diff 太大无法显示。
  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-querystring v1.1.0 // indirect
  14 + github.com/gorilla/websocket v1.4.2 // indirect
  15 + github.com/imkira/go-interpol v1.1.0 // indirect
  16 + github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88 // indirect
  17 + github.com/linmadan/egglib-go v0.0.0-20210527091316-06b0732fb5f6
  18 + github.com/mattn/go-colorable v0.1.8 // indirect
  19 + github.com/moul/http2curl v1.0.0 // indirect
  20 + github.com/onsi/ginkgo v1.14.2
  21 + github.com/onsi/gomega v1.10.3
  22 + github.com/sergi/go-diff v1.2.0 // indirect
  23 + github.com/shopspring/decimal v1.2.0
  24 + github.com/sirupsen/logrus v1.8.1 // indirect
  25 + github.com/smartystreets/goconvey v1.6.4 // indirect
  26 + github.com/valyala/fasthttp v1.28.0 // indirect
  27 + github.com/xeipuuv/gojsonschema v1.2.0 // indirect
  28 + github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0 // indirect
  29 + github.com/yudai/gojsondiff v1.0.0 // indirect
  30 + github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82 // indirect
  31 + github.com/yudai/pp v2.0.1+incompatible // indirect
  32 +)
  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/go.mod h1:UwaDJsD3rWLM5rKNFzv9hgox93HoX8utj1kxD9aFUcI=
  53 +github.com/elazarl/go-bindata-assetfs v1.0.0 h1:G/bYguwHIzWq9ZoyUQqrjTmJbbYn3j3CKKpKinvZLFk=
  54 +github.com/elazarl/go-bindata-assetfs v1.0.0/go.mod h1:v+YaWX3bdea5J/mo8dSETolEo7R71Vk1u8bnjau5yw4=
  55 +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
  56 +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
  57 +github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072 h1:DddqAaWDpywytcG8w/qoQ5sAN8X12d3Z3koB0C3Rxsc=
  58 +github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8=
  59 +github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo=
  60 +github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M=
  61 +github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw=
  62 +github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g=
  63 +github.com/frankban/quicktest v1.4.1 h1:Wv2VwvNn73pAdFIVUQRXYDFp31lXKbqblIXo/Q5GPSg=
  64 +github.com/frankban/quicktest v1.4.1/go.mod h1:36zfPVQyHxymz4cH7wlDmVwDrJuljRB60qkgn7rorfQ=
  65 +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
  66 +github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4=
  67 +github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
  68 +github.com/gavv/httpexpect v2.0.0+incompatible h1:1X9kcRshkSKEjNJJxX9Y9mQ5BRfbxU5kORdjhlA1yX8=
  69 +github.com/gavv/httpexpect v2.0.0+incompatible/go.mod h1:x+9tiU1YnrOvnB725RkpoLv1M62hOWzwo5OXotisrKc=
  70 +github.com/glendc/gopher-json v0.0.0-20170414221815-dc4743023d0c/go.mod h1:Gja1A+xZ9BoviGJNA2E9vFkPjjsl+CoJxSXiQM1UXtw=
  71 +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
  72 +github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
  73 +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
  74 +github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
  75 +github.com/go-pg/pg/v10 v10.7.7 h1:jPooLMqrVVV5Ejpcxpwxv9R2gECT/+UEpz+qIzOUJ9A=
  76 +github.com/go-pg/pg/v10 v10.7.7/go.mod h1:d0w17Xw5x2DtbD/UgB9rnZg3FAck3eDHXff0Srrzuuk=
  77 +github.com/go-pg/zerochecker v0.2.0 h1:pp7f72c3DobMWOb2ErtZsnrPaSvHd2W4o9//8HtF4mU=
  78 +github.com/go-pg/zerochecker v0.2.0/go.mod h1:NJZ4wKL0NmTtz0GKCoJ8kym6Xn/EQzXRl2OnAe7MmDo=
  79 +github.com/go-redis/redis v6.14.2+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA=
  80 +github.com/go-redis/redis/v7 v7.4.0/go.mod h1:JDNMw23GTyLNC4GZu9njt15ctBQVn7xjRfnwdHj/Dcg=
  81 +github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs=
  82 +github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
  83 +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
  84 +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
  85 +github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
  86 +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
  87 +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
  88 +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
  89 +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
  90 +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
  91 +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
  92 +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
  93 +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
  94 +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
  95 +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
  96 +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
  97 +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
  98 +github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM=
  99 +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
  100 +github.com/golang/snappy v0.0.0-20170215233205-553a64147049/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
  101 +github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
  102 +github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
  103 +github.com/golang/snappy v0.0.3 h1:fHPg5GQYlCeLIPB9BZqMVR5nR9A+IM5zcgeTdjMYmLA=
  104 +github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
  105 +github.com/gomodule/redigo v2.0.0+incompatible/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4=
  106 +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
  107 +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
  108 +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
  109 +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
  110 +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
  111 +github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
  112 +github.com/google/go-cmp v0.5.4 h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M=
  113 +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
  114 +github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8=
  115 +github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU=
  116 +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
  117 +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
  118 +github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY=
  119 +github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
  120 +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8=
  121 +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
  122 +github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc=
  123 +github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
  124 +github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
  125 +github.com/hashicorp/go-uuid v1.0.1 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE=
  126 +github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
  127 +github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc=
  128 +github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
  129 +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
  130 +github.com/imkira/go-interpol v1.1.0 h1:KIiKr0VSG2CUW1hl1jpiyuzuJeKUUpC8iM1AIE7N1Vk=
  131 +github.com/imkira/go-interpol v1.1.0/go.mod h1:z0h2/2T3XF8kyEPpRgJ3kmNv+C43p+I/CoI+jC3w2iA=
  132 +github.com/jcmturner/gofork v0.0.0-20190328161633-dc7c13fece03 h1:FUwcHNlEqkqLjLBdCp5PRlCFijNjvcYANOZXzCfXwCM=
  133 +github.com/jcmturner/gofork v0.0.0-20190328161633-dc7c13fece03/go.mod h1:MK8+TM0La+2rjBD4jE12Kj1pCCxK7d2LK/UM3ncEo0o=
  134 +github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E=
  135 +github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
  136 +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
  137 +github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
  138 +github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo=
  139 +github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
  140 +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
  141 +github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88 h1:uC1QfSlInpQF+M0ao65imhwqKnz3Q2z/d8PWZRMQvDM=
  142 +github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k=
  143 +github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=
  144 +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
  145 +github.com/klauspost/compress v1.9.7/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A=
  146 +github.com/klauspost/compress v1.12.2 h1:2KCfW3I9M7nSc5wOqXAlW2v2U6v+w6cbjvbfp+OykW8=
  147 +github.com/klauspost/compress v1.12.2/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg=
  148 +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
  149 +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
  150 +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
  151 +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
  152 +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
  153 +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
  154 +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
  155 +github.com/ledisdb/ledisdb v0.0.0-20200510135210-d35789ec47e6/go.mod h1:n931TsDuKuq+uX4v1fulaMbA/7ZLLhjc85h7chZGBCQ=
  156 +github.com/lib/pq v1.0.0 h1:X5PMW56eZitiTeO7tKzZxFCSpbFZJtkMMooicw2us9A=
  157 +github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
  158 +github.com/linmadan/egglib-go v0.0.0-20210527091316-06b0732fb5f6 h1:nyhVnOIXsESuhZ95Ak6VRSF+0fHeKlYWq0EvHByt5RU=
  159 +github.com/linmadan/egglib-go v0.0.0-20210527091316-06b0732fb5f6/go.mod h1:ZZuSWicGxpgN0OulARhuKwFJuJ9we0otaPVAJtz10yk=
  160 +github.com/magefile/mage v1.10.0/go.mod h1:z5UZb/iS3GoOSn0JgWuiw7dxlurVYTu+/jHXqQg881A=
  161 +github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8=
  162 +github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
  163 +github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY=
  164 +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
  165 +github.com/mattn/go-sqlite3 v2.0.3+incompatible h1:gXHsfypPkaMZrKbD5209QV9jbUTJKjyR5WD3HYQSd+U=
  166 +github.com/mattn/go-sqlite3 v2.0.3+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
  167 +github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU=
  168 +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
  169 +github.com/mitchellh/mapstructure v1.3.3 h1:SzB1nHZ2Xi+17FP0zVQBHIZqvwRN9408fJO8h+eeNA8=
  170 +github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
  171 +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
  172 +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
  173 +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
  174 +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
  175 +github.com/moul/http2curl v1.0.0 h1:dRMWoAtb+ePxMlLkrCbAqh4TlPHXvoGUSQ323/9Zahs=
  176 +github.com/moul/http2curl v1.0.0/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOAZ3H0fQ=
  177 +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
  178 +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
  179 +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
  180 +github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78=
  181 +github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
  182 +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
  183 +github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
  184 +github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg=
  185 +github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk=
  186 +github.com/onsi/ginkgo v1.14.2 h1:8mVmC9kjFFmA8H4pKMUhcblgifdkOIXPvbhN1T36q1M=
  187 +github.com/onsi/ginkgo v1.14.2/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY=
  188 +github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
  189 +github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
  190 +github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
  191 +github.com/onsi/gomega v1.10.3 h1:gph6h/qe9GSUw1NhH1gp+qb+h8rXD8Cy60Z32Qw3ELA=
  192 +github.com/onsi/gomega v1.10.3/go.mod h1:V9xEwhxec5O8UDM77eCW8vLymOMltsqPVYWrpDsH8xc=
  193 +github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc=
  194 +github.com/pelletier/go-toml v1.0.1/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
  195 +github.com/pelletier/go-toml v1.8.1/go.mod h1:T2/BmBdy8dvIRq1a/8aqjN41wvWlN4lrapLU/GW4pbc=
  196 +github.com/peterh/liner v1.0.1-0.20171122030339-3681c2a91233/go.mod h1:xIteQHvHuaLYG9IFj6mSxM0fCKrs34IrEQUhOYuGPHc=
  197 +github.com/pierrec/lz4 v2.2.6+incompatible h1:6aCX4/YZ9v8q69hTyiR7dNLnTA3fgtKHVVW5BCd5Znw=
  198 +github.com/pierrec/lz4 v2.2.6+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
  199 +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
  200 +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
  201 +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
  202 +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
  203 +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
  204 +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
  205 +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
  206 +github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
  207 +github.com/prometheus/client_golang v1.7.0 h1:wCi7urQOGBsYcQROHqpUUX4ct84xp40t9R9JX0FuA/U=
  208 +github.com/prometheus/client_golang v1.7.0/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M=
  209 +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
  210 +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
  211 +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
  212 +github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M=
  213 +github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
  214 +github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
  215 +github.com/prometheus/common v0.10.0 h1:RyRA7RzGXQZiW+tGMr7sxa85G1z0yOpM1qq5c8lNawc=
  216 +github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo=
  217 +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
  218 +github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
  219 +github.com/prometheus/procfs v0.1.3 h1:F0+tqvhOksq22sc6iCHF5WGlWjdwj92p0udFh1VFBS8=
  220 +github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU=
  221 +github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a h1:9ZKAASQSHhDYGoxY8uLVpewe1GDZ2vu2Tr/vTdVAkFQ=
  222 +github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
  223 +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
  224 +github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ=
  225 +github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
  226 +github.com/shiena/ansicolor v0.0.0-20151119151921-a422bbe96644 h1:X+yvsM2yrEktyI+b2qND5gpH8YhURn0k8OCaeRnkINo=
  227 +github.com/shiena/ansicolor v0.0.0-20151119151921-a422bbe96644/go.mod h1:nkxAfR/5quYxwPZhyDxgasBMnRtBZd0FCEpawpjMUFg=
  228 +github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ=
  229 +github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
  230 +github.com/siddontang/go v0.0.0-20170517070808-cb568a3e5cc0/go.mod h1:3yhqj7WBBfRhbBlzyOC3gUxftwsU0u8gqevxwIHQpMw=
  231 +github.com/siddontang/goredis v0.0.0-20150324035039-760763f78400/go.mod h1:DDcKzU3qCuvj/tPnimWSsZZzvk9qvkvrIL5naVBPh5s=
  232 +github.com/siddontang/rdb v0.0.0-20150307021120-fc89ed2e418d/go.mod h1:AMEsy7v5z92TR1JKMkLLoaOQk++LVnOKL3ScbJ8GNGA=
  233 +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
  234 +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
  235 +github.com/sirupsen/logrus v1.8.0/go.mod h1:4GuYW9TZmE769R5STWrRakJc4UqQ3+QQ95fyz7ENv1A=
  236 +github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE=
  237 +github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
  238 +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM=
  239 +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
  240 +github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s=
  241 +github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
  242 +github.com/ssdb/gossdb v0.0.0-20180723034631-88f6b59b84ec/go.mod h1:QBvMkMya+gXctz3kmljlUCu/yB3GZ6oee+dUozsezQE=
  243 +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
  244 +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
  245 +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
  246 +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
  247 +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
  248 +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
  249 +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
  250 +github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
  251 +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
  252 +github.com/syndtr/goleveldb v0.0.0-20160425020131-cfa635847112/go.mod h1:Z4AUp2Km+PwemOoO/VB5AOx9XSsIItzFjoJlOSiYmn0=
  253 +github.com/syndtr/goleveldb v0.0.0-20181127023241-353a9fca669c/go.mod h1:Z4AUp2Km+PwemOoO/VB5AOx9XSsIItzFjoJlOSiYmn0=
  254 +github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc h1:9lRDQMhESg+zvGYmW5DyG0UqvY96Bu5QYsTLvCHdrgo=
  255 +github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc/go.mod h1:bciPuU6GHm1iF1pBvUfxfsH0Wmnc2VbpgvbI9ZWuIRs=
  256 +github.com/ugorji/go v0.0.0-20171122102828-84cb69a8af83/go.mod h1:hnLbHMwcvSihnDhEfx2/BzKp2xb0Y+ErdfYcrs9tkJQ=
  257 +github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
  258 +github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
  259 +github.com/valyala/fasthttp v1.28.0 h1:ruVmTmZaBR5i67NqnjvvH5gEv0zwHfWtbjoyW98iho4=
  260 +github.com/valyala/fasthttp v1.28.0/go.mod h1:cmWIqlu99AO/RKcp1HWaViTqc57FswJOfYYdPJBl8BA=
  261 +github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc=
  262 +github.com/vmihailenco/bufpool v0.1.11 h1:gOq2WmBrq0i2yW5QJ16ykccQ4wH9UyEsgLm6czKAd94=
  263 +github.com/vmihailenco/bufpool v0.1.11/go.mod h1:AFf/MOy3l2CFTKbxwt0mp2MwnqjNEs5H/UxrkA5jxTQ=
  264 +github.com/vmihailenco/msgpack/v5 v5.2.0 h1:ZhIAtVUP1mme8GIlpiAnmTzjSWMexA/uNF2We85DR0w=
  265 +github.com/vmihailenco/msgpack/v5 v5.2.0/go.mod h1:fEM7KuHcnm0GvDCztRpw9hV0PuoO2ciTismP6vjggcM=
  266 +github.com/vmihailenco/tagparser v0.1.2 h1:gnjoVuB/kljJ5wICEEOpx98oXMWPLj22G67Vbd1qPqc=
  267 +github.com/vmihailenco/tagparser v0.1.2/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI=
  268 +github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g=
  269 +github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds=
  270 +github.com/wendal/errors v0.0.0-20130201093226-f66c77a7882b/go.mod h1:Q12BUT7DqIlHRmgv3RskH+UCM/4eqVMgI0EMmlSpAXc=
  271 +github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I=
  272 +github.com/xdg/stringprep v1.0.0/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y=
  273 +github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f h1:J9EGpcZtP0E/raorCMxlFGSTBrsSlaDGf3jU/qvAE2c=
  274 +github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
  275 +github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0=
  276 +github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ=
  277 +github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74=
  278 +github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y=
  279 +github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0 h1:6fRhSjgLCkTD3JnJxvaJ4Sj+TYblw757bqYgZaOq5ZY=
  280 +github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0/go.mod h1:/LWChgwKmvncFJFHJ7Gvn9wZArjbV5/FppcK2fKk/tI=
  281 +github.com/yudai/gojsondiff v1.0.0 h1:27cbfqXLVEJ1o8I6v3y9lg8Ydm53EKqHXAOMxEGlCOA=
  282 +github.com/yudai/gojsondiff v1.0.0/go.mod h1:AY32+k2cwILAkW1fbgxQ5mUmMiZFgLIV+FBNExI05xg=
  283 +github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82 h1:BHyfKlQyqbsFN5p3IfnEUduWvb9is428/nNb5L3U01M=
  284 +github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82/go.mod h1:lgjkn3NuSvDfVJdfcVVdX+jpBxNmX4rDAzaS45IcYoM=
  285 +github.com/yudai/pp v2.0.1+incompatible h1:Q4//iY4pNF6yPLZIigmvcl7k/bPgrcTPIFIcmawg5bI=
  286 +github.com/yudai/pp v2.0.1+incompatible/go.mod h1:PuxR/8QJ7cyCkFp/aUDS+JY727OFEZkTdatxwunjIkc=
  287 +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
  288 +github.com/yuin/gopher-lua v0.0.0-20171031051903-609c9cd26973/go.mod h1:aEV29XrmTYFr3CiRxZeGHpkvbwq+prZduBqMaascyCU=
  289 +go.etcd.io/etcd v3.3.25+incompatible/go.mod h1:yaeTdrJi5lOmYerz05bd8+V7KubZs8YSFZfzsF9A6aI=
  290 +go.opentelemetry.io/otel v0.17.0 h1:6MKOu8WY4hmfpQ4oQn34u6rYhnf2sWf1LXYO/UFm71U=
  291 +go.opentelemetry.io/otel v0.17.0/go.mod h1:Oqtdxmf7UtEvL037ohlgnaYa1h7GtMh0NcSd9eqkC9s=
  292 +go.opentelemetry.io/otel/metric v0.17.0 h1:t+5EioN8YFXQ2EH+1j6FHCKMUj+57zIDSnSGr/mWuug=
  293 +go.opentelemetry.io/otel/metric v0.17.0/go.mod h1:hUz9lH1rNXyEwWAhIWCMFWKhYtpASgSnObJFnU26dJ0=
  294 +go.opentelemetry.io/otel/oteltest v0.17.0 h1:TyAihUowTDLqb4+m5ePAsR71xPJaTBJl4KDArIdi9k4=
  295 +go.opentelemetry.io/otel/oteltest v0.17.0/go.mod h1:JT/LGFxPwpN+nlsTiinSYjdIx3hZIGqHCpChcIZmdoE=
  296 +go.opentelemetry.io/otel/trace v0.17.0 h1:SBOj64/GAOyWzs5F680yW1ITIfJkm6cJWL2YAvuL9xY=
  297 +go.opentelemetry.io/otel/trace v0.17.0/go.mod h1:bIujpqg6ZL6xUTubIUgziI1jSaUPthmabA/ygf/6Cfg=
  298 +go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
  299 +go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU=
  300 +go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA=
  301 +go.uber.org/zap v1.15.0/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc=
  302 +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
  303 +golang.org/x/crypto v0.0.0-20180910181607-0e37d006457b/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
  304 +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
  305 +golang.org/x/crypto v0.0.0-20190404164418-38d8ce5564a5/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE=
  306 +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
  307 +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
  308 +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
  309 +golang.org/x/crypto v0.0.0-20210218145215-b8e89b74b9df/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
  310 +golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a h1:kr2P4QFmQr29mSLA43kwrOcgcReGTfbE9N577tCTuBc=
  311 +golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8=
  312 +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
  313 +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
  314 +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
  315 +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
  316 +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
  317 +golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
  318 +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
  319 +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
  320 +golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4=
  321 +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
  322 +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
  323 +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
  324 +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
  325 +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
  326 +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
  327 +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
  328 +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
  329 +golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
  330 +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
  331 +golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
  332 +golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
  333 +golang.org/x/net v0.0.0-20201006153459-a7d1128ccaa0/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
  334 +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
  335 +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
  336 +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
  337 +golang.org/x/net v0.0.0-20210510120150-4163338589ed h1:p9UgmWI9wKpfYmgaV/IZKGdXc5qEK45tDwwwDyjS26I=
  338 +golang.org/x/net v0.0.0-20210510120150-4163338589ed/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
  339 +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
  340 +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
  341 +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
  342 +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
  343 +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
  344 +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
  345 +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
  346 +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
  347 +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
  348 +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
  349 +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
  350 +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
  351 +golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
  352 +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
  353 +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
  354 +golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
  355 +golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
  356 +golang.org/x/sys v0.0.0-20191010194322-b09406accb47/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
  357 +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
  358 +golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
  359 +golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
  360 +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
  361 +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
  362 +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
  363 +golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
  364 +golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
  365 +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
  366 +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
  367 +golang.org/x/sys v0.0.0-20210218155724-8ebf48af031b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
  368 +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
  369 +golang.org/x/sys v0.0.0-20210514084401-e8d321eab015 h1:hZR0X1kPW+nwyJ9xRxqZk1vx5RUObAPBdKVvXPDUH/E=
  370 +golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
  371 +golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
  372 +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
  373 +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
  374 +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
  375 +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
  376 +golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M=
  377 +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
  378 +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
  379 +golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
  380 +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
  381 +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
  382 +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
  383 +golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
  384 +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
  385 +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
  386 +golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
  387 +golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
  388 +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
  389 +golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
  390 +golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
  391 +golang.org/x/tools v0.0.0-20201211185031-d93e913c1a58 h1:1Bs6RVeBFtLZ8Yi1Hk07DiOqzvwLD/4hln4iahvFlag=
  392 +golang.org/x/tools v0.0.0-20201211185031-d93e913c1a58/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
  393 +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
  394 +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
  395 +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
  396 +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
  397 +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
  398 +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
  399 +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
  400 +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
  401 +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
  402 +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
  403 +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
  404 +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
  405 +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
  406 +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
  407 +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
  408 +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
  409 +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
  410 +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
  411 +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
  412 +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
  413 +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
  414 +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
  415 +google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c=
  416 +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
  417 +gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
  418 +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
  419 +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
  420 +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
  421 +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU=
  422 +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
  423 +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
  424 +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
  425 +gopkg.in/jcmturner/aescts.v1 v1.0.1 h1:cVVZBK2b1zY26haWB4vbBiZrfFQnfbTVrE3xZq6hrEw=
  426 +gopkg.in/jcmturner/aescts.v1 v1.0.1/go.mod h1:nsR8qBOg+OucoIW+WMhB3GspUQXq9XorLnQb9XtvcOo=
  427 +gopkg.in/jcmturner/dnsutils.v1 v1.0.1 h1:cIuC1OLRGZrld+16ZJvvZxVJeKPsvd5eUIvxfoN5hSM=
  428 +gopkg.in/jcmturner/dnsutils.v1 v1.0.1/go.mod h1:m3v+5svpVOhtFAP/wSz+yzh4Mc0Fg7eRhxkJMWSIz9Q=
  429 +gopkg.in/jcmturner/goidentity.v3 v3.0.0 h1:1duIyWiTaYvVx3YX2CYtpJbUFd7/UuPYCfgXtQ3VTbI=
  430 +gopkg.in/jcmturner/goidentity.v3 v3.0.0/go.mod h1:oG2kH0IvSYNIu80dVAyu/yoefjq1mNfM5bm88whjWx4=
  431 +gopkg.in/jcmturner/gokrb5.v7 v7.2.3 h1:hHMV/yKPwMnJhPuPx7pH2Uw/3Qyf+thJYlisUc44010=
  432 +gopkg.in/jcmturner/gokrb5.v7 v7.2.3/go.mod h1:l8VISx+WGYp+Fp7KRbsiUuXTTOnxIc3Tuvyavf11/WM=
  433 +gopkg.in/jcmturner/rpc.v1 v1.1.0 h1:QHIUxTX1ISuAv9dD2wJ9HWQVuWDX/Zc0PfeC2tjc4rU=
  434 +gopkg.in/jcmturner/rpc.v1 v1.1.0/go.mod h1:YIdkC4XfD6GXbzje11McwsDuOlZQSb9W4vfLvuNnlv8=
  435 +gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA=
  436 +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
  437 +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
  438 +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
  439 +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
  440 +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
  441 +gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
  442 +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
  443 +gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU=
  444 +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
  445 +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
  446 +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
  447 +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
  448 +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
  449 +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
  450 +honnef.co/go/tools v0.0.1-2020.1.5/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
  451 +mellium.im/sasl v0.2.1 h1:nspKSRg7/SyO0cRGY71OkfHab8tf9kCts6a6oTDut0w=
  452 +mellium.im/sasl v0.2.1/go.mod h1:ROaEDLQNuf9vjKqE1SrAfnsobm2YKXT1gnN1uDp1PjQ=
  1 +package main
  2 +
  3 +import (
  4 + "github.com/beego/beego/v2/server/web"
  5 + _ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/pg"
  6 + _ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/port/beego"
  7 +)
  8 +
  9 +func main() {
  10 + // web主服务
  11 + web.Run()
  12 +}
不能预览此文件类型
  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 +}
  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 +}
  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 + // 获取项目合约信息
  84 + var cooperationContractRepository domain.CooperationContractRepository
  85 + if value, err := factory.CreateCooperationContractRepository(map[string]interface{}{
  86 + "transactionContext": transactionContext,
  87 + }); err != nil {
  88 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  89 + } else {
  90 + cooperationContractRepository = value
  91 + }
  92 + cooperationContract, err := cooperationContractRepository.FindOne(map[string]interface{}{"cooperationContractNumber": createContractUndertakerFeedbackCommand.CooperationContractNumber})
  93 + if err != nil {
  94 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "共创合约不存在")
  95 + }
  96 + if cooperationContract == nil {
  97 + return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", createContractUndertakerFeedbackCommand.CooperationContractNumber))
  98 + } else {
  99 + newContractUndertakerFeedback := &domain.ContractUndertakerFeedback{
  100 + FeedbackAttachment: createContractUndertakerFeedbackCommand.FeedbackAttachment,
  101 + FeedbackContent: createContractUndertakerFeedbackCommand.FeedbackContent,
  102 + CooperationContractNumber: createContractUndertakerFeedbackCommand.CooperationContractNumber,
  103 + CooperationContractName: cooperationContract.CooperationContractName,
  104 + CooperationModeName: cooperationContract.CooperationMode.CooperationModeName,
  105 + ContractUndertaker: undertaker,
  106 + Company: company,
  107 + Org: organization,
  108 + UpdatedAt: time.Time{},
  109 + DeletedAt: time.Time{},
  110 + CreatedAt: time.Now(),
  111 + }
  112 +
  113 + var contractUndertakerFeedbackRepository domain.ContractUndertakerFeedbackRepository
  114 + if value, err := factory.CreateContractUndertakerFeedbackRepository(map[string]interface{}{
  115 + "transactionContext": transactionContext,
  116 + }); err != nil {
  117 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  118 + } else {
  119 + contractUndertakerFeedbackRepository = value
  120 + }
  121 + if contractUndertakerFeedback, err := contractUndertakerFeedbackRepository.Save(newContractUndertakerFeedback); err != nil {
  122 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  123 + } else {
  124 + if err := transactionContext.CommitTransaction(); err != nil {
  125 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  126 + }
  127 + return contractUndertakerFeedback, nil
  128 + }
  129 + }
  130 +}
  131 +
  132 +// GetContractUndertakerFeedback 返回共创合约反馈服务
  133 +func (contractUndertakerFeedbackService *ContractUndertakerFeedbackService) GetContractUndertakerFeedback(getContractUndertakerFeedbackQuery *query.GetContractUndertakerFeedbackQuery) (interface{}, error) {
  134 + if err := getContractUndertakerFeedbackQuery.ValidateQuery(); err != nil {
  135 + return nil, application.ThrowError(application.ARG_ERROR, err.Error())
  136 + }
  137 + transactionContext, err := factory.CreateTransactionContext(nil)
  138 + if err != nil {
  139 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  140 + }
  141 + if err := transactionContext.StartTransaction(); err != nil {
  142 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  143 + }
  144 + defer func() {
  145 + _ = transactionContext.RollbackTransaction()
  146 + }()
  147 + var contractUndertakerFeedbackRepository domain.ContractUndertakerFeedbackRepository
  148 + if value, err := factory.CreateContractUndertakerFeedbackRepository(map[string]interface{}{
  149 + "transactionContext": transactionContext,
  150 + }); err != nil {
  151 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  152 + } else {
  153 + contractUndertakerFeedbackRepository = value
  154 + }
  155 + contractUndertakerFeedback, err := contractUndertakerFeedbackRepository.FindOne(map[string]interface{}{"contractUndertakerFeedbackId": getContractUndertakerFeedbackQuery.FeedbackId})
  156 + if err != nil {
  157 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "合约反馈信息不存在")
  158 + }
  159 + if contractUndertakerFeedback == nil {
  160 + return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", string(getContractUndertakerFeedbackQuery.FeedbackId)))
  161 + } else {
  162 + if err := transactionContext.CommitTransaction(); err != nil {
  163 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  164 + }
  165 + return contractUndertakerFeedback, nil
  166 + }
  167 +}
  168 +
  169 +// ListContractUndertakerFeedback 返回共创合约反馈服务列表
  170 +func (contractUndertakerFeedbackService *ContractUndertakerFeedbackService) ListContractUndertakerFeedback(listContractUndertakerFeedbackQuery *query.ListContractUndertakerFeedbackQuery) (interface{}, error) {
  171 + if err := listContractUndertakerFeedbackQuery.ValidateQuery(); err != nil {
  172 + return nil, application.ThrowError(application.ARG_ERROR, err.Error())
  173 + }
  174 + transactionContext, err := factory.CreateTransactionContext(nil)
  175 + if err != nil {
  176 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  177 + }
  178 + if err := transactionContext.StartTransaction(); err != nil {
  179 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  180 + }
  181 + defer func() {
  182 + _ = transactionContext.RollbackTransaction()
  183 + }()
  184 + var contractUndertakerFeedbackRepository domain.ContractUndertakerFeedbackRepository
  185 + if value, err := factory.CreateContractUndertakerFeedbackRepository(map[string]interface{}{
  186 + "transactionContext": transactionContext,
  187 + }); err != nil {
  188 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  189 + } else {
  190 + contractUndertakerFeedbackRepository = value
  191 + }
  192 + if count, contractUndertakerFeedbacks, err := contractUndertakerFeedbackRepository.Find(tool_funs.SimpleStructToMap(listContractUndertakerFeedbackQuery)); err != nil {
  193 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  194 + } else {
  195 + if err := transactionContext.CommitTransaction(); err != nil {
  196 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  197 + }
  198 + return map[string]interface{}{
  199 + "grid": map[string]interface{}{
  200 + "total": count,
  201 + "list": contractUndertakerFeedbacks,
  202 + },
  203 + }, nil
  204 + }
  205 +}
  206 +
  207 +// RemoveContractUndertakerFeedback 移除共创合约反馈服务
  208 +func (contractUndertakerFeedbackService *ContractUndertakerFeedbackService) RemoveContractUndertakerFeedback(removeContractUndertakerFeedbackCommand *command.RemoveContractUndertakerFeedbackCommand) (interface{}, error) {
  209 + if err := removeContractUndertakerFeedbackCommand.ValidateCommand(); err != nil {
  210 + return nil, application.ThrowError(application.ARG_ERROR, err.Error())
  211 + }
  212 + transactionContext, err := factory.CreateTransactionContext(nil)
  213 + if err != nil {
  214 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  215 + }
  216 + if err := transactionContext.StartTransaction(); err != nil {
  217 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  218 + }
  219 + defer func() {
  220 + _ = transactionContext.RollbackTransaction()
  221 + }()
  222 + var contractUndertakerFeedbackRepository domain.ContractUndertakerFeedbackRepository
  223 + if value, err := factory.CreateContractUndertakerFeedbackRepository(map[string]interface{}{
  224 + "transactionContext": transactionContext,
  225 + }); err != nil {
  226 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  227 + } else {
  228 + contractUndertakerFeedbackRepository = value
  229 + }
  230 + contractUndertakerFeedback, err := contractUndertakerFeedbackRepository.FindOne(map[string]interface{}{"contractUndertakerFeedbackId": removeContractUndertakerFeedbackCommand.FeedbackId})
  231 + if err != nil {
  232 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "反馈信息不存在")
  233 + }
  234 + if contractUndertakerFeedback == nil {
  235 + return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", string(removeContractUndertakerFeedbackCommand.FeedbackId)))
  236 + }
  237 + if contractUndertakerFeedback, err := contractUndertakerFeedbackRepository.Remove(contractUndertakerFeedback); err != nil {
  238 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  239 + } else {
  240 + if err := transactionContext.CommitTransaction(); err != nil {
  241 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  242 + }
  243 + return contractUndertakerFeedback, nil
  244 + }
  245 +}
  246 +
  247 +// SearchContractUndertakerFeedback 查询共创承接方反馈信息
  248 +func (contractUndertakerFeedbackService *ContractUndertakerFeedbackService) SearchContractUndertakerFeedback(searchContractUndertakerFeedbackQuery *query.SearchContractUndertakerFeedbackQuery) (interface{}, error) {
  249 + if err := searchContractUndertakerFeedbackQuery.ValidateQuery(); err != nil {
  250 + return nil, application.ThrowError(application.ARG_ERROR, err.Error())
  251 + }
  252 + transactionContext, err := factory.CreateTransactionContext(nil)
  253 + if err != nil {
  254 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  255 + }
  256 + if err := transactionContext.StartTransaction(); err != nil {
  257 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  258 + }
  259 + defer func() {
  260 + _ = transactionContext.RollbackTransaction()
  261 + }()
  262 + var contractUndertakerFeedbackRepository domain.ContractUndertakerFeedbackRepository
  263 + if value, err := factory.CreateContractUndertakerFeedbackRepository(map[string]interface{}{
  264 + "transactionContext": transactionContext,
  265 + }); err != nil {
  266 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  267 + } else {
  268 + contractUndertakerFeedbackRepository = value
  269 + }
  270 + if count, contractUndertakerFeedbacks, err := contractUndertakerFeedbackRepository.Find(tool_funs.SimpleStructToMap(searchContractUndertakerFeedbackQuery)); err != nil {
  271 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  272 + } else {
  273 + if err := transactionContext.CommitTransaction(); err != nil {
  274 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  275 + }
  276 + return map[string]interface{}{
  277 + "grid": map[string]interface{}{
  278 + "total": count,
  279 + "list": contractUndertakerFeedbacks,
  280 + },
  281 + }, nil
  282 + }
  283 +}
  284 +
  285 +// UpdateContractUndertakerFeedback 更新共创合约反馈服务
  286 +func (contractUndertakerFeedbackService *ContractUndertakerFeedbackService) UpdateContractUndertakerFeedback(updateContractUndertakerFeedbackCommand *command.UpdateContractUndertakerFeedbackCommand) (interface{}, error) {
  287 + if err := updateContractUndertakerFeedbackCommand.ValidateCommand(); err != nil {
  288 + return nil, application.ThrowError(application.ARG_ERROR, err.Error())
  289 + }
  290 + transactionContext, err := factory.CreateTransactionContext(nil)
  291 + if err != nil {
  292 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  293 + }
  294 + if err := transactionContext.StartTransaction(); err != nil {
  295 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  296 + }
  297 + defer func() {
  298 + _ = transactionContext.RollbackTransaction()
  299 + }()
  300 + var contractUndertakerFeedbackRepository domain.ContractUndertakerFeedbackRepository
  301 + if value, err := factory.CreateContractUndertakerFeedbackRepository(map[string]interface{}{
  302 + "transactionContext": transactionContext,
  303 + }); err != nil {
  304 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  305 + } else {
  306 + contractUndertakerFeedbackRepository = value
  307 + }
  308 + contractUndertakerFeedback, err := contractUndertakerFeedbackRepository.FindOne(map[string]interface{}{"contractUndertakerFeedbackId": updateContractUndertakerFeedbackCommand.FeedbackId})
  309 + if err != nil {
  310 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "反馈信息不存在")
  311 + }
  312 + if contractUndertakerFeedback == nil {
  313 + return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", string(updateContractUndertakerFeedbackCommand.FeedbackId)))
  314 + }
  315 + if err := contractUndertakerFeedback.Update(tool_funs.SimpleStructToMap(updateContractUndertakerFeedbackCommand)); err != nil {
  316 + return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
  317 + }
  318 + if contractUndertakerFeedback, err := contractUndertakerFeedbackRepository.Save(contractUndertakerFeedback); err != nil {
  319 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  320 + } else {
  321 + if err := transactionContext.CommitTransaction(); err != nil {
  322 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  323 + }
  324 + return contractUndertakerFeedback, nil
  325 + }
  326 +}
  327 +
  328 +func NewContractUndertakerFeedbackService(options map[string]interface{}) *ContractUndertakerFeedbackService {
  329 + newContractUndertakerFeedbackService := &ContractUndertakerFeedbackService{}
  330 + return newContractUndertakerFeedbackService
  331 +}
  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" valid:"Required"`
  14 + // 共创申请描述
  15 + CooperationApplicationDescription string `cname:"共创申请描述" json:"cooperationApplicationDescription,omitempty"`
  16 + // 申请人ID
  17 + UserId int64 `cname:"申请人ID" json:"userId" valid:"Required"`
  18 + // 用户基本id
  19 + UserBaseId int64 `cname:"用户基本数据ID" json:"userBaseId" valid:"Required"`
  20 + // 组织机构ID
  21 + OrgId int64 `cname:"组织机构ID" json:"orgId" valid:"Required"`
  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 + //validation.SetError("CustomValid", "未实现的自定义认证")
  30 +}
  31 +
  32 +func (applyForCooperationCommand *ApplyForCooperationCommand) ValidateCommand() error {
  33 + valid := validation.Validation{}
  34 + b, err := valid.Valid(applyForCooperationCommand)
  35 + if err != nil {
  36 + return err
  37 + }
  38 + if !b {
  39 + elem := reflect.TypeOf(applyForCooperationCommand).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 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 +}
  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 + data.IsCanceled = a.IsCanceled
  102 + data.Company = data.LoadCompany(a.Company)
  103 +}
  104 +
  105 +func (data *CooperationApplicationDto) LoadUser(v *domain.User) *User {
  106 + if v == nil {
  107 + return &User{}
  108 + }
  109 + result := User{
  110 + UserId: v.UserId,
  111 + UserInfo: v.UserInfo,
  112 + }
  113 + if v.Department != nil {
  114 + result.Department = &Department{
  115 + DepartmentId: v.Department.DepartmentId,
  116 + DepartmentName: v.Department.DepartmentName,
  117 + }
  118 + }
  119 +
  120 + return &result
  121 +}
  122 +
  123 +func (data *CooperationApplicationDto) LoadCompany(v *domain.Company) *Company {
  124 + return &Company{
  125 + CompanyId: v.CompanyId,
  126 + CompanyName: v.CompanyName,
  127 + }
  128 +}
  129 +
  130 +func (data *CooperationApplicationDto) LoadOrg(v *domain.Org) *Org {
  131 + return &Org{
  132 + OrgId: v.OrgId,
  133 + OrgName: v.OrgName,
  134 + }
  135 +}
  136 +
  137 +func (data *CooperationApplicationDto) LoadDepartment(v *domain.Org) *Department {
  138 + return &Department{
  139 + DepartmentId: v.OrgId,
  140 + DepartmentName: v.OrgName,
  141 + }
  142 +}
  143 +
  144 +func (data *CooperationApplicationDto) LoadCooperationProject(v *domain.CooperationProject) *CooperationProject {
  145 + return &CooperationProject{
  146 + CooperationProjectId: v.CooperationProjectId,
  147 + CooperationProjectNumber: v.CooperationProjectNumber,
  148 + CooperationProjectDescription: v.CooperationProjectDescription,
  149 + CooperationProjectName: v.CooperationProjectName,
  150 + Attachment: v.Attachment,
  151 + CooperationMode: v.CooperationMode,
  152 + }
  153 +}
  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 + // 页面大小
  21 + PageSize int64 `cname:"页面大小" json:"pageSize,omitempty"`
  22 + // 页面大小
  23 + PageNumber int64 `cname:"页码" json:"pageNumber,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 (searchCooperationApplicationQuery *SearchCooperationApplicationQuery) Valid(validation *validation.Validation) {
  37 + //validation.SetError("CustomValid", "未实现的自定义认证")
  38 +}
  39 +
  40 +func (searchCooperationApplicationQuery *SearchCooperationApplicationQuery) ValidateQuery() error {
  41 + valid := validation.Validation{}
  42 + b, err := valid.Valid(searchCooperationApplicationQuery)
  43 + if err != nil {
  44 + return err
  45 + }
  46 + if !b {
  47 + elem := reflect.TypeOf(searchCooperationApplicationQuery).Elem()
  48 + for _, validErr := range valid.Errors {
  49 + field, isExist := elem.FieldByName(validErr.Field)
  50 + if isExist {
  51 + return fmt.Errorf(strings.Replace(validErr.Message, validErr.Field, field.Tag.Get("cname"), -1))
  52 + } else {
  53 + return fmt.Errorf(validErr.Message)
  54 + }
  55 + }
  56 + }
  57 + return nil
  58 +}
  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/utils"
  14 + "strconv"
  15 + "time"
  16 +)
  17 +
  18 +// CooperationApplicationService 共创申请服务
  19 +type CooperationApplicationService struct {
  20 +}
  21 +
  22 +// ApplyForCooperation 申请共创
  23 +func (cooperationApplicationService *CooperationApplicationService) ApplyForCooperation(applyForCooperationCommand *command.ApplyForCooperationCommand) (interface{}, error) {
  24 + if err := applyForCooperationCommand.ValidateCommand(); err != nil {
  25 + return nil, application.ThrowError(application.ARG_ERROR, err.Error())
  26 + }
  27 + transactionContext, err := factory.CreateTransactionContext(nil)
  28 + if err != nil {
  29 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  30 + }
  31 + if err := transactionContext.StartTransaction(); err != nil {
  32 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  33 + }
  34 + defer func() {
  35 + _ = transactionContext.RollbackTransaction()
  36 + }()
  37 +
  38 + // 共创项目仓储初始化
  39 + var cooperationProjectRepository domain.CooperationProjectRepository
  40 + if value, err := factory.CreateCooperationProjectRepository(map[string]interface{}{
  41 + "transactionContext": transactionContext,
  42 + }); err != nil {
  43 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  44 + } else {
  45 + cooperationProjectRepository = value
  46 + }
  47 +
  48 + // 获取共创项目
  49 + cooperationProject, err := cooperationProjectRepository.FindOne(map[string]interface{}{"cooperationProjectId": applyForCooperationCommand.CooperationProjectId})
  50 + if err != nil {
  51 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "共创项目不存在")
  52 + }
  53 + if cooperationProject == nil {
  54 + return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", strconv.FormatInt(applyForCooperationCommand.CooperationProjectId, 10)))
  55 + }
  56 +
  57 + // 用户REST服务初始化
  58 + var userService service.UserService
  59 + if value, err := factory.CreateUserService(map[string]interface{}{}); err != nil {
  60 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  61 + } else {
  62 + userService = value
  63 + }
  64 +
  65 + // 获取申请人
  66 + var applicant *domain.User
  67 + if data, err := userService.UserFrom(applyForCooperationCommand.CompanyId, applyForCooperationCommand.OrgId, applyForCooperationCommand.UserId); err != nil {
  68 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取申请人失败")
  69 + } else {
  70 + applicant = data
  71 + }
  72 +
  73 + // 公司REST服务初始化
  74 + var companyService service.CompanyService
  75 + if value, err := factory.CreateCompanyService(map[string]interface{}{}); err != nil {
  76 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  77 + } else {
  78 + companyService = value
  79 + }
  80 +
  81 + // 获取公司信息
  82 + var company *domain.Company
  83 + if data, err := companyService.CompanyFrom(applyForCooperationCommand.CompanyId); err != nil {
  84 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取公司信息失败")
  85 + } else {
  86 + company = data
  87 + }
  88 +
  89 + // 组织机构REST服务初始化
  90 + var organizationService service.OrgService
  91 + if value, err := factory.CreateOrganizationService(map[string]interface{}{}); err != nil {
  92 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  93 + } else {
  94 + organizationService = value
  95 + }
  96 +
  97 + // 获取组织机构信息
  98 + var organization *domain.Org
  99 + if data, err := organizationService.OrgFrom(applyForCooperationCommand.CompanyId, applyForCooperationCommand.OrgId); err != nil {
  100 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取组织机构数据失败")
  101 + } else {
  102 + organization = data
  103 + }
  104 +
  105 + newCooperationApplication := &domain.CooperationApplication{
  106 + CooperationApplicationApplicant: applicant,
  107 + CooperationApplicationAttachment: applyForCooperationCommand.CooperationApplicationAttachment,
  108 + CooperationApplicationDescription: applyForCooperationCommand.CooperationApplicationDescription,
  109 + CooperationApplicationStatus: 1,
  110 + CooperationApplicationVerifier: nil,
  111 + CooperationApplicationVerifyDescription: "",
  112 + CooperationApplicationVerifyTime: time.Time{},
  113 + CooperationApplyTime: time.Now(),
  114 + CooperationProject: cooperationProject,
  115 + Org: organization,
  116 + IsCanceled: false,
  117 + Company: company,
  118 + CreatedAt: time.Now(),
  119 + DeletedAt: time.Time{},
  120 + UpdatedAt: time.Time{},
  121 + }
  122 +
  123 + var cooperationApplicationRepository domain.CooperationApplicationRepository
  124 + if value, err := factory.CreateCooperationApplicationRepository(map[string]interface{}{
  125 + "transactionContext": transactionContext,
  126 + }); err != nil {
  127 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  128 + } else {
  129 + cooperationApplicationRepository = value
  130 + }
  131 + if cooperationApplication, err := cooperationApplicationRepository.Save(newCooperationApplication); err != nil {
  132 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  133 + } else {
  134 + if err := transactionContext.CommitTransaction(); err != nil {
  135 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  136 + }
  137 + return cooperationApplication, nil
  138 + }
  139 +}
  140 +
  141 +// ApprovalCooperationApplication 审核共创申请
  142 +func (cooperationApplicationService *CooperationApplicationService) ApprovalCooperationApplication(approvalCooperationApplicationCommand *command.ApprovalCooperationApplicationCommand) (interface{}, error) {
  143 + if err := approvalCooperationApplicationCommand.ValidateCommand(); err != nil {
  144 + return nil, application.ThrowError(application.ARG_ERROR, err.Error())
  145 + }
  146 + transactionContext, err := factory.CreateTransactionContext(nil)
  147 + if err != nil {
  148 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  149 + }
  150 + if err := transactionContext.StartTransaction(); err != nil {
  151 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  152 + }
  153 + defer func() {
  154 + _ = transactionContext.RollbackTransaction()
  155 + }()
  156 +
  157 + // 共创申请仓储初始化
  158 + var cooperationApplicationRepository domain.CooperationApplicationRepository
  159 + if value, err := factory.CreateCooperationApplicationRepository(map[string]interface{}{
  160 + "transactionContext": transactionContext,
  161 + }); err != nil {
  162 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  163 + } else {
  164 + cooperationApplicationRepository = value
  165 + }
  166 +
  167 + // 用户REST服务初始化
  168 + var userService service.UserService
  169 + if value, err := factory.CreateUserService(map[string]interface{}{}); err != nil {
  170 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  171 + } else {
  172 + userService = value
  173 + }
  174 +
  175 + // 获取审核人
  176 + var verifier *domain.User
  177 + if data, err := userService.UserFrom(approvalCooperationApplicationCommand.CompanyId, approvalCooperationApplicationCommand.OrgId, approvalCooperationApplicationCommand.UserId); err != nil {
  178 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取申请人失败")
  179 + } else {
  180 + verifier = data
  181 + }
  182 +
  183 + // 共创申请ID转换
  184 + cooperationApplicationId, err := strconv.ParseInt(approvalCooperationApplicationCommand.CooperationApplicationId, 10, 64)
  185 + if err != nil {
  186 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "共创申请ID类型错误")
  187 + }
  188 +
  189 + // 获取共创申请
  190 + cooperationApplication, err := cooperationApplicationRepository.FindOne(map[string]interface{}{"cooperationApplicationId": approvalCooperationApplicationCommand.CooperationApplicationId})
  191 + if err != nil {
  192 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "共创申请不存在")
  193 + }
  194 + if cooperationApplication == nil {
  195 + return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", strconv.FormatInt(cooperationApplicationId, 10)))
  196 + }
  197 +
  198 + if approvalCooperationApplicationCommand.Action == 1 {
  199 + cooperationApplication.CooperationApplicationStatus = 2
  200 + } else if approvalCooperationApplicationCommand.Action == 2 {
  201 + cooperationApplication.CooperationApplicationStatus = 3
  202 + }
  203 +
  204 + cooperationApplication.CooperationApplicationVerifier = verifier
  205 + cooperationApplication.CooperationApplicationVerifyTime = time.Now()
  206 +
  207 + if err := cooperationApplication.Update(tool_funs.SimpleStructToMap(approvalCooperationApplicationCommand)); err != nil {
  208 + return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
  209 + }
  210 + if cooperationApplicationSaved, err := cooperationApplicationRepository.Save(cooperationApplication); err != nil {
  211 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  212 + } else {
  213 + if err := transactionContext.CommitTransaction(); err != nil {
  214 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  215 + }
  216 + return cooperationApplicationSaved, nil
  217 + }
  218 +}
  219 +
  220 +// BatchApprovalCooperationApplication 批量审核共创申请
  221 +func (cooperationApplicationService *CooperationApplicationService) BatchApprovalCooperationApplication(batchApprovalCooperationApplicationCommand *command.BatchApprovalCooperationApplicationCommand) (interface{}, error) {
  222 + if err := batchApprovalCooperationApplicationCommand.ValidateCommand(); err != nil {
  223 + return nil, application.ThrowError(application.ARG_ERROR, err.Error())
  224 + }
  225 + transactionContext, err := factory.CreateTransactionContext(nil)
  226 + if err != nil {
  227 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  228 + }
  229 + if err := transactionContext.StartTransaction(); err != nil {
  230 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  231 + }
  232 + defer func() {
  233 + _ = transactionContext.RollbackTransaction()
  234 + }()
  235 +
  236 + // 共创申请仓储初始化
  237 + var cooperationApplicationRepository domain.CooperationApplicationRepository
  238 + if value, err := factory.CreateCooperationApplicationRepository(map[string]interface{}{
  239 + "transactionContext": transactionContext,
  240 + }); err != nil {
  241 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  242 + } else {
  243 + cooperationApplicationRepository = value
  244 + }
  245 +
  246 + // 共创申请ID类型转换
  247 + cooperationApplicationIds, err := utils.SliceAtoi(batchApprovalCooperationApplicationCommand.CooperationApplicationIds)
  248 + if err != nil {
  249 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "共创申请ID列表类型错误")
  250 + }
  251 +
  252 + // 用户REST服务初始化
  253 + var userService service.UserService
  254 + if value, err := factory.CreateUserService(map[string]interface{}{}); err != nil {
  255 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  256 + } else {
  257 + userService = value
  258 + }
  259 +
  260 + // 获取审核人
  261 + var verifier *domain.User
  262 + if data, err := userService.UserFrom(batchApprovalCooperationApplicationCommand.CompanyId, batchApprovalCooperationApplicationCommand.OrgId, batchApprovalCooperationApplicationCommand.UserId); err != nil {
  263 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取申请人失败")
  264 + } else {
  265 + verifier = data
  266 + }
  267 +
  268 + // 获取共创申请
  269 + if count, cooperationApplications, err := cooperationApplicationRepository.Find(map[string]interface{}{
  270 + "cooperationApplicationIds": cooperationApplicationIds,
  271 + }); err != nil {
  272 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  273 + } else {
  274 + if count > 0 {
  275 + for i, _ := range cooperationApplications {
  276 + cooperationApplications[i].CooperationApplicationVerifyDescription = batchApprovalCooperationApplicationCommand.CooperationApplicationVerifyDescription
  277 + if batchApprovalCooperationApplicationCommand.Action == 1 { // 同意
  278 + cooperationApplications[i].CooperationApplicationStatus = 2
  279 + } else if batchApprovalCooperationApplicationCommand.Action == 2 { // 拒绝
  280 + cooperationApplications[i].CooperationApplicationStatus = 3
  281 + }
  282 + cooperationApplications[i].CooperationApplicationVerifier = verifier
  283 + cooperationApplications[i].CooperationApplicationVerifyTime = time.Now()
  284 + }
  285 + cooperationApplicationsApproved, err := cooperationApplicationRepository.UpdateMany(cooperationApplications)
  286 + if err != nil {
  287 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  288 + }
  289 + if err := transactionContext.CommitTransaction(); err != nil {
  290 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  291 + }
  292 + return map[string]interface{}{
  293 + "cooperationApplications": cooperationApplicationsApproved,
  294 + }, nil
  295 + } else {
  296 + return map[string]interface{}{}, nil
  297 + }
  298 + }
  299 +}
  300 +
  301 +// OneClickApprovalCooperationApplication 一键审核共创申请
  302 +func (cooperationApplicationService *CooperationApplicationService) OneClickApprovalCooperationApplication(oneClickApprovalCooperationApplicationCommand *command.OneClickApprovalCooperationApplicationCommand) (interface{}, error) {
  303 + if err := oneClickApprovalCooperationApplicationCommand.ValidateCommand(); err != nil {
  304 + return nil, application.ThrowError(application.ARG_ERROR, err.Error())
  305 + }
  306 + transactionContext, err := factory.CreateTransactionContext(nil)
  307 + if err != nil {
  308 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  309 + }
  310 + if err := transactionContext.StartTransaction(); err != nil {
  311 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  312 + }
  313 + defer func() {
  314 + _ = transactionContext.RollbackTransaction()
  315 + }()
  316 +
  317 + // 共创申请仓储初始化
  318 + var cooperationApplicationRepository domain.CooperationApplicationRepository
  319 + if value, err := factory.CreateCooperationApplicationRepository(map[string]interface{}{
  320 + "transactionContext": transactionContext,
  321 + }); err != nil {
  322 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  323 + } else {
  324 + cooperationApplicationRepository = value
  325 + }
  326 +
  327 + // 用户REST服务初始化
  328 + var userService service.UserService
  329 + if value, err := factory.CreateUserService(map[string]interface{}{}); err != nil {
  330 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  331 + } else {
  332 + userService = value
  333 + }
  334 +
  335 + // 获取审核人
  336 + var verifier *domain.User
  337 + if data, err := userService.UserFrom(oneClickApprovalCooperationApplicationCommand.CompanyId, oneClickApprovalCooperationApplicationCommand.OrgId, oneClickApprovalCooperationApplicationCommand.UserId); err != nil {
  338 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取申请人失败")
  339 + } else {
  340 + verifier = data
  341 + }
  342 +
  343 + // 查询共创申请
  344 + oneClickApprovalCooperationApplicationCommand.CooperationApplicationStatus = 1 // 待审核
  345 + if count, cooperationApplications, err := cooperationApplicationRepository.Find(tool_funs.SimpleStructToMap(oneClickApprovalCooperationApplicationCommand)); err != nil {
  346 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  347 + } else {
  348 + if count > 0 {
  349 + for i, _ := range cooperationApplications {
  350 + if oneClickApprovalCooperationApplicationCommand.Action == 1 {
  351 + cooperationApplications[i].CooperationApplicationStatus = 2
  352 + } else if oneClickApprovalCooperationApplicationCommand.Action == 2 {
  353 + cooperationApplications[i].CooperationApplicationStatus = 3
  354 + }
  355 + cooperationApplications[i].CooperationApplicationVerifyDescription = oneClickApprovalCooperationApplicationCommand.CooperationApplicationVerifyDescription
  356 + cooperationApplications[i].CooperationApplicationVerifier = verifier
  357 + cooperationApplications[i].CooperationApplicationVerifyTime = time.Now()
  358 + }
  359 + cooperationApplicationsApproved, err := cooperationApplicationRepository.UpdateMany(cooperationApplications)
  360 + if err != nil {
  361 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  362 + }
  363 + if err := transactionContext.CommitTransaction(); err != nil {
  364 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  365 + }
  366 + return map[string]interface{}{
  367 + "cooperationApplications": cooperationApplicationsApproved,
  368 + }, nil
  369 + } else {
  370 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "未找到待审核的共创申请")
  371 + }
  372 + }
  373 +}
  374 +
  375 +// CreateCooperationApplication 创建共创申请服务
  376 +func (cooperationApplicationService *CooperationApplicationService) CreateCooperationApplication(createCooperationApplicationCommand *command.CreateCooperationApplicationCommand) (interface{}, error) {
  377 + if err := createCooperationApplicationCommand.ValidateCommand(); err != nil {
  378 + return nil, application.ThrowError(application.ARG_ERROR, err.Error())
  379 + }
  380 + transactionContext, err := factory.CreateTransactionContext(nil)
  381 + if err != nil {
  382 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  383 + }
  384 + if err := transactionContext.StartTransaction(); err != nil {
  385 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  386 + }
  387 + defer func() {
  388 + _ = transactionContext.RollbackTransaction()
  389 + }()
  390 +
  391 + var cooperationProjectRepository domain.CooperationProjectRepository
  392 + if value, err := factory.CreateCooperationProjectRepository(map[string]interface{}{
  393 + "transactionContext": transactionContext,
  394 + }); err != nil {
  395 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  396 + } else {
  397 + cooperationProjectRepository = value
  398 + }
  399 + cooperationProject, err := cooperationProjectRepository.FindOne(map[string]interface{}{"cooperationProjectNumber": createCooperationApplicationCommand.CooperationProjectNumber})
  400 + if err != nil {
  401 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "共创项目不存在")
  402 + }
  403 + if cooperationProject == nil {
  404 + return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", createCooperationApplicationCommand.CooperationProjectNumber))
  405 + }
  406 +
  407 + // 用户REST服务初始化
  408 + var userService service.UserService
  409 + if value, err := factory.CreateUserService(map[string]interface{}{}); err != nil {
  410 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  411 + } else {
  412 + userService = value
  413 + }
  414 +
  415 + // 获取申请人
  416 + var applicant *domain.User
  417 + if data, err := userService.UserFrom(createCooperationApplicationCommand.CompanyId, createCooperationApplicationCommand.OrgId, createCooperationApplicationCommand.UserId); err != nil {
  418 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  419 + } else {
  420 + applicant = data
  421 + }
  422 +
  423 + // 公司REST服务初始化
  424 + var companyService service.CompanyService
  425 + if value, err := factory.CreateCompanyService(map[string]interface{}{}); err != nil {
  426 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  427 + } else {
  428 + companyService = value
  429 + }
  430 +
  431 + // 获取公司信息
  432 + var company *domain.Company
  433 + if data, err := companyService.CompanyFrom(createCooperationApplicationCommand.CompanyId); err != nil {
  434 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  435 + } else {
  436 + company = data
  437 + }
  438 +
  439 + // 组织机构REST服务初始化
  440 + var organizationService service.OrgService
  441 + if value, err := factory.CreateOrganizationService(map[string]interface{}{}); err != nil {
  442 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  443 + } else {
  444 + organizationService = value
  445 + }
  446 +
  447 + // 获取组织机构信息
  448 + var organization *domain.Org
  449 + if data, err := organizationService.OrgFrom(createCooperationApplicationCommand.CompanyId, createCooperationApplicationCommand.OrgId); err != nil {
  450 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  451 + } else {
  452 + organization = data
  453 + }
  454 +
  455 + newCooperationApplication := &domain.CooperationApplication{
  456 + CooperationApplicationApplicant: applicant,
  457 + CooperationApplicationAttachment: createCooperationApplicationCommand.CooperationApplicationAttachment,
  458 + CooperationApplicationDescription: createCooperationApplicationCommand.CooperationApplicationDescription,
  459 + CooperationApplicationStatus: 1,
  460 + CooperationApplicationVerifier: nil,
  461 + CooperationApplicationVerifyDescription: "",
  462 + CooperationApplicationVerifyTime: time.Time{},
  463 + CooperationApplyTime: time.Now(),
  464 + CooperationProject: cooperationProject,
  465 + Org: organization,
  466 + IsCanceled: false,
  467 + Company: company,
  468 + CreatedAt: time.Now(),
  469 + DeletedAt: time.Time{},
  470 + UpdatedAt: time.Time{},
  471 + }
  472 +
  473 + var cooperationApplicationRepository domain.CooperationApplicationRepository
  474 + if value, err := factory.CreateCooperationApplicationRepository(map[string]interface{}{
  475 + "transactionContext": transactionContext,
  476 + }); err != nil {
  477 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  478 + } else {
  479 + cooperationApplicationRepository = value
  480 + }
  481 + if cooperationApplication, err := cooperationApplicationRepository.Save(newCooperationApplication); err != nil {
  482 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  483 + } else {
  484 + if err := transactionContext.CommitTransaction(); err != nil {
  485 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  486 + }
  487 + return cooperationApplication, nil
  488 + }
  489 +}
  490 +
  491 +// GetCooperationApplication 返回共创申请服务
  492 +func (cooperationApplicationService *CooperationApplicationService) GetCooperationApplication(getCooperationApplicationQuery *query.GetCooperationApplicationQuery) (interface{}, error) {
  493 + if err := getCooperationApplicationQuery.ValidateQuery(); err != nil {
  494 + return nil, application.ThrowError(application.ARG_ERROR, err.Error())
  495 + }
  496 + transactionContext, err := factory.CreateTransactionContext(nil)
  497 + if err != nil {
  498 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  499 + }
  500 + if err := transactionContext.StartTransaction(); err != nil {
  501 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  502 + }
  503 + defer func() {
  504 + _ = transactionContext.RollbackTransaction()
  505 + }()
  506 + var cooperationApplicationRepository domain.CooperationApplicationRepository
  507 + if value, err := factory.CreateCooperationApplicationRepository(map[string]interface{}{
  508 + "transactionContext": transactionContext,
  509 + }); err != nil {
  510 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  511 + } else {
  512 + cooperationApplicationRepository = value
  513 + }
  514 + cooperationApplication, err := cooperationApplicationRepository.FindOne(map[string]interface{}{"cooperationApplicationId": getCooperationApplicationQuery.CooperationApplicationId})
  515 + if err != nil {
  516 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "共创申请不存在")
  517 + }
  518 + if cooperationApplication == nil {
  519 + return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", strconv.FormatInt(getCooperationApplicationQuery.CooperationApplicationId, 10)))
  520 + } else {
  521 + if err := transactionContext.CommitTransaction(); err != nil {
  522 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  523 + }
  524 + coProjectDto := &dto.CooperationApplicationDto{}
  525 + coProjectDto.LoadDto(cooperationApplication)
  526 + return coProjectDto, nil
  527 + }
  528 +}
  529 +
  530 +// ListCooperationApplication 返回共创申请服务列表
  531 +func (cooperationApplicationService *CooperationApplicationService) ListCooperationApplication(listCooperationApplicationQuery *query.ListCooperationApplicationQuery) (interface{}, error) {
  532 + if err := listCooperationApplicationQuery.ValidateQuery(); err != nil {
  533 + return nil, application.ThrowError(application.ARG_ERROR, err.Error())
  534 + }
  535 + transactionContext, err := factory.CreateTransactionContext(nil)
  536 + if err != nil {
  537 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  538 + }
  539 + if err := transactionContext.StartTransaction(); err != nil {
  540 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  541 + }
  542 + defer func() {
  543 + _ = transactionContext.RollbackTransaction()
  544 + }()
  545 + // 共创申请仓储初始化
  546 + var cooperationApplicationRepository domain.CooperationApplicationRepository
  547 + if value, err := factory.CreateCooperationApplicationRepository(map[string]interface{}{
  548 + "transactionContext": transactionContext,
  549 + }); err != nil {
  550 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  551 + } else {
  552 + cooperationApplicationRepository = value
  553 + }
  554 + if count, cooperationApplications, err := cooperationApplicationRepository.Find(tool_funs.SimpleStructToMap(listCooperationApplicationQuery)); err != nil {
  555 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  556 + } else {
  557 + if err := transactionContext.CommitTransaction(); err != nil {
  558 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  559 + }
  560 + return map[string]interface{}{
  561 + "grid": map[string]interface{}{
  562 + "total": count,
  563 + "list": cooperationApplications,
  564 + },
  565 + }, nil
  566 + }
  567 +}
  568 +
  569 +// RemoveCooperationApplication 移除共创申请服务
  570 +func (cooperationApplicationService *CooperationApplicationService) RemoveCooperationApplication(removeCooperationApplicationCommand *command.RemoveCooperationApplicationCommand) (interface{}, error) {
  571 + if err := removeCooperationApplicationCommand.ValidateCommand(); err != nil {
  572 + return nil, application.ThrowError(application.ARG_ERROR, err.Error())
  573 + }
  574 + transactionContext, err := factory.CreateTransactionContext(nil)
  575 + if err != nil {
  576 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  577 + }
  578 + if err := transactionContext.StartTransaction(); err != nil {
  579 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  580 + }
  581 + defer func() {
  582 + _ = transactionContext.RollbackTransaction()
  583 + }()
  584 + var cooperationApplicationRepository domain.CooperationApplicationRepository
  585 + if value, err := factory.CreateCooperationApplicationRepository(map[string]interface{}{
  586 + "transactionContext": transactionContext,
  587 + }); err != nil {
  588 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  589 + } else {
  590 + cooperationApplicationRepository = value
  591 + }
  592 + cooperationApplication, err := cooperationApplicationRepository.FindOne(map[string]interface{}{"cooperationApplicationId": removeCooperationApplicationCommand.CooperationApplicationId})
  593 + if err != nil {
  594 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "共创申请不存在")
  595 + }
  596 + if cooperationApplication == nil {
  597 + return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", strconv.FormatInt(removeCooperationApplicationCommand.CooperationApplicationId, 10)))
  598 + }
  599 + if cooperationApplication, err := cooperationApplicationRepository.Remove(cooperationApplication); err != nil {
  600 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  601 + } else {
  602 + if err := transactionContext.CommitTransaction(); err != nil {
  603 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  604 + }
  605 + return cooperationApplication, nil
  606 + }
  607 +}
  608 +
  609 +// SearchCooperationApplication 查询共创申请
  610 +func (cooperationApplicationService *CooperationApplicationService) SearchCooperationApplication(searchCooperationApplicationQuery *query.SearchCooperationApplicationQuery) (interface{}, error) {
  611 + if err := searchCooperationApplicationQuery.ValidateQuery(); err != nil {
  612 + return nil, application.ThrowError(application.ARG_ERROR, err.Error())
  613 + }
  614 + transactionContext, err := factory.CreateTransactionContext(nil)
  615 + if err != nil {
  616 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  617 + }
  618 + if err := transactionContext.StartTransaction(); err != nil {
  619 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  620 + }
  621 + defer func() {
  622 + _ = transactionContext.RollbackTransaction()
  623 + }()
  624 + var cooperationApplicationRepository domain.CooperationApplicationRepository
  625 + if value, err := factory.CreateCooperationApplicationRepository(map[string]interface{}{
  626 + "transactionContext": transactionContext,
  627 + }); err != nil {
  628 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  629 + } else {
  630 + cooperationApplicationRepository = value
  631 + }
  632 + if count, cooperationApplications, err := cooperationApplicationRepository.Find(tool_funs.SimpleStructToMap(searchCooperationApplicationQuery)); err != nil {
  633 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  634 + } else {
  635 + if err := transactionContext.CommitTransaction(); err != nil {
  636 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  637 + }
  638 + var coProjectDtos []*dto.CooperationApplicationDto
  639 + for i := range cooperationApplications {
  640 + var coProjectDto = &dto.CooperationApplicationDto{}
  641 + coProjectDto.LoadDto(cooperationApplications[i])
  642 + coProjectDtos = append(coProjectDtos, coProjectDto)
  643 + }
  644 +
  645 + return map[string]interface{}{
  646 + "grid": map[string]interface{}{
  647 + "total": count,
  648 + "list": coProjectDtos,
  649 + },
  650 + }, nil
  651 + }
  652 +}
  653 +
  654 +// UpdateCooperationApplication 更新共创申请服务
  655 +func (cooperationApplicationService *CooperationApplicationService) UpdateCooperationApplication(updateCooperationApplicationCommand *command.UpdateCooperationApplicationCommand) (interface{}, error) {
  656 + if err := updateCooperationApplicationCommand.ValidateCommand(); err != nil {
  657 + return nil, application.ThrowError(application.ARG_ERROR, err.Error())
  658 + }
  659 + transactionContext, err := factory.CreateTransactionContext(nil)
  660 + if err != nil {
  661 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  662 + }
  663 + if err := transactionContext.StartTransaction(); err != nil {
  664 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  665 + }
  666 + defer func() {
  667 + _ = transactionContext.RollbackTransaction()
  668 + }()
  669 + var cooperationApplicationRepository domain.CooperationApplicationRepository
  670 + if value, err := factory.CreateCooperationApplicationRepository(map[string]interface{}{
  671 + "transactionContext": transactionContext,
  672 + }); err != nil {
  673 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  674 + } else {
  675 + cooperationApplicationRepository = value
  676 + }
  677 + cooperationApplication, err := cooperationApplicationRepository.FindOne(map[string]interface{}{"cooperationApplicationId": updateCooperationApplicationCommand.CooperationApplicationId})
  678 + if err != nil {
  679 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "共创申请不存在")
  680 + }
  681 + if cooperationApplication == nil {
  682 + return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", strconv.FormatInt(updateCooperationApplicationCommand.CooperationApplicationId, 10)))
  683 + }
  684 + if err := cooperationApplication.Update(tool_funs.SimpleStructToMap(updateCooperationApplicationCommand)); err != nil {
  685 + return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
  686 + }
  687 + if cooperationApplication, err := cooperationApplicationRepository.Save(cooperationApplication); err != nil {
  688 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  689 + } else {
  690 + if err := transactionContext.CommitTransaction(); err != nil {
  691 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  692 + }
  693 + return cooperationApplication, nil
  694 + }
  695 +}
  696 +
  697 +// CancelCooperationApplication 取消共创申请
  698 +func (cooperationApplicationService *CooperationApplicationService) CancelCooperationApplication(cancelCooperationApplicationCommand *command.CancelCooperationApplicationCommand) (interface{}, error) {
  699 + if err := cancelCooperationApplicationCommand.ValidateCommand(); err != nil {
  700 + return nil, application.ThrowError(application.ARG_ERROR, err.Error())
  701 + }
  702 + transactionContext, err := factory.CreateTransactionContext(nil)
  703 + if err != nil {
  704 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  705 + }
  706 + if err := transactionContext.StartTransaction(); err != nil {
  707 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  708 + }
  709 + defer func() {
  710 + _ = transactionContext.RollbackTransaction()
  711 + }()
  712 + //TODO 校验用户菜单模块权限
  713 +
  714 + // 共创申请仓储初始化
  715 + var cooperationApplicationRepository domain.CooperationApplicationRepository
  716 + if value, err := factory.CreateCooperationApplicationRepository(map[string]interface{}{
  717 + "transactionContext": transactionContext,
  718 + }); err != nil {
  719 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  720 + } else {
  721 + cooperationApplicationRepository = value
  722 + }
  723 + cooperationApplicationId, err := strconv.ParseInt(cancelCooperationApplicationCommand.CooperationApplicationId, 10, 64)
  724 + if err != nil {
  725 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "共创申请ID错误")
  726 + }
  727 + cooperationApplication, err := cooperationApplicationRepository.FindOne(map[string]interface{}{"cooperationApplicationId": cooperationApplicationId})
  728 + if err != nil {
  729 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "共创申请不存在")
  730 + }
  731 + if cooperationApplication == nil {
  732 + return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", strconv.FormatInt(cooperationApplicationId, 10)))
  733 + }
  734 + if err := cooperationApplication.Update(map[string]interface{}{
  735 + "isCanceled": true,
  736 + }); err != nil {
  737 + return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
  738 + }
  739 + if cooperationApplication, err := cooperationApplicationRepository.Save(cooperationApplication); err != nil {
  740 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  741 + } else {
  742 + if err := transactionContext.CommitTransaction(); err != nil {
  743 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  744 + }
  745 + return cooperationApplication, nil
  746 + }
  747 +}
  748 +
  749 +func NewCooperationApplicationService(options map[string]interface{}) *CooperationApplicationService {
  750 + newCooperationApplicationService := &CooperationApplicationService{}
  751 + return newCooperationApplicationService
  752 +}
  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"`
  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,omitempty"`
  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) <= 0 && len(updateCooperationContractCommand.MoneyIncentivesRules) <= 0 {
  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) <= 0 {
  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 + Attachment []*domain.Attachment `json:"attachment"`
  23 + // 发起人姓名
  24 + SponsorName string `json:"sponsorName"`
  25 + // 发起部门名称
  26 + DepartmentName string `json:"departmentName"`
  27 + // 共创模式名称
  28 + CooperationModeName string `json:"cooperationModeName"`
  29 + // 组织机构名称
  30 + OrgName string `json:"orgName"`
  31 +}
  32 +
  33 +func (dto *CooperationContractByUndertakerDto) LoadDto(contractByUndertaker *models.CooperationContractByUndertaker) error {
  34 + dto.UndertakerId = contractByUndertaker.CooperationContractUndertakerId
  35 + dto.UndertakerCode = contractByUndertaker.UndertakerCode
  36 + dto.UndertakerName = contractByUndertaker.UndertakerName
  37 + dto.UndertakerPhone = contractByUndertaker.UndertakerPhone
  38 + dto.CooperationContractNumber = contractByUndertaker.CooperationContractNumber
  39 + dto.CooperationContractName = contractByUndertaker.CooperationContractName
  40 + dto.Attachment = contractByUndertaker.ContractAttachment
  41 + dto.SponsorName = contractByUndertaker.CooperationContractSponsor.UserName
  42 + if contractByUndertaker.Department != nil {
  43 + dto.DepartmentName = contractByUndertaker.Department.DepartmentName
  44 + }
  45 + dto.CooperationModeName = contractByUndertaker.CooperationModeName
  46 + if contractByUndertaker.Org != nil {
  47 + dto.OrgName = contractByUndertaker.Org.OrgName
  48 + }
  49 + return nil
  50 +}
  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 + // 公司ID,通过集成REST上下文获取
  21 + CompanyId int64 `cname:"公司ID" json:"companyId"`
  22 + // 组织机构ID
  23 + OrgId int64 `cname:"组织机构ID" json:"orgId"`
  24 + // 关联的组织机构ID列表
  25 + OrgIds []int64 `cname:"关联的组织机构ID列表" json:"orgIds"`
  26 + // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员
  27 + UserId int64 `cname:"用户ID" json:"userId"`
  28 + // 用户基础数据id
  29 + UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId"`
  30 +}
  31 +
  32 +func (searchCooperationContractQuery *SearchCooperationContractQuery) Valid(validation *validation.Validation) {
  33 + //validation.SetError("CustomValid", "未实现的自定义认证")
  34 +}
  35 +
  36 +func (searchCooperationContractQuery *SearchCooperationContractQuery) ValidateQuery() error {
  37 + valid := validation.Validation{}
  38 + b, err := valid.Valid(searchCooperationContractQuery)
  39 + if err != nil {
  40 + return err
  41 + }
  42 + if !b {
  43 + elem := reflect.TypeOf(searchCooperationContractQuery).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 +}
  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 +}