作者 yangfu

接口服务初始化

正在显示 100 个修改的文件 包含 3665 行增加42 行删除

要显示太多修改。

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

@@ -27,4 +27,5 @@ _testmain.go @@ -27,4 +27,5 @@ _testmain.go
27 27
28 swagger.json 28 swagger.json
29 swagger.yaml 29 swagger.yaml
30 -*.log  
  30 +*.log
  31 +lastupdate.tmp
@@ -3,13 +3,26 @@ module gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture @@ -3,13 +3,26 @@ module gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture
3 go 1.16 3 go 1.16
4 4
5 require ( 5 require (
  6 + github.com/ajg/form v1.5.1 // indirect
6 github.com/beego/beego/v2 v2.0.1 7 github.com/beego/beego/v2 v2.0.1
  8 + github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072 // indirect
  9 + github.com/fatih/structs v1.1.0 // indirect
  10 + github.com/gavv/httpexpect v2.0.0+incompatible
7 github.com/go-pg/pg/v10 v10.9.0 11 github.com/go-pg/pg/v10 v10.9.0
8 - github.com/klauspost/compress v1.11.8 // indirect 12 + github.com/google/go-querystring v1.1.0 // indirect
  13 + github.com/imkira/go-interpol v1.1.0 // indirect
9 github.com/linmadan/egglib-go v0.0.0-20210313060205-8b5e456b11f7 14 github.com/linmadan/egglib-go v0.0.0-20210313060205-8b5e456b11f7
10 - github.com/onsi/ginkgo v1.15.2 // indirect  
11 - github.com/onsi/gomega v1.11.0 // indirect  
12 - golang.org/x/text v0.3.5 // indirect 15 + github.com/moul/http2curl v1.0.0 // indirect
  16 + github.com/onsi/ginkgo v1.15.2
  17 + github.com/onsi/gomega v1.11.0
  18 + github.com/sergi/go-diff v1.2.0 // indirect
  19 + github.com/smartystreets/goconvey v1.7.2 // indirect
  20 + github.com/valyala/fasthttp v1.32.0 // indirect
  21 + github.com/xeipuuv/gojsonschema v1.2.0 // indirect
  22 + github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0 // indirect
  23 + github.com/yudai/gojsondiff v1.0.0 // indirect
  24 + github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82 // indirect
  25 + github.com/yudai/pp v2.0.1+incompatible // indirect
13 ) 26 )
14 27
15 replace github.com/linmadan/egglib-go v0.0.0-20210313060205-8b5e456b11f7 => github.com/tiptok/egglib-go v0.0.0-20210608073225-c852ce95ae34 28 replace github.com/linmadan/egglib-go v0.0.0-20210313060205-8b5e456b11f7 => github.com/tiptok/egglib-go v0.0.0-20210608073225-c852ce95ae34
@@ -8,12 +8,18 @@ github.com/Shopify/sarama v1.25.0/go.mod h1:y/CFFTO9eaMTNriwu/Q+W4eioLqiDMGkA1W+ @@ -8,12 +8,18 @@ github.com/Shopify/sarama v1.25.0/go.mod h1:y/CFFTO9eaMTNriwu/Q+W4eioLqiDMGkA1W+
8 github.com/Shopify/toxiproxy v2.1.4+incompatible h1:TKdv8HiTLgE5wdJuEML90aBgNWsokNbMijUGhmcoBJc= 8 github.com/Shopify/toxiproxy v2.1.4+incompatible h1:TKdv8HiTLgE5wdJuEML90aBgNWsokNbMijUGhmcoBJc=
9 github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= 9 github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI=
10 github.com/StackExchange/wmi v0.0.0-20170410192909-ea383cf3ba6e/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= 10 github.com/StackExchange/wmi v0.0.0-20170410192909-ea383cf3ba6e/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg=
  11 +github.com/ajg/form v1.5.1 h1:t9c7v8JUKu/XxOGBU0yjNpaMloxGEJhUkqFRq0ibGeU=
  12 +github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY=
11 github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= 13 github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
12 github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= 14 github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
13 github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= 15 github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
14 github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= 16 github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
  17 +github.com/alicebob/gopher-json v0.0.0-20180125190556-5a6b3ba71ee6 h1:45bxf7AZMwWcqkLzDAQugVEwedisr5nRJ1r+7LYnv0U=
15 github.com/alicebob/gopher-json v0.0.0-20180125190556-5a6b3ba71ee6/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= 18 github.com/alicebob/gopher-json v0.0.0-20180125190556-5a6b3ba71ee6/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc=
  19 +github.com/alicebob/miniredis v2.5.0+incompatible h1:yBHoLpsyjupjz3NL3MhKMVkR41j82Yjf3KFv7ApYzUI=
16 github.com/alicebob/miniredis v2.5.0+incompatible/go.mod h1:8HZjEj4yU0dwhYHky+DxYx+6BMjkBbe5ONFIF1MXffk= 20 github.com/alicebob/miniredis v2.5.0+incompatible/go.mod h1:8HZjEj4yU0dwhYHky+DxYx+6BMjkBbe5ONFIF1MXffk=
  21 +github.com/andybalholm/brotli v1.0.2 h1:JKnhI/XQ75uFBTiuzXpzFrUriDPiZjlOSzh6wXogP0E=
  22 +github.com/andybalholm/brotli v1.0.2/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y=
17 github.com/antihax/optional v0.0.0-20180407024304-ca021399b1a6/go.mod h1:V8iCPQYkqmusNa815XgQio277wI47sdRh1dUOLdyC6Q= 23 github.com/antihax/optional v0.0.0-20180407024304-ca021399b1a6/go.mod h1:V8iCPQYkqmusNa815XgQio277wI47sdRh1dUOLdyC6Q=
18 github.com/beego/beego/v2 v2.0.1 h1:07a7Z0Ok5vbqyqh+q53sDPl9LdhKh0ZDy3gbyGrhFnE= 24 github.com/beego/beego/v2 v2.0.1 h1:07a7Z0Ok5vbqyqh+q53sDPl9LdhKh0ZDy3gbyGrhFnE=
19 github.com/beego/beego/v2 v2.0.1/go.mod h1:8zyHi1FnWO1mZLwTn62aKRIZF/aIKvkCBB2JYs+eqQI= 25 github.com/beego/beego/v2 v2.0.1/go.mod h1:8zyHi1FnWO1mZLwTn62aKRIZF/aIKvkCBB2JYs+eqQI=
@@ -71,8 +77,12 @@ github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymF @@ -71,8 +77,12 @@ github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymF
71 github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= 77 github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
72 github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= 78 github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
73 github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= 79 github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
  80 +github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072 h1:DddqAaWDpywytcG8w/qoQ5sAN8X12d3Z3koB0C3Rxsc=
  81 +github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8=
74 github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= 82 github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
75 github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= 83 github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU=
  84 +github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo=
  85 +github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M=
76 github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= 86 github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw=
77 github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= 87 github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g=
78 github.com/frankban/quicktest v1.4.1/go.mod h1:36zfPVQyHxymz4cH7wlDmVwDrJuljRB60qkgn7rorfQ= 88 github.com/frankban/quicktest v1.4.1/go.mod h1:36zfPVQyHxymz4cH7wlDmVwDrJuljRB60qkgn7rorfQ=
@@ -81,6 +91,8 @@ github.com/frankban/quicktest v1.7.2/go.mod h1:jaStnuzAqU1AJdCO0l53JDCJrVDKcS03D @@ -81,6 +91,8 @@ github.com/frankban/quicktest v1.7.2/go.mod h1:jaStnuzAqU1AJdCO0l53JDCJrVDKcS03D
81 github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= 91 github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
82 github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= 92 github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4=
83 github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= 93 github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
  94 +github.com/gavv/httpexpect v2.0.0+incompatible h1:1X9kcRshkSKEjNJJxX9Y9mQ5BRfbxU5kORdjhlA1yX8=
  95 +github.com/gavv/httpexpect v2.0.0+incompatible/go.mod h1:x+9tiU1YnrOvnB725RkpoLv1M62hOWzwo5OXotisrKc=
84 github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= 96 github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
85 github.com/glendc/gopher-json v0.0.0-20170414221815-dc4743023d0c/go.mod h1:Gja1A+xZ9BoviGJNA2E9vFkPjjsl+CoJxSXiQM1UXtw= 97 github.com/glendc/gopher-json v0.0.0-20170414221815-dc4743023d0c/go.mod h1:Gja1A+xZ9BoviGJNA2E9vFkPjjsl+CoJxSXiQM1UXtw=
86 github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= 98 github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q=
@@ -95,6 +107,7 @@ github.com/go-pg/pg/v10 v10.9.0/go.mod h1:rgmTPgHgl5EN2CNKKoMwC7QT62t8BqsdpEkUQu @@ -95,6 +107,7 @@ github.com/go-pg/pg/v10 v10.9.0/go.mod h1:rgmTPgHgl5EN2CNKKoMwC7QT62t8BqsdpEkUQu
95 github.com/go-pg/zerochecker v0.2.0 h1:pp7f72c3DobMWOb2ErtZsnrPaSvHd2W4o9//8HtF4mU= 107 github.com/go-pg/zerochecker v0.2.0 h1:pp7f72c3DobMWOb2ErtZsnrPaSvHd2W4o9//8HtF4mU=
96 github.com/go-pg/zerochecker v0.2.0/go.mod h1:NJZ4wKL0NmTtz0GKCoJ8kym6Xn/EQzXRl2OnAe7MmDo= 108 github.com/go-pg/zerochecker v0.2.0/go.mod h1:NJZ4wKL0NmTtz0GKCoJ8kym6Xn/EQzXRl2OnAe7MmDo=
97 github.com/go-redis/redis v6.14.2+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= 109 github.com/go-redis/redis v6.14.2+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA=
  110 +github.com/go-redis/redis v6.15.7+incompatible h1:3skhDh95XQMpnqeqNftPkQD9jL9e5e36z/1SUm6dy1U=
98 github.com/go-redis/redis v6.15.7+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= 111 github.com/go-redis/redis v6.15.7+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA=
99 github.com/go-redis/redis/v7 v7.4.0/go.mod h1:JDNMw23GTyLNC4GZu9njt15ctBQVn7xjRfnwdHj/Dcg= 112 github.com/go-redis/redis/v7 v7.4.0/go.mod h1:JDNMw23GTyLNC4GZu9njt15ctBQVn7xjRfnwdHj/Dcg=
100 github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= 113 github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
@@ -126,8 +139,10 @@ github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM @@ -126,8 +139,10 @@ github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM
126 github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= 139 github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
127 github.com/golang/snappy v0.0.0-20170215233205-553a64147049/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= 140 github.com/golang/snappy v0.0.0-20170215233205-553a64147049/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
128 github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= 141 github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
129 -github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4=  
130 github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= 142 github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
  143 +github.com/golang/snappy v0.0.3 h1:fHPg5GQYlCeLIPB9BZqMVR5nR9A+IM5zcgeTdjMYmLA=
  144 +github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
  145 +github.com/gomodule/redigo v2.0.0+incompatible h1:K/R+8tc58AaqLkqG2Ol3Qk+DR/TlNuhuh457pBFPtt0=
131 github.com/gomodule/redigo v2.0.0+incompatible/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= 146 github.com/gomodule/redigo v2.0.0+incompatible/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4=
132 github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= 147 github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
133 github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= 148 github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
@@ -135,21 +150,28 @@ github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw @@ -135,21 +150,28 @@ github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw
135 github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= 150 github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
136 github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 151 github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
137 github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 152 github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
  153 +github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
138 github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 154 github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
139 github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= 155 github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=
140 github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 156 github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
  157 +github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8=
  158 +github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU=
141 github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= 159 github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
142 github.com/google/gops v0.3.7/go.mod h1:bj0cwMmX1X4XIJFTjR99R5sCxNssNJ8HebFNvoQlmgY= 160 github.com/google/gops v0.3.7/go.mod h1:bj0cwMmX1X4XIJFTjR99R5sCxNssNJ8HebFNvoQlmgY=
143 github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= 161 github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
144 github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= 162 github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
145 github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= 163 github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY=
146 github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= 164 github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
  165 +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8=
  166 +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
147 github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= 167 github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
  168 +github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc=
148 github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= 169 github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
149 github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= 170 github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
150 github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= 171 github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
151 github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= 172 github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
152 github.com/grpc-ecosystem/grpc-gateway v1.14.3/go.mod h1:6CwZWGDSPRJidgKAtJVvND6soZe6fT7iteq8wDPdhb0= 173 github.com/grpc-ecosystem/grpc-gateway v1.14.3/go.mod h1:6CwZWGDSPRJidgKAtJVvND6soZe6fT7iteq8wDPdhb0=
  174 +github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542 h1:2VTzZjLZBgl62/EtslCrtky5vbi9dd7HrQPQIx6wqiw=
153 github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542/go.mod h1:Ow0tF8D4Kplbc8s8sSb3V2oUCygFHVp8gC3Dn6U4MNI= 175 github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542/go.mod h1:Ow0tF8D4Kplbc8s8sSb3V2oUCygFHVp8gC3Dn6U4MNI=
154 github.com/hashicorp/go-uuid v1.0.1 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE= 176 github.com/hashicorp/go-uuid v1.0.1 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE=
155 github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= 177 github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
@@ -157,6 +179,8 @@ github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+l @@ -157,6 +179,8 @@ github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+l
157 github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= 179 github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
158 github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= 180 github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
159 github.com/iancoleman/strcase v0.1.2/go.mod h1:SK73tn/9oHe+/Y0h39VT4UCxmurVJkR5NA7kMEAOgSE= 181 github.com/iancoleman/strcase v0.1.2/go.mod h1:SK73tn/9oHe+/Y0h39VT4UCxmurVJkR5NA7kMEAOgSE=
  182 +github.com/imkira/go-interpol v1.1.0 h1:KIiKr0VSG2CUW1hl1jpiyuzuJeKUUpC8iM1AIE7N1Vk=
  183 +github.com/imkira/go-interpol v1.1.0/go.mod h1:z0h2/2T3XF8kyEPpRgJ3kmNv+C43p+I/CoI+jC3w2iA=
160 github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= 184 github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
161 github.com/jcmturner/gofork v0.0.0-20190328161633-dc7c13fece03 h1:FUwcHNlEqkqLjLBdCp5PRlCFijNjvcYANOZXzCfXwCM= 185 github.com/jcmturner/gofork v0.0.0-20190328161633-dc7c13fece03 h1:FUwcHNlEqkqLjLBdCp5PRlCFijNjvcYANOZXzCfXwCM=
162 github.com/jcmturner/gofork v0.0.0-20190328161633-dc7c13fece03/go.mod h1:MK8+TM0La+2rjBD4jE12Kj1pCCxK7d2LK/UM3ncEo0o= 186 github.com/jcmturner/gofork v0.0.0-20190328161633-dc7c13fece03/go.mod h1:MK8+TM0La+2rjBD4jE12Kj1pCCxK7d2LK/UM3ncEo0o=
@@ -168,6 +192,8 @@ github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCV @@ -168,6 +192,8 @@ github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCV
168 github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= 192 github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
169 github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= 193 github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
170 github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= 194 github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
  195 +github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo=
  196 +github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
171 github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= 197 github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
172 github.com/justinas/alice v1.2.0/go.mod h1:fN5HRH/reO/zrUflLfTN43t3vXvKzvZIENsNEe7i7qA= 198 github.com/justinas/alice v1.2.0/go.mod h1:fN5HRH/reO/zrUflLfTN43t3vXvKzvZIENsNEe7i7qA=
173 github.com/kardianos/osext v0.0.0-20170510131534-ae77be60afb1/go.mod h1:1NbS8ALrpOvjt0rHPNLyCIeMtbizbir8U//inJ+zuB8= 199 github.com/kardianos/osext v0.0.0-20170510131534-ae77be60afb1/go.mod h1:1NbS8ALrpOvjt0rHPNLyCIeMtbizbir8U//inJ+zuB8=
@@ -177,8 +203,8 @@ github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvW @@ -177,8 +203,8 @@ github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvW
177 github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= 203 github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=
178 github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= 204 github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
179 github.com/klauspost/compress v1.9.7/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= 205 github.com/klauspost/compress v1.9.7/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A=
180 -github.com/klauspost/compress v1.11.8 h1:difgzQsp5mdAz9v8lm3P/I+EpDKMU/6uTMw1y1FObuo=  
181 -github.com/klauspost/compress v1.11.8/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= 206 +github.com/klauspost/compress v1.13.4 h1:0zhec2I8zGnjWcKyLl6i3gPqKANCCn5e9xmviEEeX6s=
  207 +github.com/klauspost/compress v1.13.4/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg=
182 github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= 208 github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
183 github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= 209 github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
184 github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= 210 github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
@@ -196,10 +222,12 @@ github.com/magefile/mage v1.10.0 h1:3HiXzCUY12kh9bIuyXShaVe529fJfyqoVM42o/uom2g= @@ -196,10 +222,12 @@ github.com/magefile/mage v1.10.0 h1:3HiXzCUY12kh9bIuyXShaVe529fJfyqoVM42o/uom2g=
196 github.com/magefile/mage v1.10.0/go.mod h1:z5UZb/iS3GoOSn0JgWuiw7dxlurVYTu+/jHXqQg881A= 222 github.com/magefile/mage v1.10.0/go.mod h1:z5UZb/iS3GoOSn0JgWuiw7dxlurVYTu+/jHXqQg881A=
197 github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= 223 github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
198 github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= 224 github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
  225 +github.com/mattn/go-colorable v0.1.6 h1:6Su7aK7lXmJ/U79bYtBjLNaha4Fs1Rg9plHpcH+vvnE=
199 github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= 226 github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
200 github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= 227 github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
201 github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= 228 github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
202 github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= 229 github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE=
  230 +github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY=
203 github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= 231 github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
204 github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= 232 github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
205 github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= 233 github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
@@ -214,7 +242,10 @@ github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJ @@ -214,7 +242,10 @@ github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJ
214 github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= 242 github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
215 github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= 243 github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
216 github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= 244 github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
  245 +github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw=
217 github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= 246 github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8=
  247 +github.com/moul/http2curl v1.0.0 h1:dRMWoAtb+ePxMlLkrCbAqh4TlPHXvoGUSQ323/9Zahs=
  248 +github.com/moul/http2curl v1.0.0/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOAZ3H0fQ=
218 github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= 249 github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
219 github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32/go.mod h1:9wM+0iRr9ahx58uYLpLIr5fm8diHn0JbqRycJi6w0Ms= 250 github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32/go.mod h1:9wM+0iRr9ahx58uYLpLIr5fm8diHn0JbqRycJi6w0Ms=
220 github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= 251 github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
@@ -279,6 +310,8 @@ github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6L @@ -279,6 +310,8 @@ github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6L
279 github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= 310 github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
280 github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= 311 github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
281 github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= 312 github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
  313 +github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ=
  314 +github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
282 github.com/shiena/ansicolor v0.0.0-20151119151921-a422bbe96644 h1:X+yvsM2yrEktyI+b2qND5gpH8YhURn0k8OCaeRnkINo= 315 github.com/shiena/ansicolor v0.0.0-20151119151921-a422bbe96644 h1:X+yvsM2yrEktyI+b2qND5gpH8YhURn0k8OCaeRnkINo=
283 github.com/shiena/ansicolor v0.0.0-20151119151921-a422bbe96644/go.mod h1:nkxAfR/5quYxwPZhyDxgasBMnRtBZd0FCEpawpjMUFg= 316 github.com/shiena/ansicolor v0.0.0-20151119151921-a422bbe96644/go.mod h1:nkxAfR/5quYxwPZhyDxgasBMnRtBZd0FCEpawpjMUFg=
284 github.com/shirou/gopsutil v0.0.0-20180427012116-c95755e4bcd7/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= 317 github.com/shirou/gopsutil v0.0.0-20180427012116-c95755e4bcd7/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=
@@ -291,7 +324,12 @@ github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPx @@ -291,7 +324,12 @@ github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPx
291 github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= 324 github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
292 github.com/sirupsen/logrus v1.8.0 h1:nfhvjKcUMhBMVqbKHJlk5RPrrfYr/NMo3692g0dwfWU= 325 github.com/sirupsen/logrus v1.8.0 h1:nfhvjKcUMhBMVqbKHJlk5RPrrfYr/NMo3692g0dwfWU=
293 github.com/sirupsen/logrus v1.8.0/go.mod h1:4GuYW9TZmE769R5STWrRakJc4UqQ3+QQ95fyz7ENv1A= 326 github.com/sirupsen/logrus v1.8.0/go.mod h1:4GuYW9TZmE769R5STWrRakJc4UqQ3+QQ95fyz7ENv1A=
  327 +github.com/smartystreets/assertions v1.2.0 h1:42S6lae5dvLc7BrLu/0ugRtcFVjoJNMC/N3yZFZkDFs=
  328 +github.com/smartystreets/assertions v1.2.0/go.mod h1:tcbTF8ujkAEcZ8TElKY+i30BzYlVhC/LOxJk7iOWnoo=
  329 +github.com/smartystreets/goconvey v1.7.2 h1:9RBaZCeXEQ3UselpuwUQHltGVXvdwm6cv1hgR6gDIPg=
  330 +github.com/smartystreets/goconvey v1.7.2/go.mod h1:Vw0tHAZW6lzCRk3xgdin6fKYcG+G3Pg9vgXWeJpQFMM=
294 github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= 331 github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM=
  332 +github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI=
295 github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= 333 github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
296 github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= 334 github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
297 github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= 335 github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
@@ -307,6 +345,7 @@ github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5Cc @@ -307,6 +345,7 @@ github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5Cc
307 github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= 345 github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
308 github.com/syndtr/goleveldb v0.0.0-20160425020131-cfa635847112/go.mod h1:Z4AUp2Km+PwemOoO/VB5AOx9XSsIItzFjoJlOSiYmn0= 346 github.com/syndtr/goleveldb v0.0.0-20160425020131-cfa635847112/go.mod h1:Z4AUp2Km+PwemOoO/VB5AOx9XSsIItzFjoJlOSiYmn0=
309 github.com/syndtr/goleveldb v0.0.0-20181127023241-353a9fca669c/go.mod h1:Z4AUp2Km+PwemOoO/VB5AOx9XSsIItzFjoJlOSiYmn0= 347 github.com/syndtr/goleveldb v0.0.0-20181127023241-353a9fca669c/go.mod h1:Z4AUp2Km+PwemOoO/VB5AOx9XSsIItzFjoJlOSiYmn0=
  348 +github.com/tal-tech/go-zero v1.0.27 h1:QMIbaTxibMc/OsO5RTAuKZ8ndbl2dGN6pITQEtp2x/A=
310 github.com/tal-tech/go-zero v1.0.27/go.mod h1:JtNXlsh/CgeIHyQnt5C5M2IcSevW7V0NAnqO93TQgm8= 349 github.com/tal-tech/go-zero v1.0.27/go.mod h1:JtNXlsh/CgeIHyQnt5C5M2IcSevW7V0NAnqO93TQgm8=
311 github.com/tiptok/egglib-go v0.0.0-20210608073225-c852ce95ae34 h1:9iDNyYbfpv5KLWDLpDywD/aIODg+PNnwn+v9on7KGlE= 350 github.com/tiptok/egglib-go v0.0.0-20210608073225-c852ce95ae34 h1:9iDNyYbfpv5KLWDLpDywD/aIODg+PNnwn+v9on7KGlE=
312 github.com/tiptok/egglib-go v0.0.0-20210608073225-c852ce95ae34/go.mod h1:KT8WFA2LPo5zVKbomCR6HocO4prnIY9DUVGekA3Ifo4= 351 github.com/tiptok/egglib-go v0.0.0-20210608073225-c852ce95ae34/go.mod h1:KT8WFA2LPo5zVKbomCR6HocO4prnIY9DUVGekA3Ifo4=
@@ -317,6 +356,11 @@ github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc/go.mod h1:bciPuU6GH @@ -317,6 +356,11 @@ github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc/go.mod h1:bciPuU6GH
317 github.com/ugorji/go v0.0.0-20171122102828-84cb69a8af83/go.mod h1:hnLbHMwcvSihnDhEfx2/BzKp2xb0Y+ErdfYcrs9tkJQ= 356 github.com/ugorji/go v0.0.0-20171122102828-84cb69a8af83/go.mod h1:hnLbHMwcvSihnDhEfx2/BzKp2xb0Y+ErdfYcrs9tkJQ=
318 github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= 357 github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
319 github.com/urfave/cli v1.22.5/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= 358 github.com/urfave/cli v1.22.5/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
  359 +github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
  360 +github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
  361 +github.com/valyala/fasthttp v1.32.0 h1:keswgWzyKyNIIjz2a7JmCYHOOIkRp6HMx9oTV6QrZWY=
  362 +github.com/valyala/fasthttp v1.32.0/go.mod h1:2rsYD01CKFrjjsvFxx75KlEUNpWNBY9JWD3K/7o2Cus=
  363 +github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc=
