作者 yangfu

模型初始化

正在显示 71 个修改的文件 包含 4770 行增加0 行删除

要显示太多修改。

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

# Compiled Object codefiles, Static and Dynamic libs (Shared Objects)
*.o
*.a
*.so
# Folders
_obj
_test
# Architecture specific extensions/prefixes
*.[568vq]
[568vq].out
*.cgo1.go
*.cgo2.c
_cgo_defun.c
_cgo_gotypes.go
_cgo_export.*
_testmain.go
*.exe
*.test
.log
.idea
swagger.json
swagger.yaml
*.log
\ No newline at end of file
... ...
FROM 192.168.0.243:5000/mmm/allied-creation-manufacture:20210809
ENV APP_DIR $GOPATH/src/project-20211220
RUN mkdir -p $APP_DIR
WORKDIR $APP_DIR/
COPY ./pkg pkg
COPY ./config config
COPY ./go.mod go.mod
COPY ./go.sum go.sum
COPY ./main.go main.go
RUN ["ln","-sf","/usr/share/zoneinfo/Asia/Shanghai","/etc/localtime"]
ENV GO111MODULE on
ENV GOPROXY https://goproxy.cn
RUN ["go","mod","tidy"]
RUN ["go","build"]
RUN ["ls"]
ENTRYPOINT ["./allied-creation-manufacture"]
\ No newline at end of file
... ...
#project
\ No newline at end of file
... ...
-----BEGIN RSA PRIVATE KEY-----
MIIEpQIBAAKCAQEAy0OxRf+NheQG9epxbrudwnrzqVgqK5zCuRAkLUgaSMATVXEA
iDzJN39om+Q49MmtEk4pXGzKUyzkFJG96PA8tJq0E+bSDtSK3n+2mjZb6pChmgHw
KEX7T8ZVLqJBSrfrI4Z2BJDNEC+3wvVW3zpog1RlfKgft6NYUzNLUqE5Mxzq7lpD
eRsq+FhzM1sOeEb2dAmUlDDs+7HcR3Kj0ttKeg+hKqIottQ/H6Tq4c8deEQGnO0+
RN3CygyETbYmLuWttI/sUltulWJALIuU81Yr6uCOq5MSt2WsU8CTuhRwGXSvcQCO
FLYppYktoMDOGIBQffmJc/DdT1d35fvdpKbm+QIDAQABAoIBAQC8X7+qX2uI6gqJ
XPxC4x0RX2DxUAPE50KOv6bHUEsLoPZJ+K/Fko/oHuuTja47Lax3inhKb4gSDUhS
x754YivgNH8u8ns5wz/vc+yGflowyFj7oVAwAqslA2luDnD0Df6crcAx+wAQQCjN
RRF9T2QMUeq73BOI3Ji+gosLyN55vms2KadrwpPQwYN7qhdrerE7vPqCZeswzs1/
A5M9PVGBG+simNea5kv+tVJUdLi6ckGAB5KabyhpG779ckwzV/aZy3wIj4SvUvCd
bewH0xPHx5TqnMOXtzHgktClmL7hIYxy9sL14Dn0KVHbyolQ7IqmJtjXYqG84Fmx
AfyDfeABAoGBAPP820tKElrfTuZ+Z19kJBTp6I5iax2Ph10glUHLlLqJ82clI/Gl
CbMtnGmD72HfnJei82xqoVLsUkN9Sp+TSNJALh4N8rHkAtwq5kWToiAWZydwxVsp
x5OWEN3+QFIdjVW6fhg6jZSK5HHIqMdZOVvbfKP+Cv9fWWzlS7/WVTlJAoGBANVF
kol+KojM4DEASrw0s1mfPr0XvUFvKJ2TgVGR3HxAk4r0e0WwJdSfwGiB/ePcc6g5
D5dxBe8W5g3+V0DaC0f1DDNXg2MjYWoByWrurbm14FRnpMnx/UfZLo7rq8T9YrUT
Bd/y0/JasndN27bIfd60n233IYMqhV2+wBwqD3AxAoGAE2/wdHYJMk4Z9gjZ6WKL
8VKVIUq759X4XbXrzhsO1TGKP4xY6bZRKIIYtNs65dwvmHD13Yw9H+MNxqyjlkTg
h0dvpRtNW1ij1bBhOefCAbZnL2AviMyyRpKs81J/A0uxZ8P8qad4gf3ypxHqSD9W
b3fz3QivDZsl/6Pgvf6wOWkCgYEA1Cv9x5lj2WrxEu62axyG3P9nHBm055cdsf5g
JfVVg6t+3TuyM7c1O52efpnsKrdTvKTf1QrVG3INdxh0V4lUtcac16sVhBhbvml+
p0pCPMIrJe1ibKG5F7SB9B+TaEuo2nnNW2mp367JY5VqoyI8zsWk4nJ8vZAc1BGD
78EMUNECgYEAtV0pta3GuHKOLX1HMRsUsYuWjLqAbahnciF6MnjNWSonEK3VjMhI
g+krP/9sWoC3cFOG+4s96ubjDTWImvQvCrPaENdvlNwgp035bn51eFRv00QchM2H
VCS9Nhoqj5BIHl1G7Q13+tYTzjUWtteG902nWDVhgSlNLJf1rbTn34g=
-----END RSA PRIVATE KEY-----
... ...
-----BEGIN CERTIFICATE-----
MIIGazCCBVOgAwIBAgIQZBwijHoFToh2kjGwQ1E6bjANBgkqhkiG9w0BAQsFADBc
MQswCQYDVQQGEwJDTjEaMBgGA1UEChMRV29UcnVzIENBIExpbWl0ZWQxMTAvBgNV
BAMMKFdvVHJ1cyBPViBTZXJ2ZXIgQ0EgIFtSdW4gYnkgdGhlIElzc3Vlcl0wHhcN
MjEwMjA0MDAwMDAwWhcNMjIwMzA2MjM1OTU5WjCB0TELMAkGA1UEBhMCQ04xDzAN
BgNVBBETBjM1MDAxNTESMBAGA1UEBwwJ56aP5bee5biCMU8wTQYDVQQJDEbpqazl
sL7ljLrmuZbph4zot68yN+WPtzEj5qW85LqU5qW8NTEw44CBNTEx5a6k77yI6Ieq
6LS46K+V6aqM5Yy65YaF77yJMTAwLgYDVQQKDCfnpo/lu7rkubDkubDkubDkv6Hm
ga/np5HmioDmnInpmZDlhazlj7gxGjAYBgNVBAMMESouZmptYWltYWltYWkuY29t
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAy0OxRf+NheQG9epxbrud
wnrzqVgqK5zCuRAkLUgaSMATVXEAiDzJN39om+Q49MmtEk4pXGzKUyzkFJG96PA8
tJq0E+bSDtSK3n+2mjZb6pChmgHwKEX7T8ZVLqJBSrfrI4Z2BJDNEC+3wvVW3zpo
g1RlfKgft6NYUzNLUqE5Mxzq7lpDeRsq+FhzM1sOeEb2dAmUlDDs+7HcR3Kj0ttK
eg+hKqIottQ/H6Tq4c8deEQGnO0+RN3CygyETbYmLuWttI/sUltulWJALIuU81Yr
6uCOq5MSt2WsU8CTuhRwGXSvcQCOFLYppYktoMDOGIBQffmJc/DdT1d35fvdpKbm
+QIDAQABo4ICsTCCAq0wHwYDVR0jBBgwFoAUDUmPFTN7wE+2+zo4Cfw0Fdpg3RQw
HQYDVR0OBBYEFMGZEgzwtp+UhpTAS9nmSxlo9tIlMA4GA1UdDwEB/wQEAwIFoDAM
BgNVHRMBAf8EAjAAMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjBJBgNV
HSAEQjBAMDQGCysGAQQBsjEBAgIWMCUwIwYIKwYBBQUHAgEWF2h0dHBzOi8vc2Vj
dGlnby5jb20vQ1BTMAgGBmeBDAECAjA9BgNVHR8ENjA0MDKgMKAuhixodHRwOi8v
Y3JsLmNybG9jc3AuY24vV29UcnVzT1ZTZXJ2ZXJDQV8yLmNybDBsBggrBgEFBQcB
AQRgMF4wOAYIKwYBBQUHMAKGLGh0dHA6Ly9haWEuY3Jsb2NzcC5jbi9Xb1RydXNP
VlNlcnZlckNBXzIuY3J0MCIGCCsGAQUFBzABhhZodHRwOi8vb2NzcC5jcmxvY3Nw
LmNuMIIBBQYKKwYBBAHWeQIEAgSB9gSB8wDxAHcARqVV63X6kSAwtaKJafTzfREs
QXS+/Um4havy/HD+bUcAAAF3brV9qAAABAMASDBGAiEAjrXS+1JJW9jag/XfW+kY
oL4sGGDNvcZgV35E0EcGQVACIQCjQh8k5oSFtqo7Qrbx2k3OISjfPSYRXNNsG4Ba
MyDmRwB2AN+lXqtogk8fbK3uuF9OPlrqzaISpGpejjsSwCBEXCpzAAABd261fdAA
AAQDAEcwRQIgcPQQJ3rkCFaQPKwT3rtfQkr0taPzw0KW7yqu+MtmBH0CIQChKeMk
v7Xs0z7J47lM6HTPOU+xXL2riC69LC1KCOS6GTAtBgNVHREEJjAkghEqLmZqbWFp
bWFpbWFpLmNvbYIPZmptYWltYWltYWkuY29tMA0GCSqGSIb3DQEBCwUAA4IBAQBn
+jDy7sZS0gZzwMR4hnZHWqFYcJR3wnk77xr+5Yu2ifhlxaLHE3rEY3xTR9LsPwfW
pdg2McinPCI6vs009NYIpeTiHzVDPzKu2BaUfKj+EHLwZQGfXkNhp3cpqZMiTkr/
YNqf25GXsBa+spwzyHh9MBXXCfWRfdHX7JlH5zyoLNztTp8unxaRYldjghHDA3Q7
8Fyz6OncY3I4U4KKBSq2/TTxveDW6NxTTuJTPOg3/qSIkwdOBLuIzuhxmF4D9wpl
LMHmne2CilVeg73/GAzQt/w7FzmdvaHPAOVYWzdaTNALiXJxbi7EyO8q/uNK0GqY
hljMsnA1hApG+/2sOP/P
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
MIIF4TCCA8mgAwIBAgIQHQgpVDhMv3SvabmRFpvwLTANBgkqhkiG9w0BAQwFADCB
iDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0pl
cnNleSBDaXR5MR4wHAYDVQQKExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNV
BAMTJVVTRVJUcnVzdCBSU0EgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMjAw
MTA4MDAwMDAwWhcNMzAwMTA3MjM1OTU5WjBcMQswCQYDVQQGEwJDTjEaMBgGA1UE
ChMRV29UcnVzIENBIExpbWl0ZWQxMTAvBgNVBAMMKFdvVHJ1cyBPViBTZXJ2ZXIg
Q0EgIFtSdW4gYnkgdGhlIElzc3Vlcl0wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw
ggEKAoIBAQCARFLq6kqQRZ4SdFMPdd3XJTcOdVVT5bvZZx0VVDrkw3TmSAloQVFf
RhqDOSXg4CsIaa64qFSrC3a5sc8LgRhx7AUdvoUdfvdxIY1uoyxRWpoWO8oTUkSn
EXjEPf+zrcU5cWTOi32xWL9vklYds7iOQwgsKAHDzt4an8MLGvcLxAHciyiKcDEh
HZOGUHO5bKaCq+kP2rJCfVSlNvdyl1B8q+aGWXoi0gXGVL7WX4pcWj+DGuITbLB2
MzMytse4MjLJ84zaXh0UD4STlyD8tu/fakdxIwQ7K3/pP3RoGj1R9CvMWXUU+fZm
KNLW5565hd9Bh3Wkz8b4ApgMD9o3RUjTAgMBAAGjggFwMIIBbDAfBgNVHSMEGDAW
gBRTeb9aqitKz1SA4dibwJ3ysgNmyzAdBgNVHQ4EFgQUDUmPFTN7wE+2+zo4Cfw0
Fdpg3RQwDgYDVR0PAQH/BAQDAgGGMBIGA1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0l
BBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMCIGA1UdIAQbMBkwDQYLKwYBBAGyMQEC
AhYwCAYGZ4EMAQICMFAGA1UdHwRJMEcwRaBDoEGGP2h0dHA6Ly9jcmwudXNlcnRy
dXN0LmNvbS9VU0VSVHJ1c3RSU0FDZXJ0aWZpY2F0aW9uQXV0aG9yaXR5LmNybDBx
BggrBgEFBQcBAQRlMGMwOgYIKwYBBQUHMAKGLmh0dHA6Ly9jcnQudXNlcnRydXN0
LmNvbS9VU0VSVHJ1c3RSU0FBQUFDQS5jcnQwJQYIKwYBBQUHMAGGGWh0dHA6Ly9v
Y3NwLnVzZXJ0cnVzdC5jb20wDQYJKoZIhvcNAQEMBQADggIBAA5G7XA+fNKyj7Fy
uotoII38/32eZ4UrC1vGFPEtDyd0yzOrr7SvQUoO2GLxFzIQ0SsgMNXJ4UAhMkTD
yz1OA0tx0g0GjOQXBGA/yfRR7SgitRJAdbqkPfppMn+dtKXCHHx35ohTL0PklRdb
mXacvR7rXUIiJMdsvZZqYwc+DpGJ+Zv0sRJZEL7pm1oZv6EV+UzjAlOnLe6yrnyD
c99Kk1H/RFPUzduUWjiVR2aMDT1oMiwYeB2Zq60Sb201jqZPNQj5E+TkDD5BPFVc
kLeRi3LyXBUuBvXPsdLtBNlr+LExtCDd66kjeUe2/YbTHF4ai5PZPraQxgbOJJyc
gizGl/JOgrIQPUOLSQvXlxpKEqS+0z6KqV52bco2PNrC0f8ILKuw0nsfhgcGy46d
Su8fmU9+FT6e61i2nteKvt8qkkSkAJKQxRUWYduN24mG/OOIkoeOPdYHi+qEfbyI
qxiiqcH9cZgLK9AVuJoKtt7vg21OyrWi7S5T/WbTfTz9XL7QGe8ZODZZx6d50uo/
lDOmXm3p/kdGApvUF1UrL+og22jBLi0Ns6xzCfzrI3SpC9abvU8E9EnxQABuu/gM
/B63dbaZzSsMVFxeECD9nMWv7IH+/rqyGmjqEJzgKdPGvXhqpebQ1HhWrV+j+ipc
jplXB1j3GCozDFsninXG102N6wC8
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
MIIFgTCCBGmgAwIBAgIQOXJEOvkit1HX02wQ3TE1lTANBgkqhkiG9w0BAQwFADB7
MQswCQYDVQQGEwJHQjEbMBkGA1UECAwSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYD
VQQHDAdTYWxmb3JkMRowGAYDVQQKDBFDb21vZG8gQ0EgTGltaXRlZDEhMB8GA1UE
AwwYQUFBIENlcnRpZmljYXRlIFNlcnZpY2VzMB4XDTE5MDMxMjAwMDAwMFoXDTI4
MTIzMTIzNTk1OVowgYgxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpOZXcgSmVyc2V5
MRQwEgYDVQQHEwtKZXJzZXkgQ2l0eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBO
ZXR3b3JrMS4wLAYDVQQDEyVVU0VSVHJ1c3QgUlNBIENlcnRpZmljYXRpb24gQXV0
aG9yaXR5MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAgBJlFzYOw9sI
s9CsVw127c0n00ytUINh4qogTQktZAnczomfzD2p7PbPwdzx07HWezcoEStH2jnG
vDoZtF+mvX2do2NCtnbyqTsrkfjib9DsFiCQCT7i6HTJGLSR1GJk23+jBvGIGGqQ
Ijy8/hPwhxR79uQfjtTkUcYRZ0YIUcuGFFQ/vDP+fmyc/xadGL1RjjWmp2bIcmfb
IWax1Jt4A8BQOujM8Ny8nkz+rwWWNR9XWrf/zvk9tyy29lTdyOcSOk2uTIq3XJq0
tyA9yn8iNK5+O2hmAUTnAU5GU5szYPeUvlM3kHND8zLDU+/bqv50TmnHa4xgk97E
xwzf4TKuzJM7UXiVZ4vuPVb+DNBpDxsP8yUmazNt925H+nND5X4OpWaxKXwyhGNV
icQNwZNUMBkTrNN9N6frXTpsNVzbQdcS2qlJC9/YgIoJk2KOtWbPJYjNhLixP6Q5
D9kCnusSTJV882sFqV4Wg8y4Z+LoE53MW4LTTLPtW//e5XOsIzstAL81VXQJSdhJ
WBp/kjbmUZIO8yZ9HE0XvMnsQybQv0FfQKlERPSZ51eHnlAfV1SoPv10Yy+xUGUJ
5lhCLkMaTLTwJUdZ+gQek9QmRkpQgbLevni3/GcV4clXhB4PY9bpYrrWX1Uu6lzG
KAgEJTm4Diup8kyXHAc/DVL17e8vgg8CAwEAAaOB8jCB7zAfBgNVHSMEGDAWgBSg
EQojPpbxB+zirynvgqV/0DCktDAdBgNVHQ4EFgQUU3m/WqorSs9UgOHYm8Cd8rID
ZsswDgYDVR0PAQH/BAQDAgGGMA8GA1UdEwEB/wQFMAMBAf8wEQYDVR0gBAowCDAG
BgRVHSAAMEMGA1UdHwQ8MDowOKA2oDSGMmh0dHA6Ly9jcmwuY29tb2RvY2EuY29t
L0FBQUNlcnRpZmljYXRlU2VydmljZXMuY3JsMDQGCCsGAQUFBwEBBCgwJjAkBggr
BgEFBQcwAYYYaHR0cDovL29jc3AuY29tb2RvY2EuY29tMA0GCSqGSIb3DQEBDAUA
A4IBAQAYh1HcdCE9nIrgJ7cz0C7M7PDmy14R3iJvm3WOnnL+5Nb+qh+cli3vA0p+
rvSNb3I8QzvAP+u431yqqcau8vzY7qN7Q/aGNnwU4M309z/+3ri0ivCRlv79Q2R+
/czSAaF9ffgZGclCKxO/WIu6pKJmBHaIkU4MiRTOok3JMrO66BQavHHxW/BBC5gA
CiIDEOUMsfnNkjcZ7Tvx5Dq2+UUTJnWvu6rvP3t3O9LEApE9GQDTF1w52z97GA1F
zZOFli9d31kWTz9RvdVFGD/tSo7oBmF0Ixa1DVBzJ0RHfxBdiSprhTEUxOipakyA
vGp4z7h/jnZymQyd/teRCBaho1+V
-----END CERTIFICATE-----
... ...
#!/bin/bash
export PATH=/root/local/bin:$PATH
kubectl -n <replace-your-k8s-namespace> get pods | grep -q project
if [ "$?" == "1" ];then
kubectl create -f /tmp/dev/project/project.yaml --record
kubectl -n <replace-your-k8s-namespace> get svc | grep -q project
if [ "$?" == "0" ];then
echo "project service install success!"
else
echo "project service install fail!"
fi
kubectl -n <replace-your-k8s-namespace> get pods | grep -q project
if [ "$?" == "0" ];then
echo "project deployment install success!"
else
echo "project deployment install fail!"
fi
else
kubectl delete -f /tmp/dev/project/project.yaml
kubectl -n <replace-your-k8s-namespace> get svc | grep -q project
while [ "$?" == "0" ]
do
kubectl -n <replace-your-k8s-namespace> get svc | grep -q project
done
kubectl -n <replace-your-k8s-namespace> get pods | grep -q project
while [ "$?" == "0" ]
do
kubectl -n <replace-your-k8s-namespace> get pods | grep -q project
done
kubectl create -f /tmp/dev/project/project.yaml --record
kubectl -n <replace-your-k8s-namespace> get svc | grep -q project
if [ "$?" == "0" ];then
echo "project service update success!"
else
echo "project service update fail!"
fi
kubectl -n <replace-your-k8s-namespace> get pods | grep -q project
if [ "$?" == "0" ];then
echo "project deployment update success!"
else
echo "project deployment update fail!"
fi
fi
\ No newline at end of file
... ...
apiVersion: v1
kind: Service
metadata:
name: project
namespace: <replace-your-k8s-namespace>
labels:
k8s-app: project
spec:
ports:
- name: "http"
port: 80
targetPort: 8082
selector:
k8s-app: project
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: project
namespace: <replace-your-k8s-namespace>
labels:
k8s-app: project
spec:
replicas: 1
template:
metadata:
labels:
k8s-app: project
spec:
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- preference: {}
weight: 100
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- cn-hangzhou.i-bp1djh1xn7taumbue1ze
- cn-hangzhou.i-bp1djh1xn7taumbue1zd
- cn-hangzhou.i-bp1euf5u1ph9kbhtndhb
- cn-hangzhou.i-bp1hyp5oips9cdwxxgxy
containers:
- name: project
image: 192.168.0.243:5000/mmm/project:dev
imagePullPolicy: Always
ports:
- containerPort: 8082
volumeMounts:
- mountPath: /opt/logs
name: accesslogs
env:
- name: LOG_LEVEL
value: "debug"
- name: ERROR_BASE_CODE
value: "1"
- name: ERROR_BASE_CODE_MULTIPLE
value: "1000"
volumes:
- name: accesslogs
emptyDir: {}
\ No newline at end of file
... ...
module gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture
go 1.16
require (
github.com/beego/beego/v2 v2.0.1
github.com/go-pg/pg/v10 v10.9.0
github.com/klauspost/compress v1.11.8 // indirect
github.com/linmadan/egglib-go v0.0.0-20210313060205-8b5e456b11f7
github.com/onsi/ginkgo v1.15.2 // indirect
github.com/onsi/gomega v1.11.0 // indirect
golang.org/x/text v0.3.5 // indirect
)
replace github.com/linmadan/egglib-go v0.0.0-20210313060205-8b5e456b11f7 => github.com/tiptok/egglib-go v0.0.0-20210608073225-c852ce95ae34
... ...
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/ClickHouse/clickhouse-go v1.4.3/go.mod h1:EaI/sW7Azgz9UATzd5ZdZHRUhHgv5+JMS9NSr2smCJI=
github.com/DATA-DOG/go-sqlmock v1.4.1/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM=
github.com/Knetic/govaluate v3.0.0+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0=
github.com/Shopify/sarama v1.25.0 h1:ch1ywjRLjfJtU+EaiJ+l0rWffQ6TRpyYmW4DX7Cb2SU=
github.com/Shopify/sarama v1.25.0/go.mod h1:y/CFFTO9eaMTNriwu/Q+W4eioLqiDMGkA1W+gmdfj8w=
github.com/Shopify/toxiproxy v2.1.4+incompatible h1:TKdv8HiTLgE5wdJuEML90aBgNWsokNbMijUGhmcoBJc=
github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI=
github.com/StackExchange/wmi v0.0.0-20170410192909-ea383cf3ba6e/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg=
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
github.com/alicebob/gopher-json v0.0.0-20180125190556-5a6b3ba71ee6/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc=
github.com/alicebob/miniredis v2.5.0+incompatible/go.mod h1:8HZjEj4yU0dwhYHky+DxYx+6BMjkBbe5ONFIF1MXffk=
github.com/antihax/optional v0.0.0-20180407024304-ca021399b1a6/go.mod h1:V8iCPQYkqmusNa815XgQio277wI47sdRh1dUOLdyC6Q=
github.com/beego/beego/v2 v2.0.1 h1:07a7Z0Ok5vbqyqh+q53sDPl9LdhKh0ZDy3gbyGrhFnE=
github.com/beego/beego/v2 v2.0.1/go.mod h1:8zyHi1FnWO1mZLwTn62aKRIZF/aIKvkCBB2JYs+eqQI=
github.com/beego/goyaml2 v0.0.0-20130207012346-5545475820dd/go.mod h1:1b+Y/CofkYwXMUU0OhQqGvsY2Bvgr4j6jfT699wyZKQ=
github.com/beego/x2j v0.0.0-20131220205130-a0352aadc542/go.mod h1:kSeGC/p1AbBiEp5kat81+DSQrZenVBZXklMLaELspWU=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
github.com/bkaradzic/go-lz4 v1.0.0/go.mod h1:0YdlkowM3VswSROI7qDxhRvJ3sLhlFrRRwjwegp5jy4=
github.com/bradfitz/gomemcache v0.0.0-20180710155616-bc664df96737/go.mod h1:PmM6Mmwb0LSuEubjR8N7PtNe1KxZLtOUHtbeikc5h60=
github.com/casbin/casbin v1.7.0/go.mod h1:c67qKN6Oum3UF5Q1+BByfFxkwKvhwW57ITjqwtzR1KE=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY=
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/cloudflare/golz4 v0.0.0-20150217214814-ef862a3cdc58/go.mod h1:EOBUe0h4xcZ5GoxqC5SDxFQ8gwyZPKQoEzownBlhI80=
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8=
github.com/coreos/etcd v3.3.25+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
github.com/coreos/go-systemd/v22 v22.0.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk=
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
github.com/couchbase/go-couchbase v0.0.0-20200519150804-63f3cdb75e0d/go.mod h1:TWI8EKQMs5u5jLKW/tsb9VwauIrMIxQG1r5fMsswK5U=
github.com/couchbase/gomemcached v0.0.0-20200526233749-ec430f949808/go.mod h1:srVSlQLB8iXBVXHgnqemxUXqN6FCvClgCMPCsjBDR7c=
github.com/couchbase/goutils v0.0.0-20180530154633-e865a1461c8a/go.mod h1:BQwMFlJzDjFDG3DJUdU0KORxn88UlsOULuxLExMh3Hs=
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY=
github.com/cupcake/rdb v0.0.0-20161107195141-43ba34106c76/go.mod h1:vYwsqCOLxGiisLwp9rITslkFNpZD5rz43tf41QFkTWY=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dchest/siphash v1.2.1/go.mod h1:q+IRvb2gOSrUnYoPqHiyHXS0FOBBOdl6tONBlVnOnt4=
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
github.com/eapache/go-resiliency v1.1.0 h1:1NtRmCAqadE2FN4ZcN6g90TP3uk8cg9rn9eNK2197aU=
github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs=
github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21 h1:YEetp8/yCZMuEPMUDHG0CW/brkkEp8mzqk2+ODEitlw=
github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU=
github.com/eapache/queue v1.1.0 h1:YOEu7KNc61ntiQlcEeUIoDTJ2o8mQznoNvUhiigpIqc=
github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I=
github.com/edsrzf/mmap-go v0.0.0-20170320065105-0bce6a688712/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M=
github.com/elastic/go-elasticsearch/v6 v6.8.5/go.mod h1:UwaDJsD3rWLM5rKNFzv9hgox93HoX8utj1kxD9aFUcI=
github.com/elazarl/go-bindata-assetfs v1.0.0 h1:G/bYguwHIzWq9ZoyUQqrjTmJbbYn3j3CKKpKinvZLFk=
github.com/elazarl/go-bindata-assetfs v1.0.0/go.mod h1:v+YaWX3bdea5J/mo8dSETolEo7R71Vk1u8bnjau5yw4=
github.com/emicklei/proto v1.9.0/go.mod h1:rn1FgRS/FANiZdD2djyH7TMA9jdRDcYQ9IEN9yvjX0A=
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU=
github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw=
github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g=
github.com/frankban/quicktest v1.4.1/go.mod h1:36zfPVQyHxymz4cH7wlDmVwDrJuljRB60qkgn7rorfQ=
github.com/frankban/quicktest v1.7.2 h1:2QxQoC1TS09S7fhCPsrvqYdvP1H5M1P1ih5ABm3BTYk=
github.com/frankban/quicktest v1.7.2/go.mod h1:jaStnuzAqU1AJdCO0l53JDCJrVDKcS03DbaAcR7Ks/o=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4=
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/glendc/gopher-json v0.0.0-20170414221815-dc4743023d0c/go.mod h1:Gja1A+xZ9BoviGJNA2E9vFkPjjsl+CoJxSXiQM1UXtw=
github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q=
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8=
github.com/go-pg/pg/v10 v10.7.7/go.mod h1:d0w17Xw5x2DtbD/UgB9rnZg3FAck3eDHXff0Srrzuuk=
github.com/go-pg/pg/v10 v10.9.0 h1:mNIxE7H7/5fHOniVrLgUXNoIgHiJXXvhiNY+PxqtV6k=
github.com/go-pg/pg/v10 v10.9.0/go.mod h1:rgmTPgHgl5EN2CNKKoMwC7QT62t8BqsdpEkUQuiZMQs=
github.com/go-pg/zerochecker v0.2.0 h1:pp7f72c3DobMWOb2ErtZsnrPaSvHd2W4o9//8HtF4mU=
github.com/go-pg/zerochecker v0.2.0/go.mod h1:NJZ4wKL0NmTtz0GKCoJ8kym6Xn/EQzXRl2OnAe7MmDo=
github.com/go-redis/redis v6.14.2+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA=
github.com/go-redis/redis v6.15.7+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA=
github.com/go-redis/redis/v7 v7.4.0/go.mod h1:JDNMw23GTyLNC4GZu9njt15ctBQVn7xjRfnwdHj/Dcg=
github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
github.com/go-xorm/builder v0.3.4/go.mod h1:KxkQkNN1DpPKTedxXyTQcmH+rXfvk4LZ9SOOBoZBAxw=
github.com/go-xorm/sqlfiddle v0.0.0-20180821085327-62ce714f951a/go.mod h1:56xuuqnHyryaerycW3BfssRdxQstACi0Epw/yC5E2xM=
github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM=
github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/golang/snappy v0.0.0-20170215233205-553a64147049/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4=
github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/gomodule/redigo v2.0.0+incompatible/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4=
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/gops v0.3.7/go.mod h1:bj0cwMmX1X4XIJFTjR99R5sCxNssNJ8HebFNvoQlmgY=
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY=
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
github.com/grpc-ecosystem/grpc-gateway v1.14.3/go.mod h1:6CwZWGDSPRJidgKAtJVvND6soZe6fT7iteq8wDPdhb0=
github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542/go.mod h1:Ow0tF8D4Kplbc8s8sSb3V2oUCygFHVp8gC3Dn6U4MNI=
github.com/hashicorp/go-uuid v1.0.1 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE=
github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc=
github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/iancoleman/strcase v0.1.2/go.mod h1:SK73tn/9oHe+/Y0h39VT4UCxmurVJkR5NA7kMEAOgSE=
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
github.com/jcmturner/gofork v0.0.0-20190328161633-dc7c13fece03 h1:FUwcHNlEqkqLjLBdCp5PRlCFijNjvcYANOZXzCfXwCM=
github.com/jcmturner/gofork v0.0.0-20190328161633-dc7c13fece03/go.mod h1:MK8+TM0La+2rjBD4jE12Kj1pCCxK7d2LK/UM3ncEo0o=
github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E=
github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
github.com/jmoiron/sqlx v1.2.0/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks=
github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
github.com/justinas/alice v1.2.0/go.mod h1:fN5HRH/reO/zrUflLfTN43t3vXvKzvZIENsNEe7i7qA=
github.com/kardianos/osext v0.0.0-20170510131534-ae77be60afb1/go.mod h1:1NbS8ALrpOvjt0rHPNLyCIeMtbizbir8U//inJ+zuB8=
github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0/go.mod h1:1NbS8ALrpOvjt0rHPNLyCIeMtbizbir8U//inJ+zuB8=
github.com/keybase/go-ps v0.0.0-20161005175911-668c8856d999/go.mod h1:hY+WOq6m2FpbvyrI93sMaypsttvaIL5nhVR92dTMUcQ=
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/klauspost/compress v1.9.7/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A=
github.com/klauspost/compress v1.11.8 h1:difgzQsp5mdAz9v8lm3P/I+EpDKMU/6uTMw1y1FObuo=
github.com/klauspost/compress v1.11.8/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs=
github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/ledisdb/ledisdb v0.0.0-20200510135210-d35789ec47e6/go.mod h1:n931TsDuKuq+uX4v1fulaMbA/7ZLLhjc85h7chZGBCQ=
github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/lib/pq v1.3.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/logrusorgru/aurora v2.0.3+incompatible/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4=
github.com/magefile/mage v1.10.0 h1:3HiXzCUY12kh9bIuyXShaVe529fJfyqoVM42o/uom2g=
github.com/magefile/mage v1.10.0/go.mod h1:z5UZb/iS3GoOSn0JgWuiw7dxlurVYTu+/jHXqQg881A=
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE=
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
github.com/mattn/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
github.com/mattn/go-sqlite3 v2.0.3+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU=
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/mitchellh/mapstructure v1.3.3 h1:SzB1nHZ2Xi+17FP0zVQBHIZqvwRN9408fJO8h+eeNA8=
github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8=
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32/go.mod h1:9wM+0iRr9ahx58uYLpLIr5fm8diHn0JbqRycJi6w0Ms=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo=
github.com/olekukonko/tablewriter v0.0.4/go.mod h1:zq6QwlOf5SlnkVbMSr5EoBv3636FWnp+qbPhuoO21uA=
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg=
github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk=
github.com/onsi/ginkgo v1.14.2/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY=
github.com/onsi/ginkgo v1.15.2 h1:l77YT15o814C2qVL47NOyjV/6RbaP7kKdrvZnxQ3Org=
github.com/onsi/ginkgo v1.15.2/go.mod h1:Dd6YFfwBW84ETqqtL0CPyPXillHgY6XhQH3uuCCTr/o=
github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
github.com/onsi/gomega v1.10.3/go.mod h1:V9xEwhxec5O8UDM77eCW8vLymOMltsqPVYWrpDsH8xc=
github.com/onsi/gomega v1.11.0 h1:+CqWgvj0OZycCaqclBD1pxKHAU+tOkHmQIWvDHq2aug=
github.com/onsi/gomega v1.11.0/go.mod h1:azGKhqFUon9Vuj0YmTfLSmx0FUwqXYSTl5re8lQLTUg=
github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc=
github.com/pelletier/go-toml v1.0.1/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
github.com/pelletier/go-toml v1.8.1/go.mod h1:T2/BmBdy8dvIRq1a/8aqjN41wvWlN4lrapLU/GW4pbc=
github.com/peterh/liner v1.0.1-0.20171122030339-3681c2a91233/go.mod h1:xIteQHvHuaLYG9IFj6mSxM0fCKrs34IrEQUhOYuGPHc=
github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
github.com/pierrec/lz4 v2.2.6+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
github.com/pierrec/lz4 v2.5.1+incompatible h1:Yq0up0149Hh5Ekhm/91lgkZuD1ZDnXNM26bycpTzYBM=
github.com/pierrec/lz4 v2.5.1+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
github.com/prometheus/client_golang v1.5.1/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU=
github.com/prometheus/client_golang v1.7.0 h1:wCi7urQOGBsYcQROHqpUUX4ct84xp40t9R9JX0FuA/U=
github.com/prometheus/client_golang v1.7.0/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M=
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M=
github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4=
github.com/prometheus/common v0.10.0 h1:RyRA7RzGXQZiW+tGMr7sxa85G1z0yOpM1qq5c8lNawc=
github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo=
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A=
github.com/prometheus/procfs v0.1.3 h1:F0+tqvhOksq22sc6iCHF5WGlWjdwj92p0udFh1VFBS8=
github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU=
github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a h1:9ZKAASQSHhDYGoxY8uLVpewe1GDZ2vu2Tr/vTdVAkFQ=
github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/shiena/ansicolor v0.0.0-20151119151921-a422bbe96644 h1:X+yvsM2yrEktyI+b2qND5gpH8YhURn0k8OCaeRnkINo=
github.com/shiena/ansicolor v0.0.0-20151119151921-a422bbe96644/go.mod h1:nkxAfR/5quYxwPZhyDxgasBMnRtBZd0FCEpawpjMUFg=
github.com/shirou/gopsutil v0.0.0-20180427012116-c95755e4bcd7/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=
github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4/go.mod h1:qsXQc7+bwAM3Q1u/4XEfrquwF8Lw7D7y5cD8CuHnfIc=
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
github.com/siddontang/go v0.0.0-20170517070808-cb568a3e5cc0/go.mod h1:3yhqj7WBBfRhbBlzyOC3gUxftwsU0u8gqevxwIHQpMw=
github.com/siddontang/goredis v0.0.0-20150324035039-760763f78400/go.mod h1:DDcKzU3qCuvj/tPnimWSsZZzvk9qvkvrIL5naVBPh5s=
github.com/siddontang/rdb v0.0.0-20150307021120-fc89ed2e418d/go.mod h1:AMEsy7v5z92TR1JKMkLLoaOQk++LVnOKL3ScbJ8GNGA=
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
github.com/sirupsen/logrus v1.8.0 h1:nfhvjKcUMhBMVqbKHJlk5RPrrfYr/NMo3692g0dwfWU=
github.com/sirupsen/logrus v1.8.0/go.mod h1:4GuYW9TZmE769R5STWrRakJc4UqQ3+QQ95fyz7ENv1A=
github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM=
github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/ssdb/gossdb v0.0.0-20180723034631-88f6b59b84ec/go.mod h1:QBvMkMya+gXctz3kmljlUCu/yB3GZ6oee+dUozsezQE=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/syndtr/goleveldb v0.0.0-20160425020131-cfa635847112/go.mod h1:Z4AUp2Km+PwemOoO/VB5AOx9XSsIItzFjoJlOSiYmn0=
github.com/syndtr/goleveldb v0.0.0-20181127023241-353a9fca669c/go.mod h1:Z4AUp2Km+PwemOoO/VB5AOx9XSsIItzFjoJlOSiYmn0=
github.com/tal-tech/go-zero v1.0.27/go.mod h1:JtNXlsh/CgeIHyQnt5C5M2IcSevW7V0NAnqO93TQgm8=
github.com/tiptok/egglib-go v0.0.0-20210608073225-c852ce95ae34 h1:9iDNyYbfpv5KLWDLpDywD/aIODg+PNnwn+v9on7KGlE=
github.com/tiptok/egglib-go v0.0.0-20210608073225-c852ce95ae34/go.mod h1:KT8WFA2LPo5zVKbomCR6HocO4prnIY9DUVGekA3Ifo4=
github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
github.com/tmc/grpc-websocket-proxy v0.0.0-20171017195756-830351dc03c6/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc h1:9lRDQMhESg+zvGYmW5DyG0UqvY96Bu5QYsTLvCHdrgo=
github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc/go.mod h1:bciPuU6GHm1iF1pBvUfxfsH0Wmnc2VbpgvbI9ZWuIRs=
github.com/ugorji/go v0.0.0-20171122102828-84cb69a8af83/go.mod h1:hnLbHMwcvSihnDhEfx2/BzKp2xb0Y+ErdfYcrs9tkJQ=
github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
github.com/urfave/cli v1.22.5/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
github.com/vmihailenco/bufpool v0.1.11 h1:gOq2WmBrq0i2yW5QJ16ykccQ4wH9UyEsgLm6czKAd94=
github.com/vmihailenco/bufpool v0.1.11/go.mod h1:AFf/MOy3l2CFTKbxwt0mp2MwnqjNEs5H/UxrkA5jxTQ=
github.com/vmihailenco/msgpack/v5 v5.2.0/go.mod h1:fEM7KuHcnm0GvDCztRpw9hV0PuoO2ciTismP6vjggcM=
github.com/vmihailenco/msgpack/v5 v5.3.0 h1:8G3at/kelmBKeHY6d6cKnGsYO3BLn+uubitdOtOhyNI=
github.com/vmihailenco/msgpack/v5 v5.3.0/go.mod h1:7xyJ9e+0+9SaZT0Wt1RGleJXzli6Q/V5KbhBonMG9jc=
github.com/vmihailenco/tagparser v0.1.2 h1:gnjoVuB/kljJ5wICEEOpx98oXMWPLj22G67Vbd1qPqc=
github.com/vmihailenco/tagparser v0.1.2/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI=
github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g=
github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds=
github.com/wendal/errors v0.0.0-20130201093226-f66c77a7882b/go.mod h1:Q12BUT7DqIlHRmgv3RskH+UCM/4eqVMgI0EMmlSpAXc=
github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I=
github.com/xdg/stringprep v1.0.0/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y=
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
github.com/xlab/treeprint v0.0.0-20180616005107-d6fb6747feb6/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg=
github.com/xwb1989/sqlparser v0.0.0-20180606152119-120387863bf2/go.mod h1:hzfGeIUDq/j97IG+FhNqkowIyEcD88LrW6fyU3K3WqY=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/gopher-lua v0.0.0-20171031051903-609c9cd26973/go.mod h1:aEV29XrmTYFr3CiRxZeGHpkvbwq+prZduBqMaascyCU=
github.com/yuin/gopher-lua v0.0.0-20191220021717-ab39c6098bdb/go.mod h1:gqRgreBUhTSL0GeU64rtZ3Uq3wtjOa/TB2YfrtkCbVQ=
go.etcd.io/bbolt v1.3.4/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ=
go.etcd.io/etcd v0.0.0-20200402134248-51bdeb39e698/go.mod h1:YoUyTScD3Vcv2RBm3eGVOq7i1ULiz3OuXoQFWOirmAM=
go.etcd.io/etcd v3.3.25+incompatible/go.mod h1:yaeTdrJi5lOmYerz05bd8+V7KubZs8YSFZfzsF9A6aI=
go.opentelemetry.io/otel v0.17.0/go.mod h1:Oqtdxmf7UtEvL037ohlgnaYa1h7GtMh0NcSd9eqkC9s=
go.opentelemetry.io/otel v0.19.0 h1:Lenfy7QHRXPZVsw/12CWpxX6d/JkrX8wrx2vO8G80Ng=
go.opentelemetry.io/otel v0.19.0/go.mod h1:j9bF567N9EfomkSidSfmMwIwIBuP37AMAIzVW85OxSg=
go.opentelemetry.io/otel/metric v0.17.0/go.mod h1:hUz9lH1rNXyEwWAhIWCMFWKhYtpASgSnObJFnU26dJ0=
go.opentelemetry.io/otel/metric v0.19.0 h1:dtZ1Ju44gkJkYvo+3qGqVXmf88tc+a42edOywypengg=
go.opentelemetry.io/otel/metric v0.19.0/go.mod h1:8f9fglJPRnXuskQmKpnad31lcLJ2VmNNqIsx/uIwBSc=
go.opentelemetry.io/otel/oteltest v0.17.0/go.mod h1:JT/LGFxPwpN+nlsTiinSYjdIx3hZIGqHCpChcIZmdoE=
go.opentelemetry.io/otel/oteltest v0.19.0 h1:YVfA0ByROYqTwOxqHVZYZExzEpfZor+MU1rU+ip2v9Q=
go.opentelemetry.io/otel/oteltest v0.19.0/go.mod h1:tI4yxwh8U21v7JD6R3BcA/2+RBoTKFexE/PJ/nSO7IA=
go.opentelemetry.io/otel/trace v0.17.0/go.mod h1:bIujpqg6ZL6xUTubIUgziI1jSaUPthmabA/ygf/6Cfg=
go.opentelemetry.io/otel/trace v0.19.0 h1:1ucYlenXIDA1OlHVLDZKX0ObXV5RLaq06DtUKz5e5zc=
go.opentelemetry.io/otel/trace v0.19.0/go.mod h1:4IXiNextNOpPnRlI4ryK69mn5iC84bjBWZQA5DXz/qg=
go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
go.uber.org/automaxprocs v1.3.0/go.mod h1:9CWT6lKIep8U41DDaPiH6eFscnTyjfTANNQNx6LrIcA=
go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU=
go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA=
go.uber.org/zap v1.14.1/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc=
go.uber.org/zap v1.15.0/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20180910181607-0e37d006457b/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190404164418-38d8ce5564a5/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE=
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191002192127-34f69633bfdc/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20210218145215-b8e89b74b9df/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2 h1:It14KIkyBFYkHkwZ7k45minvA9aorojkyjGk9KJ5B/w=
golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs=
golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20191002035440-2ec189313ef0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20201006153459-a7d1128ccaa0/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110 h1:qWPm9rbaAMKs8Bq/9LRpbMqxWRVUAQwMI9fVrssnTfw=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20171017063910-8dbc5d05d6ed/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190204203706-41f3e6584952/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191010194322-b09406accb47/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200728102440-3e129f6d46b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210218155724-8ebf48af031b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4 h1:EZ2mChiOa8udjfp6rRmswTbtZN/QzUQp4ptM4rnjHvc=
golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ=
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200410132612-ae9902aceb98/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20201211185031-d93e913c1a58/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e h1:4nW4NLDYnU28ojHaHO8OVxFHk/aQ33U01a9cjED+pzE=
golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/genproto v0.0.0-20190927181202-20e1ac93f88c/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8=
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
google.golang.org/grpc v1.24.0/go.mod h1:XDChyiUovWa60DnaeDeZmSW86xtLtjtZbwvSiRnRtcA=
google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4=
google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c=
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU=
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw=
gopkg.in/cheggaaa/pb.v1 v1.0.28/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw=
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
gopkg.in/h2non/gock.v1 v1.0.15/go.mod h1:sX4zAkdYX1TRGJ2JY156cFspQn4yRWn6p9EMdODlynE=
gopkg.in/jcmturner/aescts.v1 v1.0.1 h1:cVVZBK2b1zY26haWB4vbBiZrfFQnfbTVrE3xZq6hrEw=
gopkg.in/jcmturner/aescts.v1 v1.0.1/go.mod h1:nsR8qBOg+OucoIW+WMhB3GspUQXq9XorLnQb9XtvcOo=
gopkg.in/jcmturner/dnsutils.v1 v1.0.1 h1:cIuC1OLRGZrld+16ZJvvZxVJeKPsvd5eUIvxfoN5hSM=
gopkg.in/jcmturner/dnsutils.v1 v1.0.1/go.mod h1:m3v+5svpVOhtFAP/wSz+yzh4Mc0Fg7eRhxkJMWSIz9Q=
gopkg.in/jcmturner/goidentity.v3 v3.0.0 h1:1duIyWiTaYvVx3YX2CYtpJbUFd7/UuPYCfgXtQ3VTbI=
gopkg.in/jcmturner/goidentity.v3 v3.0.0/go.mod h1:oG2kH0IvSYNIu80dVAyu/yoefjq1mNfM5bm88whjWx4=
gopkg.in/jcmturner/gokrb5.v7 v7.2.3 h1:hHMV/yKPwMnJhPuPx7pH2Uw/3Qyf+thJYlisUc44010=
gopkg.in/jcmturner/gokrb5.v7 v7.2.3/go.mod h1:l8VISx+WGYp+Fp7KRbsiUuXTTOnxIc3Tuvyavf11/WM=
gopkg.in/jcmturner/rpc.v1 v1.1.0 h1:QHIUxTX1ISuAv9dD2wJ9HWQVuWDX/Zc0PfeC2tjc4rU=
gopkg.in/jcmturner/rpc.v1 v1.1.0/go.mod h1:YIdkC4XfD6GXbzje11McwsDuOlZQSb9W4vfLvuNnlv8=
gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA=
gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
honnef.co/go/tools v0.0.1-2020.1.5/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
mellium.im/sasl v0.2.1 h1:nspKSRg7/SyO0cRGY71OkfHab8tf9kCts6a6oTDut0w=
mellium.im/sasl v0.2.1/go.mod h1:ROaEDLQNuf9vjKqE1SrAfnsobm2YKXT1gnN1uDp1PjQ=
rsc.io/goversion v1.0.0/go.mod h1:Eih9y/uIBS3ulggl7KNJ09xGSLcuNaLgmvvqa07sgfo=
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc=
... ...
package main
import (
"fmt"
"github.com/beego/beego/v2/server/web"
"github.com/linmadan/egglib-go/log/logrus"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/constant"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/log"
)
func main() {
log.Logger.Info("server start ....")
log.Logger.Info(fmt.Sprintf("ENABLE_KAFKA_LOG:%v", constant.ENABLE_KAFKA_LOG))
if constant.ENABLE_KAFKA_LOG {
w, _ := logrus.NewKafkaWriter(constant.KAFKA_HOST, constant.TOPIC_LOG_STASH, false)
log.Logger.AddHook(w)
}
bw := log.NewBeegoLogWriter(log.LoggerConfig{
Filename: constant.LOG_FILE,
Level: 7,
MaxSize: 1024 * 1024 * 2,
})
log.Logger.AddHook(bw)
log.Logger.Info("server start!")
web.Run()
}
... ...
package factory
import (
"github.com/linmadan/egglib-go/transaction/pg"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/domain"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/repository"
)
func CreateDeviceRepository(options map[string]interface{}) (domain.DeviceRepository, error) {
var transactionContext *pg.TransactionContext
if value, ok := options["transactionContext"]; ok {
transactionContext = value.(*pg.TransactionContext)
}
return repository.NewDeviceRepository(transactionContext)
}
func CreateProductRepository(options map[string]interface{}) (domain.ProductRepository, error) {
var transactionContext *pg.TransactionContext
if value, ok := options["transactionContext"]; ok {
transactionContext = value.(*pg.TransactionContext)
}
return repository.NewProductRepository(transactionContext)
}
func CreateProductAttendanceRecordRepository(options map[string]interface{}) (domain.ProductAttendanceRecordRepository, error) {
var transactionContext *pg.TransactionContext
if value, ok := options["transactionContext"]; ok {
transactionContext = value.(*pg.TransactionContext)
}
return repository.NewProductAttendanceRecordRepository(transactionContext)
}
func CreateProductCalendarRepository(options map[string]interface{}) (domain.ProductCalendarRepository, error) {
var transactionContext *pg.TransactionContext
if value, ok := options["transactionContext"]; ok {
transactionContext = value.(*pg.TransactionContext)
}
return repository.NewProductCalendarRepository(transactionContext)
}
func CreateProductGroupRepository(options map[string]interface{}) (domain.ProductGroupRepository, error) {
var transactionContext *pg.TransactionContext
if value, ok := options["transactionContext"]; ok {
transactionContext = value.(*pg.TransactionContext)
}
return repository.NewProductGroupRepository(transactionContext)
}
func CreateProductJobRepository(options map[string]interface{}) (domain.ProductJobRepository, error) {
var transactionContext *pg.TransactionContext
if value, ok := options["transactionContext"]; ok {
transactionContext = value.(*pg.TransactionContext)
}
return repository.NewProductJobRepository(transactionContext)
}
func CreateProductPlanRepository(options map[string]interface{}) (domain.ProductPlanRepository, error) {
var transactionContext *pg.TransactionContext
if value, ok := options["transactionContext"]; ok {
transactionContext = value.(*pg.TransactionContext)
}
return repository.NewProductPlanRepository(transactionContext)
}
func CreateProductRecordRepository(options map[string]interface{}) (domain.ProductRecordRepository, error) {
var transactionContext *pg.TransactionContext
if value, ok := options["transactionContext"]; ok {
transactionContext = value.(*pg.TransactionContext)
}
return repository.NewProductRecordRepository(transactionContext)
}
func CreateUnitConversionRepository(options map[string]interface{}) (domain.UnitConversionRepository, error) {
var transactionContext *pg.TransactionContext
if value, ok := options["transactionContext"]; ok {
transactionContext = value.(*pg.TransactionContext)
}
return repository.NewUnitConversionRepository(transactionContext)
}
func CreateWorkshopRepository(options map[string]interface{}) (domain.WorkshopRepository, error) {
var transactionContext *pg.TransactionContext
if value, ok := options["transactionContext"]; ok {
transactionContext = value.(*pg.TransactionContext)
}
return repository.NewWorkshopRepository(transactionContext)
}
... ...
package factory
import (
"github.com/linmadan/egglib-go/core/application"
pG "github.com/linmadan/egglib-go/transaction/pg"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg"
)
func CreateTransactionContext(options map[string]interface{}) (application.TransactionContext, error) {
return pG.NewPGTransactionContext(pg.DB), nil
}
... ...
package application
import (
"github.com/beego/beego/v2/core/validation"
"github.com/linmadan/egglib-go/validation/beego"
)
func init() {
validation.MessageTmpls = beego.ValidationMessageTmpls
}
... ...
package constant
import (
"fmt"
"os"
"strconv"
"strings"
)
var SERVICE_NAME = "allied-creation-manufacture"
var SERVICE_ENV = "dev"
var HTTP_PORT int = 8081
var CACHE_PREFIX = "allied-creation-manufacture-dev"
var LOG_LEVEL = "debug"
var LOG_FILE = "app.log"
var CUSTOMER_ACCOUNT = []int64{3129687560814592, 3129687690100739, 3492238958608384}
const CUSTOMER_ACCOUNT_DELIMITER = ","
/***** 1.数据传输 *****/
const HeaderCompanyId = "companyId"
const HeaderUserId = "userId"
const HeaderOrgId = "orgId"
func init() {
if os.Getenv("LOG_LEVEL") != "" {
LOG_LEVEL = os.Getenv("LOG_LEVEL")
}
if os.Getenv("CUSTOMER_ACCOUNT") != "" {
account := os.Getenv("CUSTOMER_ACCOUNT")
accounts := strings.Split(account, CUSTOMER_ACCOUNT_DELIMITER)
var tmpAccounts []int64
for i := range accounts {
v, err := strconv.ParseInt(accounts[i], 10, 64)
if err != nil {
panic(err)
}
tmpAccounts = append(tmpAccounts, v)
}
if len(tmpAccounts) > 0 {
CUSTOMER_ACCOUNT = tmpAccounts
}
}
if os.Getenv("SERVICE_ENV") != "" {
SERVICE_ENV = os.Getenv("SERVICE_ENV")
}
if os.Getenv("HTTP_PORT") != "" {
HTTP_PORT, _ = strconv.Atoi(os.Getenv("HTTP_PORT"))
}
SERVICE_NAME = fmt.Sprintf("%v-%v", SERVICE_NAME, SERVICE_ENV)
CACHE_PREFIX = SERVICE_NAME
}
... ...
package constant
import "os"
var (
// kafka 地址
KAFKA_HOST = "192.168.0.250:9092,192.168.0.251:9092,192.168.0.252:9092" //"106.75.231.90:9092"
// kafka topic log stash
TOPIC_LOG_STASH = "go_stash_dev" //"pushMessage"
// kafka topic up_block_chain
TOPIC_UP_BLOCK_CHAIN = "allied_creation_message"
// 是否启用日志收集 (本地不启用)
ENABLE_KAFKA_LOG = false
)
func init() {
if os.Getenv("KAFKA_HOST") != "" {
KAFKA_HOST = os.Getenv("KAFKA_HOST")
}
//if os.Getenv("TOPIC_LOG_STASH") != "" {
// POSTGRESQL_PORT = os.Getenv("TOPIC_LOG_STASH")
//}
if os.Getenv("ENABLE_KAFKA_LOG") != "" {
ENABLE_KAFKA_LOG = true
}
}
... ...
package constant
import (
"os"
)
var POSTGRESQL_DB_NAME = "terms"
var POSTGRESQL_USER = "postgres"
var POSTGRESQL_PASSWORD = "123456"
var POSTGRESQL_HOST = "127.0.0.1"
var POSTGRESQL_PORT = "5432"
var DISABLE_CREATE_TABLE = false
var DISABLE_SQL_GENERATE_PRINT = false
var DISABLE_SQL_GENERATE_COMMENT = true
func init() {
if os.Getenv("POSTGRESQL_DB_NAME") != "" {
POSTGRESQL_DB_NAME = os.Getenv("POSTGRESQL_DB_NAME")
}
if os.Getenv("POSTGRESQL_USER") != "" {
POSTGRESQL_USER = os.Getenv("POSTGRESQL_USER")
}
if os.Getenv("POSTGRESQL_PASSWORD") != "" {
POSTGRESQL_PASSWORD = os.Getenv("POSTGRESQL_PASSWORD")
}
if os.Getenv("POSTGRESQL_HOST") != "" {
POSTGRESQL_HOST = os.Getenv("POSTGRESQL_HOST")
}
if os.Getenv("POSTGRESQL_PORT") != "" {
POSTGRESQL_PORT = os.Getenv("POSTGRESQL_PORT")
}
if os.Getenv("DISABLE_CREATE_TABLE") != "" {
DISABLE_CREATE_TABLE = true
}
if os.Getenv("DISABLE_SQL_GENERATE_PRINT") != "" {
DISABLE_SQL_GENERATE_PRINT = true
}
}
... ...
package constant
import "os"
var (
REDIS_HOST = "127.0.0.1"
REDIS_PORT = "6379"
REDIS_AUTH = ""
// 是否关闭仓储层缓存
DISABLE_REPOSITORY_CACHE = false
// 缓存过期时间 单位秒
REPOSITORY_CACHE_EXPIRE = 30 * 60
)
func init() {
if os.Getenv("REDIS_HOST") != "" {
REDIS_HOST = os.Getenv("REDIS_HOST")
REDIS_AUTH = os.Getenv("REDIS_AUTH")
}
if os.Getenv("REDIS_PORT") != "" {
REDIS_PORT = os.Getenv("REDIS_PORT")
}
if _, ok := os.LookupEnv("REDIS_AUTH"); ok {
REDIS_AUTH = os.Getenv("REDIS_AUTH")
}
if os.Getenv("ENABLE_REPOSITORY_CACHE") != "" {
DISABLE_REPOSITORY_CACHE = false
}
if os.Getenv("DISABLE_REPOSITORY_CACHE") != "" {
DISABLE_REPOSITORY_CACHE = true
}
}
... ...
package domain
// 企业对象
type Company struct {
// 企业id
CompanyId int `json:"companyId,omitempty"`
// 企业名称
CompanyName string `json:"companyName,omitempty"`
}
... ...
package domain
import "time"
// 设备
type Device struct {
// 设备Id
DeviceId int `json:"deviceId,omitempty"`
// 企业id
CompanyId int `json:"companyId,omitempty"`
// 组织ID
OrgId int `json:"orgId,omitempty"`
// 设备编号
DeviceCode string `json:"deviceCode,omitempty"`
// 设备名称
DeviceName string `json:"deviceName,omitempty"`
// 设备型号
DeviceModel string `json:"deviceModel,omitempty"`
// 设备类型
DeviceType string `json:"deviceType,omitempty"`
// 品牌
Brand string `json:"brand,omitempty"`
// 设备状态 1:正常 2:封存 3:报废
DeviceStatus int `json:"deviceStatus,omitempty"`
// 风险等级 1:高 2:中 3:低
RiskLevel int `json:"riskLevel,omitempty"`
// 创建时间
CreatedAt time.Time `json:"createdAt,omitempty"`
// 更新时间
UpdatedAt time.Time `json:"updatedAt,omitempty"`
// 删除时间
DeletedAt time.Time `json:"deletedAt,omitempty"`
// 所属位置
WorkStation *WorkStation `json:"workStation,omitempty"`
}
type DeviceRepository interface {
Save(device *Device) (*Device, error)
Remove(device *Device) (*Device, error)
FindOne(queryOptions map[string]interface{}) (*Device, error)
Find(queryOptions map[string]interface{}) (int64, []*Device, error)
}
func (device *Device) Identify() interface{} {
if device.DeviceId == 0 {
return nil
}
return device.DeviceId
}
func (device *Device) Update(data map[string]interface{}) error {
if companyId, ok := data["companyId"]; ok {
device.CompanyId = companyId.(int)
}
if orgId, ok := data["orgId"]; ok {
device.OrgId = orgId.(int)
}
if deviceCode, ok := data["deviceCode"]; ok {
device.DeviceCode = deviceCode.(string)
}
if deviceName, ok := data["deviceName"]; ok {
device.DeviceName = deviceName.(string)
}
if deviceModel, ok := data["deviceModel"]; ok {
device.DeviceModel = deviceModel.(string)
}
if deviceType, ok := data["deviceType"]; ok {
device.DeviceType = deviceType.(string)
}
if brand, ok := data["brand"]; ok {
device.Brand = brand.(string)
}
if deviceStatus, ok := data["deviceStatus"]; ok {
device.DeviceStatus = deviceStatus.(int)
}
if riskLevel, ok := data["riskLevel"]; ok {
device.RiskLevel = riskLevel.(int)
}
if createdAt, ok := data["createdAt"]; ok {
device.CreatedAt = createdAt.(time.Time)
}
if updatedAt, ok := data["updatedAt"]; ok {
device.UpdatedAt = updatedAt.(time.Time)
}
if deletedAt, ok := data["deletedAt"]; ok {
device.DeletedAt = deletedAt.(time.Time)
}
if workStationId, ok := data["workStationId"]; ok {
device.WorkStation.WorkStationId = workStationId.(string)
}
if workshopId, ok := data["workshopId"]; ok {
device.WorkStation.WorkshopId = workshopId.(int)
}
if workshopName, ok := data["workshopName"]; ok {
device.WorkStation.WorkshopName = workshopName.(string)
}
if lineId, ok := data["lineId"]; ok {
device.WorkStation.LineId = lineId.(int)
}
if lineName, ok := data["lineName"]; ok {
device.WorkStation.LineName = lineName.(string)
}
if sectionId, ok := data["sectionId"]; ok {
device.WorkStation.SectionId = sectionId.(int)
}
if sectionName, ok := data["sectionName"]; ok {
device.WorkStation.SectionName = sectionName.(string)
}
return nil
}
... ...
package domain
// 物料
type Material struct {
// 物料名称
MaterialName string `json:"materialName,omitempty"`
// 物料类别
MaterialCategory string `json:"materialCategory,omitempty"`
}
... ...
package domain
// 组织机构
type Org struct {
// 组织ID
OrgId int `json:"orgId,omitempty"`
// 组织名称
OrgName string `json:"orgName,omitempty"`
}
... ...
package domain
import "time"
// 产品信息
type Product struct {
// 企业id
CompanyId int `json:"companyId,omitempty"`
// 组织ID
OrgId int `json:"orgId,omitempty"`
// 产品ID
ProductId int `json:"productId,omitempty"`
// 产品编号 编码规则为“CP”+2 位年+2 位月+2 位日+3 位流水码,如 CP211229001
ProductCode string `json:"productCode,omitempty"`
// 产品名称
ProductName string `json:"productName,omitempty"`
// 产品类别
ProductCategory string `json:"productCategory,omitempty"`
// 产品规格
ProductSpec *UnitQuantity `json:"productSpec,omitempty"`
// 创建时间
CreatedAt time.Time `json:"createdAt,omitempty"`
// 更新时间
UpdatedAt time.Time `json:"updatedAt,omitempty"`
// 删除时间
DeletedAt time.Time `json:"deletedAt,omitempty"`
}
type ProductRepository interface {
Save(product *Product) (*Product, error)
Remove(product *Product) (*Product, error)
FindOne(queryOptions map[string]interface{}) (*Product, error)
Find(queryOptions map[string]interface{}) (int64, []*Product, error)
}
func (product *Product) Identify() interface{} {
if product.ProductId == 0 {
return nil
}
return product.ProductId
}
func (product *Product) Update(data map[string]interface{}) error {
if companyId, ok := data["companyId"]; ok {
product.CompanyId = companyId.(int)
}
if orgId, ok := data["orgId"]; ok {
product.OrgId = orgId.(int)
}
if productCode, ok := data["productCode"]; ok {
product.ProductCode = productCode.(string)
}
if productName, ok := data["productName"]; ok {
product.ProductName = productName.(string)
}
if productCategory, ok := data["productCategory"]; ok {
product.ProductCategory = productCategory.(string)
}
if quantity, ok := data["quantity"]; ok {
product.ProductSpec.Quantity = quantity.(float64)
}
if unit, ok := data["unit"]; ok {
product.ProductSpec.Unit = unit.(string)
}
if unitWeight, ok := data["unitWeight"]; ok {
product.ProductSpec.UnitWeight = unitWeight.(float64)
}
if weight, ok := data["weight"]; ok {
product.ProductSpec.Weight = weight.(float64)
}
if createdAt, ok := data["createdAt"]; ok {
product.CreatedAt = createdAt.(time.Time)
}
if updatedAt, ok := data["updatedAt"]; ok {
product.UpdatedAt = updatedAt.(time.Time)
}
if deletedAt, ok := data["deletedAt"]; ok {
product.DeletedAt = deletedAt.(time.Time)
}
return nil
}
... ...
package domain
import "time"
// 生产考勤记录
type ProductAttendanceRecord struct {
// 考勤记录ID
ProductAttendanceId int `json:"productAttendanceId,omitempty"`
// 组织ID
OrgId int `json:"orgId,omitempty"`
// 产品ID
ProductId int `json:"productId,omitempty"`
// 考勤类型 1.正常 2.支援
AttendanceType int `json:"attendanceType,omitempty"`
// 生产工人
ProductWorker *User `json:"productWorker,omitempty"`
// 工作位置
WorkStation *WorkStation `json:"workStation,omitempty"`
// 签到
SignIn time.Time `json:"signIn,omitempty"`
// 签退
SignOut time.Time `json:"signOut,omitempty"`
// 考勤状态 1.未审核 2:已审核 3.自动审核
AttendanceStatus int `json:"attendanceStatus,omitempty"`
// 工时(审核前)
WorkTimeBefore float64 `json:"workTimeBefore,omitempty"`
// 工时(审核后)
WorkTimeAfter float64 `json:"workTimeAfter,omitempty"`
// 创建时间
CreatedAt time.Time `json:"createdAt,omitempty"`
// 更新时间
UpdatedAt time.Time `json:"updatedAt,omitempty"`
// 删除时间
DeletedAt time.Time `json:"deletedAt,omitempty"`
}
type ProductAttendanceRecordRepository interface {
Save(productAttendanceRecord *ProductAttendanceRecord) (*ProductAttendanceRecord, error)
Remove(productAttendanceRecord *ProductAttendanceRecord) (*ProductAttendanceRecord, error)
FindOne(queryOptions map[string]interface{}) (*ProductAttendanceRecord, error)
Find(queryOptions map[string]interface{}) (int64, []*ProductAttendanceRecord, error)
}
func (productAttendanceRecord *ProductAttendanceRecord) Identify() interface{} {
if productAttendanceRecord.ProductAttendanceId == 0 {
return nil
}
return productAttendanceRecord.ProductAttendanceId
}
func (productAttendanceRecord *ProductAttendanceRecord) Update(data map[string]interface{}) error {
if productAttendanceId, ok := data["productAttendanceId"]; ok {
productAttendanceRecord.ProductAttendanceId = productAttendanceId.(int)
}
if orgId, ok := data["orgId"]; ok {
productAttendanceRecord.OrgId = orgId.(int)
}
if productId, ok := data["productId"]; ok {
productAttendanceRecord.ProductId = productId.(int)
}
if attendanceType, ok := data["attendanceType"]; ok {
productAttendanceRecord.AttendanceType = attendanceType.(int)
}
if userId, ok := data["userId"]; ok {
productAttendanceRecord.ProductWorker.UserId = userId.(int)
}
if userName, ok := data["userName"]; ok {
productAttendanceRecord.ProductWorker.UserName = userName.(string)
}
if employeeType, ok := data["employeeType"]; ok {
productAttendanceRecord.ProductWorker.EmployeeType = employeeType.(int)
}
if icCardNumber, ok := data["icCardNumber"]; ok {
productAttendanceRecord.ProductWorker.IcCardNumber = icCardNumber.(string)
}
if avatar, ok := data["avatar"]; ok {
productAttendanceRecord.ProductWorker.Avatar = avatar.(string)
}
if phone, ok := data["phone"]; ok {
productAttendanceRecord.ProductWorker.Phone = phone.(string)
}
if workStationId, ok := data["workStationId"]; ok {
productAttendanceRecord.WorkStation.WorkStationId = workStationId.(string)
}
if workshopId, ok := data["workshopId"]; ok {
productAttendanceRecord.WorkStation.WorkshopId = workshopId.(int)
}
if workshopName, ok := data["workshopName"]; ok {
productAttendanceRecord.WorkStation.WorkshopName = workshopName.(string)
}
if lineId, ok := data["lineId"]; ok {
productAttendanceRecord.WorkStation.LineId = lineId.(int)
}
if lineName, ok := data["lineName"]; ok {
productAttendanceRecord.WorkStation.LineName = lineName.(string)
}
if sectionId, ok := data["sectionId"]; ok {
productAttendanceRecord.WorkStation.SectionId = sectionId.(int)
}
if sectionName, ok := data["sectionName"]; ok {
productAttendanceRecord.WorkStation.SectionName = sectionName.(string)
}
if signIn, ok := data["signIn"]; ok {
productAttendanceRecord.SignIn = signIn.(time.Time)
}
if signOut, ok := data["signOut"]; ok {
productAttendanceRecord.SignOut = signOut.(time.Time)
}
if attendanceStatus, ok := data["attendanceStatus"]; ok {
productAttendanceRecord.AttendanceStatus = attendanceStatus.(int)
}
if workTimeBefore, ok := data["workTimeBefore"]; ok {
productAttendanceRecord.WorkTimeBefore = workTimeBefore.(float64)
}
if workTimeAfter, ok := data["workTimeAfter"]; ok {
productAttendanceRecord.WorkTimeAfter = workTimeAfter.(float64)
}
if createdAt, ok := data["createdAt"]; ok {
productAttendanceRecord.CreatedAt = createdAt.(time.Time)
}
if updatedAt, ok := data["updatedAt"]; ok {
productAttendanceRecord.UpdatedAt = updatedAt.(time.Time)
}
if deletedAt, ok := data["deletedAt"]; ok {
productAttendanceRecord.DeletedAt = deletedAt.(time.Time)
}
return nil
}
... ...
package domain
import "time"
// 工厂日历
type ProductCalendar struct {
// 工厂日历ID
ProductCalendarId int `json:"productCalendarId,omitempty"`
// 企业id
CompanyId int `json:"companyId,omitempty"`
// 组织ID
OrgId int `json:"orgId,omitempty"`
// 工作位置
WorkStation *WorkStation `json:"workStation,omitempty"`
// 上班班次 1:全天 2:白班 4:中班 8:夜班
WorkOn int `json:"workOn,omitempty"`
// 日历选择
CalendarSelected []string `json:"calendarSelected,omitempty"`
// 上岗时间
InWorkAt string `json:"inWorkAt,omitempty"`
// 下岗时间
OutWorkAt string `json:"outWorkAt,omitempty"`
// 休息时间 (单位 h)
BreakTime float64 `json:"breakTime,omitempty"`
// 工时 (单位 h)
WorkTime float64 `json:"workTime,omitempty"`
// 创建时间
CreatedAt time.Time `json:"createdAt,omitempty"`
// 更新时间
UpdatedAt time.Time `json:"updatedAt,omitempty"`
// 删除时间
DeletedAt time.Time `json:"deletedAt,omitempty"`
}
type ProductCalendarRepository interface {
Save(productCalendar *ProductCalendar) (*ProductCalendar, error)
Remove(productCalendar *ProductCalendar) (*ProductCalendar, error)
FindOne(queryOptions map[string]interface{}) (*ProductCalendar, error)
Find(queryOptions map[string]interface{}) (int64, []*ProductCalendar, error)
}
func (productCalendar *ProductCalendar) Identify() interface{} {
if productCalendar.ProductCalendarId == 0 {
return nil
}
return productCalendar.ProductCalendarId
}
func (productCalendar *ProductCalendar) Update(data map[string]interface{}) error {
if productCalendarId, ok := data["productCalendarId"]; ok {
productCalendar.ProductCalendarId = productCalendarId.(int)
}
if companyId, ok := data["companyId"]; ok {
productCalendar.CompanyId = companyId.(int)
}
if orgId, ok := data["orgId"]; ok {
productCalendar.OrgId = orgId.(int)
}
if workStationId, ok := data["workStationId"]; ok {
productCalendar.WorkStation.WorkStationId = workStationId.(string)
}
if workshopId, ok := data["workshopId"]; ok {
productCalendar.WorkStation.WorkshopId = workshopId.(int)
}
if workshopName, ok := data["workshopName"]; ok {
productCalendar.WorkStation.WorkshopName = workshopName.(string)
}
if lineId, ok := data["lineId"]; ok {
productCalendar.WorkStation.LineId = lineId.(int)
}
if lineName, ok := data["lineName"]; ok {
productCalendar.WorkStation.LineName = lineName.(string)
}
if sectionId, ok := data["sectionId"]; ok {
productCalendar.WorkStation.SectionId = sectionId.(int)
}
if sectionName, ok := data["sectionName"]; ok {
productCalendar.WorkStation.SectionName = sectionName.(string)
}
if workOn, ok := data["workOn"]; ok {
productCalendar.WorkOn = workOn.(int)
}
//if calendarSelected, ok := data["calendarSelected"]; ok {
// productCalendar.CalendarSelected = calendarSelected.(array)
//}
if inWorkAt, ok := data["inWorkAt"]; ok {
productCalendar.InWorkAt = inWorkAt.(string)
}
if outWorkAt, ok := data["outWorkAt"]; ok {
productCalendar.OutWorkAt = outWorkAt.(string)
}
if breakTime, ok := data["breakTime"]; ok {
productCalendar.BreakTime = breakTime.(float64)
}
if workTime, ok := data["workTime"]; ok {
productCalendar.WorkTime = workTime.(float64)
}
if createdAt, ok := data["createdAt"]; ok {
productCalendar.CreatedAt = createdAt.(time.Time)
}
if updatedAt, ok := data["updatedAt"]; ok {
productCalendar.UpdatedAt = updatedAt.(time.Time)
}
if deletedAt, ok := data["deletedAt"]; ok {
productCalendar.DeletedAt = deletedAt.(time.Time)
}
return nil
}
... ...
package domain
// 产品扩展
type ProductExt struct {
// 单份重量(原材料)
UnitWeight float64 `json:"unitWeight"`
}
... ...
package domain
import "time"
// 生产班组
type ProductGroup struct {
// 生产小组ID
ProductGroupId int `json:"productGroupId,omitempty"`
// 企业id
CompanyId int `json:"companyId,omitempty"`
// 组织ID
OrgId int `json:"orgId,omitempty"`
// 班组名称
GroupName string `json:"groupName,omitempty"`
// 班组长
GroupLeader *User `json:"groupLeader,omitempty"`
// 帮组成员列表
GroupMembers []*User `json:"groupMembers,omitempty"`
// 上班班次 1:全天 2:白班 4:中班 8:夜班
WorkOn int `json:"workOn,omitempty"`
// 工作位置
WorkStation *WorkStation `json:"workStation,omitempty"`
// 创建时间
CreatedAt time.Time `json:"createdAt,omitempty"`
// 更新时间
UpdatedAt time.Time `json:"updatedAt,omitempty"`
// 删除时间
DeletedAt time.Time `json:"deletedAt,omitempty"`
}
type ProductGroupRepository interface {
Save(productGroup *ProductGroup) (*ProductGroup, error)
Remove(productGroup *ProductGroup) (*ProductGroup, error)
FindOne(queryOptions map[string]interface{}) (*ProductGroup, error)
Find(queryOptions map[string]interface{}) (int64, []*ProductGroup, error)
}
func (productGroup *ProductGroup) Identify() interface{} {
if productGroup.ProductGroupId == 0 {
return nil
}
return productGroup.ProductGroupId
}
func (productGroup *ProductGroup) Update(data map[string]interface{}) error {
if productGroupId, ok := data["productGroupId"]; ok {
productGroup.ProductGroupId = productGroupId.(int)
}
if companyId, ok := data["companyId"]; ok {
productGroup.CompanyId = companyId.(int)
}
if orgId, ok := data["orgId"]; ok {
productGroup.OrgId = orgId.(int)
}
if groupName, ok := data["groupName"]; ok {
productGroup.GroupName = groupName.(string)
}
if userId, ok := data["userId"]; ok {
productGroup.GroupLeader.UserId = userId.(int)
}
if userName, ok := data["userName"]; ok {
productGroup.GroupLeader.UserName = userName.(string)
}
if employeeType, ok := data["employeeType"]; ok {
productGroup.GroupLeader.EmployeeType = employeeType.(int)
}
if icCardNumber, ok := data["icCardNumber"]; ok {
productGroup.GroupLeader.IcCardNumber = icCardNumber.(string)
}
if avatar, ok := data["avatar"]; ok {
productGroup.GroupLeader.Avatar = avatar.(string)
}
if phone, ok := data["phone"]; ok {
productGroup.GroupLeader.Phone = phone.(string)
}
//if groupMembers, ok := data["groupMembers"]; ok {
// productGroup.GroupMembers = groupMembers.(array)
//}
if workOn, ok := data["workOn"]; ok {
productGroup.WorkOn = workOn.(int)
}
if workStationId, ok := data["workStationId"]; ok {
productGroup.WorkStation.WorkStationId = workStationId.(string)
}
if workshopId, ok := data["workshopId"]; ok {
productGroup.WorkStation.WorkshopId = workshopId.(int)
}
if workshopName, ok := data["workshopName"]; ok {
productGroup.WorkStation.WorkshopName = workshopName.(string)
}
if lineId, ok := data["lineId"]; ok {
productGroup.WorkStation.LineId = lineId.(int)
}
if lineName, ok := data["lineName"]; ok {
productGroup.WorkStation.LineName = lineName.(string)
}
if sectionId, ok := data["sectionId"]; ok {
productGroup.WorkStation.SectionId = sectionId.(int)
}
if sectionName, ok := data["sectionName"]; ok {
productGroup.WorkStation.SectionName = sectionName.(string)
}
if createdAt, ok := data["createdAt"]; ok {
productGroup.CreatedAt = createdAt.(time.Time)
}
if updatedAt, ok := data["updatedAt"]; ok {
productGroup.UpdatedAt = updatedAt.(time.Time)
}
if deletedAt, ok := data["deletedAt"]; ok {
productGroup.DeletedAt = deletedAt.(time.Time)
}
return nil
}
... ...
package domain
import "time"
// 工位(车间-生产线-工段-工位)
type ProductJob struct {
// 工位ID
ProductJobId int `json:"productJobId,omitempty"`
// 企业id
CompanyId int `json:"companyId,omitempty"`
// 组织ID
OrgId int `json:"orgId,omitempty"`
// 工位名称
JobName string `json:"jobName,omitempty"`
// 创建时间
CreatedAt time.Time `json:"createdAt,omitempty"`
// 更新时间
UpdatedAt time.Time `json:"updatedAt,omitempty"`
// 删除时间
DeletedAt time.Time `json:"deletedAt,omitempty"`
// 工作位置
WorkStation *WorkStation `json:"workStation,omitempty"`
// 关联设备列表
RelatedDevices []int `json:"relatedDevices,omitempty"`
}
type ProductJobRepository interface {
Save(productJob *ProductJob) (*ProductJob, error)
Remove(productJob *ProductJob) (*ProductJob, error)
FindOne(queryOptions map[string]interface{}) (*ProductJob, error)
Find(queryOptions map[string]interface{}) (int64, []*ProductJob, error)
}
func (productJob *ProductJob) Identify() interface{} {
if productJob.ProductJobId == 0 {
return nil
}
return productJob.ProductJobId
}
func (productJob *ProductJob) Update(data map[string]interface{}) error {
if productJobId, ok := data["productJobId"]; ok {
productJob.ProductJobId = productJobId.(int)
}
if companyId, ok := data["companyId"]; ok {
productJob.CompanyId = companyId.(int)
}
if orgId, ok := data["orgId"]; ok {
productJob.OrgId = orgId.(int)
}
if jobName, ok := data["jobName"]; ok {
productJob.JobName = jobName.(string)
}
if createdAt, ok := data["createdAt"]; ok {
productJob.CreatedAt = createdAt.(time.Time)
}
if updatedAt, ok := data["updatedAt"]; ok {
productJob.UpdatedAt = updatedAt.(time.Time)
}
if deletedAt, ok := data["deletedAt"]; ok {
productJob.DeletedAt = deletedAt.(time.Time)
}
if workStationId, ok := data["workStationId"]; ok {
productJob.WorkStation.WorkStationId = workStationId.(string)
}
if workshopId, ok := data["workshopId"]; ok {
productJob.WorkStation.WorkshopId = workshopId.(int)
}
if workshopName, ok := data["workshopName"]; ok {
productJob.WorkStation.WorkshopName = workshopName.(string)
}
if lineId, ok := data["lineId"]; ok {
productJob.WorkStation.LineId = lineId.(int)
}
if lineName, ok := data["lineName"]; ok {
productJob.WorkStation.LineName = lineName.(string)
}
if sectionId, ok := data["sectionId"]; ok {
productJob.WorkStation.SectionId = sectionId.(int)
}
if sectionName, ok := data["sectionName"]; ok {
productJob.WorkStation.SectionName = sectionName.(string)
}
//if relatedDevices, ok := data["relatedDevices"]; ok {
// productJob.RelatedDevices = relatedDevices.(array)
//}
return nil
}
... ...
package domain
// 生产线
type ProductLine struct {
// 生产线ID
LineId int `json:"lineId,omitempty"`
// 生产线名称
LineName string `json:"lineName,omitempty"`
// 工段列表
ProductSections []*ProductSection `json:"productSections,omitempty"`
}
... ...
package domain
import "time"
// 生产计划
type ProductPlan struct {
// 生产计划ID
ProductPlanId int `json:"productPlanId,omitempty"`
// 企业id
CompanyId int `json:"companyId,omitempty"`
// 组织ID
OrgId int `json:"orgId,omitempty"`
// 批号
BatchNumber string `json:"batchNumber,omitempty"`
// 生产日期
ProductDate time.Time `json:"productDate,omitempty"`
// 车间
Workshop *Workshop `json:"workshop,omitempty"`
// 上班班次 1:全天 2:白班 4:中班 8:夜班
WorkOn int `json:"workOn,omitempty"`
// 机台 (A、B、C、D 区分机器大小)
Machine string `json:"machine,omitempty"`
// 计划的产品名称
PlanProductName string `json:"planProductName,omitempty"`
// 计划投入
PlanDevoted *UnitQuantity `json:"planDevoted,omitempty"`
// 计划状态 (1:上线 2:下线 默认下线)
PlanStatus int `json:"planStatus,omitempty"`
// 工作位置
WorkStation *WorkStation `json:"workStation,omitempty"`
// 备注
Remark string `json:"remark,omitempty"`
// 创建时间
CreatedAt time.Time `json:"createdAt,omitempty"`
// 更新时间
UpdatedAt time.Time `json:"updatedAt,omitempty"`
// 删除时间
DeletedAt time.Time `json:"deletedAt,omitempty"`
}
type ProductPlanRepository interface {
Save(productPlan *ProductPlan) (*ProductPlan, error)
Remove(productPlan *ProductPlan) (*ProductPlan, error)
FindOne(queryOptions map[string]interface{}) (*ProductPlan, error)
Find(queryOptions map[string]interface{}) (int64, []*ProductPlan, error)
}
func (productPlan *ProductPlan) Identify() interface{} {
if productPlan.ProductPlanId == 0 {
return nil
}
return productPlan.ProductPlanId
}
func (productPlan *ProductPlan) Update(data map[string]interface{}) error {
//if productPlanId, ok := data["productPlanId"]; ok {
// productPlan.ProductPlanId = productPlanId.(int)
//}
//if companyId, ok := data["companyId"]; ok {
// productPlan.CompanyId = companyId.(int)
//}
//if orgId, ok := data["orgId"]; ok {
// productPlan.OrgId = orgId.(int)
//}
//if batchNumber, ok := data["batchNumber"]; ok {
// productPlan.BatchNumber = batchNumber.(string)
//}
//if productDate, ok := data["productDate"]; ok {
// productPlan.ProductDate = productDate.(time.Time)
//}
//if companyId, ok := data["companyId"]; ok {
// productPlan.Workshop.CompanyId = companyId.(int)
//}
//if orgId, ok := data["orgId"]; ok {
// productPlan.Workshop.OrgId = orgId.(int)
//}
//if workshopId, ok := data["workshopId"]; ok {
// productPlan.Workshop.WorkshopId = workshopId.(int)
//}
//if workshopName, ok := data["workshopName"]; ok {
// productPlan.Workshop.WorkshopName = workshopName.(string)
//}
//if userId, ok := data["userId"]; ok {
// productPlan.Workshop.Principal.UserId = userId.(int)
//}
//if userName, ok := data["userName"]; ok {
// productPlan.Workshop.Principal.UserName = userName.(string)
//}
//if employeeType, ok := data["employeeType"]; ok {
// productPlan.Workshop.Principal.EmployeeType = employeeType.(int)
//}
//if icCardNumber, ok := data["icCardNumber"]; ok {
// productPlan.Workshop.Principal.IcCardNumber = icCardNumber.(string)
//}
//if avatar, ok := data["avatar"]; ok {
// productPlan.Workshop.Principal.Avatar = avatar.(string)
//}
//if phone, ok := data["phone"]; ok {
// productPlan.Workshop.Principal.Phone = phone.(string)
//}
//if productLines, ok := data["productLines"]; ok {
// productPlan.Workshop.ProductLines = productLines.(array)
//}
//if createdAt, ok := data["createdAt"]; ok {
// productPlan.Workshop.CreatedAt = createdAt.(time.Time)
//}
//if updatedAt, ok := data["updatedAt"]; ok {
// productPlan.Workshop.UpdatedAt = updatedAt.(time.Time)
//}
//if deletedAt, ok := data["deletedAt"]; ok {
// productPlan.Workshop.DeletedAt = deletedAt.(time.Time)
//}
//if workOn, ok := data["workOn"]; ok {
// productPlan.WorkOn = workOn.(int)
//}
//if machine, ok := data["machine"]; ok {
// productPlan.Machine = machine.(string)
//}
//if planProductName, ok := data["planProductName"]; ok {
// productPlan.PlanProductName = planProductName.(string)
//}
//if quantity, ok := data["quantity"]; ok {
// productPlan.PlanDevoted.Quantity = quantity.(float64)
//}
//if unit, ok := data["unit"]; ok {
// productPlan.PlanDevoted.Unit = unit.(string)
//}
//if unitWeight, ok := data["unitWeight"]; ok {
// productPlan.PlanDevoted.UnitWeight = unitWeight.(float64)
//}
//if weight, ok := data["weight"]; ok {
// productPlan.PlanDevoted.Weight = weight.(float64)
//}
//if planStatus, ok := data["planStatus"]; ok {
// productPlan.PlanStatus = planStatus.(int)
//}
//if workStationId, ok := data["workStationId"]; ok {
// productPlan.WorkStation.WorkStationId = workStationId.(string)
//}
//if workshopId, ok := data["workshopId"]; ok {
// productPlan.WorkStation.WorkshopId = workshopId.(int)
//}
//if workshopName, ok := data["workshopName"]; ok {
// productPlan.WorkStation.WorkshopName = workshopName.(string)
//}
//if lineId, ok := data["lineId"]; ok {
// productPlan.WorkStation.LineId = lineId.(int)
//}
//if lineName, ok := data["lineName"]; ok {
// productPlan.WorkStation.LineName = lineName.(string)
//}
//if sectionId, ok := data["sectionId"]; ok {
// productPlan.WorkStation.SectionId = sectionId.(int)
//}
//if sectionName, ok := data["sectionName"]; ok {
// productPlan.WorkStation.SectionName = sectionName.(string)
//}
//if remark, ok := data["remark"]; ok {
// productPlan.Remark = remark.(string)
//}
//if createdAt, ok := data["createdAt"]; ok {
// productPlan.CreatedAt = createdAt.(time.Time)
//}
//if updatedAt, ok := data["updatedAt"]; ok {
// productPlan.UpdatedAt = updatedAt.(time.Time)
//}
//if deletedAt, ok := data["deletedAt"]; ok {
// productPlan.DeletedAt = deletedAt.(time.Time)
//}
return nil
}
... ...
package domain
import "time"
// 生产记录
type ProductRecord struct {
// 生产记录ID
ProductRecordId int `json:"productRecordId,omitempty"`
// 企业id
CompanyId int `json:"companyId,omitempty"`
// 组织ID
OrgId int `json:"orgId,omitempty"`
// 生产记录类型:1:领料 2:退料 4:称重 8:二级品称重
ProductRecordType int `json:"productRecordType,omitempty"`
// 生产工人
ProductWorker *User `json:"productWorker,omitempty"`
// 工作位置
WorkStation *WorkStation `json:"workStation,omitempty"`
// 创建时间
CreatedAt time.Time `json:"createdAt,omitempty"`
// 更新时间
UpdatedAt time.Time `json:"updatedAt,omitempty"`
// 删除时间
DeletedAt time.Time `json:"deletedAt,omitempty"`
// 生产记录信息
ProductRecordInfo *ProductRecordInfo `json:"productRecordInfo,omitempty"`
}
type ProductRecordRepository interface {
Save(productRecord *ProductRecord) (*ProductRecord, error)
Remove(productRecord *ProductRecord) (*ProductRecord, error)
FindOne(queryOptions map[string]interface{}) (*ProductRecord, error)
Find(queryOptions map[string]interface{}) (int64, []*ProductRecord, error)
}
func (productRecord *ProductRecord) Identify() interface{} {
if productRecord.ProductRecordId == 0 {
return nil
}
return productRecord.ProductRecordId
}
func (productRecord *ProductRecord) Update(data map[string]interface{}) error {
return nil
}
... ...
package domain
// 生产记录信息 (物料、批次、产能(产能、领料、退料、二级品))
type ProductRecordInfo struct {
// 产能
ProductWeigh int `json:"productWeigh,omitempty"`
// 物料信息
Material *UnitConversion `json:"material,omitempty"`
// 生产计划信息(批次)
ProductPlan *ProductPlan `json:"productPlan,omitempty"`
}
... ...
package domain
// 工段
type ProductSection struct {
// 工段ID
SectionId int `json:"sectionId,omitempty"`
// 工段名称
SectionName string `json:"sectionName,omitempty"`
}
... ...
package domain
import "time"
// 单位换算
type UnitConversion struct {
// 单位换算ID
UnitConversionId int `json:"unitConversionId,omitempty"`
// 企业id
CompanyId int `json:"companyId,omitempty"`
// 组织ID
OrgId int `json:"orgId,omitempty"`
// 工作位置
WorkStation *WorkStation `json:"workStation,omitempty"`
// material
Material *Material `json:"material,omitempty"`
// 转换前单位数量
FromUnitQuantity *UnitQuantity `json:"fromUnitQuantity,omitempty"`
// 转换后单位数量
ToUnitQuantity *UnitQuantity `json:"toUnitQuantity,omitempty"`
// 智能称重标识
IntelligentWeighingFlag bool `json:"intelligentWeighingFlag,omitempty"`
// 创建时间
CreatedAt time.Time `json:"createdAt,omitempty"`
// 更新时间
UpdatedAt time.Time `json:"updatedAt,omitempty"`
// 删除时间
DeletedAt time.Time `json:"deletedAt,omitempty"`
}
type UnitConversionRepository interface {
Save(unitConversion *UnitConversion) (*UnitConversion, error)
Remove(unitConversion *UnitConversion) (*UnitConversion, error)
FindOne(queryOptions map[string]interface{}) (*UnitConversion, error)
Find(queryOptions map[string]interface{}) (int64, []*UnitConversion, error)
}
func (unitConversion *UnitConversion) Identify() interface{} {
if unitConversion.UnitConversionId == 0 {
return nil
}
return unitConversion.UnitConversionId
}
func (unitConversion *UnitConversion) Update(data map[string]interface{}) error {
if unitConversionId, ok := data["unitConversionId"]; ok {
unitConversion.UnitConversionId = unitConversionId.(int)
}
if companyId, ok := data["companyId"]; ok {
unitConversion.CompanyId = companyId.(int)
}
if orgId, ok := data["orgId"]; ok {
unitConversion.OrgId = orgId.(int)
}
if workStationId, ok := data["workStationId"]; ok {
unitConversion.WorkStation.WorkStationId = workStationId.(string)
}
if workshopId, ok := data["workshopId"]; ok {
unitConversion.WorkStation.WorkshopId = workshopId.(int)
}
if workshopName, ok := data["workshopName"]; ok {
unitConversion.WorkStation.WorkshopName = workshopName.(string)
}
if lineId, ok := data["lineId"]; ok {
unitConversion.WorkStation.LineId = lineId.(int)
}
if lineName, ok := data["lineName"]; ok {
unitConversion.WorkStation.LineName = lineName.(string)
}
if sectionId, ok := data["sectionId"]; ok {
unitConversion.WorkStation.SectionId = sectionId.(int)
}
if sectionName, ok := data["sectionName"]; ok {
unitConversion.WorkStation.SectionName = sectionName.(string)
}
if materialName, ok := data["materialName"]; ok {
unitConversion.Material.MaterialName = materialName.(string)
}
if materialCategory, ok := data["materialCategory"]; ok {
unitConversion.Material.MaterialCategory = materialCategory.(string)
}
if quantity, ok := data["quantity"]; ok {
unitConversion.FromUnitQuantity.Quantity = quantity.(float64)
}
if unit, ok := data["unit"]; ok {
unitConversion.FromUnitQuantity.Unit = unit.(string)
}
if unitWeight, ok := data["unitWeight"]; ok {
unitConversion.FromUnitQuantity.UnitWeight = unitWeight.(float64)
}
if weight, ok := data["weight"]; ok {
unitConversion.FromUnitQuantity.Weight = weight.(float64)
}
//if quantity, ok := data["quantity"]; ok {
// unitConversion.ToUnitQuantity.FromUnitQuantity.Quantity = quantity.(float64)
//}
//if unit, ok := data["unit"]; ok {
// unitConversion.ToUnitQuantity.FromUnitQuantity.Unit = unit.(string)
//}
//if unitWeight, ok := data["unitWeight"]; ok {
// unitConversion.ToUnitQuantity.FromUnitQuantity.UnitWeight = unitWeight.(float64)
//}
//if weight, ok := data["weight"]; ok {
// unitConversion.ToUnitQuantity.FromUnitQuantity.Weight = weight.(float64)
//}
//if intelligentWeighingFlag, ok := data["intelligentWeighingFlag"]; ok {
// unitConversion.IntelligentWeighingFlag = intelligentWeighingFlag.(boolean)
//}
if createdAt, ok := data["createdAt"]; ok {
unitConversion.CreatedAt = createdAt.(time.Time)
}
if updatedAt, ok := data["updatedAt"]; ok {
unitConversion.UpdatedAt = updatedAt.(time.Time)
}
if deletedAt, ok := data["deletedAt"]; ok {
unitConversion.DeletedAt = deletedAt.(time.Time)
}
return nil
}
... ...
package domain
// 单位数量
type UnitQuantity struct {
// 数量(保留两位小数)
Quantity float64 `json:"quantity,omitempty"`
// 单位
Unit string `json:"unit,omitempty"`
// 单份重量(原材料)
UnitWeight float64 `json:"unitWeight,omitempty"`
// 重量
Weight float64 `json:"weight,omitempty"`
}
... ...
package domain
// 用户对象
type User struct {
// 用户Id 用户唯一标识
UserId int `json:"userId,omitempty"`
// 用户姓名
UserName string `json:"userName,omitempty"`
// 员工类型 1:固定 2:派遣 3.临时
EmployeeType int `json:"employeeType,omitempty"`
// IC卡号
IcCardNumber string `json:"icCardNumber,omitempty"`
// 头像
Avatar string `json:"avatar,omitempty"`
// 手机号码
Phone string `json:"phone,omitempty"`
}
... ...
package domain
// 工作位置(车间、生产线、工段组成),唯一标识工作位置
type WorkStation struct {
// 工作位置键值 (车间ID+'.'+生产线ID+'.'+工段ID)
WorkStationId string `json:"workStationId,omitempty"`
// 车间ID
WorkshopId int `json:"workshopId,omitempty"`
// 车间名称
WorkshopName string `json:"workshopName,omitempty"`
// 生产线ID
LineId int `json:"lineId,omitempty"`
// 生产线名称
LineName string `json:"lineName,omitempty"`
// 工段ID
SectionId int `json:"sectionId,omitempty"`
// 工段名称
SectionName string `json:"sectionName,omitempty"`
}
... ...
package domain
import "time"
// 车间
type Workshop struct {
// 企业id
CompanyId int `json:"companyId,omitempty"`
// 组织ID
OrgId int `json:"orgId,omitempty"`
// 车间ID
WorkshopId int `json:"workshopId,omitempty"`
// 车间名称
WorkshopName string `json:"workshopName,omitempty"`
// 负责人 (用户对象)
Principal *User `json:"principal,omitempty"`
// 生产线
ProductLines []*ProductLine `json:"productLines,omitempty"`
// 创建时间
CreatedAt time.Time `json:"createdAt,omitempty"`
// 更新时间
UpdatedAt time.Time `json:"updatedAt,omitempty"`
// 删除时间
DeletedAt time.Time `json:"deletedAt,omitempty"`
}
type WorkshopRepository interface {
Save(workshop *Workshop) (*Workshop, error)
Remove(workshop *Workshop) (*Workshop, error)
FindOne(queryOptions map[string]interface{}) (*Workshop, error)
Find(queryOptions map[string]interface{}) (int64, []*Workshop, error)
}
func (workshop *Workshop) Identify() interface{} {
if workshop.WorkshopId == 0 {
return nil
}
return workshop.WorkshopId
}
func (workshop *Workshop) Update(data map[string]interface{}) error {
//if companyId, ok := data["companyId"]; ok {
// workshop.CompanyId = companyId.(int)
//}
//if orgId, ok := data["orgId"]; ok {
// workshop.OrgId = orgId.(int)
//}
//if workshopId, ok := data["workshopId"]; ok {
// workshop.WorkshopId = workshopId.(int)
//}
if workshopName, ok := data["workshopName"]; ok {
workshop.WorkshopName = workshopName.(string)
}
if userId, ok := data["userId"]; ok {
workshop.Principal.UserId = userId.(int)
}
if userName, ok := data["userName"]; ok {
workshop.Principal.UserName = userName.(string)
}
if employeeType, ok := data["employeeType"]; ok {
workshop.Principal.EmployeeType = employeeType.(int)
}
if icCardNumber, ok := data["icCardNumber"]; ok {
workshop.Principal.IcCardNumber = icCardNumber.(string)
}
if avatar, ok := data["avatar"]; ok {
workshop.Principal.Avatar = avatar.(string)
}
if phone, ok := data["phone"]; ok {
workshop.Principal.Phone = phone.(string)
}
//if productLines, ok := data["productLines"]; ok {
// workshop.ProductLines = productLines.(array)
//}
if createdAt, ok := data["createdAt"]; ok {
workshop.CreatedAt = createdAt.(time.Time)
}
if updatedAt, ok := data["updatedAt"]; ok {
workshop.UpdatedAt = updatedAt.(time.Time)
}
if deletedAt, ok := data["deletedAt"]; ok {
workshop.DeletedAt = deletedAt.(time.Time)
}
return nil
}
... ...
package pg
import (
"fmt"
"github.com/go-pg/pg/v10"
"github.com/go-pg/pg/v10/orm"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/constant"
//_ "gitlab.fjmaimaimai.com/allied-creation/manufacture/pkg/infrastructure/pg/models"
"github.com/linmadan/egglib-go/persistent/pg/comment"
"github.com/linmadan/egglib-go/persistent/pg/hooks"
)
var DB *pg.DB
func init() {
DB = pg.Connect(&pg.Options{
User: constant.POSTGRESQL_USER,
Password: constant.POSTGRESQL_PASSWORD,
Database: constant.POSTGRESQL_DB_NAME,
Addr: fmt.Sprintf("%s:%s", constant.POSTGRESQL_HOST, constant.POSTGRESQL_PORT),
})
if !constant.DISABLE_SQL_GENERATE_PRINT {
DB.AddQueryHook(hooks.SqlGeneratePrintHook{})
}
if !constant.DISABLE_CREATE_TABLE {
for _, model := range []interface{}{} {
err := DB.Model(model).CreateTable(&orm.CreateTableOptions{
Temp: false,
IfNotExists: true,
FKConstraints: true,
})
if err != nil {
panic(err)
}
comment.AddComments(DB, model)
}
}
}
... ...
package models
import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/domain"
"time"
)
type Device struct {
tableName string `comment:"设备" pg:"devices,alias:device"`
// 设备Id
DeviceId int `comment:"设备Id" pg:"pk:device_id"`
// 企业id
CompanyId int `comment:"企业id"`
// 组织ID
OrgId int `comment:"组织ID"`
// 设备编号
DeviceCode string `comment:"设备编号"`
// 设备名称
DeviceName string `comment:"设备名称"`
// 设备型号
DeviceModel string `comment:"设备型号"`
// 设备类型
DeviceType string `comment:"设备类型"`
// 品牌
Brand string `comment:"品牌"`
// 设备状态 1:正常 2:封存 3:报废
DeviceStatus int `comment:"设备状态 1:正常 2:封存 3:报废"`
// 风险等级 1:高 2:中 3:低
RiskLevel int `comment:"风险等级 1:高 2:中 3:低"`
// 创建时间
CreatedAt time.Time `comment:"创建时间"`
// 更新时间
UpdatedAt time.Time `comment:"更新时间"`
// 删除时间
DeletedAt time.Time `comment:"删除时间"`
// 所属位置
WorkStation *domain.WorkStation `comment:"所属位置"`
}
... ...
package models
import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/domain"
"time"
)
type Product struct {
tableName string `comment:"产品信息" pg:"products,alias:product"`
// 企业id
CompanyId int `comment:"企业id"`
// 组织ID
OrgId int `comment:"组织ID"`
// 产品ID
ProductId int `comment:"产品ID" pg:"pk:product_id"`
// 产品编号 编码规则为“CP”+2 位年+2 位月+2 位日+3 位流水码,如 CP211229001
ProductCode string `comment:"产品编号 编码规则为“CP”+2 位年+2 位月+2 位日+3 位流水码,如 CP211229001"`
// 产品名称
ProductName string `comment:"产品名称"`
// 产品类别
ProductCategory string `comment:"产品类别"`
// 产品规格
ProductSpec *domain.UnitQuantity `comment:"产品规格"`
// 创建时间
CreatedAt time.Time `comment:"创建时间"`
// 更新时间
UpdatedAt time.Time `comment:"更新时间"`
// 删除时间
DeletedAt time.Time `comment:"删除时间"`
}
... ...
package models
import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/domain"
"time"
)
type ProductAttendanceRecord struct {
tableName string `comment:"生产考勤记录" pg:"product_attendance_records,alias:product_attendance_record"`
// 考勤记录ID
ProductAttendanceId int `comment:"考勤记录ID"`
// 组织ID
OrgId int `comment:"组织ID"`
// 产品ID
ProductId int `comment:"产品ID"`
// 考勤类型 1.正常 2.支援
AttendanceType int `comment:"考勤类型 1.正常 2.支援"`
// 生产工人
ProductWorker *domain.User `comment:"生产工人"`
// 工作位置
WorkStation *domain.WorkStation `comment:"工作位置"`
// 签到
SignIn time.Time `comment:"签到"`
// 签退
SignOut time.Time `comment:"签退"`
// 考勤状态 1.未审核 2:已审核 3.自动审核
AttendanceStatus int `comment:"考勤状态 1.未审核 2:已审核 3.自动审核"`
// 工时(审核前)
WorkTimeBefore float64 `comment:"工时(审核前)"`
// 工时(审核后)
WorkTimeAfter float64 `comment:"工时(审核后)"`
// 创建时间
CreatedAt time.Time `comment:"创建时间"`
// 更新时间
UpdatedAt time.Time `comment:"更新时间"`
// 删除时间
DeletedAt time.Time `comment:"删除时间"`
}
... ...
package models
import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/domain"
"time"
)
type ProductCalendar struct {
tableName string `comment:"工厂日历" pg:"product_calendars,alias:product_calendar"`
// 工厂日历ID
ProductCalendarId int `comment:"工厂日历ID" pg:"pk:product_calendar_id"`
// 企业id
CompanyId int `comment:"企业id"`
// 组织ID
OrgId int `comment:"组织ID"`
// 工作位置
WorkStation *domain.WorkStation `comment:"工作位置"`
// 上班班次 1:全天 2:白班 4:中班 8:夜班
WorkOn int `comment:"上班班次 1:全天 2:白班 4:中班 8:夜班"`
// 日历选择
CalendarSelected []string `comment:"日历选择" pg:",array"`
// 上岗时间
InWorkAt string `comment:"上岗时间"`
// 下岗时间
OutWorkAt string `comment:"下岗时间"`
// 休息时间 (单位 h)
BreakTime float64 `comment:"休息时间 (单位 h)"`
// 工时 (单位 h)
WorkTime float64 `comment:"工时 (单位 h)"`
// 创建时间
CreatedAt time.Time `comment:"创建时间"`
// 更新时间
UpdatedAt time.Time `comment:"更新时间"`
// 删除时间
DeletedAt time.Time `comment:"删除时间"`
}
... ...
package models
import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/domain"
"time"
)
type ProductGroup struct {
tableName string `comment:"生产班组" pg:"product_groups,alias:product_group"`
// 生产小组ID
ProductGroupId int `comment:"生产小组ID" pg:"pk:product_group_id"`
// 企业id
CompanyId int `comment:"企业id"`
// 组织ID
OrgId int `comment:"组织ID"`
// 班组名称
GroupName string `comment:"班组名称"`
// 班组长
GroupLeader *domain.User `comment:"班组长"`
// 帮组成员列表
GroupMembers []*domain.User `comment:"帮组成员列表" pg:",array"`
// 上班班次 1:全天 2:白班 4:中班 8:夜班
WorkOn int `comment:"上班班次 1:全天 2:白班 4:中班 8:夜班"`
// 工作位置
WorkStation *domain.WorkStation `comment:"工作位置"`
// 创建时间
CreatedAt time.Time `comment:"创建时间"`
// 更新时间
UpdatedAt time.Time `comment:"更新时间"`
// 删除时间
DeletedAt time.Time `comment:"删除时间"`
}
... ...
package models
import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/domain"
"time"
)
type ProductJob struct {
tableName string `comment:"工位(车间-生产线-工段-工位)" pg:"product_jobs,alias:product_job"`
// 工位ID
ProductJobId int `comment:"工位ID" pg:"pk:product_job_id"`
// 企业id
CompanyId int `comment:"企业id"`
// 组织ID
OrgId int `comment:"组织ID"`
// 工位名称
JobName string `comment:"工位名称"`
// 创建时间
CreatedAt time.Time `comment:"创建时间"`
// 更新时间
UpdatedAt time.Time `comment:"更新时间"`
// 删除时间
DeletedAt time.Time `comment:"删除时间"`
// 工作位置
WorkStation *domain.WorkStation `comment:"工作位置"`
// 关联设备列表
RelatedDevices []int `comment:"关联设备列表" pg:",array"`
}
... ...
package models
import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/domain"
"time"
)
type ProductPlan struct {
tableName string `comment:"生产计划" pg:"product_plans,alias:product_plan"`
// 生产计划ID
ProductPlanId int `comment:"生产计划ID" pg:"pk:product_plan_id"`
// 企业id
CompanyId int `comment:"企业id"`
// 组织ID
OrgId int `comment:"组织ID"`
// 批号
BatchNumber string `comment:"批号"`
// 生产日期
ProductDate time.Time `comment:"生产日期"`
// 车间
Workshop *domain.Workshop `comment:"车间"`
// 上班班次 1:全天 2:白班 4:中班 8:夜班
WorkOn int `comment:"上班班次 1:全天 2:白班 4:中班 8:夜班"`
// 机台 (A、B、C、D 区分机器大小)
Machine string `comment:"机台 (A、B、C、D 区分机器大小)"`
// 计划的产品名称
PlanProductName string `comment:"计划的产品名称"`
// 计划投入
PlanDevoted *domain.UnitQuantity `comment:"计划投入"`
// 计划状态 (1:上线 2:下线 默认下线)
PlanStatus int `comment:"计划状态 (1:上线 2:下线 默认下线)"`
// 工作位置
WorkStation *domain.WorkStation `comment:"工作位置"`
// 备注
Remark string `comment:"备注"`
// 创建时间
CreatedAt time.Time `comment:"创建时间"`
// 更新时间
UpdatedAt time.Time `comment:"更新时间"`
// 删除时间
DeletedAt time.Time `comment:"删除时间"`
}
... ...
package models
import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/domain"
"time"
)
type ProductRecord struct {
tableName string `comment:"生产记录" pg:"product_records,alias:product_record"`
// 生产记录ID
ProductRecordId int `comment:"生产记录ID" pg:"pk:product_record_id"`
// 企业id
CompanyId int `comment:"企业id"`
// 组织ID
OrgId int `comment:"组织ID"`
// 生产记录类型:1:领料 2:退料 4:称重 8:二级品称重
ProductRecordType int `comment:"生产记录类型:1:领料 2:退料 4:称重 8:二级品称重"`
// 生产工人
ProductWorker *domain.User `comment:"生产工人"`
// 工作位置
WorkStation *domain.WorkStation `comment:"工作位置"`
// 创建时间
CreatedAt time.Time `comment:"创建时间"`
// 更新时间
UpdatedAt time.Time `comment:"更新时间"`
// 删除时间
DeletedAt time.Time `comment:"删除时间"`
// 生产记录信息
ProductRecordInfo *domain.ProductRecordInfo `comment:"生产记录信息"`
}
... ...
package models
import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/domain"
"time"
)
type UnitConversion struct {
tableName string `comment:"单位换算" pg:"unit_conversions,alias:unit_conversion"`
// 单位换算ID
UnitConversionId int `comment:"单位换算ID" pg:"pk:unit_conversion_id"`
// 企业id
CompanyId int `comment:"企业id"`
// 组织ID
OrgId int `comment:"组织ID"`
// 工作位置
WorkStation *domain.WorkStation `comment:"工作位置"`
// material
Material *domain.Material `comment:"material"`
// 转换前单位数量
FromUnitQuantity *domain.UnitQuantity `comment:"转换前单位数量"`
// 转换后单位数量
ToUnitQuantity *domain.UnitQuantity `comment:"转换后单位数量"`
// 智能称重标识
IntelligentWeighingFlag bool `comment:"智能称重标识"`
// 创建时间
CreatedAt time.Time `comment:"创建时间"`
// 更新时间
UpdatedAt time.Time `comment:"更新时间"`
// 删除时间
DeletedAt time.Time `comment:"删除时间"`
}
... ...
package models
import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/domain"
"time"
)
type Workshop struct {
tableName string `comment:"车间" pg:"workshops,alias:workshop"`
// 企业id
CompanyId int `comment:"企业id"`
// 组织ID
OrgId int `comment:"组织ID"`
// 车间ID
WorkshopId int `comment:"车间ID" pg:"pk:workshop_id"`
// 车间名称
WorkshopName string `comment:"车间名称"`
// 负责人 (用户对象)
Principal *domain.User `comment:"负责人 (用户对象)"`
// 生产线
ProductLines []*domain.ProductLine `comment:"生产线" pg:",array"`
// 创建时间
CreatedAt time.Time `comment:"创建时间"`
// 更新时间
UpdatedAt time.Time `comment:"更新时间"`
// 删除时间
DeletedAt time.Time `comment:"删除时间"`
}
... ...
package transform
import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/domain"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg/models"
)
func TransformToDeviceDomainModelFromPgModels(deviceModel *models.Device) (*domain.Device, error) {
return &domain.Device{
DeviceId: deviceModel.DeviceId,
CompanyId: deviceModel.CompanyId,
OrgId: deviceModel.OrgId,
DeviceCode: deviceModel.DeviceCode,
DeviceName: deviceModel.DeviceName,
DeviceModel: deviceModel.DeviceModel,
DeviceType: deviceModel.DeviceType,
Brand: deviceModel.Brand,
DeviceStatus: deviceModel.DeviceStatus,
RiskLevel: deviceModel.RiskLevel,
CreatedAt: deviceModel.CreatedAt,
UpdatedAt: deviceModel.UpdatedAt,
DeletedAt: deviceModel.DeletedAt,
WorkStation: deviceModel.WorkStation,
}, nil
}
... ...
package transform
import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/domain"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg/models"
)
func TransformToProductDomainModelFromPgModels(productModel *models.Product) (*domain.Product, error) {
return &domain.Product{
CompanyId: productModel.CompanyId,
OrgId: productModel.OrgId,
ProductId: productModel.ProductId,
ProductCode: productModel.ProductCode,
ProductName: productModel.ProductName,
ProductCategory: productModel.ProductCategory,
ProductSpec: productModel.ProductSpec,
CreatedAt: productModel.CreatedAt,
UpdatedAt: productModel.UpdatedAt,
DeletedAt: productModel.DeletedAt,
}, nil
}
... ...
package transform
import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/domain"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg/models"
)
func TransformToProductAttendanceRecordDomainModelFromPgModels(productAttendanceRecordModel *models.ProductAttendanceRecord) (*domain.ProductAttendanceRecord, error) {
return &domain.ProductAttendanceRecord{
ProductAttendanceId: productAttendanceRecordModel.ProductAttendanceId,
OrgId: productAttendanceRecordModel.OrgId,
ProductId: productAttendanceRecordModel.ProductId,
AttendanceType: productAttendanceRecordModel.AttendanceType,
ProductWorker: productAttendanceRecordModel.ProductWorker,
WorkStation: productAttendanceRecordModel.WorkStation,
SignIn: productAttendanceRecordModel.SignIn,
SignOut: productAttendanceRecordModel.SignOut,
AttendanceStatus: productAttendanceRecordModel.AttendanceStatus,
WorkTimeBefore: productAttendanceRecordModel.WorkTimeBefore,
WorkTimeAfter: productAttendanceRecordModel.WorkTimeAfter,
CreatedAt: productAttendanceRecordModel.CreatedAt,
UpdatedAt: productAttendanceRecordModel.UpdatedAt,
DeletedAt: productAttendanceRecordModel.DeletedAt,
}, nil
}
... ...
package transform
import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/domain"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg/models"
)
func TransformToProductCalendarDomainModelFromPgModels(productCalendarModel *models.ProductCalendar) (*domain.ProductCalendar, error) {
return &domain.ProductCalendar{
ProductCalendarId: productCalendarModel.ProductCalendarId,
CompanyId: productCalendarModel.CompanyId,
OrgId: productCalendarModel.OrgId,
WorkStation: productCalendarModel.WorkStation,
WorkOn: productCalendarModel.WorkOn,
CalendarSelected: productCalendarModel.CalendarSelected,
InWorkAt: productCalendarModel.InWorkAt,
OutWorkAt: productCalendarModel.OutWorkAt,
BreakTime: productCalendarModel.BreakTime,
WorkTime: productCalendarModel.WorkTime,
CreatedAt: productCalendarModel.CreatedAt,
UpdatedAt: productCalendarModel.UpdatedAt,
DeletedAt: productCalendarModel.DeletedAt,
}, nil
}
... ...
package transform
import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/domain"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg/models"
)
func TransformToProductGroupDomainModelFromPgModels(productGroupModel *models.ProductGroup) (*domain.ProductGroup, error) {
return &domain.ProductGroup{
ProductGroupId: productGroupModel.ProductGroupId,
CompanyId: productGroupModel.CompanyId,
OrgId: productGroupModel.OrgId,
GroupName: productGroupModel.GroupName,
GroupLeader: productGroupModel.GroupLeader,
GroupMembers: productGroupModel.GroupMembers,
WorkOn: productGroupModel.WorkOn,
WorkStation: productGroupModel.WorkStation,
CreatedAt: productGroupModel.CreatedAt,
UpdatedAt: productGroupModel.UpdatedAt,
DeletedAt: productGroupModel.DeletedAt,
}, nil
}
... ...
package transform
import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/domain"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg/models"
)
func TransformToProductJobDomainModelFromPgModels(productJobModel *models.ProductJob) (*domain.ProductJob, error) {
return &domain.ProductJob{
ProductJobId: productJobModel.ProductJobId,
CompanyId: productJobModel.CompanyId,
OrgId: productJobModel.OrgId,
JobName: productJobModel.JobName,
CreatedAt: productJobModel.CreatedAt,
UpdatedAt: productJobModel.UpdatedAt,
DeletedAt: productJobModel.DeletedAt,
WorkStation: productJobModel.WorkStation,
RelatedDevices: productJobModel.RelatedDevices,
}, nil
}
... ...
package transform
import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/domain"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg/models"
)
func TransformToProductPlanDomainModelFromPgModels(productPlanModel *models.ProductPlan) (*domain.ProductPlan, error) {
return &domain.ProductPlan{
ProductPlanId: productPlanModel.ProductPlanId,
CompanyId: productPlanModel.CompanyId,
OrgId: productPlanModel.OrgId,
BatchNumber: productPlanModel.BatchNumber,
ProductDate: productPlanModel.ProductDate,
Workshop: productPlanModel.Workshop,
WorkOn: productPlanModel.WorkOn,
Machine: productPlanModel.Machine,
PlanProductName: productPlanModel.PlanProductName,
PlanDevoted: productPlanModel.PlanDevoted,
PlanStatus: productPlanModel.PlanStatus,
WorkStation: productPlanModel.WorkStation,
Remark: productPlanModel.Remark,
CreatedAt: productPlanModel.CreatedAt,
UpdatedAt: productPlanModel.UpdatedAt,
DeletedAt: productPlanModel.DeletedAt,
}, nil
}
... ...
package transform
import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/domain"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg/models"
)
func TransformToProductRecordDomainModelFromPgModels(productRecordModel *models.ProductRecord) (*domain.ProductRecord, error) {
return &domain.ProductRecord{
ProductRecordId: productRecordModel.ProductRecordId,
CompanyId: productRecordModel.CompanyId,
OrgId: productRecordModel.OrgId,
ProductRecordType: productRecordModel.ProductRecordType,
ProductWorker: productRecordModel.ProductWorker,
WorkStation: productRecordModel.WorkStation,
CreatedAt: productRecordModel.CreatedAt,
UpdatedAt: productRecordModel.UpdatedAt,
DeletedAt: productRecordModel.DeletedAt,
ProductRecordInfo: productRecordModel.ProductRecordInfo,
}, nil
}
... ...
package transform
import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/domain"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg/models"
)
func TransformToUnitConversionDomainModelFromPgModels(unitConversionModel *models.UnitConversion) (*domain.UnitConversion, error) {
return &domain.UnitConversion{
UnitConversionId: unitConversionModel.UnitConversionId,
CompanyId: unitConversionModel.CompanyId,
OrgId: unitConversionModel.OrgId,
WorkStation: unitConversionModel.WorkStation,
Material: unitConversionModel.Material,
FromUnitQuantity: unitConversionModel.FromUnitQuantity,
ToUnitQuantity: unitConversionModel.ToUnitQuantity,
IntelligentWeighingFlag: unitConversionModel.IntelligentWeighingFlag,
CreatedAt: unitConversionModel.CreatedAt,
UpdatedAt: unitConversionModel.UpdatedAt,
DeletedAt: unitConversionModel.DeletedAt,
}, nil
}
... ...
package transform
import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/domain"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg/models"
)
func TransformToWorkshopDomainModelFromPgModels(workshopModel *models.Workshop) (*domain.Workshop, error) {
return &domain.Workshop{
CompanyId: workshopModel.CompanyId,
OrgId: workshopModel.OrgId,
WorkshopId: workshopModel.WorkshopId,
WorkshopName: workshopModel.WorkshopName,
Principal: workshopModel.Principal,
ProductLines: workshopModel.ProductLines,
CreatedAt: workshopModel.CreatedAt,
UpdatedAt: workshopModel.UpdatedAt,
DeletedAt: workshopModel.DeletedAt,
}, nil
}
... ...
package repository
import (
"fmt"
"github.com/go-pg/pg/v10"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/domain"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg/models"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg/transform"
"github.com/linmadan/egglib-go/persistent/pg/sqlbuilder"
pgTransaction "github.com/linmadan/egglib-go/transaction/pg"
"github.com/linmadan/egglib-go/utils/snowflake"
)
type DeviceRepository struct {
transactionContext *pgTransaction.TransactionContext
}
func (repository *DeviceRepository) nextIdentify() (int64, error) {
IdWorker, err := snowflake.NewIdWorker(1)
if err != nil {
return 0, err
}
id, err := IdWorker.NextId()
return id, err
}
func (repository *DeviceRepository) Save(device *domain.Device) (*domain.Device, error) {
sqlBuildFields := []string{
"device_id",
"company_id",
"org_id",
"device_code",
"device_name",
"device_model",
"device_type",
"brand",
"device_status",
"risk_level",
"created_at",
"updated_at",
"deleted_at",
"work_station",
}
insertFieldsSnippet := sqlbuilder.SqlFieldsSnippet(sqlBuildFields)
insertPlaceHoldersSnippet := sqlbuilder.SqlPlaceHoldersSnippet(sqlBuildFields)
returningFieldsSnippet := sqlbuilder.SqlFieldsSnippet(sqlBuildFields)
updateFields := sqlbuilder.RemoveSqlFields(sqlBuildFields, "device_id")
updateFieldsSnippet := sqlbuilder.SqlUpdateFieldsSnippet(updateFields)
tx := repository.transactionContext.PgTx
if device.Identify() == nil {
deviceId, err := repository.nextIdentify()
if err != nil {
return device, err
} else {
device.DeviceId = int(deviceId)
}
if _, err := tx.QueryOne(
pg.Scan(
&device.DeviceId,
&device.CompanyId,
&device.OrgId,
&device.DeviceCode,
&device.DeviceName,
&device.DeviceModel,
&device.DeviceType,
&device.Brand,
&device.DeviceStatus,
&device.RiskLevel,
&device.CreatedAt,
&device.UpdatedAt,
&device.DeletedAt,
&device.WorkStation,
),
fmt.Sprintf("INSERT INTO devices (%s) VALUES (%s) RETURNING %s", insertFieldsSnippet, insertPlaceHoldersSnippet, returningFieldsSnippet),
device.DeviceId,
device.CompanyId,
device.OrgId,
device.DeviceCode,
device.DeviceName,
device.DeviceModel,
device.DeviceType,
device.Brand,
device.DeviceStatus,
device.RiskLevel,
device.CreatedAt,
device.UpdatedAt,
device.DeletedAt,
device.WorkStation,
); err != nil {
return device, err
}
} else {
if _, err := tx.QueryOne(
pg.Scan(
&device.DeviceId,
&device.CompanyId,
&device.OrgId,
&device.DeviceCode,
&device.DeviceName,
&device.DeviceModel,
&device.DeviceType,
&device.Brand,
&device.DeviceStatus,
&device.RiskLevel,
&device.CreatedAt,
&device.UpdatedAt,
&device.DeletedAt,
&device.WorkStation,
),
fmt.Sprintf("UPDATE devices SET %s WHERE device_id=? RETURNING %s", updateFieldsSnippet, returningFieldsSnippet),
device.DeviceId,
device.CompanyId,
device.OrgId,
device.DeviceCode,
device.DeviceName,
device.DeviceModel,
device.DeviceType,
device.Brand,
device.DeviceStatus,
device.RiskLevel,
device.CreatedAt,
device.UpdatedAt,
device.DeletedAt,
device.WorkStation,
device.Identify(),
); err != nil {
return device, err
}
}
return device, nil
}
func (repository *DeviceRepository) Remove(device *domain.Device) (*domain.Device, error) {
tx := repository.transactionContext.PgTx
deviceModel := new(models.Device)
deviceModel.DeviceId = device.Identify().(int)
if _, err := tx.Model(deviceModel).WherePK().Delete(); err != nil {
return device, err
}
return device, nil
}
func (repository *DeviceRepository) FindOne(queryOptions map[string]interface{}) (*domain.Device, error) {
tx := repository.transactionContext.PgTx
deviceModel := new(models.Device)
query := sqlbuilder.BuildQuery(tx.Model(deviceModel), queryOptions)
query.SetWhereByQueryOption("device.device_id = ?", "deviceId")
if err := query.First(); err != nil {
if err.Error() == "pg: no rows in result set" {
return nil, fmt.Errorf("没有此资源")
} else {
return nil, err
}
}
if deviceModel.DeviceId == 0 {
return nil, nil
} else {
return transform.TransformToDeviceDomainModelFromPgModels(deviceModel)
}
}
func (repository *DeviceRepository) Find(queryOptions map[string]interface{}) (int64, []*domain.Device, error) {
tx := repository.transactionContext.PgTx
var deviceModels []*models.Device
devices := make([]*domain.Device, 0)
query := sqlbuilder.BuildQuery(tx.Model(&deviceModels), queryOptions)
query.SetOffsetAndLimit(20)
query.SetOrderDirect("device_id", "DESC")
if count, err := query.SelectAndCount(); err != nil {
return 0, devices, err
} else {
for _, deviceModel := range deviceModels {
if device, err := transform.TransformToDeviceDomainModelFromPgModels(deviceModel); err != nil {
return 0, devices, err
} else {
devices = append(devices, device)
}
}
return int64(count), devices, nil
}
}
func NewDeviceRepository(transactionContext *pgTransaction.TransactionContext) (*DeviceRepository, error) {
if transactionContext == nil {
return nil, fmt.Errorf("transactionContext参数不能为nil")
} else {
return &DeviceRepository{
transactionContext: transactionContext,
}, nil
}
}
... ...
package repository
import (
"fmt"
"github.com/go-pg/pg/v10"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/domain"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg/models"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg/transform"
"github.com/linmadan/egglib-go/persistent/pg/sqlbuilder"
pgTransaction "github.com/linmadan/egglib-go/transaction/pg"
"github.com/linmadan/egglib-go/utils/snowflake"
)
type ProductAttendanceRecordRepository struct {
transactionContext *pgTransaction.TransactionContext
}
func (repository *ProductAttendanceRecordRepository) nextIdentify() (int64, error) {
IdWorker, err := snowflake.NewIdWorker(1)
if err != nil {
return 0, err
}
id, err := IdWorker.NextId()
return id, err
}
func (repository *ProductAttendanceRecordRepository) Save(productAttendanceRecord *domain.ProductAttendanceRecord) (*domain.ProductAttendanceRecord, error) {
sqlBuildFields := []string{
"product_attendance_id",
"org_id",
"product_id",
"attendance_type",
"product_worker",
"work_station",
"sign_in",
"sign_out",
"attendance_status",
"work_time_before",
"work_time_after",
"created_at",
"updated_at",
"deleted_at",
}
insertFieldsSnippet := sqlbuilder.SqlFieldsSnippet(sqlBuildFields)
insertPlaceHoldersSnippet := sqlbuilder.SqlPlaceHoldersSnippet(sqlBuildFields)
returningFieldsSnippet := sqlbuilder.SqlFieldsSnippet(sqlBuildFields)
updateFields := sqlbuilder.RemoveSqlFields(sqlBuildFields, "productAttendanceRecord_id")
updateFieldsSnippet := sqlbuilder.SqlUpdateFieldsSnippet(updateFields)
tx := repository.transactionContext.PgTx
if productAttendanceRecord.Identify() == nil {
productAttendanceRecordId, err := repository.nextIdentify()
if err != nil {
return productAttendanceRecord, err
} else {
productAttendanceRecord.ProductAttendanceId = int(productAttendanceRecordId)
}
if _, err := tx.QueryOne(
pg.Scan(
&productAttendanceRecord.ProductAttendanceId,
&productAttendanceRecord.OrgId,
&productAttendanceRecord.ProductId,
&productAttendanceRecord.AttendanceType,
&productAttendanceRecord.ProductWorker,
&productAttendanceRecord.WorkStation,
&productAttendanceRecord.SignIn,
&productAttendanceRecord.SignOut,
&productAttendanceRecord.AttendanceStatus,
&productAttendanceRecord.WorkTimeBefore,
&productAttendanceRecord.WorkTimeAfter,
&productAttendanceRecord.CreatedAt,
&productAttendanceRecord.UpdatedAt,
&productAttendanceRecord.DeletedAt,
),
fmt.Sprintf("INSERT INTO product_attendance_records (%s) VALUES (%s) RETURNING %s", insertFieldsSnippet, insertPlaceHoldersSnippet, returningFieldsSnippet),
productAttendanceRecord.ProductAttendanceId,
productAttendanceRecord.OrgId,
productAttendanceRecord.ProductId,
productAttendanceRecord.AttendanceType,
productAttendanceRecord.ProductWorker,
productAttendanceRecord.WorkStation,
productAttendanceRecord.SignIn,
productAttendanceRecord.SignOut,
productAttendanceRecord.AttendanceStatus,
productAttendanceRecord.WorkTimeBefore,
productAttendanceRecord.WorkTimeAfter,
productAttendanceRecord.CreatedAt,
productAttendanceRecord.UpdatedAt,
productAttendanceRecord.DeletedAt,
); err != nil {
return productAttendanceRecord, err
}
} else {
if _, err := tx.QueryOne(
pg.Scan(
&productAttendanceRecord.ProductAttendanceId,
&productAttendanceRecord.OrgId,
&productAttendanceRecord.ProductId,
&productAttendanceRecord.AttendanceType,
&productAttendanceRecord.ProductWorker,
&productAttendanceRecord.WorkStation,
&productAttendanceRecord.SignIn,
&productAttendanceRecord.SignOut,
&productAttendanceRecord.AttendanceStatus,
&productAttendanceRecord.WorkTimeBefore,
&productAttendanceRecord.WorkTimeAfter,
&productAttendanceRecord.CreatedAt,
&productAttendanceRecord.UpdatedAt,
&productAttendanceRecord.DeletedAt,
),
fmt.Sprintf("UPDATE product_attendance_records SET %s WHERE product_attendance_record_id=? RETURNING %s", updateFieldsSnippet, returningFieldsSnippet),
productAttendanceRecord.ProductAttendanceId,
productAttendanceRecord.OrgId,
productAttendanceRecord.ProductId,
productAttendanceRecord.AttendanceType,
productAttendanceRecord.ProductWorker,
productAttendanceRecord.WorkStation,
productAttendanceRecord.SignIn,
productAttendanceRecord.SignOut,
productAttendanceRecord.AttendanceStatus,
productAttendanceRecord.WorkTimeBefore,
productAttendanceRecord.WorkTimeAfter,
productAttendanceRecord.CreatedAt,
productAttendanceRecord.UpdatedAt,
productAttendanceRecord.DeletedAt,
productAttendanceRecord.Identify(),
); err != nil {
return productAttendanceRecord, err
}
}
return productAttendanceRecord, nil
}
func (repository *ProductAttendanceRecordRepository) Remove(productAttendanceRecord *domain.ProductAttendanceRecord) (*domain.ProductAttendanceRecord, error) {
tx := repository.transactionContext.PgTx
productAttendanceRecordModel := new(models.ProductAttendanceRecord)
productAttendanceRecordModel.ProductAttendanceId = productAttendanceRecord.Identify().(int)
if _, err := tx.Model(productAttendanceRecordModel).WherePK().Delete(); err != nil {
return productAttendanceRecord, err
}
return productAttendanceRecord, nil
}
func (repository *ProductAttendanceRecordRepository) FindOne(queryOptions map[string]interface{}) (*domain.ProductAttendanceRecord, error) {
tx := repository.transactionContext.PgTx
productAttendanceRecordModel := new(models.ProductAttendanceRecord)
query := sqlbuilder.BuildQuery(tx.Model(productAttendanceRecordModel), queryOptions)
query.SetWhereByQueryOption("product_attendance_record.product_attendance_record_id = ?", "productAttendanceRecordId")
if err := query.First(); err != nil {
if err.Error() == "pg: no rows in result set" {
return nil, fmt.Errorf("没有此资源")
} else {
return nil, err
}
}
if productAttendanceRecordModel.ProductAttendanceId == 0 {
return nil, nil
} else {
return transform.TransformToProductAttendanceRecordDomainModelFromPgModels(productAttendanceRecordModel)
}
}
func (repository *ProductAttendanceRecordRepository) Find(queryOptions map[string]interface{}) (int64, []*domain.ProductAttendanceRecord, error) {
tx := repository.transactionContext.PgTx
var productAttendanceRecordModels []*models.ProductAttendanceRecord
productAttendanceRecords := make([]*domain.ProductAttendanceRecord, 0)
query := sqlbuilder.BuildQuery(tx.Model(&productAttendanceRecordModels), queryOptions)
query.SetOffsetAndLimit(20)
query.SetOrderDirect("product_attendance_record_id", "DESC")
if count, err := query.SelectAndCount(); err != nil {
return 0, productAttendanceRecords, err
} else {
for _, productAttendanceRecordModel := range productAttendanceRecordModels {
if productAttendanceRecord, err := transform.TransformToProductAttendanceRecordDomainModelFromPgModels(productAttendanceRecordModel); err != nil {
return 0, productAttendanceRecords, err
} else {
productAttendanceRecords = append(productAttendanceRecords, productAttendanceRecord)
}
}
return int64(count), productAttendanceRecords, nil
}
}
func NewProductAttendanceRecordRepository(transactionContext *pgTransaction.TransactionContext) (*ProductAttendanceRecordRepository, error) {
if transactionContext == nil {
return nil, fmt.Errorf("transactionContext参数不能为nil")
} else {
return &ProductAttendanceRecordRepository{
transactionContext: transactionContext,
}, nil
}
}
... ...
package repository
import (
"fmt"
"github.com/go-pg/pg/v10"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/domain"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg/models"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg/transform"
"github.com/linmadan/egglib-go/persistent/pg/sqlbuilder"
pgTransaction "github.com/linmadan/egglib-go/transaction/pg"
"github.com/linmadan/egglib-go/utils/snowflake"
)
type ProductCalendarRepository struct {
transactionContext *pgTransaction.TransactionContext
}
func (repository *ProductCalendarRepository) nextIdentify() (int64, error) {
IdWorker, err := snowflake.NewIdWorker(1)
if err != nil {
return 0, err
}
id, err := IdWorker.NextId()
return id, err
}
func (repository *ProductCalendarRepository) Save(productCalendar *domain.ProductCalendar) (*domain.ProductCalendar, error) {
sqlBuildFields := []string{
"product_calendar_id",
"company_id",
"org_id",
"work_station",
"work_on",
"calendar_selected",
"in_work_at",
"out_work_at",
"break_time",
"work_time",
"created_at",
"updated_at",
"deleted_at",
}
insertFieldsSnippet := sqlbuilder.SqlFieldsSnippet(sqlBuildFields)
insertPlaceHoldersSnippet := sqlbuilder.SqlPlaceHoldersSnippet(sqlBuildFields)
returningFieldsSnippet := sqlbuilder.SqlFieldsSnippet(sqlBuildFields)
updateFields := sqlbuilder.RemoveSqlFields(sqlBuildFields, "productCalendar_id")
updateFieldsSnippet := sqlbuilder.SqlUpdateFieldsSnippet(updateFields)
tx := repository.transactionContext.PgTx
if productCalendar.Identify() == nil {
productCalendarId, err := repository.nextIdentify()
if err != nil {
return productCalendar, err
} else {
productCalendar.ProductCalendarId = int(productCalendarId)
}
if _, err := tx.QueryOne(
pg.Scan(
&productCalendar.ProductCalendarId,
&productCalendar.CompanyId,
&productCalendar.OrgId,
&productCalendar.WorkStation,
&productCalendar.WorkOn,
pg.Array(&productCalendar.CalendarSelected),
&productCalendar.InWorkAt,
&productCalendar.OutWorkAt,
&productCalendar.BreakTime,
&productCalendar.WorkTime,
&productCalendar.CreatedAt,
&productCalendar.UpdatedAt,
&productCalendar.DeletedAt,
),
fmt.Sprintf("INSERT INTO product_calendars (%s) VALUES (%s) RETURNING %s", insertFieldsSnippet, insertPlaceHoldersSnippet, returningFieldsSnippet),
productCalendar.ProductCalendarId,
productCalendar.CompanyId,
productCalendar.OrgId,
productCalendar.WorkStation,
productCalendar.WorkOn,
pg.Array(productCalendar.CalendarSelected),
productCalendar.InWorkAt,
productCalendar.OutWorkAt,
productCalendar.BreakTime,
productCalendar.WorkTime,
productCalendar.CreatedAt,
productCalendar.UpdatedAt,
productCalendar.DeletedAt,
); err != nil {
return productCalendar, err
}
} else {
if _, err := tx.QueryOne(
pg.Scan(
&productCalendar.ProductCalendarId,
&productCalendar.CompanyId,
&productCalendar.OrgId,
&productCalendar.WorkStation,
&productCalendar.WorkOn,
pg.Array(&productCalendar.CalendarSelected),
&productCalendar.InWorkAt,
&productCalendar.OutWorkAt,
&productCalendar.BreakTime,
&productCalendar.WorkTime,
&productCalendar.CreatedAt,
&productCalendar.UpdatedAt,
&productCalendar.DeletedAt,
),
fmt.Sprintf("UPDATE product_calendars SET %s WHERE product_calendar_id=? RETURNING %s", updateFieldsSnippet, returningFieldsSnippet),
productCalendar.ProductCalendarId,
productCalendar.CompanyId,
productCalendar.OrgId,
productCalendar.WorkStation,
productCalendar.WorkOn,
pg.Array(productCalendar.CalendarSelected),
productCalendar.InWorkAt,
productCalendar.OutWorkAt,
productCalendar.BreakTime,
productCalendar.WorkTime,
productCalendar.CreatedAt,
productCalendar.UpdatedAt,
productCalendar.DeletedAt,
productCalendar.Identify(),
); err != nil {
return productCalendar, err
}
}
return productCalendar, nil
}
func (repository *ProductCalendarRepository) Remove(productCalendar *domain.ProductCalendar) (*domain.ProductCalendar, error) {
tx := repository.transactionContext.PgTx
productCalendarModel := new(models.ProductCalendar)
productCalendarModel.ProductCalendarId = productCalendar.Identify().(int)
if _, err := tx.Model(productCalendarModel).WherePK().Delete(); err != nil {
return productCalendar, err
}
return productCalendar, nil
}
func (repository *ProductCalendarRepository) FindOne(queryOptions map[string]interface{}) (*domain.ProductCalendar, error) {
tx := repository.transactionContext.PgTx
productCalendarModel := new(models.ProductCalendar)
query := sqlbuilder.BuildQuery(tx.Model(productCalendarModel), queryOptions)
query.SetWhereByQueryOption("product_calendar.product_calendar_id = ?", "productCalendarId")
if err := query.First(); err != nil {
if err.Error() == "pg: no rows in result set" {
return nil, fmt.Errorf("没有此资源")
} else {
return nil, err
}
}
if productCalendarModel.ProductCalendarId == 0 {
return nil, nil
} else {
return transform.TransformToProductCalendarDomainModelFromPgModels(productCalendarModel)
}
}
func (repository *ProductCalendarRepository) Find(queryOptions map[string]interface{}) (int64, []*domain.ProductCalendar, error) {
tx := repository.transactionContext.PgTx
var productCalendarModels []*models.ProductCalendar
productCalendars := make([]*domain.ProductCalendar, 0)
query := sqlbuilder.BuildQuery(tx.Model(&productCalendarModels), queryOptions)
query.SetOffsetAndLimit(20)
query.SetOrderDirect("product_calendar_id", "DESC")
if count, err := query.SelectAndCount(); err != nil {
return 0, productCalendars, err
} else {
for _, productCalendarModel := range productCalendarModels {
if productCalendar, err := transform.TransformToProductCalendarDomainModelFromPgModels(productCalendarModel); err != nil {
return 0, productCalendars, err
} else {
productCalendars = append(productCalendars, productCalendar)
}
}
return int64(count), productCalendars, nil
}
}
func NewProductCalendarRepository(transactionContext *pgTransaction.TransactionContext) (*ProductCalendarRepository, error) {
if transactionContext == nil {
return nil, fmt.Errorf("transactionContext参数不能为nil")
} else {
return &ProductCalendarRepository{
transactionContext: transactionContext,
}, nil
}
}
... ...
package repository
import (
"fmt"
"github.com/go-pg/pg/v10"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/domain"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg/models"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg/transform"
"github.com/linmadan/egglib-go/persistent/pg/sqlbuilder"
pgTransaction "github.com/linmadan/egglib-go/transaction/pg"
"github.com/linmadan/egglib-go/utils/snowflake"
)
type ProductGroupRepository struct {
transactionContext *pgTransaction.TransactionContext
}
func (repository *ProductGroupRepository) nextIdentify() (int64, error) {
IdWorker, err := snowflake.NewIdWorker(1)
if err != nil {
return 0, err
}
id, err := IdWorker.NextId()
return id, err
}
func (repository *ProductGroupRepository) Save(productGroup *domain.ProductGroup) (*domain.ProductGroup, error) {
sqlBuildFields := []string{
"product_group_id",
"company_id",
"org_id",
"group_name",
"group_leader",
"group_members",
"work_on",
"work_station",
"created_at",
"updated_at",
"deleted_at",
}
insertFieldsSnippet := sqlbuilder.SqlFieldsSnippet(sqlBuildFields)
insertPlaceHoldersSnippet := sqlbuilder.SqlPlaceHoldersSnippet(sqlBuildFields)
returningFieldsSnippet := sqlbuilder.SqlFieldsSnippet(sqlBuildFields)
updateFields := sqlbuilder.RemoveSqlFields(sqlBuildFields, "productGroup_id")
updateFieldsSnippet := sqlbuilder.SqlUpdateFieldsSnippet(updateFields)
tx := repository.transactionContext.PgTx
if productGroup.Identify() == nil {
productGroupId, err := repository.nextIdentify()
if err != nil {
return productGroup, err
} else {
productGroup.ProductGroupId = int(productGroupId)
}
if _, err := tx.QueryOne(
pg.Scan(
&productGroup.ProductGroupId,
&productGroup.CompanyId,
&productGroup.OrgId,
&productGroup.GroupName,
&productGroup.GroupLeader,
pg.Array(&productGroup.GroupMembers),
&productGroup.WorkOn,
&productGroup.WorkStation,
&productGroup.CreatedAt,
&productGroup.UpdatedAt,
&productGroup.DeletedAt,
),
fmt.Sprintf("INSERT INTO product_groups (%s) VALUES (%s) RETURNING %s", insertFieldsSnippet, insertPlaceHoldersSnippet, returningFieldsSnippet),
productGroup.ProductGroupId,
productGroup.CompanyId,
productGroup.OrgId,
productGroup.GroupName,
productGroup.GroupLeader,
pg.Array(productGroup.GroupMembers),
productGroup.WorkOn,
productGroup.WorkStation,
productGroup.CreatedAt,
productGroup.UpdatedAt,
productGroup.DeletedAt,
); err != nil {
return productGroup, err
}
} else {
if _, err := tx.QueryOne(
pg.Scan(
&productGroup.ProductGroupId,
&productGroup.CompanyId,
&productGroup.OrgId,
&productGroup.GroupName,
&productGroup.GroupLeader,
pg.Array(&productGroup.GroupMembers),
&productGroup.WorkOn,
&productGroup.WorkStation,
&productGroup.CreatedAt,
&productGroup.UpdatedAt,
&productGroup.DeletedAt,
),
fmt.Sprintf("UPDATE product_groups SET %s WHERE product_group_id=? RETURNING %s", updateFieldsSnippet, returningFieldsSnippet),
productGroup.ProductGroupId,
productGroup.CompanyId,
productGroup.OrgId,
productGroup.GroupName,
productGroup.GroupLeader,
pg.Array(productGroup.GroupMembers),
productGroup.WorkOn,
productGroup.WorkStation,
productGroup.CreatedAt,
productGroup.UpdatedAt,
productGroup.DeletedAt,
productGroup.Identify(),
); err != nil {
return productGroup, err
}
}
return productGroup, nil
}
func (repository *ProductGroupRepository) Remove(productGroup *domain.ProductGroup) (*domain.ProductGroup, error) {
tx := repository.transactionContext.PgTx
productGroupModel := new(models.ProductGroup)
productGroupModel.ProductGroupId = productGroup.Identify().(int)
if _, err := tx.Model(productGroupModel).WherePK().Delete(); err != nil {
return productGroup, err
}
return productGroup, nil
}
func (repository *ProductGroupRepository) FindOne(queryOptions map[string]interface{}) (*domain.ProductGroup, error) {
tx := repository.transactionContext.PgTx
productGroupModel := new(models.ProductGroup)
query := sqlbuilder.BuildQuery(tx.Model(productGroupModel), queryOptions)
query.SetWhereByQueryOption("product_group.product_group_id = ?", "productGroupId")
if err := query.First(); err != nil {
if err.Error() == "pg: no rows in result set" {
return nil, fmt.Errorf("没有此资源")
} else {
return nil, err
}
}
if productGroupModel.ProductGroupId == 0 {
return nil, nil
} else {
return transform.TransformToProductGroupDomainModelFromPgModels(productGroupModel)
}
}
func (repository *ProductGroupRepository) Find(queryOptions map[string]interface{}) (int64, []*domain.ProductGroup, error) {
tx := repository.transactionContext.PgTx
var productGroupModels []*models.ProductGroup
productGroups := make([]*domain.ProductGroup, 0)
query := sqlbuilder.BuildQuery(tx.Model(&productGroupModels), queryOptions)
query.SetOffsetAndLimit(20)
query.SetOrderDirect("product_group_id", "DESC")
if count, err := query.SelectAndCount(); err != nil {
return 0, productGroups, err
} else {
for _, productGroupModel := range productGroupModels {
if productGroup, err := transform.TransformToProductGroupDomainModelFromPgModels(productGroupModel); err != nil {
return 0, productGroups, err
} else {
productGroups = append(productGroups, productGroup)
}
}
return int64(count), productGroups, nil
}
}
func NewProductGroupRepository(transactionContext *pgTransaction.TransactionContext) (*ProductGroupRepository, error) {
if transactionContext == nil {
return nil, fmt.Errorf("transactionContext参数不能为nil")
} else {
return &ProductGroupRepository{
transactionContext: transactionContext,
}, nil
}
}
... ...
package repository
import (
"fmt"
"github.com/go-pg/pg/v10"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/domain"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg/models"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg/transform"
"github.com/linmadan/egglib-go/persistent/pg/sqlbuilder"
pgTransaction "github.com/linmadan/egglib-go/transaction/pg"
"github.com/linmadan/egglib-go/utils/snowflake"
)
type ProductJobRepository struct {
transactionContext *pgTransaction.TransactionContext
}
func (repository *ProductJobRepository) nextIdentify() (int64, error) {
IdWorker, err := snowflake.NewIdWorker(1)
if err != nil {
return 0, err
}
id, err := IdWorker.NextId()
return id, err
}
func (repository *ProductJobRepository) Save(productJob *domain.ProductJob) (*domain.ProductJob, error) {
sqlBuildFields := []string{
"product_job_id",
"company_id",
"org_id",
"job_name",
"created_at",
"updated_at",
"deleted_at",
"work_station",
"related_devices",
}
insertFieldsSnippet := sqlbuilder.SqlFieldsSnippet(sqlBuildFields)
insertPlaceHoldersSnippet := sqlbuilder.SqlPlaceHoldersSnippet(sqlBuildFields)
returningFieldsSnippet := sqlbuilder.SqlFieldsSnippet(sqlBuildFields)
updateFields := sqlbuilder.RemoveSqlFields(sqlBuildFields, "productJob_id")
updateFieldsSnippet := sqlbuilder.SqlUpdateFieldsSnippet(updateFields)
tx := repository.transactionContext.PgTx
if productJob.Identify() == nil {
productJobId, err := repository.nextIdentify()
if err != nil {
return productJob, err
} else {
productJob.ProductJobId = int(productJobId)
}
if _, err := tx.QueryOne(
pg.Scan(
&productJob.ProductJobId,
&productJob.CompanyId,
&productJob.OrgId,
&productJob.JobName,
&productJob.CreatedAt,
&productJob.UpdatedAt,
&productJob.DeletedAt,
&productJob.WorkStation,
pg.Array(&productJob.RelatedDevices),
),
fmt.Sprintf("INSERT INTO product_jobs (%s) VALUES (%s) RETURNING %s", insertFieldsSnippet, insertPlaceHoldersSnippet, returningFieldsSnippet),
productJob.ProductJobId,
productJob.CompanyId,
productJob.OrgId,
productJob.JobName,
productJob.CreatedAt,
productJob.UpdatedAt,
productJob.DeletedAt,
productJob.WorkStation,
pg.Array(productJob.RelatedDevices),
); err != nil {
return productJob, err
}
} else {
if _, err := tx.QueryOne(
pg.Scan(
&productJob.ProductJobId,
&productJob.CompanyId,
&productJob.OrgId,
&productJob.JobName,
&productJob.CreatedAt,
&productJob.UpdatedAt,
&productJob.DeletedAt,
&productJob.WorkStation,
pg.Array(&productJob.RelatedDevices),
),
fmt.Sprintf("UPDATE product_jobs SET %s WHERE product_job_id=? RETURNING %s", updateFieldsSnippet, returningFieldsSnippet),
productJob.ProductJobId,
productJob.CompanyId,
productJob.OrgId,
productJob.JobName,
productJob.CreatedAt,
productJob.UpdatedAt,
productJob.DeletedAt,
productJob.WorkStation,
pg.Array(productJob.RelatedDevices),
productJob.Identify(),
); err != nil {
return productJob, err
}
}
return productJob, nil
}
func (repository *ProductJobRepository) Remove(productJob *domain.ProductJob) (*domain.ProductJob, error) {
tx := repository.transactionContext.PgTx
productJobModel := new(models.ProductJob)
productJobModel.ProductJobId = productJob.Identify().(int)
if _, err := tx.Model(productJobModel).WherePK().Delete(); err != nil {
return productJob, err
}
return productJob, nil
}
func (repository *ProductJobRepository) FindOne(queryOptions map[string]interface{}) (*domain.ProductJob, error) {
tx := repository.transactionContext.PgTx
productJobModel := new(models.ProductJob)
query := sqlbuilder.BuildQuery(tx.Model(productJobModel), queryOptions)
query.SetWhereByQueryOption("product_job.product_job_id = ?", "productJobId")
if err := query.First(); err != nil {
if err.Error() == "pg: no rows in result set" {
return nil, fmt.Errorf("没有此资源")
} else {
return nil, err
}
}
if productJobModel.ProductJobId == 0 {
return nil, nil
} else {
return transform.TransformToProductJobDomainModelFromPgModels(productJobModel)
}
}
func (repository *ProductJobRepository) Find(queryOptions map[string]interface{}) (int64, []*domain.ProductJob, error) {
tx := repository.transactionContext.PgTx
var productJobModels []*models.ProductJob
productJobs := make([]*domain.ProductJob, 0)
query := sqlbuilder.BuildQuery(tx.Model(&productJobModels), queryOptions)
query.SetOffsetAndLimit(20)
query.SetOrderDirect("product_job_id", "DESC")
if count, err := query.SelectAndCount(); err != nil {
return 0, productJobs, err
} else {
for _, productJobModel := range productJobModels {
if productJob, err := transform.TransformToProductJobDomainModelFromPgModels(productJobModel); err != nil {
return 0, productJobs, err
} else {
productJobs = append(productJobs, productJob)
}
}
return int64(count), productJobs, nil
}
}
func NewProductJobRepository(transactionContext *pgTransaction.TransactionContext) (*ProductJobRepository, error) {
if transactionContext == nil {
return nil, fmt.Errorf("transactionContext参数不能为nil")
} else {
return &ProductJobRepository{
transactionContext: transactionContext,
}, nil
}
}
... ...
package repository
import (
"fmt"
"github.com/go-pg/pg/v10"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/domain"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg/models"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg/transform"
"github.com/linmadan/egglib-go/persistent/pg/sqlbuilder"
pgTransaction "github.com/linmadan/egglib-go/transaction/pg"
"github.com/linmadan/egglib-go/utils/snowflake"
)
type ProductPlanRepository struct {
transactionContext *pgTransaction.TransactionContext
}
func (repository *ProductPlanRepository) nextIdentify() (int64, error) {
IdWorker, err := snowflake.NewIdWorker(1)
if err != nil {
return 0, err
}
id, err := IdWorker.NextId()
return id, err
}
func (repository *ProductPlanRepository) Save(productPlan *domain.ProductPlan) (*domain.ProductPlan, error) {
sqlBuildFields := []string{
"product_plan_id",
"company_id",
"org_id",
"batch_number",
"product_date",
"workshop",
"work_on",
"machine",
"plan_product_name",
"plan_devoted",
"plan_status",
"work_station",
"remark",
"created_at",
"updated_at",
"deleted_at",
}
insertFieldsSnippet := sqlbuilder.SqlFieldsSnippet(sqlBuildFields)
insertPlaceHoldersSnippet := sqlbuilder.SqlPlaceHoldersSnippet(sqlBuildFields)
returningFieldsSnippet := sqlbuilder.SqlFieldsSnippet(sqlBuildFields)
updateFields := sqlbuilder.RemoveSqlFields(sqlBuildFields, "productPlan_id")
updateFieldsSnippet := sqlbuilder.SqlUpdateFieldsSnippet(updateFields)
tx := repository.transactionContext.PgTx
if productPlan.Identify() == nil {
productPlanId, err := repository.nextIdentify()
if err != nil {
return productPlan, err
} else {
productPlan.ProductPlanId = int(productPlanId)
}
if _, err := tx.QueryOne(
pg.Scan(
&productPlan.ProductPlanId,
&productPlan.CompanyId,
&productPlan.OrgId,
&productPlan.BatchNumber,
&productPlan.ProductDate,
&productPlan.Workshop,
&productPlan.WorkOn,
&productPlan.Machine,
&productPlan.PlanProductName,
&productPlan.PlanDevoted,
&productPlan.PlanStatus,
&productPlan.WorkStation,
&productPlan.Remark,
&productPlan.CreatedAt,
&productPlan.UpdatedAt,
&productPlan.DeletedAt,
),
fmt.Sprintf("INSERT INTO product_plans (%s) VALUES (%s) RETURNING %s", insertFieldsSnippet, insertPlaceHoldersSnippet, returningFieldsSnippet),
productPlan.ProductPlanId,
productPlan.CompanyId,
productPlan.OrgId,
productPlan.BatchNumber,
productPlan.ProductDate,
productPlan.Workshop,
productPlan.WorkOn,
productPlan.Machine,
productPlan.PlanProductName,
productPlan.PlanDevoted,
productPlan.PlanStatus,
productPlan.WorkStation,
productPlan.Remark,
productPlan.CreatedAt,
productPlan.UpdatedAt,
productPlan.DeletedAt,
); err != nil {
return productPlan, err
}
} else {
if _, err := tx.QueryOne(
pg.Scan(
&productPlan.ProductPlanId,
&productPlan.CompanyId,
&productPlan.OrgId,
&productPlan.BatchNumber,
&productPlan.ProductDate,
&productPlan.Workshop,
&productPlan.WorkOn,
&productPlan.Machine,
&productPlan.PlanProductName,
&productPlan.PlanDevoted,
&productPlan.PlanStatus,
&productPlan.WorkStation,
&productPlan.Remark,
&productPlan.CreatedAt,
&productPlan.UpdatedAt,
&productPlan.DeletedAt,
),
fmt.Sprintf("UPDATE product_plans SET %s WHERE product_plan_id=? RETURNING %s", updateFieldsSnippet, returningFieldsSnippet),
productPlan.ProductPlanId,
productPlan.CompanyId,
productPlan.OrgId,
productPlan.BatchNumber,
productPlan.ProductDate,
productPlan.Workshop,
productPlan.WorkOn,
productPlan.Machine,
productPlan.PlanProductName,
productPlan.PlanDevoted,
productPlan.PlanStatus,
productPlan.WorkStation,
productPlan.Remark,
productPlan.CreatedAt,
productPlan.UpdatedAt,
productPlan.DeletedAt,
productPlan.Identify(),
); err != nil {
return productPlan, err
}
}
return productPlan, nil
}
func (repository *ProductPlanRepository) Remove(productPlan *domain.ProductPlan) (*domain.ProductPlan, error) {
tx := repository.transactionContext.PgTx
productPlanModel := new(models.ProductPlan)
productPlanModel.ProductPlanId = productPlan.Identify().(int)
if _, err := tx.Model(productPlanModel).WherePK().Delete(); err != nil {
return productPlan, err
}
return productPlan, nil
}
func (repository *ProductPlanRepository) FindOne(queryOptions map[string]interface{}) (*domain.ProductPlan, error) {
tx := repository.transactionContext.PgTx
productPlanModel := new(models.ProductPlan)
query := sqlbuilder.BuildQuery(tx.Model(productPlanModel), queryOptions)
query.SetWhereByQueryOption("product_plan.product_plan_id = ?", "productPlanId")
if err := query.First(); err != nil {
if err.Error() == "pg: no rows in result set" {
return nil, fmt.Errorf("没有此资源")
} else {
return nil, err
}
}
if productPlanModel.ProductPlanId == 0 {
return nil, nil
} else {
return transform.TransformToProductPlanDomainModelFromPgModels(productPlanModel)
}
}
func (repository *ProductPlanRepository) Find(queryOptions map[string]interface{}) (int64, []*domain.ProductPlan, error) {
tx := repository.transactionContext.PgTx
var productPlanModels []*models.ProductPlan
productPlans := make([]*domain.ProductPlan, 0)
query := sqlbuilder.BuildQuery(tx.Model(&productPlanModels), queryOptions)
query.SetOffsetAndLimit(20)
query.SetOrderDirect("product_plan_id", "DESC")
if count, err := query.SelectAndCount(); err != nil {
return 0, productPlans, err
} else {
for _, productPlanModel := range productPlanModels {
if productPlan, err := transform.TransformToProductPlanDomainModelFromPgModels(productPlanModel); err != nil {
return 0, productPlans, err
} else {
productPlans = append(productPlans, productPlan)
}
}
return int64(count), productPlans, nil
}
}
func NewProductPlanRepository(transactionContext *pgTransaction.TransactionContext) (*ProductPlanRepository, error) {
if transactionContext == nil {
return nil, fmt.Errorf("transactionContext参数不能为nil")
} else {
return &ProductPlanRepository{
transactionContext: transactionContext,
}, nil
}
}
... ...
package repository
import (
"fmt"
"github.com/go-pg/pg/v10"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/domain"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg/models"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg/transform"
"github.com/linmadan/egglib-go/persistent/pg/sqlbuilder"
pgTransaction "github.com/linmadan/egglib-go/transaction/pg"
"github.com/linmadan/egglib-go/utils/snowflake"
)
type ProductRecordRepository struct {
transactionContext *pgTransaction.TransactionContext
}
func (repository *ProductRecordRepository) nextIdentify() (int64, error) {
IdWorker, err := snowflake.NewIdWorker(1)
if err != nil {
return 0, err
}
id, err := IdWorker.NextId()
return id, err
}
func (repository *ProductRecordRepository) Save(productRecord *domain.ProductRecord) (*domain.ProductRecord, error) {
sqlBuildFields := []string{
"product_record_id",
"company_id",
"org_id",
"product_record_type",
"product_worker",
"work_station",
"created_at",
"updated_at",
"deleted_at",
"product_record_info",
}
insertFieldsSnippet := sqlbuilder.SqlFieldsSnippet(sqlBuildFields)
insertPlaceHoldersSnippet := sqlbuilder.SqlPlaceHoldersSnippet(sqlBuildFields)
returningFieldsSnippet := sqlbuilder.SqlFieldsSnippet(sqlBuildFields)
updateFields := sqlbuilder.RemoveSqlFields(sqlBuildFields, "productRecord_id")
updateFieldsSnippet := sqlbuilder.SqlUpdateFieldsSnippet(updateFields)
tx := repository.transactionContext.PgTx
if productRecord.Identify() == nil {
productRecordId, err := repository.nextIdentify()
if err != nil {
return productRecord, err
} else {
productRecord.ProductRecordId = int(productRecordId)
}
if _, err := tx.QueryOne(
pg.Scan(
&productRecord.ProductRecordId,
&productRecord.CompanyId,
&productRecord.OrgId,
&productRecord.ProductRecordType,
&productRecord.ProductWorker,
&productRecord.WorkStation,
&productRecord.CreatedAt,
&productRecord.UpdatedAt,
&productRecord.DeletedAt,
&productRecord.ProductRecordInfo,
),
fmt.Sprintf("INSERT INTO product_records (%s) VALUES (%s) RETURNING %s", insertFieldsSnippet, insertPlaceHoldersSnippet, returningFieldsSnippet),
productRecord.ProductRecordId,
productRecord.CompanyId,
productRecord.OrgId,
productRecord.ProductRecordType,
productRecord.ProductWorker,
productRecord.WorkStation,
productRecord.CreatedAt,
productRecord.UpdatedAt,
productRecord.DeletedAt,
productRecord.ProductRecordInfo,
); err != nil {
return productRecord, err
}
} else {
if _, err := tx.QueryOne(
pg.Scan(
&productRecord.ProductRecordId,
&productRecord.CompanyId,
&productRecord.OrgId,
&productRecord.ProductRecordType,
&productRecord.ProductWorker,
&productRecord.WorkStation,
&productRecord.CreatedAt,
&productRecord.UpdatedAt,
&productRecord.DeletedAt,
&productRecord.ProductRecordInfo,
),
fmt.Sprintf("UPDATE product_records SET %s WHERE product_record_id=? RETURNING %s", updateFieldsSnippet, returningFieldsSnippet),
productRecord.ProductRecordId,
productRecord.CompanyId,
productRecord.OrgId,
productRecord.ProductRecordType,
productRecord.ProductWorker,
productRecord.WorkStation,
productRecord.CreatedAt,
productRecord.UpdatedAt,
productRecord.DeletedAt,
productRecord.ProductRecordInfo,
productRecord.Identify(),
); err != nil {
return productRecord, err
}
}
return productRecord, nil
}
func (repository *ProductRecordRepository) Remove(productRecord *domain.ProductRecord) (*domain.ProductRecord, error) {
tx := repository.transactionContext.PgTx
productRecordModel := new(models.ProductRecord)
productRecordModel.ProductRecordId = productRecord.Identify().(int)
if _, err := tx.Model(productRecordModel).WherePK().Delete(); err != nil {
return productRecord, err
}
return productRecord, nil
}
func (repository *ProductRecordRepository) FindOne(queryOptions map[string]interface{}) (*domain.ProductRecord, error) {
tx := repository.transactionContext.PgTx
productRecordModel := new(models.ProductRecord)
query := sqlbuilder.BuildQuery(tx.Model(productRecordModel), queryOptions)
query.SetWhereByQueryOption("product_record.product_record_id = ?", "productRecordId")
if err := query.First(); err != nil {
if err.Error() == "pg: no rows in result set" {
return nil, fmt.Errorf("没有此资源")
} else {
return nil, err
}
}
if productRecordModel.ProductRecordId == 0 {
return nil, nil
} else {
return transform.TransformToProductRecordDomainModelFromPgModels(productRecordModel)
}
}
func (repository *ProductRecordRepository) Find(queryOptions map[string]interface{}) (int64, []*domain.ProductRecord, error) {
tx := repository.transactionContext.PgTx
var productRecordModels []*models.ProductRecord
productRecords := make([]*domain.ProductRecord, 0)
query := sqlbuilder.BuildQuery(tx.Model(&productRecordModels), queryOptions)
query.SetOffsetAndLimit(20)
query.SetOrderDirect("product_record_id", "DESC")
if count, err := query.SelectAndCount(); err != nil {
return 0, productRecords, err
} else {
for _, productRecordModel := range productRecordModels {
if productRecord, err := transform.TransformToProductRecordDomainModelFromPgModels(productRecordModel); err != nil {
return 0, productRecords, err
} else {
productRecords = append(productRecords, productRecord)
}
}
return int64(count), productRecords, nil
}
}
func NewProductRecordRepository(transactionContext *pgTransaction.TransactionContext) (*ProductRecordRepository, error) {
if transactionContext == nil {
return nil, fmt.Errorf("transactionContext参数不能为nil")
} else {
return &ProductRecordRepository{
transactionContext: transactionContext,
}, nil
}
}
... ...
package repository
import (
"fmt"
"github.com/go-pg/pg/v10"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/domain"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg/models"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg/transform"
"github.com/linmadan/egglib-go/persistent/pg/sqlbuilder"
pgTransaction "github.com/linmadan/egglib-go/transaction/pg"
"github.com/linmadan/egglib-go/utils/snowflake"
)
type ProductRepository struct {
transactionContext *pgTransaction.TransactionContext
}
func (repository *ProductRepository) nextIdentify() (int64, error) {
IdWorker, err := snowflake.NewIdWorker(1)
if err != nil {
return 0, err
}
id, err := IdWorker.NextId()
return id, err
}
func (repository *ProductRepository) Save(product *domain.Product) (*domain.Product, error) {
sqlBuildFields := []string{
"company_id",
"org_id",
"product_id",
"product_code",
"product_name",
"product_category",
"product_spec",
"created_at",
"updated_at",
"deleted_at",
}
insertFieldsSnippet := sqlbuilder.SqlFieldsSnippet(sqlBuildFields)
insertPlaceHoldersSnippet := sqlbuilder.SqlPlaceHoldersSnippet(sqlBuildFields)
returningFieldsSnippet := sqlbuilder.SqlFieldsSnippet(sqlBuildFields)
updateFields := sqlbuilder.RemoveSqlFields(sqlBuildFields, "product_id")
updateFieldsSnippet := sqlbuilder.SqlUpdateFieldsSnippet(updateFields)
tx := repository.transactionContext.PgTx
if product.Identify() == nil {
productId, err := repository.nextIdentify()
if err != nil {
return product, err
} else {
product.ProductId = int(productId)
}
if _, err := tx.QueryOne(
pg.Scan(
&product.CompanyId,
&product.OrgId,
&product.ProductId,
&product.ProductCode,
&product.ProductName,
&product.ProductCategory,
&product.ProductSpec,
&product.CreatedAt,
&product.UpdatedAt,
&product.DeletedAt,
),
fmt.Sprintf("INSERT INTO products (%s) VALUES (%s) RETURNING %s", insertFieldsSnippet, insertPlaceHoldersSnippet, returningFieldsSnippet),
product.CompanyId,
product.OrgId,
product.ProductId,
product.ProductCode,
product.ProductName,
product.ProductCategory,
product.ProductSpec,
product.CreatedAt,
product.UpdatedAt,
product.DeletedAt,
); err != nil {
return product, err
}
} else {
if _, err := tx.QueryOne(
pg.Scan(
&product.CompanyId,
&product.OrgId,
&product.ProductId,
&product.ProductCode,
&product.ProductName,
&product.ProductCategory,
&product.ProductSpec,
&product.CreatedAt,
&product.UpdatedAt,
&product.DeletedAt,
),
fmt.Sprintf("UPDATE products SET %s WHERE product_id=? RETURNING %s", updateFieldsSnippet, returningFieldsSnippet),
product.CompanyId,
product.OrgId,
product.ProductId,
product.ProductCode,
product.ProductName,
product.ProductCategory,
product.ProductSpec,
product.CreatedAt,
product.UpdatedAt,
product.DeletedAt,
product.Identify(),
); err != nil {
return product, err
}
}
return product, nil
}
func (repository *ProductRepository) Remove(product *domain.Product) (*domain.Product, error) {
tx := repository.transactionContext.PgTx
productModel := new(models.Product)
productModel.ProductId = product.Identify().(int)
if _, err := tx.Model(productModel).WherePK().Delete(); err != nil {
return product, err
}
return product, nil
}
func (repository *ProductRepository) FindOne(queryOptions map[string]interface{}) (*domain.Product, error) {
tx := repository.transactionContext.PgTx
productModel := new(models.Product)
query := sqlbuilder.BuildQuery(tx.Model(productModel), queryOptions)
query.SetWhereByQueryOption("product.product_id = ?", "productId")
if err := query.First(); err != nil {
if err.Error() == "pg: no rows in result set" {
return nil, fmt.Errorf("没有此资源")
} else {
return nil, err
}
}
if productModel.ProductId == 0 {
return nil, nil
} else {
return transform.TransformToProductDomainModelFromPgModels(productModel)
}
}
func (repository *ProductRepository) Find(queryOptions map[string]interface{}) (int64, []*domain.Product, error) {
tx := repository.transactionContext.PgTx
var productModels []*models.Product
products := make([]*domain.Product, 0)
query := sqlbuilder.BuildQuery(tx.Model(&productModels), queryOptions)
query.SetOffsetAndLimit(20)
query.SetOrderDirect("product_id", "DESC")
if count, err := query.SelectAndCount(); err != nil {
return 0, products, err
} else {
for _, productModel := range productModels {
if product, err := transform.TransformToProductDomainModelFromPgModels(productModel); err != nil {
return 0, products, err
} else {
products = append(products, product)
}
}
return int64(count), products, nil
}
}
func NewProductRepository(transactionContext *pgTransaction.TransactionContext) (*ProductRepository, error) {
if transactionContext == nil {
return nil, fmt.Errorf("transactionContext参数不能为nil")
} else {
return &ProductRepository{
transactionContext: transactionContext,
}, nil
}
}
... ...
package repository
import (
"fmt"
"github.com/go-pg/pg/v10"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/domain"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg/models"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg/transform"
"github.com/linmadan/egglib-go/persistent/pg/sqlbuilder"
pgTransaction "github.com/linmadan/egglib-go/transaction/pg"
"github.com/linmadan/egglib-go/utils/snowflake"
)
type UnitConversionRepository struct {
transactionContext *pgTransaction.TransactionContext
}
func (repository *UnitConversionRepository) nextIdentify() (int64, error) {
IdWorker, err := snowflake.NewIdWorker(1)
if err != nil {
return 0, err
}
id, err := IdWorker.NextId()
return id, err
}
func (repository *UnitConversionRepository) Save(unitConversion *domain.UnitConversion) (*domain.UnitConversion, error) {
sqlBuildFields := []string{
"unit_conversion_id",
"company_id",
"org_id",
"work_station",
"material",
"from_unit_quantity",
"to_unit_quantity",
"intelligent_weighing_flag",
"created_at",
"updated_at",
"deleted_at",
}
insertFieldsSnippet := sqlbuilder.SqlFieldsSnippet(sqlBuildFields)
insertPlaceHoldersSnippet := sqlbuilder.SqlPlaceHoldersSnippet(sqlBuildFields)
returningFieldsSnippet := sqlbuilder.SqlFieldsSnippet(sqlBuildFields)
updateFields := sqlbuilder.RemoveSqlFields(sqlBuildFields, "unitConversion_id")
updateFieldsSnippet := sqlbuilder.SqlUpdateFieldsSnippet(updateFields)
tx := repository.transactionContext.PgTx
if unitConversion.Identify() == nil {
unitConversionId, err := repository.nextIdentify()
if err != nil {
return unitConversion, err
} else {
unitConversion.UnitConversionId = int(unitConversionId)
}
if _, err := tx.QueryOne(
pg.Scan(
&unitConversion.UnitConversionId,
&unitConversion.CompanyId,
&unitConversion.OrgId,
&unitConversion.WorkStation,
&unitConversion.Material,
&unitConversion.FromUnitQuantity,
&unitConversion.ToUnitQuantity,
&unitConversion.IntelligentWeighingFlag,
&unitConversion.CreatedAt,
&unitConversion.UpdatedAt,
&unitConversion.DeletedAt,
),
fmt.Sprintf("INSERT INTO unit_conversions (%s) VALUES (%s) RETURNING %s", insertFieldsSnippet, insertPlaceHoldersSnippet, returningFieldsSnippet),
unitConversion.UnitConversionId,
unitConversion.CompanyId,
unitConversion.OrgId,
unitConversion.WorkStation,
unitConversion.Material,
unitConversion.FromUnitQuantity,
unitConversion.ToUnitQuantity,
unitConversion.IntelligentWeighingFlag,
unitConversion.CreatedAt,
unitConversion.UpdatedAt,
unitConversion.DeletedAt,
); err != nil {
return unitConversion, err
}
} else {
if _, err := tx.QueryOne(
pg.Scan(
&unitConversion.UnitConversionId,
&unitConversion.CompanyId,
&unitConversion.OrgId,
&unitConversion.WorkStation,
&unitConversion.Material,
&unitConversion.FromUnitQuantity,
&unitConversion.ToUnitQuantity,
&unitConversion.IntelligentWeighingFlag,
&unitConversion.CreatedAt,
&unitConversion.UpdatedAt,
&unitConversion.DeletedAt,
),
fmt.Sprintf("UPDATE unit_conversions SET %s WHERE unit_conversion_id=? RETURNING %s", updateFieldsSnippet, returningFieldsSnippet),
unitConversion.UnitConversionId,
unitConversion.CompanyId,
unitConversion.OrgId,
unitConversion.WorkStation,
unitConversion.Material,
unitConversion.FromUnitQuantity,
unitConversion.ToUnitQuantity,
unitConversion.IntelligentWeighingFlag,
unitConversion.CreatedAt,
unitConversion.UpdatedAt,
unitConversion.DeletedAt,
unitConversion.Identify(),
); err != nil {
return unitConversion, err
}
}
return unitConversion, nil
}
func (repository *UnitConversionRepository) Remove(unitConversion *domain.UnitConversion) (*domain.UnitConversion, error) {
tx := repository.transactionContext.PgTx
unitConversionModel := new(models.UnitConversion)
unitConversionModel.UnitConversionId = unitConversion.Identify().(int)
if _, err := tx.Model(unitConversionModel).WherePK().Delete(); err != nil {
return unitConversion, err
}
return unitConversion, nil
}
func (repository *UnitConversionRepository) FindOne(queryOptions map[string]interface{}) (*domain.UnitConversion, error) {
tx := repository.transactionContext.PgTx
unitConversionModel := new(models.UnitConversion)
query := sqlbuilder.BuildQuery(tx.Model(unitConversionModel), queryOptions)
query.SetWhereByQueryOption("unit_conversion.unit_conversion_id = ?", "unitConversionId")
if err := query.First(); err != nil {
if err.Error() == "pg: no rows in result set" {
return nil, fmt.Errorf("没有此资源")
} else {
return nil, err
}
}
if unitConversionModel.UnitConversionId == 0 {
return nil, nil
} else {
return transform.TransformToUnitConversionDomainModelFromPgModels(unitConversionModel)
}
}
func (repository *UnitConversionRepository) Find(queryOptions map[string]interface{}) (int64, []*domain.UnitConversion, error) {
tx := repository.transactionContext.PgTx
var unitConversionModels []*models.UnitConversion
unitConversions := make([]*domain.UnitConversion, 0)
query := sqlbuilder.BuildQuery(tx.Model(&unitConversionModels), queryOptions)
query.SetOffsetAndLimit(20)
query.SetOrderDirect("unit_conversion_id", "DESC")
if count, err := query.SelectAndCount(); err != nil {
return 0, unitConversions, err
} else {
for _, unitConversionModel := range unitConversionModels {
if unitConversion, err := transform.TransformToUnitConversionDomainModelFromPgModels(unitConversionModel); err != nil {
return 0, unitConversions, err
} else {
unitConversions = append(unitConversions, unitConversion)
}
}
return int64(count), unitConversions, nil
}
}
func NewUnitConversionRepository(transactionContext *pgTransaction.TransactionContext) (*UnitConversionRepository, error) {
if transactionContext == nil {
return nil, fmt.Errorf("transactionContext参数不能为nil")
} else {
return &UnitConversionRepository{
transactionContext: transactionContext,
}, nil
}
}
... ...
package repository
import (
"fmt"
"github.com/go-pg/pg/v10"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/domain"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg/models"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg/transform"
"github.com/linmadan/egglib-go/persistent/pg/sqlbuilder"
pgTransaction "github.com/linmadan/egglib-go/transaction/pg"
"github.com/linmadan/egglib-go/utils/snowflake"
)
type WorkshopRepository struct {
transactionContext *pgTransaction.TransactionContext
}
func (repository *WorkshopRepository) nextIdentify() (int64, error) {
IdWorker, err := snowflake.NewIdWorker(1)
if err != nil {
return 0, err
}
id, err := IdWorker.NextId()
return id, err
}
func (repository *WorkshopRepository) Save(workshop *domain.Workshop) (*domain.Workshop, error) {
sqlBuildFields := []string{
"company_id",
"org_id",
"workshop_id",
"workshop_name",
"principal",
"product_lines",
"created_at",
"updated_at",
"deleted_at",
}
insertFieldsSnippet := sqlbuilder.SqlFieldsSnippet(sqlBuildFields)
insertPlaceHoldersSnippet := sqlbuilder.SqlPlaceHoldersSnippet(sqlBuildFields)
returningFieldsSnippet := sqlbuilder.SqlFieldsSnippet(sqlBuildFields)
updateFields := sqlbuilder.RemoveSqlFields(sqlBuildFields, "workshop_id")
updateFieldsSnippet := sqlbuilder.SqlUpdateFieldsSnippet(updateFields)
tx := repository.transactionContext.PgTx
if workshop.Identify() == nil {
workshopId, err := repository.nextIdentify()
if err != nil {
return workshop, err
} else {
workshop.WorkshopId = int(workshopId)
}
if _, err := tx.QueryOne(
pg.Scan(
&workshop.CompanyId,
&workshop.OrgId,
&workshop.WorkshopId,
&workshop.WorkshopName,
&workshop.Principal,
pg.Array(&workshop.ProductLines),
&workshop.CreatedAt,
&workshop.UpdatedAt,
&workshop.DeletedAt,
),
fmt.Sprintf("INSERT INTO workshops (%s) VALUES (%s) RETURNING %s", insertFieldsSnippet, insertPlaceHoldersSnippet, returningFieldsSnippet),
workshop.CompanyId,
workshop.OrgId,
workshop.WorkshopId,
workshop.WorkshopName,
workshop.Principal,
pg.Array(workshop.ProductLines),
workshop.CreatedAt,
workshop.UpdatedAt,
workshop.DeletedAt,
); err != nil {
return workshop, err
}
} else {
if _, err := tx.QueryOne(
pg.Scan(
&workshop.CompanyId,
&workshop.OrgId,
&workshop.WorkshopId,
&workshop.WorkshopName,
&workshop.Principal,
pg.Array(&workshop.ProductLines),
&workshop.CreatedAt,
&workshop.UpdatedAt,
&workshop.DeletedAt,
),
fmt.Sprintf("UPDATE workshops SET %s WHERE workshop_id=? RETURNING %s", updateFieldsSnippet, returningFieldsSnippet),
workshop.CompanyId,
workshop.OrgId,
workshop.WorkshopId,
workshop.WorkshopName,
workshop.Principal,
pg.Array(workshop.ProductLines),
workshop.CreatedAt,
workshop.UpdatedAt,
workshop.DeletedAt,
workshop.Identify(),
); err != nil {
return workshop, err
}
}
return workshop, nil
}
func (repository *WorkshopRepository) Remove(workshop *domain.Workshop) (*domain.Workshop, error) {
tx := repository.transactionContext.PgTx
workshopModel := new(models.Workshop)
workshopModel.WorkshopId = workshop.Identify().(int)
if _, err := tx.Model(workshopModel).WherePK().Delete(); err != nil {
return workshop, err
}
return workshop, nil
}
func (repository *WorkshopRepository) FindOne(queryOptions map[string]interface{}) (*domain.Workshop, error) {
tx := repository.transactionContext.PgTx
workshopModel := new(models.Workshop)
query := sqlbuilder.BuildQuery(tx.Model(workshopModel), queryOptions)
query.SetWhereByQueryOption("workshop.workshop_id = ?", "workshopId")
if err := query.First(); err != nil {
if err.Error() == "pg: no rows in result set" {
return nil, fmt.Errorf("没有此资源")
} else {
return nil, err
}
}
if workshopModel.WorkshopId == 0 {
return nil, nil
} else {
return transform.TransformToWorkshopDomainModelFromPgModels(workshopModel)
}
}
func (repository *WorkshopRepository) Find(queryOptions map[string]interface{}) (int64, []*domain.Workshop, error) {
tx := repository.transactionContext.PgTx
var workshopModels []*models.Workshop
workshops := make([]*domain.Workshop, 0)
query := sqlbuilder.BuildQuery(tx.Model(&workshopModels), queryOptions)
query.SetOffsetAndLimit(20)
query.SetOrderDirect("workshop_id", "DESC")
if count, err := query.SelectAndCount(); err != nil {
return 0, workshops, err
} else {
for _, workshopModel := range workshopModels {
if workshop, err := transform.TransformToWorkshopDomainModelFromPgModels(workshopModel); err != nil {
return 0, workshops, err
} else {
workshops = append(workshops, workshop)
}
}
return int64(count), workshops, nil
}
}
func NewWorkshopRepository(transactionContext *pgTransaction.TransactionContext) (*WorkshopRepository, error) {
if transactionContext == nil {
return nil, fmt.Errorf("transactionContext参数不能为nil")
} else {
return &WorkshopRepository{
transactionContext: transactionContext,
}, nil
}
}
... ...
package log
import (
"github.com/linmadan/egglib-go/log"
"github.com/linmadan/egglib-go/log/logrus"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/constant"
)
var Logger log.Logger
func init() {
Logger = logrus.NewLogrusLogger()
Logger.SetServiceName(constant.SERVICE_NAME)
Logger.SetLevel(constant.LOG_LEVEL)
}
... ...
package log
import (
"encoding/json"
"errors"
"fmt"
"github.com/beego/beego/v2/core/logs"
"io"
"sync/atomic"
)
var errOutOfMaxSize = errors.New("msg size is out of limit ")
type BaseHook struct {
syncWrite bool
msgChan chan []byte
maxSize int32
currentSize int32
closeChan chan struct{}
w io.Writer
}
func (b *BaseHook) Write(p []byte) (n int, err error) {
if b.syncWrite {
return b.w.Write(p)
}
if b.currentSize >= b.maxSize {
fmt.Println(errOutOfMaxSize.Error(), b.currentSize)
return 0, errOutOfMaxSize
}
b.msgChan <- p
atomic.AddInt32(&b.currentSize, 1)
return len(p), nil
}
// NewBaseHook
// syncWriteFlag 同步写标识 true:同步写 false:异步写
func NewBaseHook(syncWriteFlag bool, internalIo io.WriteCloser) (*BaseHook, error) {
writer := &BaseHook{
syncWrite: syncWriteFlag,
maxSize: 10000,
msgChan: make(chan []byte, 10000),
closeChan: make(chan struct{}),
w: internalIo,
}
go writer.ConsumeMsg()
return writer, nil
}
func (b *BaseHook) ConsumeMsg() {
for {
select {
case <-b.closeChan:
return
case m, ok := <-b.msgChan:
if ok {
atomic.AddInt32(&b.currentSize, -1)
if _, err := b.w.Write(m); err != nil {
fmt.Println(err)
}
}
}
}
}
func (b *BaseHook) Close() {
close(b.msgChan)
b.closeChan <- struct{}{}
//b.wc.Close()
}
type LoggerConfig struct {
Level int `json:"level,omitempty"`
Filename string `json:"filename,omitempty"`
MaxSize int `json:"maxsize,omitempty"`
//MaxBackups int `json:"max_backups,omitempty"`
//MaxAge int `json:"max_age,omitempty"`
//Compress bool `json:"compress,omitempty"`
}
type internalLog struct {
*logs.BeeLogger
}
func NewBeegoLogWriter(conf LoggerConfig) io.Writer {
logger := logs.GetBeeLogger()
logger.SetLevel(conf.Level)
logger.EnableFuncCallDepth(true)
logger.SetLogFuncCallDepth(2)
confByte, _ := json.Marshal(conf)
err := logger.SetLogger(logs.AdapterFile, string(confByte))
if err != nil {
fmt.Println(err.Error())
}
return &internalLog{logger}
}
func (l *internalLog) Write(p []byte) (n int, err error) {
l.Debug(string(p))
return len(p), nil
}
... ...