320 github.com/vmihailenco/bufpool v0.1.11 h1:gOq2WmBrq0i2yW5QJ16ykccQ4wH9UyEsgLm6czKAd94= 364 github.com/vmihailenco/bufpool v0.1.11 h1:gOq2WmBrq0i2yW5QJ16ykccQ4wH9UyEsgLm6czKAd94=
321 github.com/vmihailenco/bufpool v0.1.11/go.mod h1:AFf/MOy3l2CFTKbxwt0mp2MwnqjNEs5H/UxrkA5jxTQ= 365 github.com/vmihailenco/bufpool v0.1.11/go.mod h1:AFf/MOy3l2CFTKbxwt0mp2MwnqjNEs5H/UxrkA5jxTQ=
322 github.com/vmihailenco/msgpack/v5 v5.2.0/go.mod h1:fEM7KuHcnm0GvDCztRpw9hV0PuoO2ciTismP6vjggcM= 366 github.com/vmihailenco/msgpack/v5 v5.2.0/go.mod h1:fEM7KuHcnm0GvDCztRpw9hV0PuoO2ciTismP6vjggcM=
@@ -329,12 +373,27 @@ github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV @@ -329,12 +373,27 @@ github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV
329 github.com/wendal/errors v0.0.0-20130201093226-f66c77a7882b/go.mod h1:Q12BUT7DqIlHRmgv3RskH+UCM/4eqVMgI0EMmlSpAXc= 373 github.com/wendal/errors v0.0.0-20130201093226-f66c77a7882b/go.mod h1:Q12BUT7DqIlHRmgv3RskH+UCM/4eqVMgI0EMmlSpAXc=
330 github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I= 374 github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I=
331 github.com/xdg/stringprep v1.0.0/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= 375 github.com/xdg/stringprep v1.0.0/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y=
  376 +github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f h1:J9EGpcZtP0E/raorCMxlFGSTBrsSlaDGf3jU/qvAE2c=
  377 +github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
  378 +github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0=
  379 +github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ=
  380 +github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74=
  381 +github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y=
332 github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= 382 github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
333 github.com/xlab/treeprint v0.0.0-20180616005107-d6fb6747feb6/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= 383 github.com/xlab/treeprint v0.0.0-20180616005107-d6fb6747feb6/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg=
334 github.com/xwb1989/sqlparser v0.0.0-20180606152119-120387863bf2/go.mod h1:hzfGeIUDq/j97IG+FhNqkowIyEcD88LrW6fyU3K3WqY= 384 github.com/xwb1989/sqlparser v0.0.0-20180606152119-120387863bf2/go.mod h1:hzfGeIUDq/j97IG+FhNqkowIyEcD88LrW6fyU3K3WqY=
  385 +github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0 h1:6fRhSjgLCkTD3JnJxvaJ4Sj+TYblw757bqYgZaOq5ZY=
  386 +github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0/go.mod h1:/LWChgwKmvncFJFHJ7Gvn9wZArjbV5/FppcK2fKk/tI=
  387 +github.com/yudai/gojsondiff v1.0.0 h1:27cbfqXLVEJ1o8I6v3y9lg8Ydm53EKqHXAOMxEGlCOA=
  388 +github.com/yudai/gojsondiff v1.0.0/go.mod h1:AY32+k2cwILAkW1fbgxQ5mUmMiZFgLIV+FBNExI05xg=
  389 +github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82 h1:BHyfKlQyqbsFN5p3IfnEUduWvb9is428/nNb5L3U01M=
  390 +github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82/go.mod h1:lgjkn3NuSvDfVJdfcVVdX+jpBxNmX4rDAzaS45IcYoM=
  391 +github.com/yudai/pp v2.0.1+incompatible h1:Q4//iY4pNF6yPLZIigmvcl7k/bPgrcTPIFIcmawg5bI=
  392 +github.com/yudai/pp v2.0.1+incompatible/go.mod h1:PuxR/8QJ7cyCkFp/aUDS+JY727OFEZkTdatxwunjIkc=
335 github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= 393 github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
336 github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= 394 github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
337 github.com/yuin/gopher-lua v0.0.0-20171031051903-609c9cd26973/go.mod h1:aEV29XrmTYFr3CiRxZeGHpkvbwq+prZduBqMaascyCU= 395 github.com/yuin/gopher-lua v0.0.0-20171031051903-609c9cd26973/go.mod h1:aEV29XrmTYFr3CiRxZeGHpkvbwq+prZduBqMaascyCU=
  396 +github.com/yuin/gopher-lua v0.0.0-20191220021717-ab39c6098bdb h1:ZkM6LRnq40pR1Ox0hTHlnpkcOTuFIDQpZ1IN8rKKhX0=
338 github.com/yuin/gopher-lua v0.0.0-20191220021717-ab39c6098bdb/go.mod h1:gqRgreBUhTSL0GeU64rtZ3Uq3wtjOa/TB2YfrtkCbVQ= 397 github.com/yuin/gopher-lua v0.0.0-20191220021717-ab39c6098bdb/go.mod h1:gqRgreBUhTSL0GeU64rtZ3Uq3wtjOa/TB2YfrtkCbVQ=
339 go.etcd.io/bbolt v1.3.4/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= 398 go.etcd.io/bbolt v1.3.4/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ=
340 go.etcd.io/etcd v0.0.0-20200402134248-51bdeb39e698/go.mod h1:YoUyTScD3Vcv2RBm3eGVOq7i1ULiz3OuXoQFWOirmAM= 399 go.etcd.io/etcd v0.0.0-20200402134248-51bdeb39e698/go.mod h1:YoUyTScD3Vcv2RBm3eGVOq7i1ULiz3OuXoQFWOirmAM=
@@ -352,6 +411,7 @@ go.opentelemetry.io/otel/trace v0.17.0/go.mod h1:bIujpqg6ZL6xUTubIUgziI1jSaUPthm @@ -352,6 +411,7 @@ go.opentelemetry.io/otel/trace v0.17.0/go.mod h1:bIujpqg6ZL6xUTubIUgziI1jSaUPthm
352 go.opentelemetry.io/otel/trace v0.19.0 h1:1ucYlenXIDA1OlHVLDZKX0ObXV5RLaq06DtUKz5e5zc= 411 go.opentelemetry.io/otel/trace v0.19.0 h1:1ucYlenXIDA1OlHVLDZKX0ObXV5RLaq06DtUKz5e5zc=
353 go.opentelemetry.io/otel/trace v0.19.0/go.mod h1:4IXiNextNOpPnRlI4ryK69mn5iC84bjBWZQA5DXz/qg= 412 go.opentelemetry.io/otel/trace v0.19.0/go.mod h1:4IXiNextNOpPnRlI4ryK69mn5iC84bjBWZQA5DXz/qg=
354 go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= 413 go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
  414 +go.uber.org/automaxprocs v1.3.0 h1:II28aZoGdaglS5vVNnspf28lnZpXScxtIozx1lAjdb0=
355 go.uber.org/automaxprocs v1.3.0/go.mod h1:9CWT6lKIep8U41DDaPiH6eFscnTyjfTANNQNx6LrIcA= 415 go.uber.org/automaxprocs v1.3.0/go.mod h1:9CWT6lKIep8U41DDaPiH6eFscnTyjfTANNQNx6LrIcA=
356 go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= 416 go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU=
357 go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= 417 go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA=
@@ -366,8 +426,9 @@ golang.org/x/crypto v0.0.0-20191002192127-34f69633bfdc/go.mod h1:yigFU9vqHzYiE8U @@ -366,8 +426,9 @@ golang.org/x/crypto v0.0.0-20191002192127-34f69633bfdc/go.mod h1:yigFU9vqHzYiE8U
366 golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 426 golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
367 golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= 427 golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
368 golang.org/x/crypto v0.0.0-20210218145215-b8e89b74b9df/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= 428 golang.org/x/crypto v0.0.0-20210218145215-b8e89b74b9df/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
369 -golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2 h1:It14KIkyBFYkHkwZ7k45minvA9aorojkyjGk9KJ5B/w=  
370 golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= 429 golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
  430 +golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a h1:kr2P4QFmQr29mSLA43kwrOcgcReGTfbE9N577tCTuBc=
  431 +golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8=
371 golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= 432 golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
372 golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= 433 golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
373 golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= 434 golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
@@ -401,8 +462,9 @@ golang.org/x/net v0.0.0-20201006153459-a7d1128ccaa0/go.mod h1:sp8m0HH+o8qH0wwXwY @@ -401,8 +462,9 @@ golang.org/x/net v0.0.0-20201006153459-a7d1128ccaa0/go.mod h1:sp8m0HH+o8qH0wwXwY
401 golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= 462 golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
402 golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= 463 golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
403 golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= 464 golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
404 -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110 h1:qWPm9rbaAMKs8Bq/9LRpbMqxWRVUAQwMI9fVrssnTfw=  
405 golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= 465 golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
  466 +golang.org/x/net v0.0.0-20210510120150-4163338589ed h1:p9UgmWI9wKpfYmgaV/IZKGdXc5qEK45tDwwwDyjS26I=
  467 +golang.org/x/net v0.0.0-20210510120150-4163338589ed/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
406 golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= 468 golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
407 golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 469 golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
408 golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 470 golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@@ -440,16 +502,18 @@ golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7w @@ -440,16 +502,18 @@ golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7w
440 golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 502 golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
441 golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 503 golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
442 golang.org/x/sys v0.0.0-20210218155724-8ebf48af031b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 504 golang.org/x/sys v0.0.0-20210218155724-8ebf48af031b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
443 -golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4 h1:EZ2mChiOa8udjfp6rRmswTbtZN/QzUQp4ptM4rnjHvc=  
444 golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 505 golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
  506 +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
  507 +golang.org/x/sys v0.0.0-20210514084401-e8d321eab015 h1:hZR0X1kPW+nwyJ9xRxqZk1vx5RUObAPBdKVvXPDUH/E=
  508 +golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
445 golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= 509 golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
446 golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= 510 golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
447 golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 511 golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
448 golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 512 golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
449 golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= 513 golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
450 golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= 514 golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
451 -golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ=  
452 -golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= 515 +golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M=
  516 +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
453 golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= 517 golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
454 golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= 518 golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
455 golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 519 golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
@@ -458,6 +522,7 @@ golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGm @@ -458,6 +522,7 @@ golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGm
458 golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 522 golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
459 golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= 523 golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
460 golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= 524 golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
  525 +golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
461 golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= 526 golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
462 golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= 527 golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
463 golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= 528 golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
@@ -511,6 +576,7 @@ gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qS @@ -511,6 +576,7 @@ gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qS
511 gopkg.in/cheggaaa/pb.v1 v1.0.28/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= 576 gopkg.in/cheggaaa/pb.v1 v1.0.28/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw=
512 gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= 577 gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
513 gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= 578 gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
  579 +gopkg.in/h2non/gock.v1 v1.0.15 h1:SzLqcIlb/fDfg7UvukMpNcWsu7sI5tWwL+KCATZqks0=
514 gopkg.in/h2non/gock.v1 v1.0.15/go.mod h1:sX4zAkdYX1TRGJ2JY156cFspQn4yRWn6p9EMdODlynE= 580 gopkg.in/h2non/gock.v1 v1.0.15/go.mod h1:sX4zAkdYX1TRGJ2JY156cFspQn4yRWn6p9EMdODlynE=
515 gopkg.in/jcmturner/aescts.v1 v1.0.1 h1:cVVZBK2b1zY26haWB4vbBiZrfFQnfbTVrE3xZq6hrEw= 581 gopkg.in/jcmturner/aescts.v1 v1.0.1 h1:cVVZBK2b1zY26haWB4vbBiZrfFQnfbTVrE3xZq6hrEw=
516 gopkg.in/jcmturner/aescts.v1 v1.0.1/go.mod h1:nsR8qBOg+OucoIW+WMhB3GspUQXq9XorLnQb9XtvcOo= 582 gopkg.in/jcmturner/aescts.v1 v1.0.1/go.mod h1:nsR8qBOg+OucoIW+WMhB3GspUQXq9XorLnQb9XtvcOo=
@@ -6,6 +6,12 @@ import ( @@ -6,6 +6,12 @@ import (
6 "github.com/linmadan/egglib-go/log/logrus" 6 "github.com/linmadan/egglib-go/log/logrus"
7 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/constant" 7 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/constant"
8 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/log" 8 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/log"
  9 +
  10 + _ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/constant"
  11 + _ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg"
  12 + _ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/redis"
  13 + _ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/log"
  14 + _ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/port/beego"
9 ) 15 )
10 16
11 func main() { 17 func main() {
@@ -5,9 +5,9 @@ import ( @@ -5,9 +5,9 @@ import (
5 "github.com/go-pg/pg/v10" 5 "github.com/go-pg/pg/v10"
6 "github.com/go-pg/pg/v10/orm" 6 "github.com/go-pg/pg/v10/orm"
7 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/constant" 7 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/constant"
  8 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg/models"
  9 + "reflect"
8 10
9 - //_ "gitlab.fjmaimaimai.com/allied-creation/manufacture/pkg/infrastructure/pg/models"  
10 - "github.com/linmadan/egglib-go/persistent/pg/comment"  
11 "github.com/linmadan/egglib-go/persistent/pg/hooks" 11 "github.com/linmadan/egglib-go/persistent/pg/hooks"
12 ) 12 )
13 13
@@ -24,7 +24,18 @@ func init() { @@ -24,7 +24,18 @@ func init() {
24 DB.AddQueryHook(hooks.SqlGeneratePrintHook{}) 24 DB.AddQueryHook(hooks.SqlGeneratePrintHook{})
25 } 25 }
26 if !constant.DISABLE_CREATE_TABLE { 26 if !constant.DISABLE_CREATE_TABLE {
27 - for _, model := range []interface{}{} { 27 + for _, model := range []interface{}{
  28 + (*models.Device)(nil),
  29 + (*models.Product)(nil),
  30 + (*models.ProductAttendanceRecord)(nil),
  31 + (*models.ProductCalendar)(nil),
  32 + (*models.ProductGroup)(nil),
  33 + (*models.ProductJob)(nil),
  34 + (*models.ProductPlan)(nil),
  35 + (*models.ProductRecord)(nil),
  36 + (*models.UnitConversion)(nil),
  37 + (*models.Workshop)(nil),
  38 + } {
28 err := DB.Model(model).CreateTable(&orm.CreateTableOptions{ 39 err := DB.Model(model).CreateTable(&orm.CreateTableOptions{
29 Temp: false, 40 Temp: false,
30 IfNotExists: true, 41 IfNotExists: true,
@@ -33,7 +44,32 @@ func init() { @@ -33,7 +44,32 @@ func init() {
33 if err != nil { 44 if err != nil {
34 panic(err) 45 panic(err)
35 } 46 }
36 - comment.AddComments(DB, model) 47 + if !constant.DISABLE_SQL_GENERATE_COMMENT {
  48 + AddComments(DB, model)
  49 + }
  50 + }
  51 + }
  52 +}
  53 +
  54 +func AddComments(db *pg.DB, model interface{}) {
  55 + tableName := db.Model(model).TableModel().Table().SQLName
  56 + columnsMap := make(map[string]*orm.Field)
  57 + columns := db.Model(model).TableModel().Table().Fields
  58 + for _, item := range columns {
  59 + columnsMap[item.GoName] = item
  60 + }
  61 + valueOf := reflect.TypeOf(model)
  62 + for i := 0; i < valueOf.Elem().NumField(); i++ {
  63 + field := valueOf.Elem().Field(i)
  64 + comment := field.Tag.Get("comment")
  65 + if comment != "" {
  66 + if field.Name == "tableName" {
  67 + _, _ = db.Exec(fmt.Sprintf("COMMENT ON TABLE %s IS '%s';", tableName, comment))
  68 + } else {
  69 + if columnField, ok := columnsMap[field.Name]; ok {
  70 + _, _ = db.Exec(fmt.Sprintf("COMMENT ON COLUMN %s.%s IS '%s';", tableName, columnField.SQLName, comment))
  71 + }
  72 + }
37 } 73 }
38 } 74 }
39 } 75 }
@@ -6,13 +6,15 @@ import ( @@ -6,13 +6,15 @@ import (
6 ) 6 )
7 7
8 type Device struct { 8 type Device struct {
9 - tableName string `comment:"设备" pg:"devices,alias:device"` 9 + tableName string `comment:"设备" pg:"manufacture.device,alias:device"`
10 // 设备Id 10 // 设备Id
11 DeviceId int `comment:"设备Id" pg:"pk:device_id"` 11 DeviceId int `comment:"设备Id" pg:"pk:device_id"`
12 // 企业id 12 // 企业id
13 CompanyId int `comment:"企业id"` 13 CompanyId int `comment:"企业id"`
14 // 组织ID 14 // 组织ID
15 OrgId int `comment:"组织ID"` 15 OrgId int `comment:"组织ID"`
  16 + // 所属位置
  17 + WorkStation *domain.WorkStation `comment:"所属位置"`
16 // 设备编号 18 // 设备编号
17 DeviceCode string `comment:"设备编号"` 19 DeviceCode string `comment:"设备编号"`
18 // 设备名称 20 // 设备名称
@@ -32,7 +34,5 @@ type Device struct { @@ -32,7 +34,5 @@ type Device struct {
32 // 更新时间 34 // 更新时间
33 UpdatedAt time.Time `comment:"更新时间"` 35 UpdatedAt time.Time `comment:"更新时间"`
34 // 删除时间 36 // 删除时间
35 - DeletedAt time.Time `comment:"删除时间"`  
36 - // 所属位置  
37 - WorkStation *domain.WorkStation `comment:"所属位置"` 37 + DeletedAt time.Time `pg:",soft_delete" comment:"删除时间"`
38 } 38 }
@@ -6,7 +6,7 @@ import ( @@ -6,7 +6,7 @@ import (
6 ) 6 )
7 7
8 type Product struct { 8 type Product struct {
9 - tableName string `comment:"产品信息" pg:"products,alias:product"` 9 + tableName string `comment:"产品信息" pg:"manufacture.product,alias:product"`
10 // 企业id 10 // 企业id
11 CompanyId int `comment:"企业id"` 11 CompanyId int `comment:"企业id"`
12 // 组织ID 12 // 组织ID
@@ -26,5 +26,5 @@ type Product struct { @@ -26,5 +26,5 @@ type Product struct {
26 // 更新时间 26 // 更新时间
27 UpdatedAt time.Time `comment:"更新时间"` 27 UpdatedAt time.Time `comment:"更新时间"`
28 // 删除时间 28 // 删除时间
29 - DeletedAt time.Time `comment:"删除时间"` 29 + DeletedAt time.Time `pg:",soft_delete" comment:"删除时间"`
30 } 30 }
@@ -6,9 +6,11 @@ import ( @@ -6,9 +6,11 @@ import (
6 ) 6 )
7 7
8 type ProductAttendanceRecord struct { 8 type ProductAttendanceRecord struct {
9 - tableName string `comment:"生产考勤记录" pg:"product_attendance_records,alias:product_attendance_record"` 9 + tableName string `comment:"生产考勤记录" pg:"manufacture.product_attendance_record,alias:product_attendance_record"`
10 // 考勤记录ID 10 // 考勤记录ID
11 ProductAttendanceId int `comment:"考勤记录ID"` 11 ProductAttendanceId int `comment:"考勤记录ID"`
  12 + // 企业id
  13 + CompanyId int `comment:"企业id"`
12 // 组织ID 14 // 组织ID
13 OrgId int `comment:"组织ID"` 15 OrgId int `comment:"组织ID"`
14 // 产品ID 16 // 产品ID
@@ -34,5 +36,5 @@ type ProductAttendanceRecord struct { @@ -34,5 +36,5 @@ type ProductAttendanceRecord struct {
34 // 更新时间 36 // 更新时间
35 UpdatedAt time.Time `comment:"更新时间"` 37 UpdatedAt time.Time `comment:"更新时间"`
36 // 删除时间 38 // 删除时间
37 - DeletedAt time.Time `comment:"删除时间"` 39 + DeletedAt time.Time `pg:",soft_delete" comment:"删除时间"`
38 } 40 }
@@ -6,7 +6,7 @@ import ( @@ -6,7 +6,7 @@ import (
6 ) 6 )
7 7
8 type ProductCalendar struct { 8 type ProductCalendar struct {
9 - tableName string `comment:"工厂日历" pg:"product_calendars,alias:product_calendar"` 9 + tableName string `comment:"工厂日历" pg:"manufacture.product_calendar,alias:product_calendar"`
10 // 工厂日历ID 10 // 工厂日历ID
11 ProductCalendarId int `comment:"工厂日历ID" pg:"pk:product_calendar_id"` 11 ProductCalendarId int `comment:"工厂日历ID" pg:"pk:product_calendar_id"`
12 // 企业id 12 // 企业id
@@ -32,5 +32,5 @@ type ProductCalendar struct { @@ -32,5 +32,5 @@ type ProductCalendar struct {
32 // 更新时间 32 // 更新时间
33 UpdatedAt time.Time `comment:"更新时间"` 33 UpdatedAt time.Time `comment:"更新时间"`
34 // 删除时间 34 // 删除时间
35 - DeletedAt time.Time `comment:"删除时间"` 35 + DeletedAt time.Time `pg:",soft_delete" comment:"删除时间"`
36 } 36 }
@@ -6,7 +6,7 @@ import ( @@ -6,7 +6,7 @@ import (
6 ) 6 )
7 7
8 type ProductGroup struct { 8 type ProductGroup struct {
9 - tableName string `comment:"生产班组" pg:"product_groups,alias:product_group"` 9 + tableName string `comment:"生产班组" pg:"manufacture.product_group,alias:product_group"`
10 // 生产小组ID 10 // 生产小组ID
11 ProductGroupId int `comment:"生产小组ID" pg:"pk:product_group_id"` 11 ProductGroupId int `comment:"生产小组ID" pg:"pk:product_group_id"`
12 // 企业id 12 // 企业id
@@ -18,7 +18,7 @@ type ProductGroup struct { @@ -18,7 +18,7 @@ type ProductGroup struct {
18 // 班组长 18 // 班组长
19 GroupLeader *domain.User `comment:"班组长"` 19 GroupLeader *domain.User `comment:"班组长"`
20 // 帮组成员列表 20 // 帮组成员列表
21 - GroupMembers []*domain.User `comment:"帮组成员列表" pg:",array"` 21 + GroupMembers []*domain.User `comment:"帮组成员列表"`
22 // 上班班次 1:全天 2:白班 4:中班 8:夜班 22 // 上班班次 1:全天 2:白班 4:中班 8:夜班
23 WorkOn int `comment:"上班班次 1:全天 2:白班 4:中班 8:夜班"` 23 WorkOn int `comment:"上班班次 1:全天 2:白班 4:中班 8:夜班"`
24 // 工作位置 24 // 工作位置
@@ -28,5 +28,5 @@ type ProductGroup struct { @@ -28,5 +28,5 @@ type ProductGroup struct {
28 // 更新时间 28 // 更新时间
29 UpdatedAt time.Time `comment:"更新时间"` 29 UpdatedAt time.Time `comment:"更新时间"`
30 // 删除时间 30 // 删除时间
31 - DeletedAt time.Time `comment:"删除时间"` 31 + DeletedAt time.Time `pg:",soft_delete" comment:"删除时间"`
32 } 32 }
@@ -6,7 +6,7 @@ import ( @@ -6,7 +6,7 @@ import (
6 ) 6 )
7 7
8 type ProductJob struct { 8 type ProductJob struct {
9 - tableName string `comment:"工位(车间-生产线-工段-工位)" pg:"product_jobs,alias:product_job"` 9 + tableName string `comment:"工位(车间-生产线-工段-工位)" pg:"manufacture.product_job,alias:product_job"`
10 // 工位ID 10 // 工位ID
11 ProductJobId int `comment:"工位ID" pg:"pk:product_job_id"` 11 ProductJobId int `comment:"工位ID" pg:"pk:product_job_id"`
12 // 企业id 12 // 企业id
@@ -24,5 +24,5 @@ type ProductJob struct { @@ -24,5 +24,5 @@ type ProductJob struct {
24 // 工作位置 24 // 工作位置
25 WorkStation *domain.WorkStation `comment:"工作位置"` 25 WorkStation *domain.WorkStation `comment:"工作位置"`
26 // 关联设备列表 26 // 关联设备列表
27 - RelatedDevices []int `comment:"关联设备列表" pg:",array"` 27 + RelatedDevices []int `pg:",soft_delete" comment:"关联设备列表" pg:",array"`
28 } 28 }
@@ -6,7 +6,7 @@ import ( @@ -6,7 +6,7 @@ import (
6 ) 6 )
7 7
8 type ProductPlan struct { 8 type ProductPlan struct {
9 - tableName string `comment:"生产计划" pg:"product_plans,alias:product_plan"` 9 + tableName string `comment:"生产计划" pg:"product_plans,alias:manufacture.product_plan"`
10 // 生产计划ID 10 // 生产计划ID
11 ProductPlanId int `comment:"生产计划ID" pg:"pk:product_plan_id"` 11 ProductPlanId int `comment:"生产计划ID" pg:"pk:product_plan_id"`
12 // 企业id 12 // 企业id
@@ -38,5 +38,5 @@ type ProductPlan struct { @@ -38,5 +38,5 @@ type ProductPlan struct {
38 // 更新时间 38 // 更新时间
39 UpdatedAt time.Time `comment:"更新时间"` 39 UpdatedAt time.Time `comment:"更新时间"`
40 // 删除时间 40 // 删除时间
41 - DeletedAt time.Time `comment:"删除时间"` 41 + DeletedAt time.Time `pg:",soft_delete" comment:"删除时间"`
42 } 42 }
@@ -6,7 +6,7 @@ import ( @@ -6,7 +6,7 @@ import (
6 ) 6 )
7 7
8 type ProductRecord struct { 8 type ProductRecord struct {
9 - tableName string `comment:"生产记录" pg:"product_records,alias:product_record"` 9 + tableName string `comment:"生产记录" pg:"manufacture.product_records,alias:product_record"`
10 // 生产记录ID 10 // 生产记录ID
11 ProductRecordId int `comment:"生产记录ID" pg:"pk:product_record_id"` 11 ProductRecordId int `comment:"生产记录ID" pg:"pk:product_record_id"`
12 // 企业id 12 // 企业id
@@ -24,7 +24,7 @@ type ProductRecord struct { @@ -24,7 +24,7 @@ type ProductRecord struct {
24 // 更新时间 24 // 更新时间
25 UpdatedAt time.Time `comment:"更新时间"` 25 UpdatedAt time.Time `comment:"更新时间"`
26 // 删除时间 26 // 删除时间
27 - DeletedAt time.Time `comment:"删除时间"` 27 + DeletedAt time.Time `pg:",soft_delete" comment:"删除时间"`
28 // 生产记录信息 28 // 生产记录信息
29 ProductRecordInfo *domain.ProductRecordInfo `comment:"生产记录信息"` 29 ProductRecordInfo *domain.ProductRecordInfo `comment:"生产记录信息"`
30 } 30 }
@@ -6,7 +6,7 @@ import ( @@ -6,7 +6,7 @@ import (
6 ) 6 )
7 7
8 type UnitConversion struct { 8 type UnitConversion struct {
9 - tableName string `comment:"单位换算" pg:"unit_conversions,alias:unit_conversion"` 9 + tableName string `comment:"单位换算" pg:"manufacture.unit_conversion,alias:unit_conversion"`
10 // 单位换算ID 10 // 单位换算ID
11 UnitConversionId int `comment:"单位换算ID" pg:"pk:unit_conversion_id"` 11 UnitConversionId int `comment:"单位换算ID" pg:"pk:unit_conversion_id"`
12 // 企业id 12 // 企业id
@@ -28,5 +28,5 @@ type UnitConversion struct { @@ -28,5 +28,5 @@ type UnitConversion struct {
28 // 更新时间 28 // 更新时间
29 UpdatedAt time.Time `comment:"更新时间"` 29 UpdatedAt time.Time `comment:"更新时间"`
30 // 删除时间 30 // 删除时间
31 - DeletedAt time.Time `comment:"删除时间"` 31 + DeletedAt time.Time `pg:",soft_delete" comment:"删除时间"`
32 } 32 }
@@ -6,7 +6,7 @@ import ( @@ -6,7 +6,7 @@ import (
6 ) 6 )
7 7
8 type Workshop struct { 8 type Workshop struct {
9 - tableName string `comment:"车间" pg:"workshops,alias:workshop"` 9 + tableName string `comment:"车间" pg:"manufacture.workshop,alias:workshop"`
10 // 企业id 10 // 企业id
11 CompanyId int `comment:"企业id"` 11 CompanyId int `comment:"企业id"`
12 // 组织ID 12 // 组织ID
@@ -18,11 +18,11 @@ type Workshop struct { @@ -18,11 +18,11 @@ type Workshop struct {
18 // 负责人 (用户对象) 18 // 负责人 (用户对象)
19 Principal *domain.User `comment:"负责人 (用户对象)"` 19 Principal *domain.User `comment:"负责人 (用户对象)"`
20 // 生产线 20 // 生产线
21 - ProductLines []*domain.ProductLine `comment:"生产线" pg:",array"` 21 + ProductLines []*domain.ProductLine `comment:"生产线" `
22 // 创建时间 22 // 创建时间
23 CreatedAt time.Time `comment:"创建时间"` 23 CreatedAt time.Time `comment:"创建时间"`
24 // 更新时间 24 // 更新时间
25 UpdatedAt time.Time `comment:"更新时间"` 25 UpdatedAt time.Time `comment:"更新时间"`
26 // 删除时间 26 // 删除时间
27 - DeletedAt time.Time `comment:"删除时间"` 27 + DeletedAt time.Time `pg:",soft_delete" comment:"删除时间"`
28 } 28 }
  1 +package redis
  2 +
  3 +import (
  4 + ilog "github.com/linmadan/egglib-go/log"
  5 + "github.com/linmadan/egglib-go/persistent/cache"
  6 + "github.com/linmadan/egglib-go/persistent/cache/gzcache"
  7 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/constant"
  8 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/log"
  9 +)
  10 +
  11 +func init() {
  12 + cache.NewDefaultCache(cache.WithDebugLog(true, func() ilog.Logger { return log.Logger }))
  13 + cache.RegisterCache(gzcache.NewNodeCache(constant.REDIS_HOST+":"+constant.REDIS_PORT, constant.REDIS_AUTH))
  14 +}
@@ -6,8 +6,8 @@ import ( @@ -6,8 +6,8 @@ import (
6 "os" 6 "os"
7 "strconv" 7 "strconv"
8 8
9 - //_ "gitlab.fjmaimaimai.com/allied-creation/manufacture/pkg/port/beego/routers"  
10 . "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/log" 9 . "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/log"
  10 + _ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/port/beego/routers"
11 ) 11 )
12 12
13 func init() { 13 func init() {
  1 +package controllers
  2 +
  3 +import (
  4 + "github.com/linmadan/egglib-go/web/beego"
  5 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/application/device/command"
  6 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/application/device/query"
  7 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/application/device/service"
  8 +)
  9 +
  10 +type DeviceController struct {
  11 + beego.BaseController
  12 +}
  13 +
  14 +func (controller *DeviceController) CreateDevice() {
  15 + deviceService := service.NewDeviceService(nil)
  16 + createDeviceCommand := &command.CreateDeviceCommand{}
  17 + controller.Unmarshal(createDeviceCommand)
  18 + data, err := deviceService.CreateDevice(createDeviceCommand)
  19 + controller.Response(data, err)
  20 +}
  21 +
  22 +func (controller *DeviceController) UpdateDevice() {
  23 + deviceService := service.NewDeviceService(nil)
  24 + updateDeviceCommand := &command.UpdateDeviceCommand{}
  25 + controller.Unmarshal(updateDeviceCommand)
  26 + deviceId, _ := controller.GetInt(":deviceId")
  27 + updateDeviceCommand.DeviceId = deviceId
  28 + data, err := deviceService.UpdateDevice(updateDeviceCommand)
  29 + controller.Response(data, err)
  30 +}
  31 +
  32 +func (controller *DeviceController) GetDevice() {
  33 + deviceService := service.NewDeviceService(nil)
  34 + getDeviceQuery := &query.GetDeviceQuery{}
  35 + deviceId, _ := controller.GetInt(":deviceId")
  36 + getDeviceQuery.DeviceId = deviceId
  37 + data, err := deviceService.GetDevice(getDeviceQuery)
  38 + controller.Response(data, err)
  39 +}
  40 +
  41 +func (controller *DeviceController) RemoveDevice() {
  42 + deviceService := service.NewDeviceService(nil)
  43 + removeDeviceCommand := &command.RemoveDeviceCommand{}
  44 + controller.Unmarshal(removeDeviceCommand)
  45 + deviceId, _ := controller.GetInt(":deviceId")
  46 + removeDeviceCommand.DeviceId = deviceId
  47 + data, err := deviceService.RemoveDevice(removeDeviceCommand)
  48 + controller.Response(data, err)
  49 +}
  50 +
  51 +func (controller *DeviceController) ListDevice() {
  52 + deviceService := service.NewDeviceService(nil)
  53 + listDeviceQuery := &query.ListDeviceQuery{}
  54 + offset, _ := controller.GetInt("offset")
  55 + listDeviceQuery.Offset = offset
  56 + limit, _ := controller.GetInt("limit")
  57 + listDeviceQuery.Limit = limit
  58 + data, err := deviceService.ListDevice(listDeviceQuery)
  59 + controller.Response(data, err)
  60 +}
  1 +package controllers
  2 +
  3 +import (
  4 + "github.com/linmadan/egglib-go/web/beego"
  5 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/application/productCalendar/command"
  6 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/application/productCalendar/query"
  7 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/application/productCalendar/service"
  8 +)
  9 +
  10 +type ProductCalendarController struct {
  11 + beego.BaseController
  12 +}
  13 +
  14 +func (controller *ProductCalendarController) CreateProductCalendar() {
  15 + productCalendarService := service.NewProductCalendarService(nil)
  16 + createProductCalendarCommand := &command.CreateProductCalendarCommand{}
  17 + controller.Unmarshal(createProductCalendarCommand)
  18 + data, err := productCalendarService.CreateProductCalendar(createProductCalendarCommand)
  19 + controller.Response(data, err)
  20 +}
  21 +
  22 +func (controller *ProductCalendarController) UpdateProductCalendar() {
  23 + productCalendarService := service.NewProductCalendarService(nil)
  24 + updateProductCalendarCommand := &command.UpdateProductCalendarCommand{}
  25 + controller.Unmarshal(updateProductCalendarCommand)
  26 + productCalendarId, _ := controller.GetInt(":productCalendarId")
  27 + updateProductCalendarCommand.ProductCalendarId = productCalendarId
  28 + data, err := productCalendarService.UpdateProductCalendar(updateProductCalendarCommand)
  29 + controller.Response(data, err)
  30 +}
  31 +
  32 +func (controller *ProductCalendarController) GetProductCalendar() {
  33 + productCalendarService := service.NewProductCalendarService(nil)
  34 + getProductCalendarQuery := &query.GetProductCalendarQuery{}
  35 + productCalendarId, _ := controller.GetInt(":productCalendarId")
  36 + getProductCalendarQuery.ProductCalendarId = productCalendarId
  37 + data, err := productCalendarService.GetProductCalendar(getProductCalendarQuery)
  38 + controller.Response(data, err)
  39 +}
  40 +
  41 +func (controller *ProductCalendarController) RemoveProductCalendar() {
  42 + productCalendarService := service.NewProductCalendarService(nil)
  43 + removeProductCalendarCommand := &command.RemoveProductCalendarCommand{}
  44 + controller.Unmarshal(removeProductCalendarCommand)
  45 + productCalendarId, _ := controller.GetInt(":productCalendarId")
  46 + removeProductCalendarCommand.ProductCalendarId = productCalendarId
  47 + data, err := productCalendarService.RemoveProductCalendar(removeProductCalendarCommand)
  48 + controller.Response(data, err)
  49 +}
  50 +
  51 +func (controller *ProductCalendarController) ListProductCalendar() {
  52 + productCalendarService := service.NewProductCalendarService(nil)
  53 + listProductCalendarQuery := &query.ListProductCalendarQuery{}
  54 + offset, _ := controller.GetInt("offset")
  55 + listProductCalendarQuery.Offset = offset
  56 + limit, _ := controller.GetInt("limit")
  57 + listProductCalendarQuery.Limit = limit
  58 + data, err := productCalendarService.ListProductCalendar(listProductCalendarQuery)
  59 + controller.Response(data, err)
  60 +}
  1 +package controllers
  2 +
  3 +import (
  4 + "github.com/linmadan/egglib-go/web/beego"
  5 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/application/product/command"
  6 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/application/product/query"
  7 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/application/product/service"
  8 +)
  9 +
  10 +type ProductController struct {
  11 + beego.BaseController
  12 +}
  13 +
  14 +func (controller *ProductController) CreateProduct() {
  15 + productService := service.NewProductService(nil)
  16 + createProductCommand := &command.CreateProductCommand{}
  17 + controller.Unmarshal(createProductCommand)
  18 + data, err := productService.CreateProduct(createProductCommand)
  19 + controller.Response(data, err)
  20 +}
  21 +
  22 +func (controller *ProductController) UpdateProduct() {
  23 + productService := service.NewProductService(nil)
  24 + updateProductCommand := &command.UpdateProductCommand{}
  25 + controller.Unmarshal(updateProductCommand)
  26 + productId, _ := controller.GetInt(":productId")
  27 + updateProductCommand.ProductId = productId
  28 + data, err := productService.UpdateProduct(updateProductCommand)
  29 + controller.Response(data, err)
  30 +}
  31 +
  32 +func (controller *ProductController) GetProduct() {
  33 + productService := service.NewProductService(nil)
  34 + getProductQuery := &query.GetProductQuery{}
  35 + productId, _ := controller.GetInt(":productId")
  36 + getProductQuery.ProductId = productId
  37 + data, err := productService.GetProduct(getProductQuery)
  38 + controller.Response(data, err)
  39 +}
  40 +
  41 +func (controller *ProductController) RemoveProduct() {
  42 + productService := service.NewProductService(nil)
  43 + removeProductCommand := &command.RemoveProductCommand{}
  44 + controller.Unmarshal(removeProductCommand)
  45 + productId, _ := controller.GetInt(":productId")
  46 + removeProductCommand.ProductId = productId
  47 + data, err := productService.RemoveProduct(removeProductCommand)
  48 + controller.Response(data, err)
  49 +}
  50 +
  51 +func (controller *ProductController) ListProduct() {
  52 + productService := service.NewProductService(nil)
  53 + listProductQuery := &query.ListProductQuery{}
  54 + offset, _ := controller.GetInt("offset")
  55 + listProductQuery.Offset = offset
  56 + limit, _ := controller.GetInt("limit")
  57 + listProductQuery.Limit = limit
  58 + data, err := productService.ListProduct(listProductQuery)
  59 + controller.Response(data, err)
  60 +}
  1 +package controllers
  2 +
  3 +import (
  4 + "github.com/linmadan/egglib-go/web/beego"
  5 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/application/productGroup/command"
  6 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/application/productGroup/query"
  7 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/application/productGroup/service"
  8 +)
  9 +
  10 +type ProductGroupController struct {
  11 + beego.BaseController
  12 +}
  13 +
  14 +func (controller *ProductGroupController) CreateProductGroup() {
  15 + productGroupService := service.NewProductGroupService(nil)
  16 + createProductGroupCommand := &command.CreateProductGroupCommand{}
  17 + controller.Unmarshal(createProductGroupCommand)
  18 + data, err := productGroupService.CreateProductGroup(createProductGroupCommand)
  19 + controller.Response(data, err)
  20 +}
  21 +
  22 +func (controller *ProductGroupController) UpdateProductGroup() {
  23 + productGroupService := service.NewProductGroupService(nil)
  24 + updateProductGroupCommand := &command.UpdateProductGroupCommand{}
  25 + controller.Unmarshal(updateProductGroupCommand)
  26 + productGroupId, _ := controller.GetInt(":productGroupId")
  27 + updateProductGroupCommand.ProductGroupId = productGroupId
  28 + data, err := productGroupService.UpdateProductGroup(updateProductGroupCommand)
  29 + controller.Response(data, err)
  30 +}
  31 +
  32 +func (controller *ProductGroupController) GetProductGroup() {
  33 + productGroupService := service.NewProductGroupService(nil)
  34 + getProductGroupQuery := &query.GetProductGroupQuery{}
  35 + productGroupId, _ := controller.GetInt(":productGroupId")
  36 + getProductGroupQuery.ProductGroupId = productGroupId
  37 + data, err := productGroupService.GetProductGroup(getProductGroupQuery)
  38 + controller.Response(data, err)
  39 +}
  40 +
  41 +func (controller *ProductGroupController) RemoveProductGroup() {
  42 + productGroupService := service.NewProductGroupService(nil)
  43 + removeProductGroupCommand := &command.RemoveProductGroupCommand{}
  44 + controller.Unmarshal(removeProductGroupCommand)
  45 + productGroupId, _ := controller.GetInt(":productGroupId")
  46 + removeProductGroupCommand.ProductGroupId = productGroupId
  47 + data, err := productGroupService.RemoveProductGroup(removeProductGroupCommand)
  48 + controller.Response(data, err)
  49 +}
  50 +
  51 +func (controller *ProductGroupController) ListProductGroup() {
  52 + productGroupService := service.NewProductGroupService(nil)
  53 + listProductGroupQuery := &query.ListProductGroupQuery{}
  54 + offset, _ := controller.GetInt("offset")
  55 + listProductGroupQuery.Offset = offset
  56 + limit, _ := controller.GetInt("limit")
  57 + listProductGroupQuery.Limit = limit
  58 + data, err := productGroupService.ListProductGroup(listProductGroupQuery)
  59 + controller.Response(data, err)
  60 +}
  1 +package controllers
  2 +
  3 +import (
  4 + "github.com/linmadan/egglib-go/web/beego"
  5 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/application/productJob/command"
  6 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/application/productJob/query"
  7 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/application/productJob/service"
  8 +)
  9 +
  10 +type ProductJobController struct {
  11 + beego.BaseController
  12 +}
  13 +
  14 +func (controller *ProductJobController) CreateProductJob() {
  15 + productJobService := service.NewProductJobService(nil)
  16 + createProductJobCommand := &command.CreateProductJobCommand{}
  17 + controller.Unmarshal(createProductJobCommand)
  18 + data, err := productJobService.CreateProductJob(createProductJobCommand)
  19 + controller.Response(data, err)
  20 +}
  21 +
  22 +func (controller *ProductJobController) UpdateProductJob() {
  23 + productJobService := service.NewProductJobService(nil)
  24 + updateProductJobCommand := &command.UpdateProductJobCommand{}
  25 + controller.Unmarshal(updateProductJobCommand)
  26 + productJobId, _ := controller.GetInt(":productJobId")
  27 + updateProductJobCommand.ProductJobId = productJobId
  28 + data, err := productJobService.UpdateProductJob(updateProductJobCommand)
  29 + controller.Response(data, err)
  30 +}
  31 +
  32 +func (controller *ProductJobController) GetProductJob() {
  33 + productJobService := service.NewProductJobService(nil)
  34 + getProductJobQuery := &query.GetProductJobQuery{}
  35 + productJobId, _ := controller.GetInt(":productJobId")
  36 + getProductJobQuery.ProductJobId = productJobId
  37 + data, err := productJobService.GetProductJob(getProductJobQuery)
  38 + controller.Response(data, err)
  39 +}
  40 +
  41 +func (controller *ProductJobController) RemoveProductJob() {
  42 + productJobService := service.NewProductJobService(nil)
  43 + removeProductJobCommand := &command.RemoveProductJobCommand{}
  44 + controller.Unmarshal(removeProductJobCommand)
  45 + productJobId, _ := controller.GetInt(":productJobId")
  46 + removeProductJobCommand.ProductJobId = productJobId
  47 + data, err := productJobService.RemoveProductJob(removeProductJobCommand)
  48 + controller.Response(data, err)
  49 +}
  50 +
  51 +func (controller *ProductJobController) ListProductJob() {
  52 + productJobService := service.NewProductJobService(nil)
  53 + listProductJobQuery := &query.ListProductJobQuery{}
  54 + offset, _ := controller.GetInt("offset")
  55 + listProductJobQuery.Offset = offset
  56 + limit, _ := controller.GetInt("limit")
  57 + listProductJobQuery.Limit = limit
  58 + data, err := productJobService.ListProductJob(listProductJobQuery)
  59 + controller.Response(data, err)
  60 +}
  1 +package controllers
  2 +
  3 +import (
  4 + "github.com/linmadan/egglib-go/web/beego"
  5 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/application/productLine/command"
  6 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/application/productLine/query"
  7 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/application/productLine/service"
  8 +)
  9 +
  10 +type ProductLineController struct {
  11 + beego.BaseController
  12 +}
  13 +
  14 +func (controller *ProductLineController) CreateProductLine() {
  15 + productLineService := service.NewProductLineService(nil)
  16 + createProductLineCommand := &command.CreateProductLineCommand{}
  17 + controller.Unmarshal(createProductLineCommand)
  18 + data, err := productLineService.CreateProductLine(createProductLineCommand)
  19 + controller.Response(data, err)
  20 +}
  21 +
  22 +func (controller *ProductLineController) UpdateProductLine() {
  23 + productLineService := service.NewProductLineService(nil)
  24 + updateProductLineCommand := &command.UpdateProductLineCommand{}
  25 + controller.Unmarshal(updateProductLineCommand)
  26 + lineId, _ := controller.GetInt(":lineId")
  27 + updateProductLineCommand.LineId = lineId
  28 + data, err := productLineService.UpdateProductLine(updateProductLineCommand)
  29 + controller.Response(data, err)
  30 +}
  31 +
  32 +func (controller *ProductLineController) GetProductLine() {
  33 + productLineService := service.NewProductLineService(nil)
  34 + getProductLineQuery := &query.GetProductLineQuery{}
  35 + lineId, _ := controller.GetInt(":lineId")
  36 + getProductLineQuery.LineId = lineId
  37 + data, err := productLineService.GetProductLine(getProductLineQuery)
  38 + controller.Response(data, err)
  39 +}
  40 +
  41 +func (controller *ProductLineController) RemoveProductLine() {
  42 + productLineService := service.NewProductLineService(nil)
  43 + removeProductLineCommand := &command.RemoveProductLineCommand{}
  44 + controller.Unmarshal(removeProductLineCommand)
  45 + lineId, _ := controller.GetInt(":lineId")
  46 + removeProductLineCommand.LineId = lineId
  47 + data, err := productLineService.RemoveProductLine(removeProductLineCommand)
  48 + controller.Response(data, err)
  49 +}
  50 +
  51 +func (controller *ProductLineController) ListProductLine() {
  52 + productLineService := service.NewProductLineService(nil)
  53 + listProductLineQuery := &query.ListProductLineQuery{}
  54 + offset, _ := controller.GetInt("offset")
  55 + listProductLineQuery.Offset = offset
  56 + limit, _ := controller.GetInt("limit")
  57 + listProductLineQuery.Limit = limit
  58 + data, err := productLineService.ListProductLine(listProductLineQuery)
  59 + controller.Response(data, err)
  60 +}
  1 +package controllers
  2 +
  3 +import (
  4 + "github.com/linmadan/egglib-go/web/beego"
  5 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/application/productPlan/command"
  6 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/application/productPlan/query"
  7 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/application/productPlan/service"
  8 +)
  9 +
  10 +type ProductPlanController struct {
  11 + beego.BaseController
  12 +}
  13 +
  14 +func (controller *ProductPlanController) CreateProductPlan() {
  15 + productPlanService := service.NewProductPlanService(nil)
  16 + createProductPlanCommand := &command.CreateProductPlanCommand{}
  17 + controller.Unmarshal(createProductPlanCommand)
  18 + data, err := productPlanService.CreateProductPlan(createProductPlanCommand)
  19 + controller.Response(data, err)
  20 +}
  21 +
  22 +func (controller *ProductPlanController) UpdateProductPlan() {
  23 + productPlanService := service.NewProductPlanService(nil)
  24 + updateProductPlanCommand := &command.UpdateProductPlanCommand{}
  25 + controller.Unmarshal(updateProductPlanCommand)
  26 + productPlanId, _ := controller.GetInt(":productPlanId")
  27 + updateProductPlanCommand.ProductPlanId = productPlanId
  28 + data, err := productPlanService.UpdateProductPlan(updateProductPlanCommand)
  29 + controller.Response(data, err)
  30 +}
  31 +
  32 +func (controller *ProductPlanController) GetProductPlan() {
  33 + productPlanService := service.NewProductPlanService(nil)
  34 + getProductPlanQuery := &query.GetProductPlanQuery{}
  35 + productPlanId, _ := controller.GetInt(":productPlanId")
  36 + getProductPlanQuery.ProductPlanId = productPlanId
  37 + data, err := productPlanService.GetProductPlan(getProductPlanQuery)
  38 + controller.Response(data, err)
  39 +}
  40 +
  41 +func (controller *ProductPlanController) RemoveProductPlan() {
  42 + productPlanService := service.NewProductPlanService(nil)
  43 + removeProductPlanCommand := &command.RemoveProductPlanCommand{}
  44 + controller.Unmarshal(removeProductPlanCommand)
  45 + productPlanId, _ := controller.GetInt(":productPlanId")
  46 + removeProductPlanCommand.ProductPlanId = productPlanId
  47 + data, err := productPlanService.RemoveProductPlan(removeProductPlanCommand)
  48 + controller.Response(data, err)
  49 +}
  50 +
  51 +func (controller *ProductPlanController) ListProductPlan() {
  52 + productPlanService := service.NewProductPlanService(nil)
  53 + listProductPlanQuery := &query.ListProductPlanQuery{}
  54 + offset, _ := controller.GetInt("offset")
  55 + listProductPlanQuery.Offset = offset
  56 + limit, _ := controller.GetInt("limit")
  57 + listProductPlanQuery.Limit = limit
  58 + data, err := productPlanService.ListProductPlan(listProductPlanQuery)
  59 + controller.Response(data, err)
  60 +}
  61 +
  62 +func (controller *ProductPlanController) ReceiveMaterial() {
  63 + productPlanService := service.NewProductPlanService(nil)
  64 + receiveMaterialCommand := &command.ReceiveMaterialCommand{}
  65 + controller.Unmarshal(receiveMaterialCommand)
  66 + data, err := productPlanService.ReceiveMaterial(receiveMaterialCommand)
  67 + controller.Response(data, err)
  68 +}
  69 +
  70 +func (controller *ProductPlanController) ReturnMaterial() {
  71 + productPlanService := service.NewProductPlanService(nil)
  72 + returnMaterialCommand := &command.ReturnMaterialCommand{}
  73 + controller.Unmarshal(returnMaterialCommand)
  74 + data, err := productPlanService.ReturnMaterial(returnMaterialCommand)
  75 + controller.Response(data, err)
  76 +}
  77 +
  78 +func (controller *ProductPlanController) SetOnline() {
  79 + productPlanService := service.NewProductPlanService(nil)
  80 + setOnlineCommand := &command.SetOnlineCommand{}
  81 + controller.Unmarshal(setOnlineCommand)
  82 + data, err := productPlanService.SetOnline(setOnlineCommand)
  83 + controller.Response(data, err)
  84 +}
  85 +
  86 +func (controller *ProductPlanController) Switch() {
  87 + productPlanService := service.NewProductPlanService(nil)
  88 + switchCommand := &command.SwitchCommand{}
  89 + controller.Unmarshal(switchCommand)
  90 + data, err := productPlanService.Switch(switchCommand)
  91 + controller.Response(data, err)
  92 +}
  93 +
  94 +func (controller *ProductPlanController) SubmitProductRecord() {
  95 + productPlanService := service.NewProductPlanService(nil)
  96 + submitProductRecordCommand := &command.SubmitProductRecordCommand{}
  97 + controller.Unmarshal(submitProductRecordCommand)
  98 + data, err := productPlanService.SubmitProductRecord(submitProductRecordCommand)
  99 + controller.Response(data, err)
  100 +}
  1 +package controllers
  2 +
  3 +import (
  4 + "github.com/linmadan/egglib-go/web/beego"
  5 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/application/productSection/command"
  6 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/application/productSection/query"
  7 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/application/productSection/service"
  8 +)
  9 +
  10 +type ProductSectionController struct {
  11 + beego.BaseController
  12 +}
  13 +
  14 +func (controller *ProductSectionController) CreateProductSection() {
  15 + productSectionService := service.NewProductSectionService(nil)
  16 + createProductSectionCommand := &command.CreateProductSectionCommand{}
  17 + controller.Unmarshal(createProductSectionCommand)
  18 + data, err := productSectionService.CreateProductSection(createProductSectionCommand)
  19 + controller.Response(data, err)
  20 +}
  21 +
  22 +func (controller *ProductSectionController) UpdateProductSection() {
  23 + productSectionService := service.NewProductSectionService(nil)
  24 + updateProductSectionCommand := &command.UpdateProductSectionCommand{}
  25 + controller.Unmarshal(updateProductSectionCommand)
  26 + sectionId, _ := controller.GetInt(":sectionId")
  27 + updateProductSectionCommand.SectionId = sectionId
  28 + data, err := productSectionService.UpdateProductSection(updateProductSectionCommand)
  29 + controller.Response(data, err)
  30 +}
  31 +
  32 +func (controller *ProductSectionController) GetProductSection() {
  33 + productSectionService := service.NewProductSectionService(nil)
  34 + getProductSectionQuery := &query.GetProductSectionQuery{}
  35 + sectionId, _ := controller.GetInt(":sectionId")
  36 + getProductSectionQuery.SectionId = sectionId
  37 + data, err := productSectionService.GetProductSection(getProductSectionQuery)
  38 + controller.Response(data, err)
  39 +}
  40 +
  41 +func (controller *ProductSectionController) RemoveProductSection() {
  42 + productSectionService := service.NewProductSectionService(nil)
  43 + removeProductSectionCommand := &command.RemoveProductSectionCommand{}
  44 + controller.Unmarshal(removeProductSectionCommand)
  45 + sectionId, _ := controller.GetInt(":sectionId")
  46 + removeProductSectionCommand.SectionId = sectionId
  47 + data, err := productSectionService.RemoveProductSection(removeProductSectionCommand)
  48 + controller.Response(data, err)
  49 +}
  50 +
  51 +func (controller *ProductSectionController) ListProductSection() {
  52 + productSectionService := service.NewProductSectionService(nil)
  53 + listProductSectionQuery := &query.ListProductSectionQuery{}
  54 + offset, _ := controller.GetInt("offset")
  55 + listProductSectionQuery.Offset = offset
  56 + limit, _ := controller.GetInt("limit")
  57 + listProductSectionQuery.Limit = limit
  58 + data, err := productSectionService.ListProductSection(listProductSectionQuery)
  59 + controller.Response(data, err)
  60 +}
  1 +package controllers
  2 +
  3 +import (
  4 + "github.com/linmadan/egglib-go/web/beego"
  5 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/application/unitConversion/command"
  6 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/application/unitConversion/query"
  7 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/application/unitConversion/service"
  8 +)
  9 +
  10 +type UnitConversionController struct {
  11 + beego.BaseController
  12 +}
  13 +
  14 +func (controller *UnitConversionController) CreateUnitConversion() {
  15 + unitConversionService := service.NewUnitConversionService(nil)
  16 + createUnitConversionCommand := &command.CreateUnitConversionCommand{}
  17 + controller.Unmarshal(createUnitConversionCommand)
  18 + data, err := unitConversionService.CreateUnitConversion(createUnitConversionCommand)
  19 + controller.Response(data, err)
  20 +}
  21 +
  22 +func (controller *UnitConversionController) UpdateUnitConversion() {
  23 + unitConversionService := service.NewUnitConversionService(nil)
  24 + updateUnitConversionCommand := &command.UpdateUnitConversionCommand{}
  25 + controller.Unmarshal(updateUnitConversionCommand)
  26 + unitConversionId, _ := controller.GetInt(":unitConversionId")
  27 + updateUnitConversionCommand.UnitConversionId = unitConversionId
  28 + data, err := unitConversionService.UpdateUnitConversion(updateUnitConversionCommand)
  29 + controller.Response(data, err)
  30 +}
  31 +
  32 +func (controller *UnitConversionController) GetUnitConversion() {
  33 + unitConversionService := service.NewUnitConversionService(nil)
  34 + getUnitConversionQuery := &query.GetUnitConversionQuery{}
  35 + unitConversionId, _ := controller.GetInt(":unitConversionId")
  36 + getUnitConversionQuery.UnitConversionId = unitConversionId
  37 + data, err := unitConversionService.GetUnitConversion(getUnitConversionQuery)
  38 + controller.Response(data, err)
  39 +}
  40 +
  41 +func (controller *UnitConversionController) RemoveUnitConversion() {
  42 + unitConversionService := service.NewUnitConversionService(nil)
  43 + removeUnitConversionCommand := &command.RemoveUnitConversionCommand{}
  44 + controller.Unmarshal(removeUnitConversionCommand)
  45 + unitConversionId, _ := controller.GetInt(":unitConversionId")
  46 + removeUnitConversionCommand.UnitConversionId = unitConversionId
  47 + data, err := unitConversionService.RemoveUnitConversion(removeUnitConversionCommand)
  48 + controller.Response(data, err)
  49 +}
  50 +
  51 +func (controller *UnitConversionController) ListUnitConversion() {
  52 + unitConversionService := service.NewUnitConversionService(nil)
  53 + listUnitConversionQuery := &query.ListUnitConversionQuery{}
  54 + offset, _ := controller.GetInt("offset")
  55 + listUnitConversionQuery.Offset = offset
  56 + limit, _ := controller.GetInt("limit")
  57 + listUnitConversionQuery.Limit = limit
  58 + data, err := unitConversionService.ListUnitConversion(listUnitConversionQuery)
  59 + controller.Response(data, err)
  60 +}
  1 +package controllers
  2 +
  3 +import (
  4 + "github.com/linmadan/egglib-go/web/beego"
  5 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/application/workshop/command"
  6 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/application/workshop/query"
  7 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/application/workshop/service"
  8 +)
  9 +
  10 +type WorkshopController struct {
  11 + beego.BaseController
  12 +}
  13 +
  14 +func (controller *WorkshopController) CreateWorkshop() {
  15 + workshopService := service.NewWorkshopService(nil)
  16 + createWorkshopCommand := &command.CreateWorkshopCommand{}
  17 + controller.Unmarshal(createWorkshopCommand)
  18 + data, err := workshopService.CreateWorkshop(createWorkshopCommand)
  19 + controller.Response(data, err)
  20 +}
  21 +
  22 +func (controller *WorkshopController) UpdateWorkshop() {
  23 + workshopService := service.NewWorkshopService(nil)
  24 + updateWorkshopCommand := &command.UpdateWorkshopCommand{}
  25 + controller.Unmarshal(updateWorkshopCommand)
  26 + workshopId, _ := controller.GetInt(":workshopId")
  27 + updateWorkshopCommand.WorkshopId = workshopId
  28 + data, err := workshopService.UpdateWorkshop(updateWorkshopCommand)
  29 + controller.Response(data, err)
  30 +}
  31 +
  32 +func (controller *WorkshopController) GetWorkshop() {
  33 + workshopService := service.NewWorkshopService(nil)
  34 + getWorkshopQuery := &query.GetWorkshopQuery{}
  35 + workshopId, _ := controller.GetInt(":workshopId")
  36 + getWorkshopQuery.WorkshopId = workshopId
  37 + data, err := workshopService.GetWorkshop(getWorkshopQuery)
  38 + controller.Response(data, err)
  39 +}
  40 +
  41 +func (controller *WorkshopController) RemoveWorkshop() {
  42 + workshopService := service.NewWorkshopService(nil)
  43 + removeWorkshopCommand := &command.RemoveWorkshopCommand{}
  44 + controller.Unmarshal(removeWorkshopCommand)
  45 + workshopId, _ := controller.GetInt(":workshopId")
  46 + removeWorkshopCommand.WorkshopId = workshopId
  47 + data, err := workshopService.RemoveWorkshop(removeWorkshopCommand)
  48 + controller.Response(data, err)
  49 +}
  50 +
  51 +func (controller *WorkshopController) ListWorkshop() {
  52 + workshopService := service.NewWorkshopService(nil)
  53 + listWorkshopQuery := &query.ListWorkshopQuery{}
  54 + offset, _ := controller.GetInt("offset")
  55 + listWorkshopQuery.Offset = offset
  56 + limit, _ := controller.GetInt("limit")
  57 + listWorkshopQuery.Limit = limit
  58 + data, err := workshopService.ListWorkshop(listWorkshopQuery)
  59 + controller.Response(data, err)
  60 +}
  1 +package routers
  2 +
  3 +import (
  4 + "github.com/beego/beego/v2/server/web"
  5 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/port/beego/controllers"
  6 +)
  7 +
  8 +func init() {
  9 + web.Router("/devices/", &controllers.DeviceController{}, "Post:CreateDevice")
  10 + web.Router("/devices/:deviceId", &controllers.DeviceController{}, "Put:UpdateDevice")
  11 + web.Router("/devices/:deviceId", &controllers.DeviceController{}, "Get:GetDevice")
  12 + web.Router("/devices/:deviceId", &controllers.DeviceController{}, "Delete:RemoveDevice")
  13 + web.Router("/devices/", &controllers.DeviceController{}, "Get:ListDevice")
  14 +}
  1 +package routers
  2 +
  3 +import (
  4 + "github.com/beego/beego/v2/server/web"
  5 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/port/beego/controllers"
  6 +)
  7 +
  8 +func init() {
  9 + web.Router("/product-calendars/", &controllers.ProductCalendarController{}, "Post:CreateProductCalendar")
  10 + web.Router("/product-calendars/:productCalendarId", &controllers.ProductCalendarController{}, "Put:UpdateProductCalendar")
  11 + web.Router("/product-calendars/:productCalendarId", &controllers.ProductCalendarController{}, "Get:GetProductCalendar")
  12 + web.Router("/product-calendars/:productCalendarId", &controllers.ProductCalendarController{}, "Delete:RemoveProductCalendar")
  13 + web.Router("/product-calendars/", &controllers.ProductCalendarController{}, "Get:ListProductCalendar")
  14 +}
  1 +package routers
  2 +
  3 +import (
  4 + "github.com/beego/beego/v2/server/web"
  5 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/port/beego/controllers"
  6 +)
  7 +
  8 +func init() {
  9 + web.Router("/product-groups/", &controllers.ProductGroupController{}, "Post:CreateProductGroup")
  10 + web.Router("/product-groups/:productGroupId", &controllers.ProductGroupController{}, "Put:UpdateProductGroup")
  11 + web.Router("/product-groups/:productGroupId", &controllers.ProductGroupController{}, "Get:GetProductGroup")
  12 + web.Router("/product-groups/:productGroupId", &controllers.ProductGroupController{}, "Delete:RemoveProductGroup")
  13 + web.Router("/product-groups/", &controllers.ProductGroupController{}, "Get:ListProductGroup")
  14 +}
  1 +package routers
  2 +
  3 +import (
  4 + "github.com/beego/beego/v2/server/web"
  5 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/port/beego/controllers"
  6 +)
  7 +
  8 +func init() {
  9 + web.Router("/product-jobs/", &controllers.ProductJobController{}, "Post:CreateProductJob")
  10 + web.Router("/product-jobs/:productJobId", &controllers.ProductJobController{}, "Put:UpdateProductJob")
  11 + web.Router("/product-jobs/:productJobId", &controllers.ProductJobController{}, "Get:GetProductJob")
  12 + web.Router("/product-jobs/:productJobId", &controllers.ProductJobController{}, "Delete:RemoveProductJob")
  13 + web.Router("/product-jobs/", &controllers.ProductJobController{}, "Get:ListProductJob")
  14 +}
  1 +package routers
  2 +
  3 +import (
  4 + "github.com/beego/beego/v2/server/web"
  5 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/port/beego/controllers"
  6 +)
  7 +
  8 +func init() {
  9 + web.Router("/product-lines/", &controllers.ProductLineController{}, "Post:CreateProductLine")
  10 + web.Router("/product-lines/:lineId", &controllers.ProductLineController{}, "Put:UpdateProductLine")
  11 + web.Router("/product-lines/:lineId", &controllers.ProductLineController{}, "Get:GetProductLine")
  12 + web.Router("/product-lines/:lineId", &controllers.ProductLineController{}, "Delete:RemoveProductLine")
  13 + web.Router("/product-lines/", &controllers.ProductLineController{}, "Get:ListProductLine")
  14 +}
  1 +package routers
  2 +
  3 +import (
  4 + "github.com/beego/beego/v2/server/web"
  5 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/port/beego/controllers"
  6 +)
  7 +
  8 +func init() {
  9 + web.Router("/product-plans/", &controllers.ProductPlanController{}, "Post:CreateProductPlan")
  10 + web.Router("/product-plans/:productPlanId", &controllers.ProductPlanController{}, "Put:UpdateProductPlan")
  11 + web.Router("/product-plans/:productPlanId", &controllers.ProductPlanController{}, "Get:GetProductPlan")
  12 + web.Router("/product-plans/:productPlanId", &controllers.ProductPlanController{}, "Delete:RemoveProductPlan")
  13 + web.Router("/product-plans/", &controllers.ProductPlanController{}, "Get:ListProductPlan")
  14 + web.Router("/product-plans/receive-material", &controllers.ProductPlanController{}, "Post:ReceiveMaterial")
  15 + web.Router("/product-plans/return-material", &controllers.ProductPlanController{}, "Post:ReturnMaterial")
  16 + web.Router("/product-plans/set-online", &controllers.ProductPlanController{}, "Post:SetOnline")
  17 + web.Router("/product-plans/switch", &controllers.ProductPlanController{}, "Post:Switch")
  18 + web.Router("/product-plans/submit-product-record", &controllers.ProductPlanController{}, "Post:SubmitProductRecord")
  19 +}
  1 +package routers
  2 +
  3 +import (
  4 + "github.com/beego/beego/v2/server/web"
  5 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/port/beego/controllers"
  6 +)
  7 +
  8 +func init() {
  9 + web.Router("/products/", &controllers.ProductController{}, "Post:CreateProduct")
  10 + web.Router("/products/:productId", &controllers.ProductController{}, "Put:UpdateProduct")
  11 + web.Router("/products/:productId", &controllers.ProductController{}, "Get:GetProduct")
  12 + web.Router("/products/:productId", &controllers.ProductController{}, "Delete:RemoveProduct")
  13 + web.Router("/products/", &controllers.ProductController{}, "Get:ListProduct")
  14 +}
  1 +package routers
  2 +
  3 +import (
  4 + "github.com/beego/beego/v2/server/web"
  5 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/port/beego/controllers"
  6 +)
  7 +
  8 +func init() {
  9 + web.Router("/product-sections/", &controllers.ProductSectionController{}, "Post:CreateProductSection")
  10 + web.Router("/product-sections/:sectionId", &controllers.ProductSectionController{}, "Put:UpdateProductSection")
  11 + web.Router("/product-sections/:sectionId", &controllers.ProductSectionController{}, "Get:GetProductSection")
  12 + web.Router("/product-sections/:sectionId", &controllers.ProductSectionController{}, "Delete:RemoveProductSection")
  13 + web.Router("/product-sections/", &controllers.ProductSectionController{}, "Get:ListProductSection")
  14 +}
  1 +package routers
  2 +
  3 +import (
  4 + "github.com/beego/beego/v2/server/web"
  5 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/port/beego/controllers"
  6 +)
  7 +
  8 +func init() {
  9 + web.Router("/unit-conversions/", &controllers.UnitConversionController{}, "Post:CreateUnitConversion")
  10 + web.Router("/unit-conversions/:unitConversionId", &controllers.UnitConversionController{}, "Put:UpdateUnitConversion")
  11 + web.Router("/unit-conversions/:unitConversionId", &controllers.UnitConversionController{}, "Get:GetUnitConversion")
  12 + web.Router("/unit-conversions/:unitConversionId", &controllers.UnitConversionController{}, "Delete:RemoveUnitConversion")
  13 + web.Router("/unit-conversions/", &controllers.UnitConversionController{}, "Get:ListUnitConversion")
  14 +}
  1 +package routers
  2 +
  3 +import (
  4 + "github.com/beego/beego/v2/server/web"
  5 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/port/beego/controllers"
  6 +)
  7 +
  8 +func init() {
  9 + web.Router("/workshops/", &controllers.WorkshopController{}, "Post:CreateWorkshop")
  10 + web.Router("/workshops/:workshopId", &controllers.WorkshopController{}, "Put:UpdateWorkshop")
  11 + web.Router("/workshops/:workshopId", &controllers.WorkshopController{}, "Get:GetWorkshop")
  12 + web.Router("/workshops/:workshopId", &controllers.WorkshopController{}, "Delete:RemoveWorkshop")
  13 + web.Router("/workshops/", &controllers.WorkshopController{}, "Get:ListWorkshop")
  14 +}
  1 +package device
  2 +
  3 +import (
  4 + "net/http"
  5 +
  6 + "github.com/gavv/httpexpect"
  7 + . "github.com/onsi/ginkgo"
  8 + . "github.com/onsi/gomega"
  9 + pG "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg"
  10 +)
  11 +
  12 +var _ = Describe("创建设备服务", func() {
  13 + Describe("提交数据创建设备服务", func() {
  14 + Context("提交正确的新设备数据", func() {
  15 + It("返回设备数据", func() {
  16 + httpExpect := httpexpect.New(GinkgoT(), server.URL)
  17 + body := map[string]interface{}{
  18 + "companyId": "int",
  19 + "orgId": "int",
  20 + "deviceCode": "string",
  21 + "deviceName": "string",
  22 + "deviceModel": "string",
  23 + "deviceType": "string",
  24 + "workshopId": "int",
  25 + "lineId": "int",
  26 + "sectionId": "int",
  27 + "brand": "string",
  28 + "deviceStatus": "int",
  29 + "riskLevel": "int",
  30 + }
  31 + httpExpect.POST("/devices/").
  32 + WithJSON(body).
  33 + Expect().
  34 + Status(http.StatusOK).
  35 + JSON().
  36 + Object().
  37 + ContainsKey("code").ValueEqual("code", 0).
  38 + ContainsKey("msg").ValueEqual("msg", "ok").
  39 + ContainsKey("data").Value("data").Object().
  40 + ContainsKey("deviceId").ValueNotEqual("deviceId", BeZero())
  41 + })
  42 + })
  43 + })
  44 + AfterEach(func() {
  45 + _, err := pG.DB.Exec("DELETE FROM devices WHERE true")
  46 + Expect(err).NotTo(HaveOccurred())
  47 + })
  48 +})
  1 +package device
  2 +
  3 +import (
  4 + "net/http"
  5 + "net/http/httptest"
  6 + "testing"
  7 +
  8 + "github.com/beego/beego/v2/server/web"
  9 + . "github.com/onsi/ginkgo"
  10 + . "github.com/onsi/gomega"
  11 + _ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/application"
  12 + _ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg"
  13 + _ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/port/beego"
  14 +)
  15 +
  16 +func TestDevice(t *testing.T) {
  17 + RegisterFailHandler(Fail)
  18 + RunSpecs(t, "Beego Port Device Correlations Test Case Suite")
  19 +}
  20 +
  21 +var handler http.Handler
  22 +var server *httptest.Server
  23 +
  24 +var _ = BeforeSuite(func() {
  25 + handler = web.BeeApp.Handlers
  26 + server = httptest.NewServer(handler)
  27 +})
  28 +
  29 +var _ = AfterSuite(func() {
  30 + server.Close()
  31 +})
  1 +package device
  2 +
  3 +import (
  4 + "github.com/go-pg/pg/v10"
  5 + "net/http"
  6 +
  7 + "github.com/gavv/httpexpect"
  8 + . "github.com/onsi/ginkgo"
  9 + . "github.com/onsi/gomega"
  10 + pG "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg"
  11 +)
  12 +
  13 +var _ = Describe("返回设备服务", func() {
  14 + var deviceId int64
  15 + BeforeEach(func() {
  16 + _, err := pG.DB.QueryOne(
  17 + pg.Scan(&deviceId),
  18 + "INSERT INTO devices (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) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING device_id",
  19 + "testDeviceId", "testCompanyId", "testOrgId", "testDeviceCode", "testDeviceName", "testDeviceModel", "testDeviceType", "testBrand", "testDeviceStatus", "testRiskLevel", "testCreatedAt", "testUpdatedAt", "testDeletedAt", "testWorkStation")
  20 + Expect(err).NotTo(HaveOccurred())
  21 + })
  22 + Describe("根据deviceId参数返回设备", func() {
  23 + Context("传入有效的deviceId", func() {
  24 + It("返回设备数据", func() {
  25 + httpExpect := httpexpect.New(GinkgoT(), server.URL)
  26 + httpExpect.GET("/devices/{deviceId}").
  27 + Expect().
  28 + Status(http.StatusOK).
  29 + JSON().
  30 + Object().
  31 + ContainsKey("code").ValueEqual("code", 0).
  32 + ContainsKey("msg").ValueEqual("msg", "ok").
  33 + ContainsKey("data").Value("data").Object()
  34 + })
  35 + })
  36 + })
  37 + AfterEach(func() {
  38 + _, err := pG.DB.Exec("DELETE FROM devices WHERE true")
  39 + Expect(err).NotTo(HaveOccurred())
  40 + })
  41 +})
  1 +package device
  2 +
  3 +import (
  4 + "github.com/go-pg/pg/v10"
  5 + "net/http"
  6 +
  7 + "github.com/gavv/httpexpect"
  8 + . "github.com/onsi/ginkgo"
  9 + . "github.com/onsi/gomega"
  10 + pG "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg"
  11 +)
  12 +
  13 +var _ = Describe("返回设备服务列表", func() {
  14 + var deviceId int64
  15 + BeforeEach(func() {
  16 + _, err := pG.DB.QueryOne(
  17 + pg.Scan(&deviceId),
  18 + "INSERT INTO devices (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) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING device_id",
  19 + "testDeviceId", "testCompanyId", "testOrgId", "testDeviceCode", "testDeviceName", "testDeviceModel", "testDeviceType", "testBrand", "testDeviceStatus", "testRiskLevel", "testCreatedAt", "testUpdatedAt", "testDeletedAt", "testWorkStation")
  20 + Expect(err).NotTo(HaveOccurred())
  21 + })
  22 + Describe("根据参数返回设备列表", func() {
  23 + Context("传入有效的参数", func() {
  24 + It("返回设备数据列表", func() {
  25 + httpExpect := httpexpect.New(GinkgoT(), server.URL)
  26 + httpExpect.GET("/devices/").
  27 + WithQuery("offset", "int").
  28 + WithQuery("limit", "int").
  29 + Expect().
  30 + Status(http.StatusOK).
  31 + JSON().
  32 + Object().
  33 + ContainsKey("code").ValueEqual("code", 0).
  34 + ContainsKey("msg").ValueEqual("msg", "ok").
  35 + ContainsKey("data").Value("data").Object().
  36 + ContainsKey("count").ValueEqual("count", 1).
  37 + ContainsKey("devices").Value("devices").Array()
  38 + })
  39 + })
  40 + })
  41 + AfterEach(func() {
  42 + _, err := pG.DB.Exec("DELETE FROM devices WHERE true")
  43 + Expect(err).NotTo(HaveOccurred())
  44 + })
  45 +})
  1 +package device
  2 +
  3 +import (
  4 + "github.com/go-pg/pg/v10"
  5 + "net/http"
  6 +
  7 + "github.com/gavv/httpexpect"
  8 + . "github.com/onsi/ginkgo"
  9 + . "github.com/onsi/gomega"
  10 + pG "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg"
  11 +)
  12 +
  13 +var _ = Describe("移除设备服务", func() {
  14 + var deviceId int64
  15 + BeforeEach(func() {
  16 + _, err := pG.DB.QueryOne(
  17 + pg.Scan(&deviceId),
  18 + "INSERT INTO devices (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) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING device_id",
  19 + "testDeviceId", "testCompanyId", "testOrgId", "testDeviceCode", "testDeviceName", "testDeviceModel", "testDeviceType", "testBrand", "testDeviceStatus", "testRiskLevel", "testCreatedAt", "testUpdatedAt", "testDeletedAt", "testWorkStation")
  20 + Expect(err).NotTo(HaveOccurred())
  21 + })
  22 + Describe("根据参数移除设备服务", func() {
  23 + Context("传入有效的deviceId", func() {
  24 + It("返回被移除设备的数据", func() {
  25 + httpExpect := httpexpect.New(GinkgoT(), server.URL)
  26 + httpExpect.DELETE("/devices/{deviceId}").
  27 + Expect().
  28 + Status(http.StatusOK).
  29 + JSON().
  30 + Object().
  31 + ContainsKey("code").ValueEqual("code", 0).
  32 + ContainsKey("msg").ValueEqual("msg", "ok").
  33 + ContainsKey("data").Value("data").Object()
  34 + })
  35 + })
  36 + })
  37 + AfterEach(func() {
  38 + _, err := pG.DB.Exec("DELETE FROM devices WHERE true")
  39 + Expect(err).NotTo(HaveOccurred())
  40 + })
  41 +})
  1 +package device
  2 +
  3 +import (
  4 + "github.com/go-pg/pg/v10"
  5 + "net/http"
  6 +
  7 + "github.com/gavv/httpexpect"
  8 + . "github.com/onsi/ginkgo"
  9 + . "github.com/onsi/gomega"
  10 + pG "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg"
  11 +)
  12 +
  13 +var _ = Describe("更新设备服务", func() {
  14 + var deviceId int64
  15 + BeforeEach(func() {
  16 + _, err := pG.DB.QueryOne(
  17 + pg.Scan(&deviceId),
  18 + "INSERT INTO devices (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) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING device_id",
  19 + "testDeviceId", "testCompanyId", "testOrgId", "testDeviceCode", "testDeviceName", "testDeviceModel", "testDeviceType", "testBrand", "testDeviceStatus", "testRiskLevel", "testCreatedAt", "testUpdatedAt", "testDeletedAt", "testWorkStation")
  20 + Expect(err).NotTo(HaveOccurred())
  21 + })
  22 + Describe("提交数据更新设备服务", func() {
  23 + Context("提交正确的设备数据", func() {
  24 + It("返回更新后的设备数据", func() {
  25 + httpExpect := httpexpect.New(GinkgoT(), server.URL)
  26 + body := map[string]interface{}{
  27 + "deviceCode": "string",
  28 + "deviceName": "string",
  29 + "deviceModel": "string",
  30 + "deviceType": "string",
  31 + "workshopId": "int",
  32 + "lineId": "int",
  33 + "sectionId": "int",
  34 + "brand": "string",
  35 + "deviceStatus": "int",
  36 + "riskLevel": "int",
  37 + }
  38 + httpExpect.PUT("/devices/{deviceId}").
  39 + WithJSON(body).
  40 + Expect().
  41 + Status(http.StatusOK).
  42 + JSON().
  43 + Object().
  44 + ContainsKey("code").ValueEqual("code", 0).
  45 + ContainsKey("msg").ValueEqual("msg", "ok").
  46 + ContainsKey("data").Value("data").Object().
  47 + ContainsKey("deviceId").ValueEqual("deviceId", deviceId)
  48 + })
  49 + })
  50 + })
  51 + AfterEach(func() {
  52 + _, err := pG.DB.Exec("DELETE FROM devices WHERE true")
  53 + Expect(err).NotTo(HaveOccurred())
  54 + })
  55 +})
  1 +package product
  2 +
  3 +import (
  4 + "net/http"
  5 +
  6 + "github.com/gavv/httpexpect"
  7 + . "github.com/onsi/ginkgo"
  8 + . "github.com/onsi/gomega"
  9 + pG "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg"
  10 +)
  11 +
  12 +var _ = Describe("创建产品服务", func() {
  13 + Describe("提交数据创建产品服务", func() {
  14 + Context("提交正确的新产品信息数据", func() {
  15 + It("返回产品信息数据", func() {
  16 + httpExpect := httpexpect.New(GinkgoT(), server.URL)
  17 + body := map[string]interface{}{
  18 + "companyId": "int",
  19 + "orgId": "int",
  20 + "productCode": "string",
  21 + "productName": "string",
  22 + "productCategory": "string",
  23 + "quantity": "float64",
  24 + "unit": "string",
  25 + "unitWeight": "float64",
  26 + "weight": "float64",
  27 + }
  28 + httpExpect.POST("/products/").
  29 + WithJSON(body).
  30 + Expect().
  31 + Status(http.StatusOK).
  32 + JSON().
  33 + Object().
  34 + ContainsKey("code").ValueEqual("code", 0).
  35 + ContainsKey("msg").ValueEqual("msg", "ok").
  36 + ContainsKey("data").Value("data").Object().
  37 + ContainsKey("productId").ValueNotEqual("productId", BeZero())
  38 + })
  39 + })
  40 + })
  41 + AfterEach(func() {
  42 + _, err := pG.DB.Exec("DELETE FROM products WHERE true")
  43 + Expect(err).NotTo(HaveOccurred())
  44 + })
  45 +})
  1 +package product
  2 +
  3 +import (
  4 + "github.com/go-pg/pg/v10"
  5 + "net/http"
  6 +
  7 + "github.com/gavv/httpexpect"
  8 + . "github.com/onsi/ginkgo"
  9 + . "github.com/onsi/gomega"
  10 + pG "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg"
  11 +)
  12 +
  13 +var _ = Describe("返回产品服务", func() {
  14 + var productId int64
  15 + BeforeEach(func() {
  16 + _, err := pG.DB.QueryOne(
  17 + pg.Scan(&productId),
  18 + "INSERT INTO products (company_id, org_id, product_id, product_code, product_name, product_category, product_spec, created_at, updated_at, deleted_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING product_id",
  19 + "testCompanyId", "testOrgId", "testProductId", "testProductCode", "testProductName", "testProductCategory", "testProductSpec", "testCreatedAt", "testUpdatedAt", "testDeletedAt")
  20 + Expect(err).NotTo(HaveOccurred())
  21 + })
  22 + Describe("根据productId参数返回产品信息", func() {
  23 + Context("传入有效的productId", func() {
  24 + It("返回产品信息数据", func() {
  25 + httpExpect := httpexpect.New(GinkgoT(), server.URL)
  26 + httpExpect.GET("/products/{productId}").
  27 + Expect().
  28 + Status(http.StatusOK).
  29 + JSON().
  30 + Object().
  31 + ContainsKey("code").ValueEqual("code", 0).
  32 + ContainsKey("msg").ValueEqual("msg", "ok").
  33 + ContainsKey("data").Value("data").Object()
  34 + })
  35 + })
  36 + })
  37 + AfterEach(func() {
  38 + _, err := pG.DB.Exec("DELETE FROM products WHERE true")
  39 + Expect(err).NotTo(HaveOccurred())
  40 + })
  41 +})
  1 +package product
  2 +
  3 +import (
  4 + "github.com/go-pg/pg/v10"
  5 + "net/http"
  6 +
  7 + "github.com/gavv/httpexpect"
  8 + . "github.com/onsi/ginkgo"
  9 + . "github.com/onsi/gomega"
  10 + pG "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg"
  11 +)
  12 +
  13 +var _ = Describe("返回产品服务列表", func() {
  14 + var productId int64
  15 + BeforeEach(func() {
  16 + _, err := pG.DB.QueryOne(
  17 + pg.Scan(&productId),
  18 + "INSERT INTO products (company_id, org_id, product_id, product_code, product_name, product_category, product_spec, created_at, updated_at, deleted_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING product_id",
  19 + "testCompanyId", "testOrgId", "testProductId", "testProductCode", "testProductName", "testProductCategory", "testProductSpec", "testCreatedAt", "testUpdatedAt", "testDeletedAt")
  20 + Expect(err).NotTo(HaveOccurred())
  21 + })
  22 + Describe("根据参数返回产品信息列表", func() {
  23 + Context("传入有效的参数", func() {
  24 + It("返回产品信息数据列表", func() {
  25 + httpExpect := httpexpect.New(GinkgoT(), server.URL)
  26 + httpExpect.GET("/products/").
  27 + WithQuery("offset", "int").
  28 + WithQuery("limit", "int").
  29 + Expect().
  30 + Status(http.StatusOK).
  31 + JSON().
  32 + Object().
  33 + ContainsKey("code").ValueEqual("code", 0).
  34 + ContainsKey("msg").ValueEqual("msg", "ok").
  35 + ContainsKey("data").Value("data").Object().
  36 + ContainsKey("count").ValueEqual("count", 1).
  37 + ContainsKey("products").Value("products").Array()
  38 + })
  39 + })
  40 + })
  41 + AfterEach(func() {
  42 + _, err := pG.DB.Exec("DELETE FROM products WHERE true")
  43 + Expect(err).NotTo(HaveOccurred())
  44 + })
  45 +})
  1 +package product
  2 +
  3 +import (
  4 + "net/http"
  5 + "net/http/httptest"
  6 + "testing"
  7 +
  8 + "github.com/beego/beego/v2/server/web"
  9 + . "github.com/onsi/ginkgo"
  10 + . "github.com/onsi/gomega"
  11 + _ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/application"
  12 + _ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg"
  13 + _ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/port/beego"
  14 +)
  15 +
  16 +func TestProduct(t *testing.T) {
  17 + RegisterFailHandler(Fail)
  18 + RunSpecs(t, "Beego Port Product Correlations Test Case Suite")
  19 +}
  20 +
  21 +var handler http.Handler
  22 +var server *httptest.Server
  23 +
  24 +var _ = BeforeSuite(func() {
  25 + handler = web.BeeApp.Handlers
  26 + server = httptest.NewServer(handler)
  27 +})
  28 +
  29 +var _ = AfterSuite(func() {
  30 + server.Close()
  31 +})
  1 +package product
  2 +
  3 +import (
  4 + "github.com/go-pg/pg/v10"
  5 + "net/http"
  6 +
  7 + "github.com/gavv/httpexpect"
  8 + . "github.com/onsi/ginkgo"
  9 + . "github.com/onsi/gomega"
  10 + pG "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg"
  11 +)
  12 +
  13 +var _ = Describe("移除产品服务", func() {
  14 + var productId int64
  15 + BeforeEach(func() {
  16 + _, err := pG.DB.QueryOne(
  17 + pg.Scan(&productId),
  18 + "INSERT INTO products (company_id, org_id, product_id, product_code, product_name, product_category, product_spec, created_at, updated_at, deleted_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING product_id",
  19 + "testCompanyId", "testOrgId", "testProductId", "testProductCode", "testProductName", "testProductCategory", "testProductSpec", "testCreatedAt", "testUpdatedAt", "testDeletedAt")
  20 + Expect(err).NotTo(HaveOccurred())
  21 + })
  22 + Describe("根据参数移除产品服务", func() {
  23 + Context("传入有效的productId", func() {
  24 + It("返回被移除产品信息的数据", func() {
  25 + httpExpect := httpexpect.New(GinkgoT(), server.URL)
  26 + httpExpect.DELETE("/products/{productId}").
  27 + Expect().
  28 + Status(http.StatusOK).
  29 + JSON().
  30 + Object().
  31 + ContainsKey("code").ValueEqual("code", 0).
  32 + ContainsKey("msg").ValueEqual("msg", "ok").
  33 + ContainsKey("data").Value("data").Object()
  34 + })
  35 + })
  36 + })
  37 + AfterEach(func() {
  38 + _, err := pG.DB.Exec("DELETE FROM products WHERE true")
  39 + Expect(err).NotTo(HaveOccurred())
  40 + })
  41 +})
  1 +package product
  2 +
  3 +import (
  4 + "github.com/go-pg/pg/v10"
  5 + "net/http"
  6 +
  7 + "github.com/gavv/httpexpect"
  8 + . "github.com/onsi/ginkgo"
  9 + . "github.com/onsi/gomega"
  10 + pG "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg"
  11 +)
  12 +
  13 +var _ = Describe("更新产品服务", func() {
  14 + var productId int64
  15 + BeforeEach(func() {
  16 + _, err := pG.DB.QueryOne(
  17 + pg.Scan(&productId),
  18 + "INSERT INTO products (company_id, org_id, product_id, product_code, product_name, product_category, product_spec, created_at, updated_at, deleted_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING product_id",
  19 + "testCompanyId", "testOrgId", "testProductId", "testProductCode", "testProductName", "testProductCategory", "testProductSpec", "testCreatedAt", "testUpdatedAt", "testDeletedAt")
  20 + Expect(err).NotTo(HaveOccurred())
  21 + })
  22 + Describe("提交数据更新产品服务", func() {
  23 + Context("提交正确的产品信息数据", func() {
  24 + It("返回更新后的产品信息数据", func() {
  25 + httpExpect := httpexpect.New(GinkgoT(), server.URL)
  26 + body := map[string]interface{}{
  27 + "productCode": "string",
  28 + "productName": "string",
  29 + "productCategory": "string",
  30 + "quantity": "float64",
  31 + "unit": "string",
  32 + "unitWeight": "float64",
  33 + "weight": "float64",
  34 + }
  35 + httpExpect.PUT("/products/{productId}").
  36 + WithJSON(body).
  37 + Expect().
  38 + Status(http.StatusOK).
  39 + JSON().
  40 + Object().
  41 + ContainsKey("code").ValueEqual("code", 0).
  42 + ContainsKey("msg").ValueEqual("msg", "ok").
  43 + ContainsKey("data").Value("data").Object().
  44 + ContainsKey("productId").ValueEqual("productId", productId)
  45 + })
  46 + })
  47 + })
  48 + AfterEach(func() {
  49 + _, err := pG.DB.Exec("DELETE FROM products WHERE true")
  50 + Expect(err).NotTo(HaveOccurred())
  51 + })
  52 +})
  1 +package product_calendar
  2 +
  3 +import (
  4 + "net/http"
  5 +
  6 + "github.com/gavv/httpexpect"
  7 + . "github.com/onsi/ginkgo"
  8 + . "github.com/onsi/gomega"
  9 + pG "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg"
  10 +)
  11 +
  12 +var _ = Describe("创建工厂日历服务", func() {
  13 + Describe("提交数据创建工厂日历服务", func() {
  14 + Context("提交正确的新工厂日历数据", func() {
  15 + It("返回工厂日历数据", func() {
  16 + httpExpect := httpexpect.New(GinkgoT(), server.URL)
  17 + body := map[string]interface{}{
  18 + "companyId": "int",
  19 + "orgId": "int",
  20 + "workshopId": "int",
  21 + "lineId": "int",
  22 + "sectionId": "int",
  23 + "workOn": "int",
  24 + "calendarSelected": "array",
  25 + "inWorkAt": "string",
  26 + "outWorkAt": "string",
  27 + "breakTime": "float64",
  28 + "workTime": "float64",
  29 + }
  30 + httpExpect.POST("/product-calendars/").
  31 + WithJSON(body).
  32 + Expect().
  33 + Status(http.StatusOK).
  34 + JSON().
  35 + Object().
  36 + ContainsKey("code").ValueEqual("code", 0).
  37 + ContainsKey("msg").ValueEqual("msg", "ok").
  38 + ContainsKey("data").Value("data").Object().
  39 + ContainsKey("productCalendarId").ValueNotEqual("productCalendarId", BeZero())
  40 + })
  41 + })
  42 + })
  43 + AfterEach(func() {
  44 + _, err := pG.DB.Exec("DELETE FROM product_calendars WHERE true")
  45 + Expect(err).NotTo(HaveOccurred())
  46 + })
  47 +})
  1 +package product_calendar
  2 +
  3 +import (
  4 + "github.com/go-pg/pg/v10"
  5 + "net/http"
  6 +
  7 + "github.com/gavv/httpexpect"
  8 + . "github.com/onsi/ginkgo"
  9 + . "github.com/onsi/gomega"
  10 + pG "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg"
  11 +)
  12 +
  13 +var _ = Describe("返回工厂日历服务", func() {
  14 + var productCalendarId int64
  15 + BeforeEach(func() {
  16 + _, err := pG.DB.QueryOne(
  17 + pg.Scan(&productCalendarId),
  18 + "INSERT INTO product_calendars (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) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING product_calendar_id",
  19 + "testProductCalendarId", "testCompanyId", "testOrgId", "testWorkStation", "testWorkOn", "testCalendarSelected", "testInWorkAt", "testOutWorkAt", "testBreakTime", "testWorkTime", "testCreatedAt", "testUpdatedAt", "testDeletedAt")
  20 + Expect(err).NotTo(HaveOccurred())
  21 + })
  22 + Describe("根据productCalendarId参数返回工厂日历", func() {
  23 + Context("传入有效的productCalendarId", func() {
  24 + It("返回工厂日历数据", func() {
  25 + httpExpect := httpexpect.New(GinkgoT(), server.URL)
  26 + httpExpect.GET("/product-calendars/{productCalendarId}").
  27 + Expect().
  28 + Status(http.StatusOK).
  29 + JSON().
  30 + Object().
  31 + ContainsKey("code").ValueEqual("code", 0).
  32 + ContainsKey("msg").ValueEqual("msg", "ok").
  33 + ContainsKey("data").Value("data").Object()
  34 + })
  35 + })
  36 + })
  37 + AfterEach(func() {
  38 + _, err := pG.DB.Exec("DELETE FROM product_calendars WHERE true")
  39 + Expect(err).NotTo(HaveOccurred())
  40 + })
  41 +})
  1 +package product_calendar
  2 +
  3 +import (
  4 + "github.com/go-pg/pg/v10"
  5 + "net/http"
  6 +
  7 + "github.com/gavv/httpexpect"
  8 + . "github.com/onsi/ginkgo"
  9 + . "github.com/onsi/gomega"
  10 + pG "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg"
  11 +)
  12 +
  13 +var _ = Describe("返回工厂日历服务列表", func() {
  14 + var productCalendarId int64
  15 + BeforeEach(func() {
  16 + _, err := pG.DB.QueryOne(
  17 + pg.Scan(&productCalendarId),
  18 + "INSERT INTO product_calendars (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) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING product_calendar_id",
  19 + "testProductCalendarId", "testCompanyId", "testOrgId", "testWorkStation", "testWorkOn", "testCalendarSelected", "testInWorkAt", "testOutWorkAt", "testBreakTime", "testWorkTime", "testCreatedAt", "testUpdatedAt", "testDeletedAt")
  20 + Expect(err).NotTo(HaveOccurred())
  21 + })
  22 + Describe("根据参数返回工厂日历列表", func() {
  23 + Context("传入有效的参数", func() {
  24 + It("返回工厂日历数据列表", func() {
  25 + httpExpect := httpexpect.New(GinkgoT(), server.URL)
  26 + httpExpect.GET("/product-calendars/").
  27 + WithQuery("offset", "int").
  28 + WithQuery("limit", "int").
  29 + Expect().
  30 + Status(http.StatusOK).
  31 + JSON().
  32 + Object().
  33 + ContainsKey("code").ValueEqual("code", 0).
  34 + ContainsKey("msg").ValueEqual("msg", "ok").
  35 + ContainsKey("data").Value("data").Object().
  36 + ContainsKey("count").ValueEqual("count", 1).
  37 + ContainsKey("productCalendars").Value("productCalendars").Array()
  38 + })
  39 + })
  40 + })
  41 + AfterEach(func() {
  42 + _, err := pG.DB.Exec("DELETE FROM product_calendars WHERE true")
  43 + Expect(err).NotTo(HaveOccurred())
  44 + })
  45 +})
  1 +package product_calendar
  2 +
  3 +import (
  4 + "net/http"
  5 + "net/http/httptest"
  6 + "testing"
  7 +
  8 + "github.com/beego/beego/v2/server/web"
  9 + . "github.com/onsi/ginkgo"
  10 + . "github.com/onsi/gomega"
  11 + _ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/application"
  12 + _ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg"
  13 + _ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/port/beego"
  14 +)
  15 +
  16 +func TestProductCalendar(t *testing.T) {
  17 + RegisterFailHandler(Fail)
  18 + RunSpecs(t, "Beego Port ProductCalendar Correlations Test Case Suite")
  19 +}
  20 +
  21 +var handler http.Handler
  22 +var server *httptest.Server
  23 +
  24 +var _ = BeforeSuite(func() {
  25 + handler = web.BeeApp.Handlers
  26 + server = httptest.NewServer(handler)
  27 +})
  28 +
  29 +var _ = AfterSuite(func() {
  30 + server.Close()
  31 +})
  1 +package product_calendar
  2 +
  3 +import (
  4 + "github.com/go-pg/pg/v10"
  5 + "net/http"
  6 +
  7 + "github.com/gavv/httpexpect"
  8 + . "github.com/onsi/ginkgo"
  9 + . "github.com/onsi/gomega"
  10 + pG "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg"
  11 +)
  12 +
  13 +var _ = Describe("移除工厂日历服务", func() {
  14 + var productCalendarId int64
  15 + BeforeEach(func() {
  16 + _, err := pG.DB.QueryOne(
  17 + pg.Scan(&productCalendarId),
  18 + "INSERT INTO product_calendars (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) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING product_calendar_id",
  19 + "testProductCalendarId", "testCompanyId", "testOrgId", "testWorkStation", "testWorkOn", "testCalendarSelected", "testInWorkAt", "testOutWorkAt", "testBreakTime", "testWorkTime", "testCreatedAt", "testUpdatedAt", "testDeletedAt")
  20 + Expect(err).NotTo(HaveOccurred())
  21 + })
  22 + Describe("根据参数移除工厂日历服务", func() {
  23 + Context("传入有效的productCalendarId", func() {
  24 + It("返回被移除工厂日历的数据", func() {
  25 + httpExpect := httpexpect.New(GinkgoT(), server.URL)
  26 + httpExpect.DELETE("/product-calendars/{productCalendarId}").
  27 + Expect().
  28 + Status(http.StatusOK).
  29 + JSON().
  30 + Object().
  31 + ContainsKey("code").ValueEqual("code", 0).
  32 + ContainsKey("msg").ValueEqual("msg", "ok").
  33 + ContainsKey("data").Value("data").Object()
  34 + })
  35 + })
  36 + })
  37 + AfterEach(func() {
  38 + _, err := pG.DB.Exec("DELETE FROM product_calendars WHERE true")
  39 + Expect(err).NotTo(HaveOccurred())
  40 + })
  41 +})
  1 +package product_calendar
  2 +
  3 +import (
  4 + "github.com/go-pg/pg/v10"
  5 + "net/http"
  6 +
  7 + "github.com/gavv/httpexpect"
  8 + . "github.com/onsi/ginkgo"
  9 + . "github.com/onsi/gomega"
  10 + pG "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg"
  11 +)
  12 +
  13 +var _ = Describe("更新工厂日历服务", func() {
  14 + var productCalendarId int64
  15 + BeforeEach(func() {
  16 + _, err := pG.DB.QueryOne(
  17 + pg.Scan(&productCalendarId),
  18 + "INSERT INTO product_calendars (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) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING product_calendar_id",
  19 + "testProductCalendarId", "testCompanyId", "testOrgId", "testWorkStation", "testWorkOn", "testCalendarSelected", "testInWorkAt", "testOutWorkAt", "testBreakTime", "testWorkTime", "testCreatedAt", "testUpdatedAt", "testDeletedAt")
  20 + Expect(err).NotTo(HaveOccurred())
  21 + })
  22 + Describe("提交数据更新工厂日历服务", func() {
  23 + Context("提交正确的工厂日历数据", func() {
  24 + It("返回更新后的工厂日历数据", func() {
  25 + httpExpect := httpexpect.New(GinkgoT(), server.URL)
  26 + body := map[string]interface{}{
  27 + "workshopId": "int",
  28 + "lineId": "int",
  29 + "sectionId": "int",
  30 + "workOn": "int",
  31 + "calendarSelected": "array",
  32 + "inWorkAt": "string",
  33 + "outWorkAt": "string",
  34 + "breakTime": "float64",
  35 + "workTime": "float64",
  36 + }
  37 + httpExpect.PUT("/product-calendars/{productCalendarId}").
  38 + WithJSON(body).
  39 + Expect().
  40 + Status(http.StatusOK).
  41 + JSON().
  42 + Object().
  43 + ContainsKey("code").ValueEqual("code", 0).
  44 + ContainsKey("msg").ValueEqual("msg", "ok").
  45 + ContainsKey("data").Value("data").Object().
  46 + ContainsKey("productCalendarId").ValueEqual("productCalendarId", productCalendarId)
  47 + })
  48 + })
  49 + })
  50 + AfterEach(func() {
  51 + _, err := pG.DB.Exec("DELETE FROM product_calendars WHERE true")
  52 + Expect(err).NotTo(HaveOccurred())
  53 + })
  54 +})
  1 +package product_group
  2 +
  3 +import (
  4 + "net/http"
  5 +
  6 + "github.com/gavv/httpexpect"
  7 + . "github.com/onsi/ginkgo"
  8 + . "github.com/onsi/gomega"
  9 + pG "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg"
  10 +)
  11 +
  12 +var _ = Describe("创建生产班组服务", func() {
  13 + Describe("提交数据创建生产班组服务", func() {
  14 + Context("提交正确的新生产班组数据", func() {
  15 + It("返回生产班组数据", func() {
  16 + httpExpect := httpexpect.New(GinkgoT(), server.URL)
  17 + body := map[string]interface{}{
  18 + "companyId": "int",
  19 + "orgId": "int",
  20 + "workshopId": "int",
  21 + "lineId": "int",
  22 + "sectionId": "int",
  23 + "groupName": "string",
  24 + "userId": "int",
  25 + "userName": "string",
  26 + "employeeType": "int",
  27 + "icCardNumber": "string",
  28 + "avatar": "string",
  29 + "phone": "string",
  30 + "groupMembers": "array",
  31 + "workOn": "int",
  32 + }
  33 + httpExpect.POST("/product-groups/").
  34 + WithJSON(body).
  35 + Expect().
  36 + Status(http.StatusOK).
  37 + JSON().
  38 + Object().
  39 + ContainsKey("code").ValueEqual("code", 0).
  40 + ContainsKey("msg").ValueEqual("msg", "ok").
  41 + ContainsKey("data").Value("data").Object().
  42 + ContainsKey("productGroupId").ValueNotEqual("productGroupId", BeZero())
  43 + })
  44 + })
  45 + })
  46 + AfterEach(func() {
  47 + _, err := pG.DB.Exec("DELETE FROM product_groups WHERE true")
  48 + Expect(err).NotTo(HaveOccurred())
  49 + })
  50 +})
  1 +package product_group
  2 +
  3 +import (
  4 + "github.com/go-pg/pg/v10"
  5 + "net/http"
  6 +
  7 + "github.com/gavv/httpexpect"
  8 + . "github.com/onsi/ginkgo"
  9 + . "github.com/onsi/gomega"
  10 + pG "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg"
  11 +)
  12 +
  13 +var _ = Describe("返回生产班组服务", func() {
  14 + var productGroupId int64
  15 + BeforeEach(func() {
  16 + _, err := pG.DB.QueryOne(
  17 + pg.Scan(&productGroupId),
  18 + "INSERT INTO product_groups (product_group_id, company_id, org_id, group_name, group_leader, group_members, work_on, work_station, created_at, updated_at, deleted_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING product_group_id",
  19 + "testProductGroupId", "testCompanyId", "testOrgId", "testGroupName", "testGroupLeader", "testGroupMembers", "testWorkOn", "testWorkStation", "testCreatedAt", "testUpdatedAt", "testDeletedAt")
  20 + Expect(err).NotTo(HaveOccurred())
  21 + })
  22 + Describe("根据productGroupId参数返回生产班组", func() {
  23 + Context("传入有效的productGroupId", func() {
  24 + It("返回生产班组数据", func() {
  25 + httpExpect := httpexpect.New(GinkgoT(), server.URL)
  26 + httpExpect.GET("/product-groups/{productGroupId}").
  27 + Expect().
  28 + Status(http.StatusOK).
  29 + JSON().
  30 + Object().
  31 + ContainsKey("code").ValueEqual("code", 0).
  32 + ContainsKey("msg").ValueEqual("msg", "ok").
  33 + ContainsKey("data").Value("data").Object()
  34 + })
  35 + })
  36 + })
  37 + AfterEach(func() {
  38 + _, err := pG.DB.Exec("DELETE FROM product_groups WHERE true")
  39 + Expect(err).NotTo(HaveOccurred())
  40 + })
  41 +})
  1 +package product_group
  2 +
  3 +import (
  4 + "github.com/go-pg/pg/v10"
  5 + "net/http"
  6 +
  7 + "github.com/gavv/httpexpect"
  8 + . "github.com/onsi/ginkgo"
  9 + . "github.com/onsi/gomega"
  10 + pG "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg"
  11 +)
  12 +
  13 +var _ = Describe("返回生产班组服务列表", func() {
  14 + var productGroupId int64
  15 + BeforeEach(func() {
  16 + _, err := pG.DB.QueryOne(
  17 + pg.Scan(&productGroupId),
  18 + "INSERT INTO product_groups (product_group_id, company_id, org_id, group_name, group_leader, group_members, work_on, work_station, created_at, updated_at, deleted_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING product_group_id",
  19 + "testProductGroupId", "testCompanyId", "testOrgId", "testGroupName", "testGroupLeader", "testGroupMembers", "testWorkOn", "testWorkStation", "testCreatedAt", "testUpdatedAt", "testDeletedAt")
  20 + Expect(err).NotTo(HaveOccurred())
  21 + })
  22 + Describe("根据参数返回生产班组列表", func() {
  23 + Context("传入有效的参数", func() {
  24 + It("返回生产班组数据列表", func() {
  25 + httpExpect := httpexpect.New(GinkgoT(), server.URL)
  26 + httpExpect.GET("/product-groups/").
  27 + WithQuery("offset", "int").
  28 + WithQuery("limit", "int").
  29 + Expect().
  30 + Status(http.StatusOK).
  31 + JSON().
  32 + Object().
  33 + ContainsKey("code").ValueEqual("code", 0).
  34 + ContainsKey("msg").ValueEqual("msg", "ok").
  35 + ContainsKey("data").Value("data").Object().
  36 + ContainsKey("count").ValueEqual("count", 1).
  37 + ContainsKey("productGroups").Value("productGroups").Array()
  38 + })
  39 + })
  40 + })
  41 + AfterEach(func() {
  42 + _, err := pG.DB.Exec("DELETE FROM product_groups WHERE true")
  43 + Expect(err).NotTo(HaveOccurred())
  44 + })
  45 +})
  1 +package product_group
  2 +
  3 +import (
  4 + "net/http"
  5 + "net/http/httptest"
  6 + "testing"
  7 +
  8 + "github.com/beego/beego/v2/server/web"
  9 + . "github.com/onsi/ginkgo"
  10 + . "github.com/onsi/gomega"
  11 + _ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/application"
  12 + _ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg"
  13 + _ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/port/beego"
  14 +)
  15 +
  16 +func TestProductGroup(t *testing.T) {
  17 + RegisterFailHandler(Fail)
  18 + RunSpecs(t, "Beego Port ProductGroup Correlations Test Case Suite")
  19 +}
  20 +
  21 +var handler http.Handler
  22 +var server *httptest.Server
  23 +
  24 +var _ = BeforeSuite(func() {
  25 + handler = web.BeeApp.Handlers
  26 + server = httptest.NewServer(handler)
  27 +})
  28 +
  29 +var _ = AfterSuite(func() {
  30 + server.Close()
  31 +})
  1 +package product_group
  2 +
  3 +import (
  4 + "github.com/go-pg/pg/v10"
  5 + "net/http"
  6 +
  7 + "github.com/gavv/httpexpect"
  8 + . "github.com/onsi/ginkgo"
  9 + . "github.com/onsi/gomega"
  10 + pG "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg"
  11 +)
  12 +
  13 +var _ = Describe("移除生产班组服务", func() {
  14 + var productGroupId int64
  15 + BeforeEach(func() {
  16 + _, err := pG.DB.QueryOne(
  17 + pg.Scan(&productGroupId),
  18 + "INSERT INTO product_groups (product_group_id, company_id, org_id, group_name, group_leader, group_members, work_on, work_station, created_at, updated_at, deleted_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING product_group_id",
  19 + "testProductGroupId", "testCompanyId", "testOrgId", "testGroupName", "testGroupLeader", "testGroupMembers", "testWorkOn", "testWorkStation", "testCreatedAt", "testUpdatedAt", "testDeletedAt")
  20 + Expect(err).NotTo(HaveOccurred())
  21 + })
  22 + Describe("根据参数移除生产班组服务", func() {
  23 + Context("传入有效的productGroupId", func() {
  24 + It("返回被移除生产班组的数据", func() {
  25 + httpExpect := httpexpect.New(GinkgoT(), server.URL)
  26 + httpExpect.DELETE("/product-groups/{productGroupId}").
  27 + Expect().
  28 + Status(http.StatusOK).
  29 + JSON().
  30 + Object().
  31 + ContainsKey("code").ValueEqual("code", 0).
  32 + ContainsKey("msg").ValueEqual("msg", "ok").
  33 + ContainsKey("data").Value("data").Object()
  34 + })
  35 + })
  36 + })
  37 + AfterEach(func() {
  38 + _, err := pG.DB.Exec("DELETE FROM product_groups WHERE true")
  39 + Expect(err).NotTo(HaveOccurred())
  40 + })
  41 +})
  1 +package product_group
  2 +
  3 +import (
  4 + "github.com/go-pg/pg/v10"
  5 + "net/http"
  6 +
  7 + "github.com/gavv/httpexpect"
  8 + . "github.com/onsi/ginkgo"
  9 + . "github.com/onsi/gomega"
  10 + pG "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg"
  11 +)
  12 +
  13 +var _ = Describe("更新生产班组服务", func() {
  14 + var productGroupId int64
  15 + BeforeEach(func() {
  16 + _, err := pG.DB.QueryOne(
  17 + pg.Scan(&productGroupId),
  18 + "INSERT INTO product_groups (product_group_id, company_id, org_id, group_name, group_leader, group_members, work_on, work_station, created_at, updated_at, deleted_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING product_group_id",
  19 + "testProductGroupId", "testCompanyId", "testOrgId", "testGroupName", "testGroupLeader", "testGroupMembers", "testWorkOn", "testWorkStation", "testCreatedAt", "testUpdatedAt", "testDeletedAt")
  20 + Expect(err).NotTo(HaveOccurred())
  21 + })
  22 + Describe("提交数据更新生产班组服务", func() {
  23 + Context("提交正确的生产班组数据", func() {
  24 + It("返回更新后的生产班组数据", func() {
  25 + httpExpect := httpexpect.New(GinkgoT(), server.URL)
  26 + body := map[string]interface{}{
  27 + "workshopId": "int",
  28 + "lineId": "int",
  29 + "sectionId": "int",
  30 + "groupName": "string",
  31 + "userId": "int",
  32 + "userName": "string",
  33 + "employeeType": "int",
  34 + "icCardNumber": "string",
  35 + "avatar": "string",
  36 + "phone": "string",
  37 + "groupMembers": "array",
  38 + "workOn": "int",
  39 + }
  40 + httpExpect.PUT("/product-groups/{productGroupId}").
  41 + WithJSON(body).
  42 + Expect().
  43 + Status(http.StatusOK).
  44 + JSON().
  45 + Object().
  46 + ContainsKey("code").ValueEqual("code", 0).
  47 + ContainsKey("msg").ValueEqual("msg", "ok").
  48 + ContainsKey("data").Value("data").Object().
  49 + ContainsKey("productGroupId").ValueEqual("productGroupId", productGroupId)
  50 + })
  51 + })
  52 + })
  53 + AfterEach(func() {
  54 + _, err := pG.DB.Exec("DELETE FROM product_groups WHERE true")
  55 + Expect(err).NotTo(HaveOccurred())
  56 + })
  57 +})
  1 +package product_job
  2 +
  3 +import (
  4 + "net/http"
  5 +
  6 + "github.com/gavv/httpexpect"
  7 + . "github.com/onsi/ginkgo"
  8 + . "github.com/onsi/gomega"
  9 + pG "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg"
  10 +)
  11 +
  12 +var _ = Describe("创建工位服务", func() {
  13 + Describe("提交数据创建工位服务", func() {
  14 + Context("提交正确的新工位(车间-生产线-工段-工位)数据", func() {
  15 + It("返回工位(车间-生产线-工段-工位)数据", func() {
  16 + httpExpect := httpexpect.New(GinkgoT(), server.URL)
  17 + body := map[string]interface{}{
  18 + "companyId": "int",
  19 + "orgId": "int",
  20 + "jobName": "string",
  21 + "workshopId": "int",
  22 + "lineId": "int",
  23 + "sectionId": "int",
  24 + "relatedDevices": "array",
  25 + }
  26 + httpExpect.POST("/product-jobs/").
  27 + WithJSON(body).
  28 + Expect().
  29 + Status(http.StatusOK).
  30 + JSON().
  31 + Object().
  32 + ContainsKey("code").ValueEqual("code", 0).
  33 + ContainsKey("msg").ValueEqual("msg", "ok").
  34 + ContainsKey("data").Value("data").Object().
  35 + ContainsKey("productJobId").ValueNotEqual("productJobId", BeZero())
  36 + })
  37 + })
  38 + })
  39 + AfterEach(func() {
  40 + _, err := pG.DB.Exec("DELETE FROM product_jobs WHERE true")
  41 + Expect(err).NotTo(HaveOccurred())
  42 + })
  43 +})
  1 +package product_job
  2 +
  3 +import (
  4 + "github.com/go-pg/pg/v10"
  5 + "net/http"
  6 +
  7 + "github.com/gavv/httpexpect"
  8 + . "github.com/onsi/ginkgo"
  9 + . "github.com/onsi/gomega"
  10 + pG "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg"
  11 +)
  12 +
  13 +var _ = Describe("返回工位服务", func() {
  14 + var productJobId int64
  15 + BeforeEach(func() {
  16 + _, err := pG.DB.QueryOne(
  17 + pg.Scan(&productJobId),
  18 + "INSERT INTO product_jobs (product_job_id, company_id, org_id, job_name, created_at, updated_at, deleted_at, work_station, related_devices) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING product_job_id",
  19 + "testProductJobId", "testCompanyId", "testOrgId", "testJobName", "testCreatedAt", "testUpdatedAt", "testDeletedAt", "testWorkStation", "testRelatedDevices")
  20 + Expect(err).NotTo(HaveOccurred())
  21 + })
  22 + Describe("根据productJobId参数返回工位(车间-生产线-工段-工位)", func() {
  23 + Context("传入有效的productJobId", func() {
  24 + It("返回工位(车间-生产线-工段-工位)数据", func() {
  25 + httpExpect := httpexpect.New(GinkgoT(), server.URL)
  26 + httpExpect.GET("/product-jobs/{productJobId}").
  27 + Expect().
  28 + Status(http.StatusOK).
  29 + JSON().
  30 + Object().
  31 + ContainsKey("code").ValueEqual("code", 0).
  32 + ContainsKey("msg").ValueEqual("msg", "ok").
  33 + ContainsKey("data").Value("data").Object()
  34 + })
  35 + })
  36 + })
  37 + AfterEach(func() {
  38 + _, err := pG.DB.Exec("DELETE FROM product_jobs WHERE true")
  39 + Expect(err).NotTo(HaveOccurred())
  40 + })
  41 +})
  1 +package product_job
  2 +
  3 +import (
  4 + "github.com/go-pg/pg/v10"
  5 + "net/http"
  6 +
  7 + "github.com/gavv/httpexpect"
  8 + . "github.com/onsi/ginkgo"
  9 + . "github.com/onsi/gomega"
  10 + pG "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg"
  11 +)
  12 +
  13 +var _ = Describe("返回工位服务列表", func() {
  14 + var productJobId int64
  15 + BeforeEach(func() {
  16 + _, err := pG.DB.QueryOne(
  17 + pg.Scan(&productJobId),
  18 + "INSERT INTO product_jobs (product_job_id, company_id, org_id, job_name, created_at, updated_at, deleted_at, work_station, related_devices) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING product_job_id",
  19 + "testProductJobId", "testCompanyId", "testOrgId", "testJobName", "testCreatedAt", "testUpdatedAt", "testDeletedAt", "testWorkStation", "testRelatedDevices")
  20 + Expect(err).NotTo(HaveOccurred())
  21 + })
  22 + Describe("根据参数返回工位(车间-生产线-工段-工位)列表", func() {
  23 + Context("传入有效的参数", func() {
  24 + It("返回工位(车间-生产线-工段-工位)数据列表", func() {
  25 + httpExpect := httpexpect.New(GinkgoT(), server.URL)
  26 + httpExpect.GET("/product-jobs/").
  27 + WithQuery("offset", "int").
  28 + WithQuery("limit", "int").
  29 + Expect().
  30 + Status(http.StatusOK).
  31 + JSON().
  32 + Object().
  33 + ContainsKey("code").ValueEqual("code", 0).
  34 + ContainsKey("msg").ValueEqual("msg", "ok").
  35 + ContainsKey("data").Value("data").Object().
  36 + ContainsKey("count").ValueEqual("count", 1).
  37 + ContainsKey("productJobs").Value("productJobs").Array()
  38 + })
  39 + })
  40 + })
  41 + AfterEach(func() {
  42 + _, err := pG.DB.Exec("DELETE FROM product_jobs WHERE true")
  43 + Expect(err).NotTo(HaveOccurred())
  44 + })
  45 +})
  1 +package product_job
  2 +
  3 +import (
  4 + "net/http"
  5 + "net/http/httptest"
  6 + "testing"
  7 +
  8 + "github.com/beego/beego/v2/server/web"
  9 + . "github.com/onsi/ginkgo"
  10 + . "github.com/onsi/gomega"
  11 + _ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/application"
  12 + _ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg"
  13 + _ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/port/beego"
  14 +)
  15 +
  16 +func TestProductJob(t *testing.T) {
  17 + RegisterFailHandler(Fail)
  18 + RunSpecs(t, "Beego Port ProductJob Correlations Test Case Suite")
  19 +}
  20 +
  21 +var handler http.Handler
  22 +var server *httptest.Server
  23 +
  24 +var _ = BeforeSuite(func() {
  25 + handler = web.BeeApp.Handlers
  26 + server = httptest.NewServer(handler)
  27 +})
  28 +
  29 +var _ = AfterSuite(func() {
  30 + server.Close()
  31 +})
  1 +package product_job
  2 +
  3 +import (
  4 + "github.com/go-pg/pg/v10"
  5 + "net/http"
  6 +
  7 + "github.com/gavv/httpexpect"
  8 + . "github.com/onsi/ginkgo"
  9 + . "github.com/onsi/gomega"
  10 + pG "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg"
  11 +)
  12 +
  13 +var _ = Describe("移除工位服务", func() {
  14 + var productJobId int64
  15 + BeforeEach(func() {
  16 + _, err := pG.DB.QueryOne(
  17 + pg.Scan(&productJobId),
  18 + "INSERT INTO product_jobs (product_job_id, company_id, org_id, job_name, created_at, updated_at, deleted_at, work_station, related_devices) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING product_job_id",
  19 + "testProductJobId", "testCompanyId", "testOrgId", "testJobName", "testCreatedAt", "testUpdatedAt", "testDeletedAt", "testWorkStation", "testRelatedDevices")
  20 + Expect(err).NotTo(HaveOccurred())
  21 + })
  22 + Describe("根据参数移除工位服务", func() {
  23 + Context("传入有效的productJobId", func() {
  24 + It("返回被移除工位(车间-生产线-工段-工位)的数据", func() {
  25 + httpExpect := httpexpect.New(GinkgoT(), server.URL)
  26 + httpExpect.DELETE("/product-jobs/{productJobId}").
  27 + Expect().
  28 + Status(http.StatusOK).
  29 + JSON().
  30 + Object().
  31 + ContainsKey("code").ValueEqual("code", 0).
  32 + ContainsKey("msg").ValueEqual("msg", "ok").
  33 + ContainsKey("data").Value("data").Object()
  34 + })
  35 + })
  36 + })
  37 + AfterEach(func() {
  38 + _, err := pG.DB.Exec("DELETE FROM product_jobs WHERE true")
  39 + Expect(err).NotTo(HaveOccurred())
  40 + })
  41 +})
  1 +package product_job
  2 +
  3 +import (
  4 + "github.com/go-pg/pg/v10"
  5 + "net/http"
  6 +
  7 + "github.com/gavv/httpexpect"
  8 + . "github.com/onsi/ginkgo"
  9 + . "github.com/onsi/gomega"
  10 + pG "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg"
  11 +)
  12 +
  13 +var _ = Describe("更新工位服务", func() {
  14 + var productJobId int64
  15 + BeforeEach(func() {
  16 + _, err := pG.DB.QueryOne(
  17 + pg.Scan(&productJobId),
  18 + "INSERT INTO product_jobs (product_job_id, company_id, org_id, job_name, created_at, updated_at, deleted_at, work_station, related_devices) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING product_job_id",
  19 + "testProductJobId", "testCompanyId", "testOrgId", "testJobName", "testCreatedAt", "testUpdatedAt", "testDeletedAt", "testWorkStation", "testRelatedDevices")
  20 + Expect(err).NotTo(HaveOccurred())
  21 + })
  22 + Describe("提交数据更新工位服务", func() {
  23 + Context("提交正确的工位(车间-生产线-工段-工位)数据", func() {
  24 + It("返回更新后的工位(车间-生产线-工段-工位)数据", func() {
  25 + httpExpect := httpexpect.New(GinkgoT(), server.URL)
  26 + body := map[string]interface{}{
  27 + "jobName": "string",
  28 + "workshopId": "int",
  29 + "lineId": "int",
  30 + "sectionId": "int",
  31 + "relatedDevices": "array",
  32 + }
  33 + httpExpect.PUT("/product-jobs/{productJobId}").
  34 + WithJSON(body).
  35 + Expect().
  36 + Status(http.StatusOK).
  37 + JSON().
  38 + Object().
  39 + ContainsKey("code").ValueEqual("code", 0).
  40 + ContainsKey("msg").ValueEqual("msg", "ok").
  41 + ContainsKey("data").Value("data").Object().
  42 + ContainsKey("productJobId").ValueEqual("productJobId", productJobId)
  43 + })
  44 + })
  45 + })
  46 + AfterEach(func() {
  47 + _, err := pG.DB.Exec("DELETE FROM product_jobs WHERE true")
  48 + Expect(err).NotTo(HaveOccurred())
  49 + })
  50 +})
  1 +package product_line
  2 +
  3 +import (
  4 + "net/http"
  5 +
  6 + "github.com/gavv/httpexpect"
  7 + . "github.com/onsi/ginkgo"
  8 + . "github.com/onsi/gomega"
  9 + pG "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg"
  10 +)
  11 +
  12 +var _ = Describe("创建生产线", func() {
  13 + Describe("提交数据创建生产线", func() {
  14 + Context("提交正确的新生产线数据", func() {
  15 + It("返回生产线数据", func() {
  16 + httpExpect := httpexpect.New(GinkgoT(), server.URL)
  17 + body := map[string]interface{}{
  18 + "workshopId": "int",
  19 + "lineName": "string",
  20 + }
  21 + httpExpect.POST("/product-lines/").
  22 + WithJSON(body).
  23 + Expect().
  24 + Status(http.StatusOK).
  25 + JSON().
  26 + Object().
  27 + ContainsKey("code").ValueEqual("code", 0).
  28 + ContainsKey("msg").ValueEqual("msg", "ok").
  29 + ContainsKey("data").Value("data").Object().
  30 + ContainsKey("productLineId").ValueNotEqual("productLineId", BeZero())
  31 + })
  32 + })
  33 + })
  34 + AfterEach(func() {
  35 + _, err := pG.DB.Exec("DELETE FROM product_lines WHERE true")
  36 + Expect(err).NotTo(HaveOccurred())
  37 + })
  38 +})
  1 +package product_line
  2 +
  3 +import (
  4 + "github.com/go-pg/pg/v10"
  5 + "net/http"
  6 +
  7 + "github.com/gavv/httpexpect"
  8 + . "github.com/onsi/ginkgo"
  9 + . "github.com/onsi/gomega"
  10 + pG "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg"
  11 +)
  12 +
  13 +var _ = Describe("返回生产线", func() {
  14 + var productLineId int64
  15 + BeforeEach(func() {
  16 + _, err := pG.DB.QueryOne(
  17 + pg.Scan(&productLineId),
  18 + "INSERT INTO product_lines (line_id, line_name, product_sections) VALUES (?, ?, ?) RETURNING product_line_id",
  19 + "testLineId", "testLineName", "testProductSections")
  20 + Expect(err).NotTo(HaveOccurred())
  21 + })
  22 + Describe("根据productLineId参数返回生产线", func() {
  23 + Context("传入有效的productLineId", func() {
  24 + It("返回生产线数据", func() {
  25 + httpExpect := httpexpect.New(GinkgoT(), server.URL)
  26 + httpExpect.GET("/product-lines/{lineId}").
  27 + Expect().
  28 + Status(http.StatusOK).
  29 + JSON().
  30 + Object().
  31 + ContainsKey("code").ValueEqual("code", 0).
  32 + ContainsKey("msg").ValueEqual("msg", "ok").
  33 + ContainsKey("data").Value("data").Object()
  34 + })
  35 + })
  36 + })
  37 + AfterEach(func() {
  38 + _, err := pG.DB.Exec("DELETE FROM product_lines WHERE true")
  39 + Expect(err).NotTo(HaveOccurred())
  40 + })
  41 +})
  1 +package product_line
  2 +
  3 +import (
  4 + "github.com/go-pg/pg/v10"
  5 + "net/http"
  6 +
  7 + "github.com/gavv/httpexpect"
  8 + . "github.com/onsi/ginkgo"
  9 + . "github.com/onsi/gomega"
  10 + pG "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg"
  11 +)
  12 +
  13 +var _ = Describe("返回生产线列表", func() {
  14 + var productLineId int64
  15 + BeforeEach(func() {
  16 + _, err := pG.DB.QueryOne(
  17 + pg.Scan(&productLineId),
  18 + "INSERT INTO product_lines (line_id, line_name, product_sections) VALUES (?, ?, ?) RETURNING product_line_id",
  19 + "testLineId", "testLineName", "testProductSections")
  20 + Expect(err).NotTo(HaveOccurred())
  21 + })
  22 + Describe("根据参数返回生产线列表", func() {
  23 + Context("传入有效的参数", func() {
  24 + It("返回生产线数据列表", func() {
  25 + httpExpect := httpexpect.New(GinkgoT(), server.URL)
  26 + httpExpect.GET("/product-lines/").
  27 + WithQuery("offset", "int").
  28 + WithQuery("limit", "int").
  29 + Expect().
  30 + Status(http.StatusOK).
  31 + JSON().
  32 + Object().
  33 + ContainsKey("code").ValueEqual("code", 0).
  34 + ContainsKey("msg").ValueEqual("msg", "ok").
  35 + ContainsKey("data").Value("data").Object().
  36 + ContainsKey("count").ValueEqual("count", 1).
  37 + ContainsKey("productLines").Value("productLines").Array()
  38 + })
  39 + })
  40 + })
  41 + AfterEach(func() {
  42 + _, err := pG.DB.Exec("DELETE FROM product_lines WHERE true")
  43 + Expect(err).NotTo(HaveOccurred())
  44 + })
  45 +})
  1 +package product_line
  2 +
  3 +import (
  4 + "net/http"
  5 + "net/http/httptest"
  6 + "testing"
  7 +
  8 + "github.com/beego/beego/v2/server/web"
  9 + . "github.com/onsi/ginkgo"
  10 + . "github.com/onsi/gomega"
  11 + _ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/application"
  12 + _ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg"
  13 + _ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/port/beego"
  14 +)
  15 +
  16 +func TestProductLine(t *testing.T) {
  17 + RegisterFailHandler(Fail)
  18 + RunSpecs(t, "Beego Port ProductLine Correlations Test Case Suite")
  19 +}
  20 +
  21 +var handler http.Handler
  22 +var server *httptest.Server
  23 +
  24 +var _ = BeforeSuite(func() {
  25 + handler = web.BeeApp.Handlers
  26 + server = httptest.NewServer(handler)
  27 +})
  28 +
  29 +var _ = AfterSuite(func() {
  30 + server.Close()
  31 +})
  1 +package product_line
  2 +
  3 +import (
  4 + "github.com/go-pg/pg/v10"
  5 + "net/http"
  6 +
  7 + "github.com/gavv/httpexpect"
  8 + . "github.com/onsi/ginkgo"
  9 + . "github.com/onsi/gomega"
  10 + pG "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg"
  11 +)
  12 +
  13 +var _ = Describe("移除生产线", func() {
  14 + var productLineId int64
  15 + BeforeEach(func() {
  16 + _, err := pG.DB.QueryOne(
  17 + pg.Scan(&productLineId),
  18 + "INSERT INTO product_lines (line_id, line_name, product_sections) VALUES (?, ?, ?) RETURNING product_line_id",
  19 + "testLineId", "testLineName", "testProductSections")
  20 + Expect(err).NotTo(HaveOccurred())
  21 + })
  22 + Describe("根据参数移除生产线", func() {
  23 + Context("传入有效的productLineId", func() {
  24 + It("返回被移除生产线的数据", func() {
  25 + httpExpect := httpexpect.New(GinkgoT(), server.URL)
  26 + httpExpect.DELETE("/product-lines/{lineId}").
  27 + Expect().
  28 + Status(http.StatusOK).
  29 + JSON().
  30 + Object().
  31 + ContainsKey("code").ValueEqual("code", 0).
  32 + ContainsKey("msg").ValueEqual("msg", "ok").
  33 + ContainsKey("data").Value("data").Object()
  34 + })
  35 + })
  36 + })
  37 + AfterEach(func() {
  38 + _, err := pG.DB.Exec("DELETE FROM product_lines WHERE true")
  39 + Expect(err).NotTo(HaveOccurred())
  40 + })
  41 +})
  1 +package product_line
  2 +
  3 +import (
  4 + "github.com/go-pg/pg/v10"
  5 + "net/http"
  6 +
  7 + "github.com/gavv/httpexpect"
  8 + . "github.com/onsi/ginkgo"
  9 + . "github.com/onsi/gomega"
  10 + pG "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg"
  11 +)
  12 +
  13 +var _ = Describe("更新生产线", func() {
  14 + var productLineId int64
  15 + BeforeEach(func() {
  16 + _, err := pG.DB.QueryOne(
  17 + pg.Scan(&productLineId),
  18 + "INSERT INTO product_lines (line_id, line_name, product_sections) VALUES (?, ?, ?) RETURNING product_line_id",
  19 + "testLineId", "testLineName", "testProductSections")
  20 + Expect(err).NotTo(HaveOccurred())
  21 + })
  22 + Describe("提交数据更新生产线", func() {
  23 + Context("提交正确的生产线数据", func() {
  24 + It("返回更新后的生产线数据", func() {
  25 + httpExpect := httpexpect.New(GinkgoT(), server.URL)
  26 + body := map[string]interface{}{
  27 + "workshopId": "int",
  28 + "lineName": "string",
  29 + }
  30 + httpExpect.PUT("/product-lines/{lineId}").
  31 + WithJSON(body).
  32 + Expect().
  33 + Status(http.StatusOK).
  34 + JSON().
  35 + Object().
  36 + ContainsKey("code").ValueEqual("code", 0).
  37 + ContainsKey("msg").ValueEqual("msg", "ok").
  38 + ContainsKey("data").Value("data").Object().
  39 + ContainsKey("productLineId").ValueEqual("productLineId", productLineId)
  40 + })
  41 + })
  42 + })
  43 + AfterEach(func() {
  44 + _, err := pG.DB.Exec("DELETE FROM product_lines WHERE true")
  45 + Expect(err).NotTo(HaveOccurred())
  46 + })
  47 +})
  1 +package product_plan
  2 +
  3 +import (
  4 + "net/http"
  5 +
  6 + "github.com/gavv/httpexpect"
  7 + . "github.com/onsi/ginkgo"
  8 + . "github.com/onsi/gomega"
  9 + pG "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg"
  10 +)
  11 +
  12 +var _ = Describe("创建生产计划服务", func() {
  13 + Describe("提交数据创建生产计划服务", func() {
  14 + Context("提交正确的新生产计划数据", func() {
  15 + It("返回生产计划数据", func() {
  16 + httpExpect := httpexpect.New(GinkgoT(), server.URL)
  17 + body := map[string]interface{}{
  18 + "companyId": "int",
  19 + "orgId": "int",
  20 + "workshopId": "int",
  21 + "batchNumber": "string",
  22 + "productDate": "datetime",
  23 + "workOn": "int",
  24 + "machine": "string",
  25 + "planProductName": "string",
  26 + "quantity": "float64",
  27 + "unit": "string",
  28 + "unitWeight": "float64",
  29 + "weight": "float64",
  30 + "remark": "string",
  31 + }
  32 + httpExpect.POST("/product-plans/").
  33 + WithJSON(body).
  34 + Expect().
  35 + Status(http.StatusOK).
  36 + JSON().
  37 + Object().
  38 + ContainsKey("code").ValueEqual("code", 0).
  39 + ContainsKey("msg").ValueEqual("msg", "ok").
  40 + ContainsKey("data").Value("data").Object().
  41 + ContainsKey("productPlanId").ValueNotEqual("productPlanId", BeZero())
  42 + })
  43 + })
  44 + })
  45 + AfterEach(func() {
  46 + _, err := pG.DB.Exec("DELETE FROM product_plans WHERE true")
  47 + Expect(err).NotTo(HaveOccurred())
  48 + })
  49 +})
  1 +package product_plan
  2 +
  3 +import (
  4 + "github.com/go-pg/pg/v10"
  5 + "net/http"
  6 +
  7 + "github.com/gavv/httpexpect"
  8 + . "github.com/onsi/ginkgo"
  9 + . "github.com/onsi/gomega"
  10 + pG "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg"
  11 +)
  12 +
  13 +var _ = Describe("返回生产计划服务", func() {
  14 + var productPlanId int64
  15 + BeforeEach(func() {
  16 + _, err := pG.DB.QueryOne(
  17 + pg.Scan(&productPlanId),
  18 + "INSERT INTO product_plans (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) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING product_plan_id",
  19 + "testProductPlanId", "testCompanyId", "testOrgId", "testBatchNumber", "testProductDate", "testWorkshop", "testWorkOn", "testMachine", "testPlanProductName", "testPlanDevoted", "testPlanStatus", "testWorkStation", "testRemark", "testCreatedAt", "testUpdatedAt", "testDeletedAt")
  20 + Expect(err).NotTo(HaveOccurred())
  21 + })
  22 + Describe("根据productPlanId参数返回生产计划", func() {
  23 + Context("传入有效的productPlanId", func() {
  24 + It("返回生产计划数据", func() {
  25 + httpExpect := httpexpect.New(GinkgoT(), server.URL)
  26 + httpExpect.GET("/product-plans/{productPlanId}").
  27 + Expect().
  28 + Status(http.StatusOK).
  29 + JSON().
  30 + Object().
  31 + ContainsKey("code").ValueEqual("code", 0).
  32 + ContainsKey("msg").ValueEqual("msg", "ok").
  33 + ContainsKey("data").Value("data").Object()
  34 + })
  35 + })
  36 + })
  37 + AfterEach(func() {
  38 + _, err := pG.DB.Exec("DELETE FROM product_plans WHERE true")
  39 + Expect(err).NotTo(HaveOccurred())
  40 + })
  41 +})
  1 +package product_plan
  2 +
  3 +import (
  4 + "github.com/go-pg/pg/v10"
  5 + "net/http"
  6 +
  7 + "github.com/gavv/httpexpect"
  8 + . "github.com/onsi/ginkgo"
  9 + . "github.com/onsi/gomega"
  10 + pG "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg"
  11 +)
  12 +
  13 +var _ = Describe("返回生产计划服务列表", func() {
  14 + var productPlanId int64
  15 + BeforeEach(func() {
  16 + _, err := pG.DB.QueryOne(
  17 + pg.Scan(&productPlanId),
  18 + "INSERT INTO product_plans (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) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING product_plan_id",
  19 + "testProductPlanId", "testCompanyId", "testOrgId", "testBatchNumber", "testProductDate", "testWorkshop", "testWorkOn", "testMachine", "testPlanProductName", "testPlanDevoted", "testPlanStatus", "testWorkStation", "testRemark", "testCreatedAt", "testUpdatedAt", "testDeletedAt")
  20 + Expect(err).NotTo(HaveOccurred())
  21 + })
  22 + Describe("根据参数返回生产计划列表", func() {
  23 + Context("传入有效的参数", func() {
  24 + It("返回生产计划数据列表", func() {
  25 + httpExpect := httpexpect.New(GinkgoT(), server.URL)
  26 + httpExpect.GET("/product-plans/").
  27 + WithQuery("offset", "int").
  28 + WithQuery("limit", "int").
  29 + Expect().
  30 + Status(http.StatusOK).
  31 + JSON().
  32 + Object().
  33 + ContainsKey("code").ValueEqual("code", 0).
  34 + ContainsKey("msg").ValueEqual("msg", "ok").
  35 + ContainsKey("data").Value("data").Object().
  36 + ContainsKey("count").ValueEqual("count", 1).
  37 + ContainsKey("productPlans").Value("productPlans").Array()
  38 + })
  39 + })
  40 + })
  41 + AfterEach(func() {
  42 + _, err := pG.DB.Exec("DELETE FROM product_plans WHERE true")
  43 + Expect(err).NotTo(HaveOccurred())
  44 + })
  45 +})
  1 +package product_plan
  2 +
  3 +import (
  4 + "net/http"
  5 + "net/http/httptest"
  6 + "testing"
  7 +
  8 + "github.com/beego/beego/v2/server/web"
  9 + . "github.com/onsi/ginkgo"
  10 + . "github.com/onsi/gomega"
  11 + _ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/application"
  12 + _ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg"
  13 + _ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/port/beego"
  14 +)
  15 +
  16 +func TestProductPlan(t *testing.T) {
  17 + RegisterFailHandler(Fail)
  18 + RunSpecs(t, "Beego Port ProductPlan Correlations Test Case Suite")
  19 +}
  20 +
  21 +var handler http.Handler
  22 +var server *httptest.Server
  23 +
  24 +var _ = BeforeSuite(func() {
  25 + handler = web.BeeApp.Handlers
  26 + server = httptest.NewServer(handler)
  27 +})
  28 +
  29 +var _ = AfterSuite(func() {
  30 + server.Close()
  31 +})
  1 +package product_plan
  2 +
  3 +import (
  4 + "github.com/go-pg/pg/v10"
  5 + "net/http"
  6 +
  7 + "github.com/gavv/httpexpect"
  8 + . "github.com/onsi/ginkgo"
  9 + . "github.com/onsi/gomega"
  10 + pG "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg"
  11 +)
  12 +
  13 +var _ = Describe("领料", func() {
  14 + var productPlanId int64
  15 + BeforeEach(func() {
  16 + _, err := pG.DB.QueryOne(
  17 + pg.Scan(&productPlanId),
  18 + "INSERT INTO product_plans (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) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING product_plan_id",
  19 + "testProductPlanId", "testCompanyId", "testOrgId", "testBatchNumber", "testProductDate", "testWorkshop", "testWorkOn", "testMachine", "testPlanProductName", "testPlanDevoted", "testPlanStatus", "testWorkStation", "testRemark", "testCreatedAt", "testUpdatedAt", "testDeletedAt")
  20 + Expect(err).NotTo(HaveOccurred())
  21 + })
  22 + Describe("领料", func() {
  23 + Context("", func() {
  24 + It("", func() {
  25 + httpExpect := httpexpect.New(GinkgoT(), server.URL)
  26 + body := map[string]interface{}{
  27 + "productPlanId": "int",
  28 + }
  29 + httpExpect.POST("/product-plans/receive-material").
  30 + WithJSON(body).
  31 + Expect().
  32 + Status(http.StatusOK).
  33 + JSON().
  34 + Object().
  35 + ContainsKey("code").ValueEqual("code", 0).
  36 + ContainsKey("msg").ValueEqual("msg", "ok").
  37 + ContainsKey("data").Value("data").Object()
  38 + })
  39 + })
  40 + })
  41 + AfterEach(func() {
  42 + _, err := pG.DB.Exec("DELETE FROM product_plans WHERE true")
  43 + Expect(err).NotTo(HaveOccurred())
  44 + })
  45 +})
  1 +package product_plan
  2 +
  3 +import (
  4 + "github.com/go-pg/pg/v10"
  5 + "net/http"
  6 +
  7 + "github.com/gavv/httpexpect"
  8 + . "github.com/onsi/ginkgo"
  9 + . "github.com/onsi/gomega"
  10 + pG "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg"
  11 +)
  12 +
  13 +var _ = Describe("移除生产计划服务", func() {
  14 + var productPlanId int64
  15 + BeforeEach(func() {
  16 + _, err := pG.DB.QueryOne(
  17 + pg.Scan(&productPlanId),
  18 + "INSERT INTO product_plans (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) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING product_plan_id",
  19 + "testProductPlanId", "testCompanyId", "testOrgId", "testBatchNumber", "testProductDate", "testWorkshop", "testWorkOn", "testMachine", "testPlanProductName", "testPlanDevoted", "testPlanStatus", "testWorkStation", "testRemark", "testCreatedAt", "testUpdatedAt", "testDeletedAt")
  20 + Expect(err).NotTo(HaveOccurred())
  21 + })
  22 + Describe("根据参数移除生产计划服务", func() {
  23 + Context("传入有效的productPlanId", func() {
  24 + It("返回被移除生产计划的数据", func() {
  25 + httpExpect := httpexpect.New(GinkgoT(), server.URL)
  26 + httpExpect.DELETE("/product-plans/{productPlanId}").
  27 + Expect().
  28 + Status(http.StatusOK).
  29 + JSON().
  30 + Object().
  31 + ContainsKey("code").ValueEqual("code", 0).
  32 + ContainsKey("msg").ValueEqual("msg", "ok").
  33 + ContainsKey("data").Value("data").Object()
  34 + })
  35 + })
  36 + })
  37 + AfterEach(func() {
  38 + _, err := pG.DB.Exec("DELETE FROM product_plans WHERE true")
  39 + Expect(err).NotTo(HaveOccurred())
  40 + })
  41 +})
  1 +package product_plan
  2 +
  3 +import (
  4 + "github.com/go-pg/pg/v10"
  5 + "net/http"
  6 +
  7 + "github.com/gavv/httpexpect"
  8 + . "github.com/onsi/ginkgo"
  9 + . "github.com/onsi/gomega"
  10 + pG "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg"
  11 +)
  12 +
  13 +var _ = Describe("退料", func() {
  14 + var productPlanId int64
  15 + BeforeEach(func() {
  16 + _, err := pG.DB.QueryOne(
  17 + pg.Scan(&productPlanId),
  18 + "INSERT INTO product_plans (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) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING product_plan_id",
  19 + "testProductPlanId", "testCompanyId", "testOrgId", "testBatchNumber", "testProductDate", "testWorkshop", "testWorkOn", "testMachine", "testPlanProductName", "testPlanDevoted", "testPlanStatus", "testWorkStation", "testRemark", "testCreatedAt", "testUpdatedAt", "testDeletedAt")
  20 + Expect(err).NotTo(HaveOccurred())
  21 + })
  22 + Describe("退料", func() {
  23 + Context("", func() {
  24 + It("", func() {
  25 + httpExpect := httpexpect.New(GinkgoT(), server.URL)
  26 + body := map[string]interface{}{
  27 + "productPlanId": "int",
  28 + }
  29 + httpExpect.POST("/product-plans/return-material").
  30 + WithJSON(body).
  31 + Expect().
  32 + Status(http.StatusOK).
  33 + JSON().
  34 + Object().
  35 + ContainsKey("code").ValueEqual("code", 0).
  36 + ContainsKey("msg").ValueEqual("msg", "ok").
  37 + ContainsKey("data").Value("data").Object()
  38 + })
  39 + })
  40 + })
  41 + AfterEach(func() {
  42 + _, err := pG.DB.Exec("DELETE FROM product_plans WHERE true")
  43 + Expect(err).NotTo(HaveOccurred())
  44 + })
  45 +})
  1 +package product_plan
  2 +
  3 +import (
  4 + "github.com/go-pg/pg/v10"
  5 + "net/http"
  6 +
  7 + "github.com/gavv/httpexpect"
  8 + . "github.com/onsi/ginkgo"
  9 + . "github.com/onsi/gomega"
  10 + pG "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg"
  11 +)
  12 +
  13 +var _ = Describe("计划上线", func() {
  14 + var productPlanId int64
  15 + BeforeEach(func() {
  16 + _, err := pG.DB.QueryOne(
  17 + pg.Scan(&productPlanId),
  18 + "INSERT INTO product_plans (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) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING product_plan_id",
  19 + "testProductPlanId", "testCompanyId", "testOrgId", "testBatchNumber", "testProductDate", "testWorkshop", "testWorkOn", "testMachine", "testPlanProductName", "testPlanDevoted", "testPlanStatus", "testWorkStation", "testRemark", "testCreatedAt", "testUpdatedAt", "testDeletedAt")
  20 + Expect(err).NotTo(HaveOccurred())
  21 + })
  22 + Describe("计划上线", func() {
  23 + Context("", func() {
  24 + It("", func() {
  25 + httpExpect := httpexpect.New(GinkgoT(), server.URL)
  26 + body := map[string]interface{}{
  27 + "productPlanId": "int",
  28 + "workshopId": "int",
  29 + "lineId": "int",
  30 + "sectionId": "int",
  31 + }
  32 + httpExpect.POST("/product-plans/set-online").
  33 + WithJSON(body).
  34 + Expect().
  35 + Status(http.StatusOK).
  36 + JSON().
  37 + Object().
  38 + ContainsKey("code").ValueEqual("code", 0).
  39 + ContainsKey("msg").ValueEqual("msg", "ok").
  40 + ContainsKey("data").Value("data").Object()
  41 + })
  42 + })
  43 + })
  44 + AfterEach(func() {
  45 + _, err := pG.DB.Exec("DELETE FROM product_plans WHERE true")
  46 + Expect(err).NotTo(HaveOccurred())
  47 + })
  48 +})
  1 +package product_plan
  2 +
  3 +import (
  4 + "github.com/go-pg/pg/v10"
  5 + "net/http"
  6 +
  7 + "github.com/gavv/httpexpect"
  8 + . "github.com/onsi/ginkgo"
  9 + . "github.com/onsi/gomega"
  10 + pG "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg"
  11 +)
  12 +
  13 +var _ = Describe("提交成品记录 (成品 二级品)", func() {
  14 + var productPlanId int64
  15 + BeforeEach(func() {
  16 + _, err := pG.DB.QueryOne(
  17 + pg.Scan(&productPlanId),
  18 + "INSERT INTO product_plans (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) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING product_plan_id",
  19 + "testProductPlanId", "testCompanyId", "testOrgId", "testBatchNumber", "testProductDate", "testWorkshop", "testWorkOn", "testMachine", "testPlanProductName", "testPlanDevoted", "testPlanStatus", "testWorkStation", "testRemark", "testCreatedAt", "testUpdatedAt", "testDeletedAt")
  20 + Expect(err).NotTo(HaveOccurred())
  21 + })
  22 + Describe("提交成品记录 (成品 二级品)", func() {
  23 + Context("", func() {
  24 + It("", func() {
  25 + httpExpect := httpexpect.New(GinkgoT(), server.URL)
  26 + body := map[string]interface{}{
  27 + "productPlanId": "int",
  28 + }
  29 + httpExpect.POST("/product-plans/submit-product-record").
  30 + WithJSON(body).
  31 + Expect().
  32 + Status(http.StatusOK).
  33 + JSON().
  34 + Object().
  35 + ContainsKey("code").ValueEqual("code", 0).
  36 + ContainsKey("msg").ValueEqual("msg", "ok").
  37 + ContainsKey("data").Value("data").Object()
  38 + })
  39 + })
  40 + })
  41 + AfterEach(func() {
  42 + _, err := pG.DB.Exec("DELETE FROM product_plans WHERE true")
  43 + Expect(err).NotTo(HaveOccurred())
  44 + })
  45 +})
  1 +package product_plan
  2 +
  3 +import (
  4 + "github.com/go-pg/pg/v10"
  5 + "net/http"
  6 +
  7 + "github.com/gavv/httpexpect"
  8 + . "github.com/onsi/ginkgo"
  9 + . "github.com/onsi/gomega"
  10 + pG "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg"
  11 +)
  12 +
  13 +var _ = Describe("换单", func() {
  14 + var productPlanId int64
  15 + BeforeEach(func() {
  16 + _, err := pG.DB.QueryOne(
  17 + pg.Scan(&productPlanId),
  18 + "INSERT INTO product_plans (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) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING product_plan_id",
  19 + "testProductPlanId", "testCompanyId", "testOrgId", "testBatchNumber", "testProductDate", "testWorkshop", "testWorkOn", "testMachine", "testPlanProductName", "testPlanDevoted", "testPlanStatus", "testWorkStation", "testRemark", "testCreatedAt", "testUpdatedAt", "testDeletedAt")
  20 + Expect(err).NotTo(HaveOccurred())
  21 + })
  22 + Describe("换单", func() {
  23 + Context("", func() {
  24 + It("", func() {
  25 + httpExpect := httpexpect.New(GinkgoT(), server.URL)
  26 + body := map[string]interface{}{
  27 + "fromProductPlanId": "int",
  28 + "toProductPlanId": "int",
  29 + }
  30 + httpExpect.POST("/product-plans/switch").
  31 + WithJSON(body).
  32 + Expect().
  33 + Status(http.StatusOK).
  34 + JSON().
  35 + Object().
  36 + ContainsKey("code").ValueEqual("code", 0).
  37 + ContainsKey("msg").ValueEqual("msg", "ok").
  38 + ContainsKey("data").Value("data").Object()
  39 + })
  40 + })
  41 + })
  42 + AfterEach(func() {
  43 + _, err := pG.DB.Exec("DELETE FROM product_plans WHERE true")
  44 + Expect(err).NotTo(HaveOccurred())
  45 + })
  46 +})
  1 +package product_plan
  2 +
  3 +import (
  4 + "github.com/go-pg/pg/v10"
  5 + "net/http"
  6 +
  7 + "github.com/gavv/httpexpect"
  8 + . "github.com/onsi/ginkgo"
  9 + . "github.com/onsi/gomega"
  10 + pG "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg"
  11 +)
  12 +
  13 +var _ = Describe("更新生产计划服务", func() {
  14 + var productPlanId int64
  15 + BeforeEach(func() {
  16 + _, err := pG.DB.QueryOne(
  17 + pg.Scan(&productPlanId),
  18 + "INSERT INTO product_plans (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) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING product_plan_id",
  19 + "testProductPlanId", "testCompanyId", "testOrgId", "testBatchNumber", "testProductDate", "testWorkshop", "testWorkOn", "testMachine", "testPlanProductName", "testPlanDevoted", "testPlanStatus", "testWorkStation", "testRemark", "testCreatedAt", "testUpdatedAt", "testDeletedAt")
  20 + Expect(err).NotTo(HaveOccurred())
  21 + })
  22 + Describe("提交数据更新生产计划服务", func() {
  23 + Context("提交正确的生产计划数据", func() {
  24 + It("返回更新后的生产计划数据", func() {
  25 + httpExpect := httpexpect.New(GinkgoT(), server.URL)
  26 + body := map[string]interface{}{
  27 + "companyId": "int",
  28 + "orgId": "int",
  29 + "workshopId": "int",
  30 + "batchNumber": "string",
  31 + "productDate": "datetime",
  32 + "workOn": "int",
  33 + "machine": "string",
  34 + "planProductName": "string",
  35 + "quantity": "float64",
  36 + "unit": "string",
  37 + "unitWeight": "float64",
  38 + "weight": "float64",
  39 + "remark": "string",
  40 + }
  41 + httpExpect.PUT("/product-plans/{productPlanId}").
  42 + WithJSON(body).
  43 + Expect().
  44 + Status(http.StatusOK).
  45 + JSON().
  46 + Object().
  47 + ContainsKey("code").ValueEqual("code", 0).
  48 + ContainsKey("msg").ValueEqual("msg", "ok").
  49 + ContainsKey("data").Value("data").Object().
  50 + ContainsKey("productPlanId").ValueEqual("productPlanId", productPlanId)
  51 + })
  52 + })
  53 + })
  54 + AfterEach(func() {
  55 + _, err := pG.DB.Exec("DELETE FROM product_plans WHERE true")
  56 + Expect(err).NotTo(HaveOccurred())
  57 + })
  58 +})
  1 +package product_section
  2 +
  3 +import (
  4 + "net/http"
  5 +
  6 + "github.com/gavv/httpexpect"
  7 + . "github.com/onsi/ginkgo"
  8 + . "github.com/onsi/gomega"
  9 + pG "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg"
  10 +)
  11 +
  12 +var _ = Describe("创建工段服务", func() {
  13 + Describe("提交数据创建工段服务", func() {
  14 + Context("提交正确的新工段数据", func() {
  15 + It("返回工段数据", func() {
  16 + httpExpect := httpexpect.New(GinkgoT(), server.URL)
  17 + body := map[string]interface{}{
  18 + "workshopId": "int",
  19 + "lineId": "int",
  20 + "sectionName": "string",
  21 + }
  22 + httpExpect.POST("/product-sections/").
  23 + WithJSON(body).
  24 + Expect().
  25 + Status(http.StatusOK).
  26 + JSON().
  27 + Object().
  28 + ContainsKey("code").ValueEqual("code", 0).
  29 + ContainsKey("msg").ValueEqual("msg", "ok").
  30 + ContainsKey("data").Value("data").Object().
  31 + ContainsKey("productSectionId").ValueNotEqual("productSectionId", BeZero())
  32 + })
  33 + })
  34 + })
  35 + AfterEach(func() {
  36 + _, err := pG.DB.Exec("DELETE FROM product_sections WHERE true")
  37 + Expect(err).NotTo(HaveOccurred())
  38 + })
  39 +})
  1 +package product_section
  2 +
  3 +import (
  4 + "github.com/go-pg/pg/v10"
  5 + "net/http"
  6 +
  7 + "github.com/gavv/httpexpect"
  8 + . "github.com/onsi/ginkgo"
  9 + . "github.com/onsi/gomega"
  10 + pG "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg"
  11 +)
  12 +
  13 +var _ = Describe("返回工段服务", func() {
  14 + var productSectionId int64
  15 + BeforeEach(func() {
  16 + _, err := pG.DB.QueryOne(
  17 + pg.Scan(&productSectionId),
  18 + "INSERT INTO product_sections (section_id, section_name) VALUES (?, ?) RETURNING product_section_id",
  19 + "testSectionId", "testSectionName")
  20 + Expect(err).NotTo(HaveOccurred())
  21 + })
  22 + Describe("根据productSectionId参数返回工段", func() {
  23 + Context("传入有效的productSectionId", func() {
  24 + It("返回工段数据", func() {
  25 + httpExpect := httpexpect.New(GinkgoT(), server.URL)
  26 + httpExpect.GET("/product-sections/{sectionId}").
  27 + Expect().
  28 + Status(http.StatusOK).
  29 + JSON().
  30 + Object().
  31 + ContainsKey("code").ValueEqual("code", 0).
  32 + ContainsKey("msg").ValueEqual("msg", "ok").
  33 + ContainsKey("data").Value("data").Object()
  34 + })
  35 + })
  36 + })
  37 + AfterEach(func() {
  38 + _, err := pG.DB.Exec("DELETE FROM product_sections WHERE true")
  39 + Expect(err).NotTo(HaveOccurred())
  40 + })
  41 +})
  1 +package product_section
  2 +
  3 +import (
  4 + "github.com/go-pg/pg/v10"
  5 + "net/http"
  6 +
  7 + "github.com/gavv/httpexpect"
  8 + . "github.com/onsi/ginkgo"
  9 + . "github.com/onsi/gomega"
  10 + pG "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg"
  11 +)
  12 +
  13 +var _ = Describe("返回工段服务列表", func() {
  14 + var productSectionId int64
  15 + BeforeEach(func() {
  16 + _, err := pG.DB.QueryOne(
  17 + pg.Scan(&productSectionId),
  18 + "INSERT INTO product_sections (section_id, section_name) VALUES (?, ?) RETURNING product_section_id",
  19 + "testSectionId", "testSectionName")
  20 + Expect(err).NotTo(HaveOccurred())
  21 + })
  22 + Describe("根据参数返回工段列表", func() {
  23 + Context("传入有效的参数", func() {
  24 + It("返回工段数据列表", func() {
  25 + httpExpect := httpexpect.New(GinkgoT(), server.URL)
  26 + httpExpect.GET("/product-sections/").
  27 + WithQuery("offset", "int").
  28 + WithQuery("limit", "int").
  29 + Expect().
  30 + Status(http.StatusOK).
  31 + JSON().
  32 + Object().
  33 + ContainsKey("code").ValueEqual("code", 0).
  34 + ContainsKey("msg").ValueEqual("msg", "ok").
  35 + ContainsKey("data").Value("data").Object().
  36 + ContainsKey("count").ValueEqual("count", 1).
  37 + ContainsKey("productSections").Value("productSections").Array()
  38 + })
  39 + })
  40 + })
  41 + AfterEach(func() {
  42 + _, err := pG.DB.Exec("DELETE FROM product_sections WHERE true")
  43 + Expect(err).NotTo(HaveOccurred())
  44 + })
  45 +})
  1 +package product_section
  2 +
  3 +import (
  4 + "net/http"
  5 + "net/http/httptest"
  6 + "testing"
  7 +
  8 + "github.com/beego/beego/v2/server/web"
  9 + . "github.com/onsi/ginkgo"
  10 + . "github.com/onsi/gomega"
  11 + _ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/application"
  12 + _ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg"
  13 + _ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/port/beego"
  14 +)
  15 +
  16 +func TestProductSection(t *testing.T) {
  17 + RegisterFailHandler(Fail)
  18 + RunSpecs(t, "Beego Port ProductSection Correlations Test Case Suite")
  19 +}
  20 +
  21 +var handler http.Handler
  22 +var server *httptest.Server
  23 +
  24 +var _ = BeforeSuite(func() {
  25 + handler = web.BeeApp.Handlers
  26 + server = httptest.NewServer(handler)
  27 +})
  28 +
  29 +var _ = AfterSuite(func() {
  30 + server.Close()
  31 +})
  1 +package product_section
  2 +
  3 +import (
  4 + "github.com/go-pg/pg/v10"
  5 + "net/http"
  6 +
  7 + "github.com/gavv/httpexpect"
  8 + . "github.com/onsi/ginkgo"
  9 + . "github.com/onsi/gomega"
  10 + pG "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg"
  11 +)
  12 +
  13 +var _ = Describe("移除工段服务", func() {
  14 + var productSectionId int64
  15 + BeforeEach(func() {
  16 + _, err := pG.DB.QueryOne(
  17 + pg.Scan(&productSectionId),
  18 + "INSERT INTO product_sections (section_id, section_name) VALUES (?, ?) RETURNING product_section_id",
  19 + "testSectionId", "testSectionName")
  20 + Expect(err).NotTo(HaveOccurred())
  21 + })
  22 + Describe("根据参数移除工段服务", func() {
  23 + Context("传入有效的productSectionId", func() {
  24 + It("返回被移除工段的数据", func() {
  25 + httpExpect := httpexpect.New(GinkgoT(), server.URL)
  26 + httpExpect.DELETE("/product-sections/{sectionId}").
  27 + Expect().
  28 + Status(http.StatusOK).
  29 + JSON().
  30 + Object().
  31 + ContainsKey("code").ValueEqual("code", 0).
  32 + ContainsKey("msg").ValueEqual("msg", "ok").
  33 + ContainsKey("data").Value("data").Object()
  34 + })
  35 + })
  36 + })
  37 + AfterEach(func() {
  38 + _, err := pG.DB.Exec("DELETE FROM product_sections WHERE true")
  39 + Expect(err).NotTo(HaveOccurred())
  40 + })
  41 +})
  1 +package product_section
  2 +
  3 +import (
  4 + "github.com/go-pg/pg/v10"
  5 + "net/http"
  6 +
  7 + "github.com/gavv/httpexpect"
  8 + . "github.com/onsi/ginkgo"
  9 + . "github.com/onsi/gomega"
  10 + pG "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg"
  11 +)
  12 +
  13 +var _ = Describe("更新工段服务", func() {
  14 + var productSectionId int64
  15 + BeforeEach(func() {
  16 + _, err := pG.DB.QueryOne(
  17 + pg.Scan(&productSectionId),
  18 + "INSERT INTO product_sections (section_id, section_name) VALUES (?, ?) RETURNING product_section_id",
  19 + "testSectionId", "testSectionName")
  20 + Expect(err).NotTo(HaveOccurred())
  21 + })
  22 + Describe("提交数据更新工段服务", func() {
  23 + Context("提交正确的工段数据", func() {
  24 + It("返回更新后的工段数据", func() {
  25 + httpExpect := httpexpect.New(GinkgoT(), server.URL)
  26 + body := map[string]interface{}{
  27 + "workshopId": "int",
  28 + "sectionName": "string",
  29 + }
  30 + httpExpect.PUT("/product-sections/{sectionId}").
  31 + WithJSON(body).
  32 + Expect().
  33 + Status(http.StatusOK).
  34 + JSON().
  35 + Object().
  36 + ContainsKey("code").ValueEqual("code", 0).
  37 + ContainsKey("msg").ValueEqual("msg", "ok").
  38 + ContainsKey("data").Value("data").Object().
  39 + ContainsKey("productSectionId").ValueEqual("productSectionId", productSectionId)
  40 + })
  41 + })
  42 + })
  43 + AfterEach(func() {
  44 + _, err := pG.DB.Exec("DELETE FROM product_sections WHERE true")
  45 + Expect(err).NotTo(HaveOccurred())
  46 + })
  47 +})
  1 +package unit_conversion
  2 +
  3 +import (
  4 + "net/http"
  5 +
  6 + "github.com/gavv/httpexpect"
  7 + . "github.com/onsi/ginkgo"
  8 + . "github.com/onsi/gomega"
  9 + pG "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg"
  10 +)
  11 +
  12 +var _ = Describe("创建单位换算服务", func() {
  13 + Describe("提交数据创建单位换算服务", func() {
  14 + Context("提交正确的新单位换算数据", func() {
  15 + It("返回单位换算数据", func() {
  16 + httpExpect := httpexpect.New(GinkgoT(), server.URL)
  17 + body := map[string]interface{}{
  18 + "companyId": "int",
  19 + "orgId": "int",
  20 + "workshopId": "int",
  21 + "lineId": "int",
  22 + "sectionId": "int",
  23 + "materialName": "string",
  24 + "materialCategory": "string",
  25 + "quantity": "float64",
  26 + "unit": "string",
  27 + "unitWeight": "float64",
  28 + "weight": "float64",
  29 + "intelligentWeighingFlag": "boolean",
  30 + }
  31 + httpExpect.POST("/unit-conversions/").
  32 + WithJSON(body).
  33 + Expect().
  34 + Status(http.StatusOK).
  35 + JSON().
  36 + Object().
  37 + ContainsKey("code").ValueEqual("code", 0).
  38 + ContainsKey("msg").ValueEqual("msg", "ok").
  39 + ContainsKey("data").Value("data").Object().
  40 + ContainsKey("unitConversionId").ValueNotEqual("unitConversionId", BeZero())
  41 + })
  42 + })
  43 + })
  44 + AfterEach(func() {
  45 + _, err := pG.DB.Exec("DELETE FROM unit_conversions WHERE true")
  46 + Expect(err).NotTo(HaveOccurred())
  47 + })
  48 +})
  1 +package unit_conversion
  2 +
  3 +import (
  4 + "github.com/go-pg/pg/v10"
  5 + "net/http"
  6 +
  7 + "github.com/gavv/httpexpect"
  8 + . "github.com/onsi/ginkgo"
  9 + . "github.com/onsi/gomega"
  10 + pG "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg"
  11 +)
  12 +
  13 +var _ = Describe("返回单位换算服务", func() {
  14 + var unitConversionId int64
  15 + BeforeEach(func() {
  16 + _, err := pG.DB.QueryOne(
  17 + pg.Scan(&unitConversionId),
  18 + "INSERT INTO unit_conversions (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) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING unit_conversion_id",
  19 + "testUnitConversionId", "testCompanyId", "testOrgId", "testWorkStation", "testMaterial", "testFromUnitQuantity", "testToUnitQuantity", "testIntelligentWeighingFlag", "testCreatedAt", "testUpdatedAt", "testDeletedAt")
  20 + Expect(err).NotTo(HaveOccurred())
  21 + })
  22 + Describe("根据unitConversionId参数返回单位换算", func() {
  23 + Context("传入有效的unitConversionId", func() {
  24 + It("返回单位换算数据", func() {
  25 + httpExpect := httpexpect.New(GinkgoT(), server.URL)
  26 + httpExpect.GET("/unit-conversions/{unitConversionId}").
  27 + Expect().
  28 + Status(http.StatusOK).
  29 + JSON().
  30 + Object().
  31 + ContainsKey("code").ValueEqual("code", 0).
  32 + ContainsKey("msg").ValueEqual("msg", "ok").
  33 + ContainsKey("data").Value("data").Object()
  34 + })
  35 + })
  36 + })
  37 + AfterEach(func() {
  38 + _, err := pG.DB.Exec("DELETE FROM unit_conversions WHERE true")
  39 + Expect(err).NotTo(HaveOccurred())
  40 + })
  41 +})
  1 +package unit_conversion
  2 +
  3 +import (
  4 + "github.com/go-pg/pg/v10"
  5 + "net/http"
  6 +
  7 + "github.com/gavv/httpexpect"
  8 + . "github.com/onsi/ginkgo"
  9 + . "github.com/onsi/gomega"
  10 + pG "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg"
  11 +)
  12 +
  13 +var _ = Describe("返回单位换算服务列表", func() {
  14 + var unitConversionId int64
  15 + BeforeEach(func() {
  16 + _, err := pG.DB.QueryOne(
  17 + pg.Scan(&unitConversionId),
  18 + "INSERT INTO unit_conversions (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) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING unit_conversion_id",
  19 + "testUnitConversionId", "testCompanyId", "testOrgId", "testWorkStation", "testMaterial", "testFromUnitQuantity", "testToUnitQuantity", "testIntelligentWeighingFlag", "testCreatedAt", "testUpdatedAt", "testDeletedAt")
  20 + Expect(err).NotTo(HaveOccurred())
  21 + })
  22 + Describe("根据参数返回单位换算列表", func() {
  23 + Context("传入有效的参数", func() {
  24 + It("返回单位换算数据列表", func() {
  25 + httpExpect := httpexpect.New(GinkgoT(), server.URL)
  26 + httpExpect.GET("/unit-conversions/").
  27 + WithQuery("offset", "int").
  28 + WithQuery("limit", "int").
  29 + Expect().
  30 + Status(http.StatusOK).
  31 + JSON().
  32 + Object().
  33 + ContainsKey("code").ValueEqual("code", 0).
  34 + ContainsKey("msg").ValueEqual("msg", "ok").
  35 + ContainsKey("data").Value("data").Object().
  36 + ContainsKey("count").ValueEqual("count", 1).
  37 + ContainsKey("unitConversions").Value("unitConversions").Array()
  38 + })
  39 + })
  40 + })
  41 + AfterEach(func() {
  42 + _, err := pG.DB.Exec("DELETE FROM unit_conversions WHERE true")
  43 + Expect(err).NotTo(HaveOccurred())
  44 + })
  45 +})
  1 +package unit_conversion
  2 +
  3 +import (
  4 + "github.com/go-pg/pg/v10"
  5 + "net/http"
  6 +
  7 + "github.com/gavv/httpexpect"
  8 + . "github.com/onsi/ginkgo"
  9 + . "github.com/onsi/gomega"
  10 + pG "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg"
  11 +)
  12 +
  13 +var _ = Describe("移除单位换算服务", func() {
  14 + var unitConversionId int64
  15 + BeforeEach(func() {
  16 + _, err := pG.DB.QueryOne(
  17 + pg.Scan(&unitConversionId),
  18 + "INSERT INTO unit_conversions (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) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING unit_conversion_id",
  19 + "testUnitConversionId", "testCompanyId", "testOrgId", "testWorkStation", "testMaterial", "testFromUnitQuantity", "testToUnitQuantity", "testIntelligentWeighingFlag", "testCreatedAt", "testUpdatedAt", "testDeletedAt")
  20 + Expect(err).NotTo(HaveOccurred())
  21 + })
  22 + Describe("根据参数移除单位换算服务", func() {
  23 + Context("传入有效的unitConversionId", func() {
  24 + It("返回被移除单位换算的数据", func() {
  25 + httpExpect := httpexpect.New(GinkgoT(), server.URL)
  26 + httpExpect.DELETE("/unit-conversions/{unitConversionId}").
  27 + Expect().
  28 + Status(http.StatusOK).
  29 + JSON().
  30 + Object().
  31 + ContainsKey("code").ValueEqual("code", 0).
  32 + ContainsKey("msg").ValueEqual("msg", "ok").
  33 + ContainsKey("data").Value("data").Object()
  34 + })
  35 + })
  36 + })
  37 + AfterEach(func() {
  38 + _, err := pG.DB.Exec("DELETE FROM unit_conversions WHERE true")
  39 + Expect(err).NotTo(HaveOccurred())
  40 + })
  41 +})
  1 +package unit_conversion
  2 +
  3 +import (
  4 + "net/http"
  5 + "net/http/httptest"
  6 + "testing"
  7 +
  8 + "github.com/beego/beego/v2/server/web"
  9 + . "github.com/onsi/ginkgo"
  10 + . "github.com/onsi/gomega"
  11 + _ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/application"
  12 + _ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg"
  13 + _ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/port/beego"
  14 +)
  15 +
  16 +func TestUnitConversion(t *testing.T) {
  17 + RegisterFailHandler(Fail)
  18 + RunSpecs(t, "Beego Port UnitConversion Correlations Test Case Suite")
  19 +}
  20 +
  21 +var handler http.Handler
  22 +var server *httptest.Server
  23 +
  24 +var _ = BeforeSuite(func() {
  25 + handler = web.BeeApp.Handlers
  26 + server = httptest.NewServer(handler)
  27 +})
  28 +
  29 +var _ = AfterSuite(func() {
  30 + server.Close()
  31 +})
  1 +package unit_conversion
  2 +
  3 +import (
  4 + "github.com/go-pg/pg/v10"
  5 + "net/http"
  6 +
  7 + "github.com/gavv/httpexpect"
  8 + . "github.com/onsi/ginkgo"
  9 + . "github.com/onsi/gomega"
  10 + pG "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg"
  11 +)
  12 +
  13 +var _ = Describe("更新单位换算服务", func() {
  14 + var unitConversionId int64
  15 + BeforeEach(func() {
  16 + _, err := pG.DB.QueryOne(
  17 + pg.Scan(&unitConversionId),
  18 + "INSERT INTO unit_conversions (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) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING unit_conversion_id",
  19 + "testUnitConversionId", "testCompanyId", "testOrgId", "testWorkStation", "testMaterial", "testFromUnitQuantity", "testToUnitQuantity", "testIntelligentWeighingFlag", "testCreatedAt", "testUpdatedAt", "testDeletedAt")
  20 + Expect(err).NotTo(HaveOccurred())
  21 + })
  22 + Describe("提交数据更新单位换算服务", func() {
  23 + Context("提交正确的单位换算数据", func() {
  24 + It("返回更新后的单位换算数据", func() {
  25 + httpExpect := httpexpect.New(GinkgoT(), server.URL)
  26 + body := map[string]interface{}{
  27 + "companyId": "int",
  28 + "orgId": "int",
  29 + "workshopId": "int",
  30 + "lineId": "int",
  31 + "sectionId": "int",
  32 + "materialName": "string",
  33 + "materialCategory": "string",
  34 + "quantity": "float64",
  35 + "unit": "string",
  36 + "unitWeight": "float64",
  37 + "weight": "float64",
  38 + "intelligentWeighingFlag": "boolean",
  39 + }
  40 + httpExpect.PUT("/unit-conversions/{unitConversionId}").
  41 + WithJSON(body).
  42 + Expect().
  43 + Status(http.StatusOK).
  44 + JSON().
  45 + Object().
  46 + ContainsKey("code").ValueEqual("code", 0).
  47 + ContainsKey("msg").ValueEqual("msg", "ok").
  48 + ContainsKey("data").Value("data").Object().
  49 + ContainsKey("unitConversionId").ValueEqual("unitConversionId", unitConversionId)
  50 + })
  51 + })
  52 + })
  53 + AfterEach(func() {
  54 + _, err := pG.DB.Exec("DELETE FROM unit_conversions WHERE true")
  55 + Expect(err).NotTo(HaveOccurred())
  56 + })
  57 +})
  1 +package workshop
  2 +
  3 +import (
  4 + "net/http"
  5 +
  6 + "github.com/gavv/httpexpect"
  7 + . "github.com/onsi/ginkgo"
  8 + . "github.com/onsi/gomega"
  9 + pG "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg"
  10 +)
  11 +
  12 +var _ = Describe("创建车间服务", func() {
  13 + Describe("提交数据创建车间服务", func() {
  14 + Context("提交正确的新车间数据", func() {
  15 + It("返回车间数据", func() {
  16 + httpExpect := httpexpect.New(GinkgoT(), server.URL)
  17 + body := map[string]interface{}{
  18 + "workshopName": "string",
  19 + "principalId": "int",
  20 + }
  21 + httpExpect.POST("/workshops/").
  22 + WithJSON(body).
  23 + Expect().
  24 + Status(http.StatusOK).
  25 + JSON().
  26 + Object().
  27 + ContainsKey("code").ValueEqual("code", 0).
  28 + ContainsKey("msg").ValueEqual("msg", "ok").
  29 + ContainsKey("data").Value("data").Object().
  30 + ContainsKey("workshopId").ValueNotEqual("workshopId", BeZero())
  31 + })
  32 + })
  33 + })
  34 + AfterEach(func() {
  35 + _, err := pG.DB.Exec("DELETE FROM workshops WHERE true")
  36 + Expect(err).NotTo(HaveOccurred())
  37 + })
  38 +})
  1 +package workshop
  2 +
  3 +import (
  4 + "github.com/go-pg/pg/v10"
  5 + "net/http"
  6 +
  7 + "github.com/gavv/httpexpect"
  8 + . "github.com/onsi/ginkgo"
  9 + . "github.com/onsi/gomega"
  10 + pG "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg"
  11 +)
  12 +
  13 +var _ = Describe("返回车间服务", func() {
  14 + var workshopId int64
  15 + BeforeEach(func() {
  16 + _, err := pG.DB.QueryOne(
  17 + pg.Scan(&workshopId),
  18 + "INSERT INTO workshops (company_id, org_id, workshop_id, workshop_name, principal, product_lines, created_at, updated_at, deleted_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING workshop_id",
  19 + "testCompanyId", "testOrgId", "testWorkshopId", "testWorkshopName", "testPrincipal", "testProductLines", "testCreatedAt", "testUpdatedAt", "testDeletedAt")
  20 + Expect(err).NotTo(HaveOccurred())
  21 + })
  22 + Describe("根据workshopId参数返回车间", func() {
  23 + Context("传入有效的workshopId", func() {
  24 + It("返回车间数据", func() {
  25 + httpExpect := httpexpect.New(GinkgoT(), server.URL)
  26 + httpExpect.GET("/workshops/{workshopId}").
  27 + Expect().
  28 + Status(http.StatusOK).
  29 + JSON().
  30 + Object().
  31 + ContainsKey("code").ValueEqual("code", 0).
  32 + ContainsKey("msg").ValueEqual("msg", "ok").
  33 + ContainsKey("data").Value("data").Object()
  34 + })
  35 + })
  36 + })
  37 + AfterEach(func() {
  38 + _, err := pG.DB.Exec("DELETE FROM workshops WHERE true")
  39 + Expect(err).NotTo(HaveOccurred())
  40 + })
  41 +})
  1 +package workshop
  2 +
  3 +import (
  4 + "github.com/go-pg/pg/v10"
  5 + "net/http"
  6 +
  7 + "github.com/gavv/httpexpect"
  8 + . "github.com/onsi/ginkgo"
  9 + . "github.com/onsi/gomega"
  10 + pG "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg"
  11 +)
  12 +
  13 +var _ = Describe("返回车间服务列表", func() {
  14 + var workshopId int64
  15 + BeforeEach(func() {
  16 + _, err := pG.DB.QueryOne(
  17 + pg.Scan(&workshopId),
  18 + "INSERT INTO workshops (company_id, org_id, workshop_id, workshop_name, principal, product_lines, created_at, updated_at, deleted_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING workshop_id",
  19 + "testCompanyId", "testOrgId", "testWorkshopId", "testWorkshopName", "testPrincipal", "testProductLines", "testCreatedAt", "testUpdatedAt", "testDeletedAt")
  20 + Expect(err).NotTo(HaveOccurred())
  21 + })
  22 + Describe("根据参数返回车间列表", func() {
  23 + Context("传入有效的参数", func() {
  24 + It("返回车间数据列表", func() {
  25 + httpExpect := httpexpect.New(GinkgoT(), server.URL)
  26 + httpExpect.GET("/workshops/").
  27 + WithQuery("offset", "int").
  28 + WithQuery("limit", "int").
  29 + Expect().
  30 + Status(http.StatusOK).
  31 + JSON().
  32 + Object().
  33 + ContainsKey("code").ValueEqual("code", 0).
  34 + ContainsKey("msg").ValueEqual("msg", "ok").
  35 + ContainsKey("data").Value("data").Object().
  36 + ContainsKey("count").ValueEqual("count", 1).
  37 + ContainsKey("workshops").Value("workshops").Array()
  38 + })
  39 + })
  40 + })
  41 + AfterEach(func() {
  42 + _, err := pG.DB.Exec("DELETE FROM workshops WHERE true")
  43 + Expect(err).NotTo(HaveOccurred())
  44 + })
  45 +})
  1 +package workshop
  2 +
  3 +import (
  4 + "github.com/go-pg/pg/v10"
  5 + "net/http"
  6 +
  7 + "github.com/gavv/httpexpect"
  8 + . "github.com/onsi/ginkgo"
  9 + . "github.com/onsi/gomega"
  10 + pG "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg"
  11 +)
  12 +
  13 +var _ = Describe("移除车间服务", func() {
  14 + var workshopId int64
  15 + BeforeEach(func() {
  16 + _, err := pG.DB.QueryOne(
  17 + pg.Scan(&workshopId),
  18 + "INSERT INTO workshops (company_id, org_id, workshop_id, workshop_name, principal, product_lines, created_at, updated_at, deleted_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING workshop_id",
  19 + "testCompanyId", "testOrgId", "testWorkshopId", "testWorkshopName", "testPrincipal", "testProductLines", "testCreatedAt", "testUpdatedAt", "testDeletedAt")
  20 + Expect(err).NotTo(HaveOccurred())
  21 + })
  22 + Describe("根据参数移除车间服务", func() {
  23 + Context("传入有效的workshopId", func() {
  24 + It("返回被移除车间的数据", func() {
  25 + httpExpect := httpexpect.New(GinkgoT(), server.URL)
  26 + httpExpect.DELETE("/workshops/{workshopId}").
  27 + Expect().
  28 + Status(http.StatusOK).
  29 + JSON().
  30 + Object().
  31 + ContainsKey("code").ValueEqual("code", 0).
  32 + ContainsKey("msg").ValueEqual("msg", "ok").
  33 + ContainsKey("data").Value("data").Object()
  34 + })
  35 + })
  36 + })
  37 + AfterEach(func() {
  38 + _, err := pG.DB.Exec("DELETE FROM workshops WHERE true")
  39 + Expect(err).NotTo(HaveOccurred())
  40 + })
  41 +})