作者 Administrator

合并分支 'test' 到 'master'

Test



查看合并请求 !8
正在显示 96 个修改的文件 包含 2897 行增加336 行删除

要显示太多修改。

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

... ... @@ -3,3 +3,6 @@
.idea
/lastupdate.tmp
static/*
cmd/pdftopng.exe
tmp/*
... ...
FROM 192.168.0.243:5000/mmm/allied-creation-gateway:20210809
ENV APP_DIR $GOPATH/src/project-20210916
FROM 192.168.0.243:5000/mmm/allied-creation-gateway:libfontconfig
ENV APP_DIR $GOPATH/src/project-20211210
RUN mkdir -p $APP_DIR
WORKDIR $APP_DIR/
COPY ./pkg pkg
COPY ./config config
#COPY ./cmd/pdftopng cmd/pdftopng
COPY ./go.mod go.mod
COPY ./go.sum go.sum
COPY ./main.go main.go
RUN chmod +x cmd/pdftopng
RUN ["ln","-sf","/usr/share/zoneinfo/Asia/Shanghai","/etc/localtime"]
ENV GO111MODULE on
ENV GOPROXY https://goproxy.cn
... ...
不能预览此文件类型
... ... @@ -103,6 +103,8 @@ spec:
value: "false"
- name: HTTP_PORT
value: "8082"
- name: SUPLUS_ADMIN_BASE_HOST
value: "http://suplus-admin-base-dev.fjmaimaimai.com"
- name: ALLIED_CREATION_GATEWAY_HOST
value: "https://allied-creation-gateway-dev.fjmaimaimai.com"
- name: ALLIED_CREATION_USER_HOST
... ... @@ -113,6 +115,8 @@ spec:
value: "http://allied-creation-basic-dev.fjmaimaimai.com"
- name: SMS_SERVE_HOST
value: "https://sms.fjmaimaimai.com:9897"
- name: SUPLUS_SALE_APP
value: "http://suplus-sale-app-gateway-test.fjmaimaimai.com"
# - name: REDIS_HOST
# valueFrom:
# configMapKeyRef:
... ...
... ... @@ -107,6 +107,10 @@ spec:
value: "false"
- name: HTTP_PORT
value: "8082"
- name: SUPLUS_ADMIN_BASE_HOST
value: "http://suplus-admin-base-prd.fjmaimaimai.com"
- name: ALLIED_CREATION_GATEWAY_HOST
value: "https://allied-creation-gateway-prd.fjmaimaimai.com"
- name: ALLIED_CREATION_USER_HOST
value: "https://allied-creation-user-prd.fjmaimaimai.com"
- name: ALLIED_CREATION_COOPERATION_HOST
... ...
... ... @@ -93,6 +93,8 @@ spec:
key: redis.port
- name: REDIS_AUTH
value: ""
- name: KAFKA_HOST
value: "192.168.0.250:9092,192.168.0.251:9092,192.168.0.252:9092"
- name: LOG_LEVEL
value: "debug"
- name: LOG_FRAMEWORK
... ... @@ -108,7 +110,7 @@ spec:
- name: HTTP_PORT
value: "8082"
- name: SUPLUS_ADMIN_BASE_HOST
value: "http://suplus-admin-base-test.fjmaimaimai.com"
value: "http://suplus-admin-base-dev.fjmaimaimai.com"
- name: ALLIED_CREATION_GATEWAY_HOST
value: "https://allied-creation-gateway-test.fjmaimaimai.com"
- name: ALLIED_CREATION_USER_HOST
... ... @@ -119,6 +121,8 @@ spec:
value: "https://allied-creation-basic-test.fjmaimaimai.com"
- name: SMS_SERVE_HOST
value: "https://sms.fjmaimaimai.com:9897"
- name: SUPLUS_SALE_APP
value: "http://suplus-sale-app-gateway-test.fjmaimaimai.com"
# - name: REDIS_HOST
# valueFrom:
# configMapKeyRef:
... ...
... ... @@ -6,9 +6,14 @@ require (
github.com/GeeTeam/gt3-golang-sdk v0.0.0-20200116043922-446ca8a507d2
github.com/beego/beego/v2 v2.0.1
github.com/dgrijalva/jwt-go v3.2.0+incompatible
github.com/forgoer/openssl v0.0.0-20210828150411-6c5378b5b719 // indirect
github.com/disintegration/imaging v1.6.2
github.com/forgoer/openssl v0.0.0-20210828150411-6c5378b5b719
github.com/go-pg/pg/v10 v10.10.1
github.com/go-redis/redis v6.14.2+incompatible
github.com/go-redis/redis v6.15.7+incompatible
github.com/google/uuid v1.1.1
github.com/linmadan/egglib-go v0.0.0-20210827085852-177fa745932d
github.com/pdfcpu/pdfcpu v0.3.13
github.com/stretchr/testify v1.7.0
github.com/tal-tech/go-queue v1.0.5
golang.org/x/text v0.3.6
)
... ...
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/ClickHouse/clickhouse-go v1.4.3/go.mod h1:EaI/sW7Azgz9UATzd5ZdZHRUhHgv5+JMS9NSr2smCJI=
github.com/DATA-DOG/go-sqlmock v1.4.1/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM=
github.com/GeeTeam/gt3-golang-sdk v0.0.0-20200116043922-446ca8a507d2 h1:KBk8MKqHvIztjEW4KAKnR9VPT4iTZYz0D4Ju0GFVsV0=
github.com/GeeTeam/gt3-golang-sdk v0.0.0-20200116043922-446ca8a507d2/go.mod h1:vqCh/LExdPmL5SULXE/9DHbuE4t3iLkzRYoNGxEvg/o=
github.com/Knetic/govaluate v3.0.0+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0=
... ... @@ -7,12 +9,15 @@ github.com/Shopify/sarama v1.25.0 h1:ch1ywjRLjfJtU+EaiJ+l0rWffQ6TRpyYmW4DX7Cb2SU
github.com/Shopify/sarama v1.25.0/go.mod h1:y/CFFTO9eaMTNriwu/Q+W4eioLqiDMGkA1W+gmdfj8w=
github.com/Shopify/toxiproxy v2.1.4+incompatible h1:TKdv8HiTLgE5wdJuEML90aBgNWsokNbMijUGhmcoBJc=
github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI=
github.com/StackExchange/wmi v0.0.0-20170410192909-ea383cf3ba6e/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg=
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
github.com/alicebob/gopher-json v0.0.0-20180125190556-5a6b3ba71ee6/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc=
github.com/alicebob/miniredis v2.5.0+incompatible/go.mod h1:8HZjEj4yU0dwhYHky+DxYx+6BMjkBbe5ONFIF1MXffk=
github.com/antihax/optional v0.0.0-20180407024304-ca021399b1a6/go.mod h1:V8iCPQYkqmusNa815XgQio277wI47sdRh1dUOLdyC6Q=
github.com/beanstalkd/go-beanstalk v0.1.0/go.mod h1:/G8YTyChOtpOArwLTQPY1CHB+i212+av35bkPXXj56Y=
github.com/beego/beego/v2 v2.0.1 h1:07a7Z0Ok5vbqyqh+q53sDPl9LdhKh0ZDy3gbyGrhFnE=
github.com/beego/beego/v2 v2.0.1/go.mod h1:8zyHi1FnWO1mZLwTn62aKRIZF/aIKvkCBB2JYs+eqQI=
github.com/beego/goyaml2 v0.0.0-20130207012346-5545475820dd/go.mod h1:1b+Y/CofkYwXMUU0OhQqGvsY2Bvgr4j6jfT699wyZKQ=
... ... @@ -21,26 +26,41 @@ github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
github.com/bkaradzic/go-lz4 v1.0.0/go.mod h1:0YdlkowM3VswSROI7qDxhRvJ3sLhlFrRRwjwegp5jy4=
github.com/bradfitz/gomemcache v0.0.0-20180710155616-bc664df96737/go.mod h1:PmM6Mmwb0LSuEubjR8N7PtNe1KxZLtOUHtbeikc5h60=
github.com/casbin/casbin v1.7.0/go.mod h1:c67qKN6Oum3UF5Q1+BByfFxkwKvhwW57ITjqwtzR1KE=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY=
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/cloudflare/golz4 v0.0.0-20150217214814-ef862a3cdc58/go.mod h1:EOBUe0h4xcZ5GoxqC5SDxFQ8gwyZPKQoEzownBlhI80=
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8=
github.com/coreos/etcd v3.3.25+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
github.com/coreos/go-systemd/v22 v22.0.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk=
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
github.com/couchbase/go-couchbase v0.0.0-20200519150804-63f3cdb75e0d/go.mod h1:TWI8EKQMs5u5jLKW/tsb9VwauIrMIxQG1r5fMsswK5U=
github.com/couchbase/gomemcached v0.0.0-20200526233749-ec430f949808/go.mod h1:srVSlQLB8iXBVXHgnqemxUXqN6FCvClgCMPCsjBDR7c=
github.com/couchbase/goutils v0.0.0-20180530154633-e865a1461c8a/go.mod h1:BQwMFlJzDjFDG3DJUdU0KORxn88UlsOULuxLExMh3Hs=
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY=
github.com/cupcake/rdb v0.0.0-20161107195141-43ba34106c76/go.mod h1:vYwsqCOLxGiisLwp9rITslkFNpZD5rz43tf41QFkTWY=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dchest/siphash v1.2.1/go.mod h1:q+IRvb2gOSrUnYoPqHiyHXS0FOBBOdl6tONBlVnOnt4=
github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM=
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
github.com/disintegration/imaging v1.6.2 h1:w1LecBlG2Lnp8B3jk5zSuNqd7b4DXhcjwek1ei82L+c=
github.com/disintegration/imaging v1.6.2/go.mod h1:44/5580QXChDfwIclfc/PCwrr44amcmDAg8hxG0Ewe4=
github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
github.com/eapache/go-resiliency v1.1.0 h1:1NtRmCAqadE2FN4ZcN6g90TP3uk8cg9rn9eNK2197aU=
github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs=
github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21 h1:YEetp8/yCZMuEPMUDHG0CW/brkkEp8mzqk2+ODEitlw=
... ... @@ -52,39 +72,58 @@ github.com/elastic/go-elasticsearch/v6 v6.8.5 h1:U2HtkBseC1FNBmDr0TR2tKltL6FxoY+
github.com/elastic/go-elasticsearch/v6 v6.8.5/go.mod h1:UwaDJsD3rWLM5rKNFzv9hgox93HoX8utj1kxD9aFUcI=
github.com/elazarl/go-bindata-assetfs v1.0.0 h1:G/bYguwHIzWq9ZoyUQqrjTmJbbYn3j3CKKpKinvZLFk=
github.com/elazarl/go-bindata-assetfs v1.0.0/go.mod h1:v+YaWX3bdea5J/mo8dSETolEo7R71Vk1u8bnjau5yw4=
github.com/emicklei/proto v1.9.0/go.mod h1:rn1FgRS/FANiZdD2djyH7TMA9jdRDcYQ9IEN9yvjX0A=
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU=
github.com/forgoer/openssl v0.0.0-20210828150411-6c5378b5b719 h1:sBIoJbXC+QBD9kL00aAxi7dfJJ70YHhiKzSN9yeTjbU=
github.com/forgoer/openssl v0.0.0-20210828150411-6c5378b5b719/go.mod h1:NMVFOzYeLVR7UiGTxsa+A21nrERTZ3Rv2JHDPcJpDyI=
github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw=
github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g=
github.com/frankban/quicktest v1.4.1 h1:Wv2VwvNn73pAdFIVUQRXYDFp31lXKbqblIXo/Q5GPSg=
github.com/frankban/quicktest v1.4.1/go.mod h1:36zfPVQyHxymz4cH7wlDmVwDrJuljRB60qkgn7rorfQ=
github.com/frankban/quicktest v1.7.2 h1:2QxQoC1TS09S7fhCPsrvqYdvP1H5M1P1ih5ABm3BTYk=
github.com/frankban/quicktest v1.7.2/go.mod h1:jaStnuzAqU1AJdCO0l53JDCJrVDKcS03DbaAcR7Ks/o=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4=
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/glendc/gopher-json v0.0.0-20170414221815-dc4743023d0c/go.mod h1:Gja1A+xZ9BoviGJNA2E9vFkPjjsl+CoJxSXiQM1UXtw=
github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q=
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8=
github.com/go-pg/pg/v10 v10.7.7/go.mod h1:d0w17Xw5x2DtbD/UgB9rnZg3FAck3eDHXff0Srrzuuk=
github.com/go-pg/pg/v10 v10.10.1 h1:82lLX4KGs2wOFOvVVIICoU0Si1fLu6Aitniu73HaDuM=
github.com/go-pg/pg/v10 v10.10.1/go.mod h1:EmoJGYErc+stNN/1Jf+o4csXuprjxcRztBnn6cHe38E=
github.com/go-pg/zerochecker v0.2.0 h1:pp7f72c3DobMWOb2ErtZsnrPaSvHd2W4o9//8HtF4mU=
github.com/go-pg/zerochecker v0.2.0/go.mod h1:NJZ4wKL0NmTtz0GKCoJ8kym6Xn/EQzXRl2OnAe7MmDo=
github.com/go-redis/redis v6.14.2+incompatible h1:UE9pLhzmWf+xHNmZsoccjXosPicuiNaInPgym8nzfg0=
github.com/go-redis/redis v6.14.2+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA=
github.com/go-redis/redis v6.15.7+incompatible h1:3skhDh95XQMpnqeqNftPkQD9jL9e5e36z/1SUm6dy1U=
github.com/go-redis/redis v6.15.7+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA=
github.com/go-redis/redis/v7 v7.4.0/go.mod h1:JDNMw23GTyLNC4GZu9njt15ctBQVn7xjRfnwdHj/Dcg=
github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
github.com/go-xorm/builder v0.3.4/go.mod h1:KxkQkNN1DpPKTedxXyTQcmH+rXfvk4LZ9SOOBoZBAxw=
github.com/go-xorm/sqlfiddle v0.0.0-20180821085327-62ce714f951a/go.mod h1:56xuuqnHyryaerycW3BfssRdxQstACi0Epw/yC5E2xM=
github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
... ... @@ -99,6 +138,7 @@ github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8l
github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4=
github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/gomodule/redigo v2.0.0+incompatible/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4=
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
... ... @@ -108,39 +148,80 @@ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/gops v0.3.7/go.mod h1:bj0cwMmX1X4XIJFTjR99R5sCxNssNJ8HebFNvoQlmgY=
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY=
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
github.com/grpc-ecosystem/grpc-gateway v1.14.3/go.mod h1:6CwZWGDSPRJidgKAtJVvND6soZe6fT7iteq8wDPdhb0=
github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542 h1:2VTzZjLZBgl62/EtslCrtky5vbi9dd7HrQPQIx6wqiw=
github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542/go.mod h1:Ow0tF8D4Kplbc8s8sSb3V2oUCygFHVp8gC3Dn6U4MNI=
github.com/hashicorp/go-uuid v1.0.1 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE=
github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc=
github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
github.com/hhrutter/lzw v0.0.0-20190827003112-58b82c5a41cc/go.mod h1:yJBvOcu1wLQ9q9XZmfiPfur+3dQJuIhYQsMGLYcItZk=
github.com/hhrutter/lzw v0.0.0-20190829144645-6f07a24e8650 h1:1yY/RQWNSBjJe2GDCIYoLmpWVidrooriUr4QS/zaATQ=
github.com/hhrutter/lzw v0.0.0-20190829144645-6f07a24e8650/go.mod h1:yJBvOcu1wLQ9q9XZmfiPfur+3dQJuIhYQsMGLYcItZk=
github.com/hhrutter/tiff v0.0.0-20190829141212-736cae8d0bc7 h1:o1wMw7uTNyA58IlEdDpxIrtFHTgnvYzA8sCQz8luv94=
github.com/hhrutter/tiff v0.0.0-20190829141212-736cae8d0bc7/go.mod h1:WkUxfS2JUu3qPo6tRld7ISb8HiC0gVSU91kooBMDVok=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/iancoleman/strcase v0.0.0-20191112232945-16388991a334/go.mod h1:SK73tn/9oHe+/Y0h39VT4UCxmurVJkR5NA7kMEAOgSE=
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
github.com/jcmturner/gofork v0.0.0-20190328161633-dc7c13fece03 h1:FUwcHNlEqkqLjLBdCp5PRlCFijNjvcYANOZXzCfXwCM=
github.com/jcmturner/gofork v0.0.0-20190328161633-dc7c13fece03/go.mod h1:MK8+TM0La+2rjBD4jE12Kj1pCCxK7d2LK/UM3ncEo0o=
github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E=
github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
github.com/jmoiron/sqlx v1.2.0/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks=
github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
github.com/justinas/alice v1.2.0/go.mod h1:fN5HRH/reO/zrUflLfTN43t3vXvKzvZIENsNEe7i7qA=
github.com/kardianos/osext v0.0.0-20170510131534-ae77be60afb1/go.mod h1:1NbS8ALrpOvjt0rHPNLyCIeMtbizbir8U//inJ+zuB8=
github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0/go.mod h1:1NbS8ALrpOvjt0rHPNLyCIeMtbizbir8U//inJ+zuB8=
github.com/keybase/go-ps v0.0.0-20161005175911-668c8856d999/go.mod h1:hY+WOq6m2FpbvyrI93sMaypsttvaIL5nhVR92dTMUcQ=
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/klauspost/compress v1.9.7 h1:hYW1gP94JUmAhBtJ+LNz5My+gBobDxPR1iVuKug26aA=
github.com/klauspost/compress v1.9.7/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A=
github.com/klauspost/compress v1.9.8 h1:VMAMUUOh+gaxKTMk+zqbjsSjsIcUcL/LF4o63i82QyA=
github.com/klauspost/compress v1.9.8/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs=
github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/ledisdb/ledisdb v0.0.0-20200510135210-d35789ec47e6/go.mod h1:n931TsDuKuq+uX4v1fulaMbA/7ZLLhjc85h7chZGBCQ=
github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/lib/pq v1.3.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/linmadan/egglib-go v0.0.0-20210827085852-177fa745932d h1:3C1xctwbWOdIFqUL1U2DGymTYLJrGOZxPaFu4SLsbkk=
github.com/linmadan/egglib-go v0.0.0-20210827085852-177fa745932d/go.mod h1:sK2YggplSGTnGLm3kHobFa41MXuBwpqADilWwb8WHK0=
github.com/logrusorgru/aurora v2.0.3+incompatible/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4=
github.com/magefile/mage v1.10.0 h1:3HiXzCUY12kh9bIuyXShaVe529fJfyqoVM42o/uom2g=
github.com/magefile/mage v1.10.0/go.mod h1:z5UZb/iS3GoOSn0JgWuiw7dxlurVYTu+/jHXqQg881A=
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE=
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
github.com/mattn/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
github.com/mattn/go-sqlite3 v2.0.3+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU=
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
... ... @@ -153,27 +234,36 @@ github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3Rllmb
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw=
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8=
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32/go.mod h1:9wM+0iRr9ahx58uYLpLIr5fm8diHn0JbqRycJi6w0Ms=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78=
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo=
github.com/olekukonko/tablewriter v0.0.4/go.mod h1:zq6QwlOf5SlnkVbMSr5EoBv3636FWnp+qbPhuoO21uA=
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg=
github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk=
github.com/onsi/ginkgo v1.14.2 h1:8mVmC9kjFFmA8H4pKMUhcblgifdkOIXPvbhN1T36q1M=
github.com/onsi/ginkgo v1.14.2/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY=
github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
github.com/onsi/gomega v1.10.3 h1:gph6h/qe9GSUw1NhH1gp+qb+h8rXD8Cy60Z32Qw3ELA=
github.com/onsi/gomega v1.10.3/go.mod h1:V9xEwhxec5O8UDM77eCW8vLymOMltsqPVYWrpDsH8xc=
github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc=
github.com/pdfcpu/pdfcpu v0.3.13 h1:VFon2Yo1PJt+sA57vPAeXWGLSZ7Ux3Jl4h02M0+s3dg=
github.com/pdfcpu/pdfcpu v0.3.13/go.mod h1:UJc5xsXg0fpmjp1zOPdyYcAQArc/Zf3V0nv5URe+9fg=
github.com/pelletier/go-toml v1.0.1/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
github.com/pelletier/go-toml v1.8.1/go.mod h1:T2/BmBdy8dvIRq1a/8aqjN41wvWlN4lrapLU/GW4pbc=
github.com/peterh/liner v1.0.1-0.20171122030339-3681c2a91233/go.mod h1:xIteQHvHuaLYG9IFj6mSxM0fCKrs34IrEQUhOYuGPHc=
github.com/pierrec/lz4 v2.2.6+incompatible h1:6aCX4/YZ9v8q69hTyiR7dNLnTA3fgtKHVVW5BCd5Znw=
github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
github.com/pierrec/lz4 v2.2.6+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
github.com/pierrec/lz4 v2.5.1+incompatible h1:Yq0up0149Hh5Ekhm/91lgkZuD1ZDnXNM26bycpTzYBM=
github.com/pierrec/lz4 v2.5.1+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
... ... @@ -182,6 +272,7 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
github.com/prometheus/client_golang v1.5.1/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU=
github.com/prometheus/client_golang v1.7.0 h1:wCi7urQOGBsYcQROHqpUUX4ct84xp40t9R9JX0FuA/U=
github.com/prometheus/client_golang v1.7.0/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M=
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
... ... @@ -190,10 +281,12 @@ github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:
github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M=
github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4=
github.com/prometheus/common v0.10.0 h1:RyRA7RzGXQZiW+tGMr7sxa85G1z0yOpM1qq5c8lNawc=
github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo=
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A=
github.com/prometheus/procfs v0.1.3 h1:F0+tqvhOksq22sc6iCHF5WGlWjdwj92p0udFh1VFBS8=
github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU=
github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a h1:9ZKAASQSHhDYGoxY8uLVpewe1GDZ2vu2Tr/vTdVAkFQ=
... ... @@ -202,9 +295,17 @@ github.com/richardlehane/mscfb v1.0.3 h1:rD8TBkYWkObWO0oLDFCbwMeZ4KoalxQy+QgniCj
github.com/richardlehane/mscfb v1.0.3/go.mod h1:YzVpcZg9czvAuhk9T+a3avCpcFPMUWm7gK3DypaEsUk=
github.com/richardlehane/msoleps v1.0.1 h1:RfrALnSNXzmXLbGct/P2b4xkFz4e8Gmj/0Vj9M9xC1o=
github.com/richardlehane/msoleps v1.0.1/go.mod h1:BWev5JBpU9Ko2WAgmZEuiz4/u3ZYTKbjLycmwiWUfWg=
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/segmentio/kafka-go v0.4.2 h1:QXZ6q9Bu1JkAJQ/CQBb2Av8pFRG8LQ0kWCrLXgQyL8c=
github.com/segmentio/kafka-go v0.4.2/go.mod h1:Inh7PqOsxmfgasV8InZYKVXWsdjcCq2d9tFV75GLbuM=
github.com/shiena/ansicolor v0.0.0-20151119151921-a422bbe96644 h1:X+yvsM2yrEktyI+b2qND5gpH8YhURn0k8OCaeRnkINo=
github.com/shiena/ansicolor v0.0.0-20151119151921-a422bbe96644/go.mod h1:nkxAfR/5quYxwPZhyDxgasBMnRtBZd0FCEpawpjMUFg=
github.com/shirou/gopsutil v0.0.0-20180427012116-c95755e4bcd7/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=
github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4/go.mod h1:qsXQc7+bwAM3Q1u/4XEfrquwF8Lw7D7y5cD8CuHnfIc=
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
github.com/siddontang/go v0.0.0-20170517070808-cb568a3e5cc0/go.mod h1:3yhqj7WBBfRhbBlzyOC3gUxftwsU0u8gqevxwIHQpMw=
github.com/siddontang/goredis v0.0.0-20150324035039-760763f78400/go.mod h1:DDcKzU3qCuvj/tPnimWSsZZzvk9qvkvrIL5naVBPh5s=
github.com/siddontang/rdb v0.0.0-20150307021120-fc89ed2e418d/go.mod h1:AMEsy7v5z92TR1JKMkLLoaOQk++LVnOKL3ScbJ8GNGA=
... ... @@ -212,6 +313,11 @@ github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPx
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
github.com/sirupsen/logrus v1.8.0 h1:nfhvjKcUMhBMVqbKHJlk5RPrrfYr/NMo3692g0dwfWU=
github.com/sirupsen/logrus v1.8.0/go.mod h1:4GuYW9TZmE769R5STWrRakJc4UqQ3+QQ95fyz7ENv1A=
github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM=
github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI=
github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/ssdb/gossdb v0.0.0-20180723034631-88f6b59b84ec/go.mod h1:QBvMkMya+gXctz3kmljlUCu/yB3GZ6oee+dUozsezQE=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
... ... @@ -224,9 +330,17 @@ github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5Cc
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/syndtr/goleveldb v0.0.0-20160425020131-cfa635847112/go.mod h1:Z4AUp2Km+PwemOoO/VB5AOx9XSsIItzFjoJlOSiYmn0=
github.com/syndtr/goleveldb v0.0.0-20181127023241-353a9fca669c/go.mod h1:Z4AUp2Km+PwemOoO/VB5AOx9XSsIItzFjoJlOSiYmn0=
github.com/tal-tech/go-queue v1.0.5 h1:cd2o0lPjAFJKIXuEbQvsGypUhzz6FLib4FVVAyxsMtY=
github.com/tal-tech/go-queue v1.0.5/go.mod h1:gQK4Eg8pqel8Z9r1hjlSXbJFavLeJQVyTSwBKeAnpm8=
github.com/tal-tech/go-zero v1.0.21 h1:IB0c6zmkhUERcagSLPrlVT4oA74yE+l2w2K1ujW0sY8=
github.com/tal-tech/go-zero v1.0.21/go.mod h1:llP5PQjnATfnzZo/lo5unjR41njzoL3lkGO/KXbnisw=
github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
github.com/tmc/grpc-websocket-proxy v0.0.0-20171017195756-830351dc03c6/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc h1:9lRDQMhESg+zvGYmW5DyG0UqvY96Bu5QYsTLvCHdrgo=
github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc/go.mod h1:bciPuU6GHm1iF1pBvUfxfsH0Wmnc2VbpgvbI9ZWuIRs=
github.com/ugorji/go v0.0.0-20171122102828-84cb69a8af83/go.mod h1:hnLbHMwcvSihnDhEfx2/BzKp2xb0Y+ErdfYcrs9tkJQ=
github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
github.com/urfave/cli v1.22.4/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
github.com/vmihailenco/bufpool v0.1.11 h1:gOq2WmBrq0i2yW5QJ16ykccQ4wH9UyEsgLm6czKAd94=
github.com/vmihailenco/bufpool v0.1.11/go.mod h1:AFf/MOy3l2CFTKbxwt0mp2MwnqjNEs5H/UxrkA5jxTQ=
github.com/vmihailenco/msgpack/v5 v5.2.0/go.mod h1:fEM7KuHcnm0GvDCztRpw9hV0PuoO2ciTismP6vjggcM=
... ... @@ -237,28 +351,42 @@ github.com/vmihailenco/tagparser v0.1.2/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgq
github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g=
github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds=
github.com/wendal/errors v0.0.0-20130201093226-f66c77a7882b/go.mod h1:Q12BUT7DqIlHRmgv3RskH+UCM/4eqVMgI0EMmlSpAXc=
github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c h1:u40Z8hqBAAQyv+vATcGgV0YCnDjqSL7/q/JyPhhJSPk=
github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I=
github.com/xdg/stringprep v1.0.0 h1:d9X0esnoa3dFsV0FG35rAT0RIhYFlPq7MiP+DW89La0=
github.com/xdg/stringprep v1.0.0/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y=
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
github.com/xlab/treeprint v0.0.0-20180616005107-d6fb6747feb6/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg=
github.com/xuri/efp v0.0.0-20210322160811-ab561f5b45e3 h1:EpI0bqf/eX9SdZDwlMmahKM+CDBgNbsXMhsN28XrM8o=
github.com/xuri/efp v0.0.0-20210322160811-ab561f5b45e3/go.mod h1:ybY/Jr0T0GTCnYjKqmdwxyxn2BQf2RcQIIvex5QldPI=
github.com/xuri/excelize/v2 v2.4.1 h1:veeeFLAJwsNEBPBlDepzPIYS1eLyBVcXNZUW79exZ1E=
github.com/xuri/excelize/v2 v2.4.1/go.mod h1:rSu0C3papjzxQA3sdK8cU544TebhrPUoTOaGPIh0Q1A=
github.com/xwb1989/sqlparser v0.0.0-20180606152119-120387863bf2/go.mod h1:hzfGeIUDq/j97IG+FhNqkowIyEcD88LrW6fyU3K3WqY=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/gopher-lua v0.0.0-20171031051903-609c9cd26973/go.mod h1:aEV29XrmTYFr3CiRxZeGHpkvbwq+prZduBqMaascyCU=
github.com/yuin/gopher-lua v0.0.0-20191220021717-ab39c6098bdb/go.mod h1:gqRgreBUhTSL0GeU64rtZ3Uq3wtjOa/TB2YfrtkCbVQ=
go.etcd.io/bbolt v1.3.4/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ=
go.etcd.io/etcd v0.0.0-20200402134248-51bdeb39e698/go.mod h1:YoUyTScD3Vcv2RBm3eGVOq7i1ULiz3OuXoQFWOirmAM=
go.etcd.io/etcd v3.3.25+incompatible/go.mod h1:yaeTdrJi5lOmYerz05bd8+V7KubZs8YSFZfzsF9A6aI=
go.opentelemetry.io/otel v0.17.0/go.mod h1:Oqtdxmf7UtEvL037ohlgnaYa1h7GtMh0NcSd9eqkC9s=
go.opentelemetry.io/otel/metric v0.17.0/go.mod h1:hUz9lH1rNXyEwWAhIWCMFWKhYtpASgSnObJFnU26dJ0=
go.opentelemetry.io/otel/oteltest v0.17.0/go.mod h1:JT/LGFxPwpN+nlsTiinSYjdIx3hZIGqHCpChcIZmdoE=
go.opentelemetry.io/otel/trace v0.17.0/go.mod h1:bIujpqg6ZL6xUTubIUgziI1jSaUPthmabA/ygf/6Cfg=
go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
go.uber.org/automaxprocs v1.3.0 h1:II28aZoGdaglS5vVNnspf28lnZpXScxtIozx1lAjdb0=
go.uber.org/automaxprocs v1.3.0/go.mod h1:9CWT6lKIep8U41DDaPiH6eFscnTyjfTANNQNx6LrIcA=
go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU=
go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA=
go.uber.org/zap v1.14.1/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc=
go.uber.org/zap v1.15.0/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20180910181607-0e37d006457b/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190404164418-38d8ce5564a5/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE=
golang.org/x/crypto v0.0.0-20190506204251-e1dfcc566284/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191002192127-34f69633bfdc/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20210218145215-b8e89b74b9df/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
... ... @@ -266,28 +394,38 @@ golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm
golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97 h1:/UOmuWzQfxxo9UtlXMwuQU8CMgg1eZXqTRwkSQJWKOI=
golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/image v0.0.0-20190823064033-3a9bac650e44/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/image v0.0.0-20191009234506-e7c1f5e7dbb8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/image v0.0.0-20210220032944-ac19c3e999fb h1:fqpd0EBDzlHRCjiphRR5Zo/RSWWQlWv34418dnEixWk=
golang.org/x/image v0.0.0-20210220032944-ac19c3e999fb/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs=
golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20191002035440-2ec189313ef0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20201006153459-a7d1128ccaa0/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
... ... @@ -301,11 +439,15 @@ golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20171017063910-8dbc5d05d6ed/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190204203706-41f3e6584952/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
... ... @@ -315,9 +457,14 @@ golang.org/x/sys v0.0.0-20191010194322-b09406accb47/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200728102440-3e129f6d46b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210218155724-8ebf48af031b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
... ... @@ -327,23 +474,30 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1 h1:SrN+KX8Art/Sf4HNj6Zcz06G7
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200410132612-ae9902aceb98/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20201211185031-d93e913c1a58 h1:1Bs6RVeBFtLZ8Yi1Hk07DiOqzvwLD/4hln4iahvFlag=
golang.org/x/tools v0.0.0-20201211185031-d93e913c1a58/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
... ... @@ -355,11 +509,16 @@ google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9Ywl
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/genproto v0.0.0-20190927181202-20e1ac93f88c/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8=
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
google.golang.org/grpc v1.24.0/go.mod h1:XDChyiUovWa60DnaeDeZmSW86xtLtjtZbwvSiRnRtcA=
google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
... ... @@ -368,6 +527,7 @@ google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzi
google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4=
google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c=
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
... ... @@ -376,8 +536,12 @@ gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU=
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw=
gopkg.in/cheggaaa/pb.v1 v1.0.28/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw=
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
gopkg.in/h2non/gock.v1 v1.0.15 h1:SzLqcIlb/fDfg7UvukMpNcWsu7sI5tWwL+KCATZqks0=
gopkg.in/h2non/gock.v1 v1.0.15/go.mod h1:sX4zAkdYX1TRGJ2JY156cFspQn4yRWn6p9EMdODlynE=
gopkg.in/jcmturner/aescts.v1 v1.0.1 h1:cVVZBK2b1zY26haWB4vbBiZrfFQnfbTVrE3xZq6hrEw=
gopkg.in/jcmturner/aescts.v1 v1.0.1/go.mod h1:nsR8qBOg+OucoIW+WMhB3GspUQXq9XorLnQb9XtvcOo=
gopkg.in/jcmturner/dnsutils.v1 v1.0.1 h1:cIuC1OLRGZrld+16ZJvvZxVJeKPsvd5eUIvxfoN5hSM=
... ... @@ -389,20 +553,30 @@ gopkg.in/jcmturner/gokrb5.v7 v7.2.3/go.mod h1:l8VISx+WGYp+Fp7KRbsiUuXTTOnxIc3Tuv
gopkg.in/jcmturner/rpc.v1 v1.1.0 h1:QHIUxTX1ISuAv9dD2wJ9HWQVuWDX/Zc0PfeC2tjc4rU=
gopkg.in/jcmturner/rpc.v1 v1.1.0/go.mod h1:YIdkC4XfD6GXbzje11McwsDuOlZQSb9W4vfLvuNnlv8=
gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA=
gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU=
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
honnef.co/go/tools v0.0.1-2020.1.5/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
mellium.im/sasl v0.2.1 h1:nspKSRg7/SyO0cRGY71OkfHab8tf9kCts6a6oTDut0w=
mellium.im/sasl v0.2.1/go.mod h1:ROaEDLQNuf9vjKqE1SrAfnsobm2YKXT1gnN1uDp1PjQ=
rsc.io/goversion v1.0.0/go.mod h1:Eih9y/uIBS3ulggl7KNJ09xGSLcuNaLgmvvqa07sgfo=
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc=
... ...
... ... @@ -4,14 +4,18 @@ import (
"github.com/beego/beego/v2/server/web"
"github.com/linmadan/egglib-go/log/logrus"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/constant"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/broker"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/cache"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/domainService"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/log"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/util/blur"
_ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/port/beego"
)
func init() {
cache.InitRedist()
domainService.AdvancedSettingInit()
}
func main() {
... ... @@ -19,5 +23,8 @@ func main() {
w, _ := logrus.NewKafkaWriter(constant.KAFKA_HOST, constant.TOPIC_LOG_STASH, false)
log.Logger.AddHook(w)
}
broker.RegisterDefaultPusherClient(constant.KAFKA_HOST, constant.TOPIC_UP_BLOCK_CHAIN)
blur.InitDefaultConfig()
web.Run()
}
... ...
package command
import (
"fmt"
"reflect"
"strings"
"github.com/beego/beego/v2/core/validation"
)
type UserSignUpCommand struct {
// 企业名称
Name string `cname:"用户姓名" json:"userName" valid:"Required"`
// 手机号码
Phone string `cname:"手机号码" json:"phone" valid:"Required"`
// 密码
Password string `cname:"密码" json:"password" valid:"Required"`
// 密码
SmsCode string `cname:"短信验证码" json:"smsCode" valid:"Required"`
}
func (companySignUpCommand *UserSignUpCommand) Valid(validation *validation.Validation) {
//validation.SetError("CustomValid", "未实现的自定义认证")
}
func (companySignUpCommand *UserSignUpCommand) ValidateCommand() error {
valid := validation.Validation{}
b, err := valid.Valid(companySignUpCommand)
if err != nil {
return err
}
if !b {
elem := reflect.TypeOf(companySignUpCommand).Elem()
for _, validErr := range valid.Errors {
field, isExist := elem.FieldByName(validErr.Field)
if isExist {
return fmt.Errorf(strings.Replace(validErr.Message, validErr.Field, field.Tag.Get("cname"), -1))
} else {
return fmt.Errorf(validErr.Message)
}
}
}
return nil
}
... ...
... ... @@ -107,45 +107,36 @@ func (svr AuthService) AuthLoginSms(loginCommand *command.LoginSmsCommand) (inte
//AuthLoginQrcode 扫码登录
func (svr AuthService) AuthLoginQrcode(queryParam *query.QrcodeLoginStatusQuery) (interface{}, error) {
qrmsg := domain.QrcodeMessage{}
failLoginData := map[string]interface{}{
"isLogin": false,
"access": struct{}{},
}
err := qrmsg.ParseToken(queryParam.Key)
cache := cache.LoginQrcodeCache{}
qrcodeMessage, err := cache.Get(queryParam.Key)
if err != nil {
log.Logger.Error(err.Error())
return nil, application.ThrowError(application.TRANSACTION_ERROR, "二维码已失效")
return nil, application.ThrowError(application.BUSINESS_ERROR, "二维码已失效")
}
qrCache := cache.LoginQrcodeCache{}
qrmsgCache, err := qrCache.Get(qrmsg.Id)
if err != nil {
log.Logger.Error(err.Error())
return nil, application.ThrowError(application.TRANSACTION_ERROR, "二维码已失效")
}
if !qrmsgCache.IsLogin {
if !qrcodeMessage.IsLogin {
return failLoginData, nil
}
loginToken := domain.LoginToken{
UserId: qrmsgCache.UserId,
UserBaseId: qrmsgCache.UserBaseId,
Account: qrmsgCache.Account,
UserId: qrcodeMessage.UserId,
UserBaseId: qrcodeMessage.UserBaseId,
Account: qrcodeMessage.Account,
Platform: domain.LoginPlatformWeb,
CompanyId: qrmsgCache.CompanyId,
OrgId: qrmsgCache.OrgId,
}
// accessToken, err := loginToken.GenerateAccessToken()
// if err != nil {
// return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
// }
qrCache.Remove(qrmsgCache.Id)
// _ = accessToken
CompanyId: qrcodeMessage.CompanyId,
OrgId: qrcodeMessage.OrgId,
}
cache.Remove(queryParam.Key)
result, err := svr.getToken(loginToken)
if err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
data := map[string]interface{}{
"isLogin": qrmsgCache.IsLogin,
"isLogin": qrcodeMessage.IsLogin,
"access": result["token"],
}
return data, nil
... ... @@ -153,22 +144,17 @@ func (svr AuthService) AuthLoginQrcode(queryParam *query.QrcodeLoginStatusQuery)
//AuthLoginQrcodeBind 扫码登录-绑定
func (svr AuthService) AuthLoginQrcodeBinding(bindingCmd *command.QrcodeBindingCommand) (interface{}, error) {
qrmsg := domain.QrcodeMessage{}
err := qrmsg.ParseToken(bindingCmd.Key)
if err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, "您扫描的二维码无效,请确认后重新扫描")
}
qrCache := cache.LoginQrcodeCache{}
qrmsgCache, err := qrCache.Get(qrmsg.Id)
qrcodeMessage, err := qrCache.Get(bindingCmd.Key)
if err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, "您扫描的二维码无效,请确认后重新扫描")
return nil, application.ThrowError(application.BUSINESS_ERROR, "您扫描的二维码无效,请确认后重新扫描")
}
if err := qrmsgCache.BindUser(bindingCmd.Operator); err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
if err := qrcodeMessage.BindUser(bindingCmd.Operator); err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
if err := qrCache.Save(*qrmsgCache); err != nil {
if err := qrCache.Save(*qrcodeMessage); err != nil {
log.Logger.Error(err.Error())
return nil, application.ThrowError(application.TRANSACTION_ERROR, "登录失败,请重试")
return nil, application.ThrowError(application.BUSINESS_ERROR, "登录失败,请重试")
}
return struct{}{}, nil
}
... ... @@ -184,13 +170,13 @@ func (svr AuthService) SendSmsCaptcha(smsCodeCommand *command.SendSmsCodeCommand
Account: smsCodeCommand.Phone,
})
if err != nil || userBase.UserInfo.Phone != smsCodeCommand.Phone {
return application.ThrowError(application.TRANSACTION_ERROR, "输入的手机号不是平台用户,请重新输入")
return application.ThrowError(application.BUSINESS_ERROR, "输入的手机号不是平台用户,请重新输入")
}
}
smsServeGateway := sms_serve.NewHttplibHttplibSmsServe()
err := smsServeGateway.SendSms(smsCodeCommand.Phone)
if err != nil {
return application.ThrowError(application.TRANSACTION_ERROR, err.Error())
return application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
return nil
}
... ... @@ -427,6 +413,27 @@ func (svr AuthService) CompanySignUp(companySignUpCommand *command.CompanySignUp
return companySignUpCommand, err
}
func (svr AuthService) UserSignUp(signUpCommand *command.UserSignUpCommand) (interface{}, error) {
if err := signUpCommand.ValidateCommand(); err != nil {
return nil, application.ThrowError(application.ARG_ERROR, err.Error())
}
smsServeGateway := sms_serve.NewHttplibHttplibSmsServe()
err := smsServeGateway.CheckSmsCode(signUpCommand.Phone, signUpCommand.SmsCode)
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(domain.Operator{})
_, err = creationUserGateway.AuthUserSignUp(allied_creation_user.ReqAuthUserSignUp{
Name: signUpCommand.Name,
Phone: signUpCommand.Phone,
Password: signUpCommand.Password,
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
return signUpCommand, err
}
// ResetPassword 重置密码(找回密码)
func (svr AuthService) ResetPassword(resetPasswordCommand *command.ResetPasswordCommand) (interface{}, error) {
if err := resetPasswordCommand.ValidateCommand(); err != nil {
... ... @@ -474,7 +481,7 @@ func (svr AuthService) getUserInfo(operator domain.Operator) (interface{}, error
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
var user = map[string]interface{}{
"userId": resultUser.UserBaseID,
"userId": resultUser.UserID,
//"userOpenId": fmt.Sprintf("%v",resultUser.UserBaseID),
"userInfo": map[string]interface{}{
"userName": resultUser.UserInfo.UserName,
... ... @@ -496,15 +503,9 @@ func (svr AuthService) getUserInfo(operator domain.Operator) (interface{}, error
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
resultOrg, err := creationUserGateway.OrgGet(allied_creation_user.ReqOrgGet{
OrgId: int(operator.OrgId),
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
var user = map[string]interface{}{
"userId": resultUser.UserBaseId,
//"publicUserId":fmt.Sprintf("%v",resultUser.UserBaseId),
"userId": resultUser.UserId,
"userType": resultUser.UserType,
"userCode": resultUser.UserCode,
"userInfo": map[string]interface{}{
... ... @@ -515,22 +516,31 @@ func (svr AuthService) getUserInfo(operator domain.Operator) (interface{}, error
"email": resultUser.UserInfo.Email,
},
"department": resultUser.Department,
"company": map[string]interface{}{
"companyId": resultUser.Company.CompanyId,
"companyName": resultUser.Company.CompanyName,
"logo": resultUser.Company.Logo,
"systemName": resultUser.Company.SystemName,
"address": resultUser.Company.Address,
},
"im": resultUser.IM,
"org": map[string]interface{}{
"favoriteMenus": resultUser.FavoriteMenus,
}
if operator.OrgId > 0 {
resultOrg, err := creationUserGateway.OrgGet(allied_creation_user.ReqOrgGet{
OrgId: int(operator.OrgId),
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
user["org"] = map[string]interface{}{
"orgId": resultOrg.OrgID,
"orgName": resultOrg.OrgName,
"orgCode": resultOrg.OrgCode,
"companyId": resultOrg.CompanyID,
},
//"currentLoginOrg": resultUser.Org,
"favoriteMenus": resultUser.FavoriteMenus,
}
}
if resultUser.Company != nil {
user["company"] = map[string]interface{}{
"companyId": resultUser.Company.CompanyId,
"companyName": resultUser.Company.CompanyName,
"logo": resultUser.Company.Logo,
"systemName": resultUser.Company.SystemName,
"address": resultUser.Company.Address,
}
}
return user, nil
}
... ... @@ -658,6 +668,7 @@ loopUser1:
if err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, "账号不存在")
}
loginToken.UserId = int64(userBase.UserID)
loginToken.UserBaseId = int64(userBase.UserBaseID)
if userBase.UserBaseID > 0 {
cooperationUsers, _ := creationUserGateway.UserSearch(allied_creation_user.ReqUserSearch{
... ... @@ -721,19 +732,18 @@ func (svr AuthService) GetCompanyOrgsByUser(queryParam *query.GetCompanyOrgsByUs
//GetQrcode 获取扫码登录需要的二维码
func (svr AuthService) GetQrcode() (interface{}, error) {
qrmsg := domain.QrcodeMessage{}
_, err := qrmsg.GenerateImageBase64() //imgBase64
qrcodeMessage := domain.QrcodeMessage{}
_, err := qrcodeMessage.Init()
if err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
qrCache := cache.LoginQrcodeCache{}
err = qrCache.Save(qrmsg)
err = qrCache.Save(qrcodeMessage)
if err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
data := map[string]interface{}{
//"image": imgBase64,
"key": qrmsg.Token,
"key": qrcodeMessage.Token,
}
return data, nil
}
... ...
package query
import (
"fmt"
"github.com/beego/beego/v2/core/validation"
)
type GetAdvancedSettingQuery struct {
//操作人
//操作人
//Operator domain.Operator `json:"-"`
Model string `json:"model"`
}
func (q *GetAdvancedSettingQuery) Valid(validation *validation.Validation) {
if len(q.Model) == 0 {
validation.Error("模型名称不能为空")
}
}
func (q *GetAdvancedSettingQuery) ValidateQuery() error {
valid := validation.Validation{}
b, err := valid.Valid(q)
if err != nil {
return err
}
if !b {
for _, validErr := range valid.Errors {
return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
}
}
return nil
}
... ...
package query
import (
"fmt"
"reflect"
"strings"
"github.com/beego/beego/v2/core/validation"
)
type GetBlockChainTokenQuery struct {
// 操作类型:
//1-交易哈希溯源
//2-溯源ID溯源
//3-验真
Type int `cname:"操作类型" json:"type" valid:"Required"`
// 参数
UpChainId int `cname:"上链Id" json:"upChainId,omitempty" valid:"Required"`
}
func (listBlockChain *GetBlockChainTokenQuery) Valid(validation *validation.Validation) {
//validation.SetError("CustomValid", "未实现的自定义认证")
}
func (listBlockChain *GetBlockChainTokenQuery) ValidateQuery() error {
valid := validation.Validation{}
b, err := valid.Valid(listBlockChain)
if err != nil {
return err
}
if !b {
elem := reflect.TypeOf(listBlockChain).Elem()
for _, validErr := range valid.Errors {
field, isExist := elem.FieldByName(validErr.Field)
if isExist {
return fmt.Errorf(strings.Replace(validErr.Message, validErr.Field, field.Tag.Get("cname"), -1))
} else {
return fmt.Errorf(validErr.Message)
}
}
}
return nil
}
... ...
... ... @@ -11,7 +11,7 @@ type GetLatestVersionQuery struct {
//操作人
//Operator domain.Operator `json:"-"`
DeviceType string `json:"-"`
VersionNo int `json:"versionNo"`
VersionNo int `json:"versionNo,string"`
Channel int `json:"channel"`
Request *http.Request `json:"-"`
}
... ...
package service
import (
"fmt"
"github.com/linmadan/egglib-go/core/application"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/common/query"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_basic"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_user"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/version_server"
)
const IOSPage = "http://fir.fjmaimaimai.com/pdvn"
... ... @@ -16,102 +22,91 @@ func NewCommonService(options map[string]interface{}) *CommonService {
//GetDictionaryByCode 根据code获取字典数据
func (srv *CommonService) GetDictionaryByCode(getDictionaryQuery *query.GetDictionaryByCodeQuery) (interface{}, error) {
//creationBasicGateway := allied_creation_basic.NewHttplibAlliedCreationBasic(domain.Operator{})
//result, err := creationBasicGateway.GetDictionarysByCode(allied_creation_basic.ReqGetDictionaryByCode{
// DictCode: getDictionaryQuery.DictCode,
//})
//if err != nil {
// return nil, err
//}
//return result, nil
// TODO:测试使用,后期移除掉
type dictItem struct {
ItemCode string `json:"itemCode"`
ItemValue string `json:"itemValue"`
creationBasicGateway := allied_creation_basic.NewHttplibAlliedCreationBasic(domain.Operator{})
result, err := creationBasicGateway.GetDictionarysByCode(allied_creation_basic.ReqGetDictionaryByCode{
DictCodes: getDictionaryQuery.DictCode,
})
if err != nil {
return nil, err
}
var response = make([]interface{}, 0)
if result == nil || len(result.Dictionarys) == 0 {
return response, nil
}
dictionaries := make([]interface{}, 0)
for i := range getDictionaryQuery.DictCode {
switch getDictionaryQuery.DictCode[i] {
case "MenuType":
dictionaries = append(dictionaries, map[string]interface{}{
"dictName": "菜单类型",
"dictItems": []dictItem{
{"目录", "catalog"},
{"菜单", "menu"},
{"按钮", "button"},
},
"dictCode": "MenuType",
})
case "XTZD-001":
dictionaries = append(dictionaries, map[string]interface{}{
"dictName": "规模",
"dictItems": []dictItem{
{"1", "0~100人"},
{"2", "101~200人"},
{"3", "201~500人"},
{"4", "501~1000人"},
{"5", "1000人以上"},
},
"dictCode": "XTZD-001",
})
case "XTZD-002":
dictionaries = append(dictionaries, map[string]interface{}{
"dictName": "产业类型",
"dictItems": []dictItem{
{"1", "食品行业"},
{"2", "电子行业"},
{"3", "纺织业"},
},
"dictCode": "XTZD-002",
})
code := getDictionaryQuery.DictCode[i]
for j := range result.Dictionarys {
item := result.Dictionarys[j]
if item.DictCode == code {
response = append(response, item)
break
}
}
}
return map[string]interface{}{"dictionarys": dictionaries}, nil
return map[string]interface{}{
"dictionarys": response,
}, nil
}
//LatestVersionInfo 版本升级
func (srv *CommonService) LatestVersionInfo(q *query.GetLatestVersionQuery) (interface{}, error) {
page := IOSPage
if q.DeviceType == "1" { // 安卓
page = ANDPage
vs := version_server.NewHttpLibVersionServer()
data, err := vs.GetLatestVersion(q.Request, version_server.ReqLatestVersion{
VersionNo: q.VersionNo,
Channel: q.Channel,
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
return map[string]interface{}{
"version": map[string]interface{}{
"downloadPage": page,
"downloadFile": "",
"updateType": 0,
},
}, nil
//vs:= version_server.NewHttpLibVersionServer()
//data,err:= vs.GetLatestVersion(q.Request,version_server.ReqLatestVersion{
// VersionNo: q.VersionNo,
// Channel: q.Channel,
//})
//if err != nil {
// return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
//}
//return data, nil
return data, nil
}
//AppSharing 获取分享链接地址
func (srv *CommonService) AppSharing(q *query.GetLatestVersionQuery) (interface{}, error) {
page := IOSPage
if q.DeviceType == "1" { // 安卓
page = ANDPage
}
return map[string]interface{}{
"version": map[string]interface{}{
"downloadPage": page,
"downloadFile": "",
},
}, nil
//vs:= version_server.NewHttpLibVersionServer()
//data,err:= vs.GetLatestVersion(q.Request,version_server.ReqLatestVersion{
// VersionNo: q.VersionNo,
// Channel: q.Channel,
//})
//if err != nil {
// return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
//page := IOSPage
//if q.DeviceType == "1" { // 安卓
// page = ANDPage
//}
//return data, nil
//return map[string]interface{}{
// "version": map[string]interface{}{
// "downloadPage": page,
// "downloadFile": "",
// },
//}, nil
vs := version_server.NewHttpLibVersionServer()
data, err := vs.GetLatestVersion(q.Request, version_server.ReqLatestVersion{
VersionNo: q.VersionNo,
Channel: q.Channel,
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
return data, nil
}
// AdvancedSetting 高级查询 配置
func (srv *CommonService) AdvancedSetting(q *query.GetAdvancedSettingQuery) (interface{}, error) {
if err := q.ValidateQuery(); err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
m, ok := domain.GetModel(q.Model)
if !ok {
return nil, application.ThrowError(application.BUSINESS_ERROR, fmt.Sprintf("模型:%v 不存在", q.Model))
}
return m, nil
}
func (srv *CommonService) BlockChainBrowser(q *query.GetBlockChainTokenQuery) (interface{}, error) {
if q.UpChainId == 0 {
return nil, application.ThrowError(application.BUSINESS_ERROR, "未查询到区块链数据")
}
alliedCreationUser := allied_creation_user.NewHttplibAlliedCreationUser(domain.Operator{})
result, err := alliedCreationUser.BlockChainsToken(allied_creation_user.ReqBlockChainToken{
Type: q.Type,
UpChainID: q.UpChainId,
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
return result, nil
}
... ...
package command
import (
"fmt"
"github.com/beego/beego/v2/core/validation"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
)
type SearchCooperationProjectContractQuery struct {
//操作人
Operator domain.Operator `json:"-"`
// 查询偏离量
PageNumber int `json:"pageNumber"`
// 查询限制
PageSize int `json:"pageSize" valid:"Required"`
//项目ID
CooperationProjectId int64 `json:"cooperationProjectId"`
}
func (listCooperationProjectQuery *SearchCooperationProjectContractQuery) Valid(validation *validation.Validation) {
}
func (listCooperationProjectQuery *SearchCooperationProjectContractQuery) ValidateQuery() error {
valid := validation.Validation{}
b, err := valid.Valid(listCooperationProjectQuery)
if err != nil {
return err
}
if !b {
for _, validErr := range valid.Errors {
return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
}
}
return nil
}
... ...
package command
import (
"fmt"
"github.com/beego/beego/v2/core/validation"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
)
type PersonCooperationProjectSharedInfoAttachmentQuery struct {
//操作人
Operator domain.Operator `json:"-"`
// 用户
UserId int64 `json:"userId" valid:"Required"`
// 项目ID
ProjectId int64 `json:"cooperationProjectId,string" valid:"Required"`
// 合约ID
ContractId int64 `json:"cooperationContractId,string" valid:"Required"`
// 附件类型 1:合约附件 2:支付凭证
AttachmentType int `json:"attachmentType" valid:"Required"`
}
func (updateCooperationProjectCommand *PersonCooperationProjectSharedInfoAttachmentQuery) Valid(validation *validation.Validation) {
}
func (updateCooperationProjectCommand *PersonCooperationProjectSharedInfoAttachmentQuery) ValidateCommand() error {
valid := validation.Validation{}
b, err := valid.Valid(updateCooperationProjectCommand)
if err != nil {
return err
}
if !b {
for _, validErr := range valid.Errors {
return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
}
}
return nil
}
... ...
... ... @@ -16,6 +16,8 @@ type CreateFeedbackCommand struct {
FeedbackContent string `cname:"合约承接方反馈内容" json:"feedbackContent" valid:"Required"`
// 共创合约编号
CooperationContractNumber string `cname:"共创合约编号" json:"cooperationContractNumber" valid:"Required"`
// 共创合约Id
CooperationContractId int64 `cname:"共创合约编号" json:"cooperationContractId"`
}
func (cmd *CreateFeedbackCommand) Valid(validation *validation.Validation) {
... ...
package dto
import "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
type CooperationProjectSearchItem struct {
allied_creation_cooperation.DataCooperationProjectSearchItem
// 共创项目关联的合约数量
//ContractCount int `json:"contractCount"`
}
... ...
package dto
// 共创项目详情
type CooperationProjectItemSharedInfo struct {
Project *CooperationProjectInfo
}
... ...
... ... @@ -16,6 +16,7 @@ func (srv PersonDividendsService) GetDividendContracts(cmd *command.GetDividendC
cmd.Operator)
result, err := gateway.CooperationStatistics(allied_creation_cooperation.GetContractDividends, map[string]interface{}{
"contractId": cmd.ContractId,
"userBaseId": cmd.Operator.UserBaseId,
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
... ...
... ... @@ -163,7 +163,6 @@ func (srv CooperationApplicationsService) PersonSearchCooperationApplications(ap
resultApplications, err := creationCooperationGateway.CooperationApplicationsSearch(allied_creation_cooperation.ReqCooperationApplicationSearch{
PageNumber: applicationQuery.PageNumber + 1,
PageSize: applicationQuery.PageSize,
CompanyId: int(applicationQuery.Operator.CompanyId),
CooperationApplicationStatus: applicationQuery.Status,
UserBaseId: applicationQuery.Operator.UserBaseId,
IsCanceled: 1,
... ...
package service
import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_user"
"strconv"
"github.com/linmadan/egglib-go/core/application"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/cooperation/command"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/cooperation/dto"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/constant"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_user"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/log"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/util/blur"
"strconv"
"strings"
)
// CooperationProjectService 共创项目服务
... ... @@ -97,10 +100,35 @@ func (srv CooperationProjectService) SearchCooperationProject(projectQuery *comm
Status: int(projectQuery.Status),
OrgId: projectQuery.Operator.OrgId,
})
var projects []dto.CooperationProjectSearchItem
if err != nil {
return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
return int(result.Total), result.List, nil
for i := range result.List {
projects = append(projects, dto.CooperationProjectSearchItem{
result.List[i],
})
}
return int(result.Total), projects, nil
}
// SearchCooperationProject 企业获取共创项目列表
func (srv CooperationProjectService) SearchCooperationProjectContracts(projectQuery *command.SearchCooperationProjectContractQuery) (int, interface{}, error) {
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
projectQuery.Operator)
result, err := creationCooperationGateway.CooperationStatistics(
allied_creation_cooperation.CompanyCooperationProjectContracts,
map[string]interface{}{
"offset": projectQuery.PageSize * projectQuery.PageNumber,
"limit": projectQuery.PageSize,
"projectId": projectQuery.CooperationProjectId,
},
)
if err != nil {
return 0, nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
return int(0), result, nil
}
// PersonSearchCooperationProject 共创用户获取共创项目列表
... ... @@ -117,6 +145,7 @@ func (srv CooperationProjectService) PersonSearchCooperationProject(projectQuery
SearchCooperationProjectExtQueriesFlag: 1,
SearchCooperationProjectExtQueries: extQueries,
SortByStatus: 1,
IsSkipFetchProjectModel: true,
})
if err != nil {
return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
... ... @@ -140,6 +169,9 @@ func extQuires(operator domain.Operator) []*allied_creation_cooperation.SearchCo
}
for i := range users.Users {
u := users.Users[i]
if u.UserType == domain.UserTypeVisitor {
continue
}
q := &allied_creation_cooperation.SearchCooperationProjectExtQuery{
ExtCompanyId: int64(u.Company.CompanyId),
//ExtOrgId: int64(u.Org.OrgId),
... ... @@ -176,3 +208,99 @@ func extQuires(operator domain.Operator) []*allied_creation_cooperation.SearchCo
// }
// return int(result.Total), result.List, nil
//}
func (srv CooperationProjectService) PersonSearchCooperationProjectShareInfo(projectQuery *command.GetCooperationProjectQuery) (interface{}, error) {
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
projectQuery.Operator)
result, err := creationCooperationGateway.CooperationStatistics(
allied_creation_cooperation.PersonCooperationProjectSharedInfo,
map[string]interface{}{
"projectId": projectQuery.CooperationProjectId,
"userBaseId": projectQuery.Operator.UserBaseId,
"sensitive": true,
},
)
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
return result, nil
}
func (srv CooperationProjectService) PersonSearchCooperationProjectShareInfoAttachment(projectQuery *command.PersonCooperationProjectSharedInfoAttachmentQuery) (interface{}, error) {
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
projectQuery.Operator)
response := struct {
Attachment *domain.Attachment `json:"attachment"`
UserBaseId int64 `json:"userBaseId"`
}{}
err := creationCooperationGateway.CooperationStatisticsWithObject(
allied_creation_cooperation.PersonCooperationProjectSharedInfoAttachment,
map[string]interface{}{
"userId": projectQuery.UserId,
"cooperationContractId": projectQuery.ContractId,
"cooperationProjectId": projectQuery.ProjectId,
"attachmentType": projectQuery.AttachmentType,
}, &response,
)
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
// 不是本人查看需要做模糊处理
if response.Attachment != nil && len(response.Attachment.Url) > 0 {
if response.UserBaseId != projectQuery.Operator.UserBaseId {
// 大文件报错
if response.Attachment.FileSize != 0 && response.Attachment.FileSize > 10*1024*1024 {
return nil, application.ThrowError(application.BUSINESS_ERROR, "文件过大,不可查看")
}
file, err := blur.FileBlur(response.Attachment.Url, true)
if err != nil { // || len(file)==0
log.Logger.Error(err.Error())
return nil, application.ThrowError(application.BUSINESS_ERROR, "文件加载错误,请重试")
}
if !(strings.HasPrefix(file, "http") || strings.HasPrefix(file, "https")) {
file = constant.ALLIED_CREATION_GATEWAY_HOST + "/" + file
}
response.Attachment.Url = file
}
}
return map[string]interface{}{
"attachment": response.Attachment,
}, nil
}
// PersonSearchCooperationProject 共创用户获取共创项目列表
func (srv CooperationProjectService) PersonSearchCooperationProjectStarred(projectQuery *command.PersonSearchCooperationProjectQuery) (int, interface{}, error) {
extQueries := extQuires(projectQuery.Operator)
if projectQuery.Operator.UserBaseId == 0 {
return 0, []struct{}{}, nil
}
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(projectQuery.Operator)
userInfo, err := creationUserGateway.AuthUserBaseInfo(allied_creation_user.ReqAuthUserBase{
UserBaseId: projectQuery.Operator.UserBaseId,
})
if err != nil {
return 0, nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
if len(userInfo.FavoriteOrg()) == 0 {
return 0, []struct{}{}, nil
}
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
projectQuery.Operator)
result, err := creationCooperationGateway.CooperationProjectsSearch(allied_creation_cooperation.ReqCooperationProjectSearch{
PageNumber: projectQuery.PageNumber + 1, //手机序号从0开始的
PageSize: projectQuery.PageSize,
//Status: 1, //搜索状态为“招标中”项目
Keyword: projectQuery.Keyword,
OrgIds: userInfo.FavoriteOrg(),
IsSkipFetchProjectModel: true,
SortByStatus: 1,
SearchCooperationProjectExtQueriesFlag: 1,
SearchCooperationProjectExtQueries: extQueries,
})
if err != nil {
return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
return int(result.Total), result.List, nil
}
... ...
... ... @@ -78,7 +78,7 @@ func (srv PersonCreditAccountService) PaymentHistoryStatistics(cmd *command.Cred
gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
cmd.Operator)
queryOptions := map[string]interface{}{
"orgId": cmd.Operator.OrgId,
//"orgId": cmd.Operator.OrgId,
"userBaseId": cmd.Operator.UserBaseId,
"offset": cmd.PageNumber * cmd.PageSize,
"limit": cmd.PageSize,
... ...
... ... @@ -41,8 +41,9 @@ func (srv PersonStatisticsService) IndexStatistics(cmd *command.IndexStatisticsC
users, err := gatewayUser.UserSearch(allied_creation_user.ReqUserSearch{
Limit: 1,
Offset: 0,
//UserType: domain.UserTypeCooperation,
UserType: domain.UserTypeCooperation | domain.UserTypeEmployee,
UserBaseId: cmd.Operator.UserBaseId,
EnableStatus: domain.UserStatusEnable,
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
... ... @@ -106,6 +107,7 @@ func (srv PersonStatisticsService) CompanyStatistics(cmd *command.CooperationPer
Limit: 100,
Offset: 0,
UserBaseId: cmd.Operator.UserBaseId,
EnableStatus: domain.UserStatusEnable,
//UserType: domain.UserTypeCooperation,
})
if err != nil {
... ... @@ -114,9 +116,16 @@ func (srv PersonStatisticsService) CompanyStatistics(cmd *command.CooperationPer
var companyList []int
for i := range users.Users {
user := users.Users[i]
if user.Org == nil || user.Org.OrgId == 0 {
continue
}
companyList = append(companyList, user.Org.OrgId)
}
if len(companyList) == 0 {
return map[string]interface{}{
"list": []struct{}{},
}, nil
}
gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
cmd.Operator)
result, err := gateway.CooperationStatistics(allied_creation_cooperation.CooperationCompanyStatistics, map[string]interface{}{
... ... @@ -145,19 +154,27 @@ func (srv PersonStatisticsService) CompanyStatistics(cmd *command.CooperationPer
if err := json.UnmarshalFromString(json.MarshalToString(result), &cooperationCompanyStatisticsResponses); err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
if len(cooperationCompanyStatisticsResponses) != len(users.Users) {
return nil, application.ThrowError(application.BUSINESS_ERROR, "数据不匹配")
}
//if len(cooperationCompanyStatisticsResponses) != len(users.Users) {
// return nil, application.ThrowError(application.BUSINESS_ERROR, "数据不匹配")
//}
var values = make([]interface{}, 0)
for i := range users.Users {
user := users.Users[i]
cooperationCompanyStatisticsResponses[i].Company = domain.Company{
if user.Company == nil {
continue
}
for j := range cooperationCompanyStatisticsResponses {
if user.Org != nil && cooperationCompanyStatisticsResponses[j].OrgId == int64(user.Org.OrgId) {
cooperationCompanyStatisticsResponses[j].Company = domain.Company{
CompanyID: user.Org.OrgId,
CompanyName: user.Org.OrgName,
Logo: user.Company.Logo,
}
values = append(values, cooperationCompanyStatisticsResponses[i])
values = append(values, cooperationCompanyStatisticsResponses[j])
}
}
}
return map[string]interface{}{
"list": values,
... ... @@ -175,6 +192,8 @@ func (srv PersonStatisticsService) CooperationProjectRecommend(projectQuery *com
PageNumber: projectQuery.PageNumber + 1,
PageSize: projectQuery.PageSize,
CooperationProjectUndertakerType: 3,
//Status: 1,
IsSkipFetchProjectModel: true,
// Status: 1,
SortByStatus: 1,
})
... ...
... ... @@ -36,6 +36,7 @@ func (srv UndertakerFeedbackService) CreateFeedback(cmd *command.CreateFeedbackC
FeedbackContent: cmd.FeedbackContent,
CooperationContractNumber: cmd.CooperationContractNumber,
UnderTakerUid: cmd.Operator.UserId,
CooperationContractId: cmd.CooperationContractId,
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
... ...
package command
import (
"fmt"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
"reflect"
"strings"
"github.com/beego/beego/v2/core/validation"
)
type UpdateFavoriteCommand struct {
Operator domain.Operator `json:"-"`
//UserBaseId int64 `json:"userBaseId" `
// 菜单编码列表
Item string `json:"item" valid:"Required"`
// 项唯一标识
ItemId int64 `cname:"项唯一标识" json:"itemId" valid:"Required"`
// 用户Id 用户唯一标识
Action int64 `cname:"操作类型 1:关注 2:取消关注 " json:"action" valid:"Required"`
}
func (UpdateFavoriteCommand *UpdateFavoriteCommand) Valid(validation *validation.Validation) {
//validation.SetError("CustomValid", "未实现的自定义认证")
}
func (UpdateFavoriteCommand *UpdateFavoriteCommand) ValidateCommand() error {
valid := validation.Validation{}
b, err := valid.Valid(UpdateFavoriteCommand)
if err != nil {
return err
}
if !b {
elem := reflect.TypeOf(UpdateFavoriteCommand).Elem()
for _, validErr := range valid.Errors {
field, isExist := elem.FieldByName(validErr.Field)
if isExist {
return fmt.Errorf(strings.Replace(validErr.Message, validErr.Field, field.Tag.Get("cname"), -1))
} else {
return fmt.Errorf(validErr.Message)
}
}
}
return nil
}
... ...
... ... @@ -284,3 +284,26 @@ func (srv UserService) CooperationOrg(operator domain.Operator) (interface{}, er
"orgs": ret,
}, nil
}
// 设置收藏菜单
func (srv UserService) UpdateFavorite(menuFavoriteCommand *command.UpdateFavoriteCommand) (interface{}, error) {
if err := menuFavoriteCommand.ValidateCommand(); err != nil {
return nil, application.ThrowError(application.ARG_ERROR, err.Error())
}
if menuFavoriteCommand.Operator.UserBaseId == 0 {
return nil, application.ThrowError(application.ARG_ERROR, "用户未登录")
}
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
menuFavoriteCommand.Operator,
)
result, err := creationUserGateway.FavoriteUpadate(allied_creation_user.ReqFavoriteUpdate{
UserBaseId: menuFavoriteCommand.Operator.UserBaseId,
Item: menuFavoriteCommand.Item,
Action: menuFavoriteCommand.Action,
ItemId: menuFavoriteCommand.ItemId,
})
if err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
return result, nil
}
... ...
... ... @@ -20,6 +20,8 @@ func (srv ContractChangeLogService) ContractChangeLogSearch(queryParam *query.Li
PageSize: queryParam.PageSize,
CooperationContractNumber: queryParam.CooperationContractNumber,
OperationType: queryParam.OperationType,
OrgIds: queryParam.Operator.OrgIds,
CompanyId: int(queryParam.Operator.CompanyId),
})
listData := dto.ToContractChangeLogList(result)
return result.Grid.Total, listData, err
... ...
... ... @@ -48,7 +48,7 @@ type UpdateCooperationContractCommand struct {
// 金额激励规则列表
MoneyIncentivesRules []struct {
// 金额激励规则ID
MoneyIncentivesRuleId int64 `json:"moneyIncentivesRuleId,string,"`
MoneyIncentivesRuleId string `json:"moneyIncentivesRuleId"`
// 关联的共创合约编号
CooperationContractNumber string `json:"cooperationContractNumber"`
// 激励金额
... ...
package service
import (
"strconv"
"time"
"github.com/linmadan/egglib-go/core/application"
... ... @@ -138,7 +139,9 @@ func (cooperationContractService *CooperationContractService) UpdateCooperationC
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(updateCooperationContractCommand.Operator)
rules1 := []allied_creation_cooperation.DividendsIncentivesRule{}
for _, v := range updateCooperationContractCommand.DividendsIncentivesRules {
id, _ := strconv.Atoi(v.DividendsIncentivesRuleId)
r := allied_creation_cooperation.DividendsIncentivesRule{
DividendsIncentivesRuleId: id,
CooperationContractNumber: v.CooperationContractNumber,
ReferrerPercentage: v.ReferrerPercentage,
SalesmanPercentage: v.SalesmanPercentage,
... ... @@ -152,8 +155,9 @@ func (cooperationContractService *CooperationContractService) UpdateCooperationC
}
rules2 := []allied_creation_cooperation.MoneyIncentivesRule{}
for _, v := range updateCooperationContractCommand.MoneyIncentivesRules {
id, _ := strconv.Atoi(v.MoneyIncentivesRuleId)
r := allied_creation_cooperation.MoneyIncentivesRule{
MoneyIncentivesRuleId: 0,
MoneyIncentivesRuleId: id,
CooperationContractNumber: v.CooperationContractNumber,
MoneyIncentivesAmount: v.MoneyIncentivesAmount,
MoneyIncentivesStage: v.MoneyIncentivesStage,
... ...
package dto
import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_user"
"strconv"
"time"
... ... @@ -154,9 +155,11 @@ func ToCooperationApplicationItem(param *allied_creation_cooperation.Cooperation
type CooperationProjectSearchItem struct {
allied_creation_cooperation.DataCooperationProjectSearchItem
AuthFlag bool `json:"authFlag"` //当前用户是否可以编辑
UpChainID int `json:"upChainId"`
BlockHash string `json:"blockChainId"`
}
func ToCooperationProjectSearchItem(items []allied_creation_cooperation.DataCooperationProjectSearchItem, operatorOrgId int) []CooperationProjectSearchItem {
func ToCooperationProjectSearchItem(items []allied_creation_cooperation.DataCooperationProjectSearchItem, operatorOrgId int, mapChainItems map[string]allied_creation_user.DataListBlockChainItem) []CooperationProjectSearchItem {
listData := []CooperationProjectSearchItem{}
operatorOrgIdStr := strconv.Itoa(operatorOrgId)
for i := range items {
... ... @@ -164,6 +167,10 @@ func ToCooperationProjectSearchItem(items []allied_creation_cooperation.DataCoop
DataCooperationProjectSearchItem: items[i],
AuthFlag: operatorOrgIdStr == items[i].Org.OrgID,
}
if v, ok := mapChainItems[items[i].CooperationProjectID]; ok {
listItem.UpChainID = v.UpChainID
listItem.BlockHash = v.BlockHash
}
listData = append(listData, listItem)
}
... ...
package service
import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/constant"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/broker"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_user"
"strconv"
"github.com/linmadan/egglib-go/core/application"
... ... @@ -40,6 +44,14 @@ func (cooperationProjectService *CooperationProjectService) CreateCooperationPro
CooperationProjectId: result.CooperationProjectId,
CreateCooperationProjectCommand: *createCooperationProjectCommand,
}
if err = broker.Push(constant.TOPIC_UP_BLOCK_CHAIN, broker.NewPushObject(
domain.BlockChainSourceCooperationProject,
strconv.Itoa(result.CooperationProject.CooperationProjectId),
strconv.Itoa(result.CooperationProject.CooperationProjectId),
result,
)); err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, "消息服务异常"+err.Error())
}
return data, nil
}
... ... @@ -122,7 +134,24 @@ func (cooperationProjectService *CooperationProjectService) ListCooperationProje
if len(result.List) == 0 {
result.List = []allied_creation_cooperation.DataCooperationProjectSearchItem{}
}
listData := dto.ToCooperationProjectSearchItem(result.List, int(listCooperationProjectQuery.Operator.OrgId))
var primaryIdList = make([]string, 0)
for i := range result.List {
item := &result.List[i].CooperationProjectID
primaryIdList = append(primaryIdList, *item)
}
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
listCooperationProjectQuery.Operator)
resp, err := creationUserGateway.ListBlockChains(allied_creation_user.ReqListBlockChain{
DisableLimit: true,
EnableDistinctPrimaryID: true,
PrimaryIDList: primaryIdList,
Source: domain.BlockChainSourceCooperationProject,
})
if err != nil {
return 0, nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
listData := dto.ToCooperationProjectSearchItem(result.List, int(listCooperationProjectQuery.Operator.OrgId), resp.ToMap())
return int64(result.Total), listData, nil
}
... ... @@ -130,7 +159,7 @@ func (cooperationProjectService *CooperationProjectService) ListCooperationProje
func (cooperationProjectService *CooperationProjectService) UpdateCooperationProject(updateCooperationProjectCommand *command.UpdateCooperationProjectCommand) (interface{}, error) {
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(updateCooperationProjectCommand.Operator)
_, err := creationCooperationGateway.CooperationProjectUpdate(allied_creation_cooperation.ReqCooperationProjectUpdate{
result, err := creationCooperationGateway.CooperationProjectUpdate(allied_creation_cooperation.ReqCooperationProjectUpdate{
CooperationProjectId: updateCooperationProjectCommand.CooperationProjectId,
CooperationProjectName: updateCooperationProjectCommand.CooperationProjectName,
CooperationModeNumber: updateCooperationProjectCommand.CooperationModeNumber,
... ... @@ -145,6 +174,14 @@ func (cooperationProjectService *CooperationProjectService) UpdateCooperationPro
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
if err = broker.Push(constant.TOPIC_UP_BLOCK_CHAIN, broker.NewPushObject(
domain.BlockChainSourceCooperationProject,
strconv.Itoa(result.CooperationProject.CooperationProjectId),
strconv.Itoa(result.CooperationProject.CooperationProjectId),
result,
)); err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, "消息服务异常"+err.Error())
}
return updateCooperationProjectCommand, nil
}
... ...
... ... @@ -121,4 +121,6 @@ type DividendsEstimateItem struct {
OrgName string `json:"orgName"` // 组织名称
} `json:"org"` // 数据所属组织机构
AuthFlag bool `json:"authFlag"`
UpChainID int `json:"upChainId"`
BlockHash string `json:"blockChainId"`
}
... ...
... ... @@ -5,7 +5,12 @@ import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/dividendsEstimate/command"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/dividendsEstimate/dto"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/dividendsEstimate/query"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/constant"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/broker"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_user"
"strconv"
)
// 分红预算管理
... ... @@ -37,6 +42,16 @@ func (dividendsEstimateService *DividendsEstimateService) EstimateDividendsIncen
respData := map[string]string{
"result": result.Report,
}
for _, v := range result.DividendsEstimates {
if err = broker.Push(constant.TOPIC_UP_BLOCK_CHAIN, broker.NewPushObject(
domain.BlockChainSourceCooperationDividendsEstimate,
strconv.Itoa(int(v.DividendsEstimateId)),
"",
v,
)); err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, "消息服务异常"+err.Error())
}
}
return respData, nil
}
... ... @@ -65,6 +80,16 @@ func (dividendsEstimateService *DividendsEstimateService) EstimateMoneyIncentive
returnData := map[string]interface{}{
"list": data,
}
for _, v := range result {
if err = broker.Push(constant.TOPIC_UP_BLOCK_CHAIN, broker.NewPushObject(
domain.BlockChainSourceCooperationDividendsEstimate,
strconv.Itoa(int(v.DividendsEstimateId)),
"",
v,
)); err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, "消息服务异常"+err.Error())
}
}
return returnData, nil
}
... ... @@ -85,6 +110,23 @@ func (dividendsEstimateService *DividendsEstimateService) SearchDividendsEstimat
if err != nil {
return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
var primaryIdList = make([]string, 0)
for _, v := range result.Grid.List {
item := strconv.Itoa(v.DividendsEstimateId)
primaryIdList = append(primaryIdList, item)
}
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
searchDividendsEstimateQuery.Operator)
resp, err := creationUserGateway.ListBlockChains(allied_creation_user.ReqListBlockChain{
DisableLimit: true,
EnableDistinctPrimaryID: true,
PrimaryIDList: primaryIdList,
Source: domain.BlockChainSourceCooperationDividendsEstimate,
})
if err != nil {
return 0, nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
mapChainItems := resp.ToMap()
items := []dto.DividendsEstimateItem{}
for _, v := range result.Grid.List {
... ... @@ -110,6 +152,12 @@ func (dividendsEstimateService *DividendsEstimateService) SearchDividendsEstimat
item.DividendsUser.UserType = v.DividendsUser.UserType
item.Org.OrgId = v.Org.OrgId
item.Org.OrgName = v.Org.OrgName
primaryId := strconv.Itoa(v.DividendsEstimateId)
if v, ok := mapChainItems[primaryId]; ok {
item.UpChainID = v.UpChainID
item.BlockHash = v.BlockHash
}
items = append(items, item)
}
... ...
... ... @@ -11,6 +11,7 @@ type ImportDataCommand struct {
//操作人
Operator domain.Operator `json:"-"`
Reader io.Reader `json:"-"`
FileExt string `json:"-"`
// 业务编码
Code string `form:"code"`
}
... ...
... ... @@ -11,4 +11,5 @@ type CompanyUserListQuery struct {
DepartmentName string `json:"departmentName"`
//操作人
Operator domain.Operator `json:"-"`
SelectedField []string `json:"selectedField"`
}
... ...
... ... @@ -11,4 +11,5 @@ type CooperationUserListQuery struct {
UserName string `json:"userName"`
//共创公司
CooperationCompany string `json:"cooperationCompany"`
SelectedField []string `json:"selectedField"`
}
... ...
... ... @@ -2,6 +2,7 @@ package service
import (
"fmt"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/excelData/query"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_user"
... ... @@ -25,7 +26,10 @@ func (srv ExcelDataService) ExportCompanyUser(companyUserListQuery *query.Compan
if err != nil {
return ExportCompanyUserData{}, fmt.Errorf("获取企业用户数据失败:%w", err)
}
return ExportCompanyUserData(result.Users), nil
return ExportCompanyUserData{
SourceData: result.Users,
SelectedField: companyUserListQuery.SelectedField,
}, nil
}
// ExportCooperationUser 导出共创用户信息列表
... ... @@ -45,5 +49,5 @@ func (srv ExcelDataService) ExportCooperationUser(companyUserListQuery *query.Co
if err != nil {
return ExportCooperationUserData{}, fmt.Errorf("获取企业用户数据失败:%w", err)
}
return ExportCooperationUserData(result.Users), nil
return ExportCooperationUserData{SourceData: result.Users, SelectedField: companyUserListQuery.SelectedField}, nil
}
... ...
... ... @@ -2,6 +2,7 @@ package service
import (
"fmt"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/util/converter"
"strings"
"github.com/linmadan/egglib-go/core/application"
... ... @@ -43,15 +44,12 @@ func (srv ExcelDataService) ImportCooperationUser(importDataCommand *command.Imp
{EnName: "phone", CnName: "*手机号"},
{EnName: "email", CnName: "邮箱"},
}
excelData, err := excelImport.OpenExcelFromIoReader(importDataCommand.Reader)
excelData, err := converter.OpenImportFileFromIoReader(excelImport, importDataCommand.Reader, importDataCommand.FileExt) //excelImport.OpenExcelFromIoReader(importDataCommand.Reader)
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
users := make([]allied_creation_user.BatchAddUserItem, 0)
for _, v := range excelData {
if srv.fieldValueAllEmpty(v) {
continue
}
item := allied_creation_user.BatchAddUserItem{
CompanyId: importDataCommand.Operator.CompanyId,
UserType: domain.UserTypeCooperation,
... ... @@ -216,3 +214,14 @@ func (srv ExcelDataService) FileImportTemplate(importDataCommand *command.Import
"url": url,
}, nil
}
func (srv ExcelDataService) GetExcelDataFields(code string) (interface{}, error) {
dataFileds := []DataFieldOptions{}
switch code {
case domain.ExportCompanyUser:
dataFileds = (ExportCompanyUserData{}).AllFields()
case domain.ExportCooperationUser:
dataFileds = (ExportCooperationUserData{}).AllFields()
}
return dataFileds, nil
}
... ...
... ... @@ -5,13 +5,22 @@ import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_user"
)
type DataFieldOptions struct {
EnName string `json:"enName"`
CnName string `json:"cnName"`
IsDefault bool `json:"isDefault"`
}
// ExportCompanyUserData 导出公司用户数据
type ExportCompanyUserData []allied_creation_user.UserDetail
type ExportCompanyUserData struct {
SourceData []allied_creation_user.UserDetail
SelectedField []string
}
var _ excel.ExcelMaker = (*ExportCompanyUserData)(nil)
func (data ExportCompanyUserData) DataFieldList() []excel.DataField {
return []excel.DataField{
func (data ExportCompanyUserData) AllFields() []DataFieldOptions {
return []DataFieldOptions{
{EnName: "UserCode", CnName: "用户编码"},
{EnName: "UserName", CnName: "用户姓名"},
{EnName: "Phone", CnName: "手机号"},
... ... @@ -21,25 +30,42 @@ func (data ExportCompanyUserData) DataFieldList() []excel.DataField {
}
}
func (data ExportCompanyUserData) DataFieldList() []excel.DataField {
fields := []excel.DataField{}
allFields := data.AllFields()
for _, value2 := range allFields {
if len(data.SelectedField) == 0 || value2.IsDefault {
fields = append(fields, excel.DataField{EnName: value2.EnName, CnName: value2.CnName})
continue
}
for _, value3 := range data.SelectedField {
if value2.EnName == value3 {
fields = append(fields, excel.DataField{EnName: value2.EnName, CnName: value2.CnName})
}
}
}
return fields
}
func (data ExportCompanyUserData) CellValue(index int, enName string) (value interface{}) {
if index > data.DataListLen() {
return ""
}
switch enName {
case "UserCode":
return data[index].UserCode
return data.SourceData[index].UserCode
case "UserName":
return data[index].UserInfo.UserName
return data.SourceData[index].UserInfo.UserName
case "Phone":
return data[index].UserInfo.Phone
return data.SourceData[index].UserInfo.Phone
case "DepartmentName":
if data[index].Department != nil {
return data[index].Department.DepartmentName
if data.SourceData[index].Department != nil {
return data.SourceData[index].Department.DepartmentName
} else {
return ""
}
case "EnableStatus":
status := data[index].EnableStatus
status := data.SourceData[index].EnableStatus
statusName := ""
// 状态(1:启用 2:禁用 3:注销)
switch status {
... ... @@ -52,8 +78,8 @@ func (data ExportCompanyUserData) CellValue(index int, enName string) (value int
}
return statusName
case "OrgName":
if data[index].Org != nil {
return data[index].Org.OrgName
if data.SourceData[index].Org != nil {
return data.SourceData[index].Org.OrgName
} else {
return ""
}
... ... @@ -62,7 +88,7 @@ func (data ExportCompanyUserData) CellValue(index int, enName string) (value int
}
func (data ExportCompanyUserData) DataListLen() int {
return len(data)
return len(data.SourceData)
}
func (data ExportCompanyUserData) TableTitle() []string {
... ... @@ -70,21 +96,39 @@ func (data ExportCompanyUserData) TableTitle() []string {
}
//ExportCooperationUserData 导出共创用户数据
type ExportCooperationUserData []allied_creation_user.UserDetail
type ExportCooperationUserData struct {
SourceData []allied_creation_user.UserDetail
SelectedField []string
}
var _ excel.ExcelMaker = (*ExportCooperationUserData)(nil)
func (data ExportCooperationUserData) DataFieldList() []excel.DataField {
return []excel.DataField{
func (data ExportCooperationUserData) AllFields() []DataFieldOptions {
return []DataFieldOptions{
{EnName: "UserCode", CnName: "用户编码"},
{EnName: "UserName", CnName: "用户姓名"},
{EnName: "Phone", CnName: "手机号"},
{EnName: "CooperationCompany", CnName: "共创公司"},
{EnName: "CooperationDeadline", CnName: "共创到期"},
{EnName: "EnableStatus", CnName: "状态"},
}
}
//{EnName: "Email", CnName: "邮箱"},
func (data ExportCooperationUserData) DataFieldList() []excel.DataField {
fields := []excel.DataField{}
allFields := data.AllFields()
for _, value2 := range allFields {
if len(data.SelectedField) == 0 || value2.IsDefault {
fields = append(fields, excel.DataField{EnName: value2.EnName, CnName: value2.CnName})
continue
}
for _, value3 := range data.SelectedField {
if value2.EnName == value3 {
fields = append(fields, excel.DataField{EnName: value2.EnName, CnName: value2.CnName})
}
}
}
return fields
}
func (data ExportCooperationUserData) CellValue(index int, enName string) (value interface{}) {
... ... @@ -93,22 +137,22 @@ func (data ExportCooperationUserData) CellValue(index int, enName string) (value
}
switch enName {
case "UserCode":
return data[index].UserCode
return data.SourceData[index].UserCode
case "UserName":
return data[index].UserInfo.UserName
return data.SourceData[index].UserInfo.UserName
case "CooperationCompany":
return data[index].CooperationInfo.CooperationCompany
return data.SourceData[index].CooperationInfo.CooperationCompany
case "CooperationDeadline":
if data[index].CooperationInfo.CooperationDeadline.IsZero() || data[index].CooperationInfo.CooperationDeadline.Unix() == 0 {
if data.SourceData[index].CooperationInfo.CooperationDeadline.IsZero() || data.SourceData[index].CooperationInfo.CooperationDeadline.Unix() == 0 {
return ""
}
return data[index].CooperationInfo.CooperationDeadline.Format("2006-01-02")
return data.SourceData[index].CooperationInfo.CooperationDeadline.Format("2006-01-02")
case "Phone":
return data[index].UserInfo.Phone
return data.SourceData[index].UserInfo.Phone
case "Email":
return data[index].UserInfo.Email
return data.SourceData[index].UserInfo.Email
case "EnableStatus":
status := data[index].EnableStatus
status := data.SourceData[index].EnableStatus
statusName := ""
// 状态(1:启用 2:禁用 3:注销)
switch status {
... ... @@ -125,7 +169,7 @@ func (data ExportCooperationUserData) CellValue(index int, enName string) (value
}
func (data ExportCooperationUserData) DataListLen() int {
return len(data)
return len(data.SourceData)
}
func (data ExportCooperationUserData) TableTitle() []string {
... ...
... ... @@ -2,6 +2,7 @@ package query
import (
"fmt"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/util/advance"
"github.com/beego/beego/v2/core/validation"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
... ... @@ -19,6 +20,8 @@ type CompanyUserListQuery struct {
DepartmentName string `json:"departmentName"`
//操作人
Operator domain.Operator `json:"-"`
AdvancedQueries advance.AdvancedQueries `json:"advancedQueries"`
}
func (companyUserListQuery *CompanyUserListQuery) Valid(validation *validation.Validation) {
... ...
... ... @@ -192,6 +192,7 @@ func (usersService *UsersService) CompanyUserList(companyUserListQuery *query.Co
UserType: domain.UserTypeEmployee,
InOrgIds: companyUserListQuery.Operator.OrgIds,
PullRealTime: true,
AdvancedQuery: domain.AdvancedQuerySql(domain.UserModel{}.ModelName(), companyUserListQuery.AdvancedQueries),
})
if err != nil {
... ... @@ -593,7 +594,7 @@ func (usersService *UsersService) SelectorCooperationProjectUsers(q *query.Coope
for i := range resultApplication.Grid.List {
item := resultApplication.Grid.List[i]
user := map[string]interface{}{
"userId": item.CooperationApplicationApplicant.UserID,
"userId": fmt.Sprintf("%v", item.CooperationApplicationApplicant.UserID),
"userCode": item.CooperationApplicationApplicant.UserInfo.UserCode,
"userInfo": map[string]interface{}{
"userName": item.CooperationApplicationApplicant.UserInfo.UserName,
... ...
... ... @@ -13,8 +13,10 @@ var LOG_FRAMEWORK = "beego" // beego logrus
var LOG_FILE = "app.log"
var LOG_PREFIX = "[allied-creation-gateway]"
var FileStatic = "./static"
var HTTP_PORT int = 8083
var ALLIED_CREATION_GATEWAY_HOST = "https://allied-creation-gateway-dev.fjmaimaimai.com"
var ALLIED_CREATION_GATEWAY_HOST = "http://localhost:8080"
//天联共创基础模块
var ALLIED_CREATION_BASIC_HOST = "http://localhost:8080" //"http://allied-creation-basic-dev.fjmaimaimai.com"
... ... @@ -26,11 +28,14 @@ var ALLIED_CREATION_USER_HOST = "http://localhost:8081" //"http://allied-creatio
var ALLIED_CREATION_COOPERATION_HOST = "http://localhost:8082" // "http://allied-creation-cooperation-dev.fjmaimaimai.com"
// 版本更新模块
var SUPLUS_ADMIN_BASE_HOST = "http://suplus-admin-base-test.fjmaimaimai.com"
var SUPLUS_ADMIN_BASE_HOST = "http://suplus-admin-base-dev.fjmaimaimai.com"
//通用模块短信服务
var SMS_SERVE_HOST = "https://sms.fjmaimaimai.com:9897"
//素加销售导航服务
var SUPLUS_SALE_APP = "http://suplus-sale-app-gateway-test.fjmaimaimai.com"
// TODO:特殊短信验证码,不验证,正式环境注入空
var SMSCODE_ALL_POWER = "999512"
... ... @@ -65,4 +70,7 @@ func init() {
if os.Getenv("SMSCODE_ALL_POWER") != "" {
SMSCODE_ALL_POWER = os.Getenv("SMSCODE_ALL_POWER")
}
if os.Getenv("SUPLUS_SALE_APP") != "" {
SUPLUS_SALE_APP = os.Getenv("SUPLUS_SALE_APP")
}
}
... ...
... ... @@ -4,17 +4,19 @@ import "os"
var (
// kafka 地址
KAFKA_HOST = "192.168.0.250:9092,192.168.0.251:9092,192.168.0.252:9092"
KAFKA_HOST = "192.168.0.250:9092,192.168.0.251:9092,192.168.0.252:9092" // "106.75.231.90:9092"
// kafka topic log stash
TOPIC_LOG_STASH = "go_stash_dev"
// 是否启用日志收集 (本地不启用)
ENABLE_KAFKA_LOG = false
// kafka topic up_block_chain
TOPIC_UP_BLOCK_CHAIN = "up_block_chain"
)
func init() {
//if os.Getenv("KAFKA_HOST") != "" {
// POSTGRESQL_HOST = os.Getenv("KAFKA_HOST")
//}
if os.Getenv("KAFKA_HOST") != "" {
KAFKA_HOST = os.Getenv("KAFKA_HOST")
}
//if os.Getenv("TOPIC_LOG_STASH") != "" {
// POSTGRESQL_PORT = os.Getenv("TOPIC_LOG_STASH")
//}
... ...
package domain
import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/log"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/util/advance"
)
type (
Model struct {
Columns []advance.Column `json:"columns"`
MapColumn advance.MapColumn `json:"-"`
Name string `json:"name"`
}
ModelInterface interface {
ModelName() string
Columns() []advance.Column
}
)
var registerModels = make(map[string]Model)
// AdvancedQuerySql 高级查询语句生成
func AdvancedQuerySql(model string, quires advance.AdvancedQueries) string {
if len(quires) == 0 {
return ""
}
fixQueries := mergeDuplicateQueries(model, quires)
sql, err := advance.AdvancedQuerySql(fixQueries)
if err != nil {
log.Logger.Error(err.Error())
}
return sql
}
func mergeDuplicateQueries(model string, quires advance.AdvancedQueries) []advance.AdvancedQuery {
m, ok := GetModel(model)
response := make([]advance.AdvancedQuery, 0)
mapResponse := make(map[string]advance.AdvancedQuery)
if !ok {
return response
}
for i := range quires {
c, ok := m.MapColumn[quires[i].Column.Column]
if !ok {
continue
}
quires[i].Column = c
if q, ok := mapResponse[c.Column]; ok {
q.Exprs = append(q.Exprs, quires[i].Exprs...)
} else {
mapResponse[c.Column] = quires[i]
}
}
for _, v := range mapResponse {
response = append(response, v)
}
return response
}
func NewModel(m ModelInterface) Model {
return Model{
Name: m.ModelName(),
Columns: m.Columns(),
MapColumn: advance.NewMapColumn(m.Columns()),
}
}
func RegisModel(m Model) {
if _, ok := registerModels[m.Name]; ok {
panic("register modes exists:" + m.Name)
}
registerModels[m.Name] = m
}
func GetModel(name string) (Model, bool) {
m, ok := registerModels[name]
return m, ok
}
/*User*/
type UserModel struct{}
// 实现接口 ModelInterface
func (u UserModel) ModelName() string { return "user" }
func (u UserModel) Columns() []advance.Column {
return []advance.Column{
{
Column: "userCode",
Name: "用户编号",
DbAlias: "user_code",
ValueType: advance.ValueChars,
},
{
Column: "userName",
Name: "姓名",
DbAlias: "ext->>'userName'",
ValueType: advance.ValueChars,
},
{
Column: "phone",
Name: "手机号",
DbAlias: "ext->>'phone'",
ValueType: advance.ValueChars,
},
{
Column: "depName",
Name: "所属部门",
DbAlias: "ext->>'depName'",
ValueType: advance.ValueChars,
},
{
Column: "status",
Name: "状态",
DbAlias: "enable_status",
ValueType: advance.ValueNumber,
},
{
Column: "orgName",
Name: "组织机构",
DbAlias: "ext->>'orgName'",
ValueType: advance.ValueChars,
},
}
}
... ...
... ... @@ -5,6 +5,7 @@ package domain
const (
UserTypeEmployee = 1
UserTypeCooperation = 2
UserTypeVisitor = 4
UserTypeCompanyAdmin = 1024
)
... ... @@ -73,3 +74,8 @@ const (
const (
CooperationUserDepartmentName = "共创用户"
)
const (
BlockChainSourceCooperationProject = "allied-creation.cooperation.project"
BlockChainSourceCooperationDividendsEstimate = "allied-creation.cooperation.dividends-estimate"
)
... ...
... ... @@ -4,22 +4,22 @@ import (
"encoding/base64"
"fmt"
"github.com/forgoer/openssl"
"github.com/google/uuid"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/constant"
"time"
jwt "github.com/dgrijalva/jwt-go"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/log"
"strings"
)
const (
qrcodeTokenSecret string = "bbe35ad433dd8e67"
qrcodeCodeExpire int64 = 60 * 30 //15分钟过期
QrcodeCodeExpire int64 = 60 * 5 //5分钟过期
)
var aecSecret = []byte("mmm.qrcode.ecb.1")
var qrcodeLogin = "/v1/auth/login/qrcode?key="
var (
aecSecret = []byte("mmm.qrcode.ecb.1")
qrcodeLogin = "/v1/auth/login/qrcode?key="
)
type QrcodeMessage struct {
jwt.StandardClaims
Id string `json:"id"`
Token string `json:"token"`
IsLogin bool `json:"isLogin"`
... ... @@ -34,46 +34,20 @@ type QrcodeMessage struct {
OrgId int64 `json:"orgId"`
}
func (qrmsg *QrcodeMessage) GenerateImageBase64() ([]byte, error) {
nowTime := time.Now().Unix()
qrmsg.StandardClaims = jwt.StandardClaims{
NotBefore: nowTime,
IssuedAt: nowTime,
ExpiresAt: nowTime + qrcodeCodeExpire,
Issuer: "allied_creation_gateway",
}
qrmsg.Id = fmt.Sprintf("%d", time.Now().UnixNano())
token := jwt.NewWithClaims(jwt.SigningMethodHS256, *qrmsg)
str, err := token.SignedString([]byte(qrcodeTokenSecret))
if err != nil {
return nil, err
}
func (qrmsg *QrcodeMessage) Init() ([]byte, error) {
str := strings.Replace(uuid.New().String(), "-", "", -1)
key := constant.ALLIED_CREATION_GATEWAY_HOST + qrcodeLogin + str
log.Logger.Debug("key:" + key)
encryptedData, err := openssl.AesECBEncrypt([]byte(key), aecSecret, openssl.PKCS7_PADDING)
if err != nil {
return nil, err
}
qrmsg.Id = str
qrmsg.Token = base64.StdEncoding.EncodeToString(encryptedData)
qrmsg.IsLogin = false
return encryptedData, err
}
func (qrmsg *QrcodeMessage) ParseToken(str string) error {
tokenClaims, err := jwt.ParseWithClaims(
str,
qrmsg,
func(token *jwt.Token) (interface{}, error) {
return []byte(loginTokenSecret), nil
})
if err != nil {
return err
}
if claim, ok := tokenClaims.Claims.(*QrcodeMessage); ok && tokenClaims.Valid {
*qrmsg = *claim
}
return nil
}
func (qrmsg *QrcodeMessage) BindUser(operator Operator) error {
if qrmsg.IsLogin {
return fmt.Errorf("登录中")
... ...
package broker
import (
"fmt"
"github.com/linmadan/egglib-go/utils/json"
"github.com/tal-tech/go-queue/kq"
"strings"
)
var defaultClientMap = make(map[string]*kq.Pusher)
type client struct {
pusher *kq.Pusher
}
func RegisterDefaultPusherClient(host, topic string) {
if _, ok := defaultClientMap[topic]; ok {
panic("duplicate register pusher client")
}
pusher := kq.NewPusher(strings.Split(host, ","), topic)
defaultClientMap[topic] = pusher
}
// 异步推送到队列
func Push(topic string, o interface{}) error {
// TODO:功能未开启
return nil
var pusher *kq.Pusher
var ok bool
if pusher, ok = defaultClientMap[topic]; !ok {
return fmt.Errorf("pusher client [%v] not found ", topic)
}
return pusher.Push(json.MarshalToString(o))
}
// 新建一个推送对象
func NewPushObject(source, primaryId, issueId string, obj interface{}) interface{} {
return map[string]interface{}{
"source": source,
"primaryId": primaryId,
"issueId": issueId,
"data": json.MarshalToString(obj),
}
}
... ...
... ... @@ -17,11 +17,7 @@ func (lq LoginQrcodeCache) keyString(str string) string {
}
func (lq LoginQrcodeCache) Save(qrcode domain.QrcodeMessage) error {
nowTime := time.Now().Unix()
exp := qrcode.ExpiresAt - nowTime
if exp <= 0 {
exp = 60 * 5
}
var exp = domain.QrcodeCodeExpire
key := lq.keyString(qrcode.Id)
bt, _ := json.Marshal(qrcode)
result := clientRedis.Set(key, string(bt), time.Duration(exp)*time.Second)
... ...
... ... @@ -8,6 +8,10 @@ import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/log"
)
func AdvancedSettingInit() {
domain.RegisModel(domain.NewModel(domain.UserModel{}))
}
//GetInitPassword 获取公司初始化密码
func GetInitPassword(operator domain.Operator) (string, string, error) {
var password string
... ...
package allied_creation_basic
import (
"encoding/json"
"fmt"
"github.com/linmadan/egglib-go/utils/json"
"strconv"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/log"
... ...
package allied_creation_basic
import (
"encoding/json"
"fmt"
"github.com/linmadan/egglib-go/utils/json"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/log"
... ...
package allied_creation_basic
import (
"encoding/json"
"fmt"
"github.com/linmadan/egglib-go/utils/json"
"strconv"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway"
... ...
package allied_creation_basic
import (
"encoding/json"
"fmt"
"github.com/linmadan/egglib-go/utils/json"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/log"
... ...
package allied_creation_cooperation
import (
"encoding/json"
"fmt"
"github.com/linmadan/egglib-go/utils/json"
"strconv"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/log"
... ...
package allied_creation_cooperation
import (
"encoding/json"
"fmt"
"github.com/linmadan/egglib-go/utils/json"
"strconv"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/log"
... ...
package allied_creation_cooperation
import (
"encoding/json"
"fmt"
"github.com/linmadan/egglib-go/utils/json"
"strconv"
"strings"
... ...
package allied_creation_cooperation
import (
"encoding/json"
"fmt"
"github.com/linmadan/egglib-go/utils/json"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/log"
... ...
package allied_creation_cooperation
import (
"encoding/json"
"fmt"
"github.com/linmadan/egglib-go/utils/json"
"strconv"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/log"
... ...
package allied_creation_cooperation
import (
"encoding/json"
"fmt"
"github.com/linmadan/egglib-go/utils/json"
"strconv"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway"
... ...
package allied_creation_cooperation
import (
"encoding/json"
"fmt"
"github.com/linmadan/egglib-go/utils/json"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/log"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway"
... ... @@ -30,6 +30,8 @@ const (
CooperationUserModeStatistics = "CooperationUserModeStatistics"
// 公司 - 共创用户分红支付统计
CompanyPaymentHistoryStatistics = "CompanyPaymentHistoryStatistics"
// 企业共创项目 - 合约列表
CompanyCooperationProjectContracts = "CompanyCooperationProjectContracts"
// 个人 - 共创企业统计
CooperationCompanyStatistics = "CooperationCompanyStatistics"
... ... @@ -37,6 +39,10 @@ const (
PersonCooperationContractStatistics = "PersonCooperationContractStatistics"
// 个人 - 企业支付统计
PersonCompanyPaymentHistoryStatistics = "PersonCompanyPaymentHistoryStatistics"
// 个人 - 共创项目共享信息数据
PersonCooperationProjectSharedInfo = "PersonCooperationProjectSharedInfo"
// 个人 - 共创项目共享信息数据 - 附件
PersonCooperationProjectSharedInfoAttachment = "PersonCooperationProjectSharedInfoAttachment"
// 账期结算单统计
CreditAccountStatistics = "CreditAccountStatistics"
... ... @@ -150,3 +156,37 @@ func (gateway HttplibAlliedCreationCooperation) RelevantCooperationContractNumbe
err = gateway.GetResponseData(result, &data)
return data, err
}
// CooperationStatistics 共创统计
func (gateway HttplibAlliedCreationCooperation) CooperationStatisticsWithObject(action string, queryOptions interface{}, object interface{}) error {
url := gateway.baseUrL + "/cooperation-statistics"
method := "post"
req := gateway.CreateRequest(url, method)
log.Logger.Debug("向业务模块请求数据:共创统计。", map[string]interface{}{
"api": method + ":" + url,
"param": queryOptions,
})
param := map[string]interface{}{
"action": action,
"queryOptions": queryOptions,
}
req, err := req.JSONBody(param)
if err != nil {
return fmt.Errorf("请求共创统计失败:%w", err)
}
byteResult, err := req.Bytes()
if err != nil {
return fmt.Errorf("获取共创统计失败:%w", err)
}
log.Logger.Debug("获取业务模块请求数据:共创统计。", map[string]interface{}{
"result": string(byteResult),
})
var result service_gateway.GatewayResponse
err = json.Unmarshal(byteResult, &result)
if err != nil {
return fmt.Errorf("解析共创统计:%w", err)
}
err = gateway.GetResponseData(result, &object)
return err
}
... ...
package allied_creation_cooperation
import (
"encoding/json"
"fmt"
"github.com/linmadan/egglib-go/utils/json"
"strconv"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/log"
... ...
package allied_creation_cooperation
import (
"encoding/json"
"fmt"
"github.com/linmadan/egglib-go/utils/json"
"strconv"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway"
... ...
package allied_creation_cooperation
import (
"encoding/json"
"fmt"
"github.com/linmadan/egglib-go/utils/json"
"strconv"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/log"
... ...
package allied_creation_cooperation
import (
"encoding/json"
"fmt"
"github.com/linmadan/egglib-go/utils/json"
"strconv"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway"
... ...
package allied_creation_cooperation
import (
"encoding/json"
"fmt"
"github.com/linmadan/egglib-go/utils/json"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/log"
... ...
... ... @@ -13,6 +13,8 @@ type (
// 合约承接方反馈内容
FeedbackContent string `cname:"合约承接方反馈内容" json:"feedbackContent" valid:"Required"`
// 共创合约编号
CooperationContractId int64 `cname:"共创合约编号" json:"cooperationContractId"`
// 共创合约编号
CooperationContractNumber string `cname:"共创合约编号" json:"cooperationContractNumber" valid:"Required"`
// 承接人uid
UnderTakerUid int64 `cname:"承接人uid" json:"underTakerUid,string,omitempty"`
... ...
... ... @@ -214,6 +214,8 @@ type (
SearchCooperationProjectExtQueries []*SearchCooperationProjectExtQuery `cname:"额外的查询条件" json:"searchCooperationProjectExtQueries"`
// 按共创项目状态排序
SortByStatus int32 `cname:"按共创项目状态排序" json:"sortByStatus,omitempty"`
// 是否跳过获取共创模式
IsSkipFetchProjectModel bool `cname:"是否跳过获取共创模式" json:"isSkipFetchProjectModel,omitempty"`
}
DataCooperationProjectSearchItem struct {
CooperationProjectID string `json:"cooperationProjectId"`
... ... @@ -282,6 +284,8 @@ type (
//OperateTime time.Time `json:"operateTime"`
Status int `json:"status"`
ApplicantCount int `json:"applicantCount"` // 共创申请人计数
// 合约计数
ContractCount int32 `json:"contractCount"`
}
DataCooperationProjectSearch struct {
List []DataCooperationProjectSearchItem `json:"list"`
... ...
... ... @@ -162,51 +162,7 @@ type (
Action int `json:"action"`
}
DataDividendsEstimateMoneyIncentives []struct {
// 承接人分红预算记录ID
DividendsEstimateId int64 `json:"dividendsEstimateId,string"`
// 分红结算状态,1待结算,2已结算
DividendsAccountStatus int32 `json:"dividendsAccountStatus"`
// 分红金额
DividendsAmount float64 `json:"dividendsAmount"`
// 承接人分红预算单号
DividendsEstimateOrderNumber string `json:"dividendsEstimateOrderNumber"`
// 分红预算时间
DividendsEstimateTime time.Time `json:"dividendsEstimateTime"`
// 参与分红类型,1承接人,2推荐人,3关联业务员
DividendsParticipateType int32 `json:"dividendsParticipateType"`
// 分红类型,1订单分红,2退货冲销,3金额激励
DividendsType int32 `json:"dividendsType"`
// 分红类型名称
DividendsTypeName string `json:"dividendsTypeName"`
// 分红订单号或退货单号
OrderOrReturnedOrderNum string `json:"orderOrReturnedOrderNum"`
// 共创项目合约编号,自生成,生成规则:XM+6位年月日+#+3位流水,例XM210601#001
CooperationContractNumber string `json:"cooperationContractNumber"`
// 分红用户(共创参与)
DividendsUser struct {
// 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员
UserId int64 `json:"userId,string"`
// 用户基本id
UserBaseId int64 `json:"userBaseId,string"`
// 用户类型
UserType int32 `json:"userType"`
UserInfo struct {
UserAvatar string `json:"userAvatar"` // 用户头像
UserEmail string `json:"userEmail"` // 用户邮箱
UserName string `json:"userName"` // 共创人员姓名
UserPhone string `json:"userPhone"` // 用户手机号
UserAccount string `json:"userAccount"` // 用户账号,区别于手机号,冗余字段
UserCode string `json:"userCode"` // 用户编码
} `json:"userInfo,omitempty"`
} `json:"dividendsUser"`
// 分红阶段
DividendsStage int32 `json:"dividendsStage"`
// 操作时间
OperateTime time.Time `json:"operateTime"`
// 取消状态
IsCanceled bool `json:"isCanceled"`
}
DataDividendsEstimateMoneyIncentives []DividendsEstimateItem
)
//返回分红预算详情
... ... @@ -263,5 +219,104 @@ type (
DataDividendsEstimateDividendsIncentives struct {
Report string `json:"report"`
// DividendsEstimate 分红预算实体
DividendsEstimates []DividendsEstimateItem `json:"dividendsEstimates"`
}
DividendsEstimateItem struct {
// 承接人分红预算记录ID
DividendsEstimateId int64 `json:"dividendsEstimateId,string"`
// 分红结算状态,1待结算,2已结算
DividendsAccountStatus int32 `json:"dividendsAccountStatus"`
// 分红金额
DividendsAmount float64 `json:"dividendsAmount"`
// 承接人分红预算单号
DividendsEstimateOrderNumber string `json:"dividendsEstimateOrderNumber"`
// 分红预算时间
DividendsEstimateTime time.Time `json:"dividendsEstimateTime"`
// 参与分红类型,1承接人,2推荐人,3关联业务员
DividendsParticipateType int32 `json:"dividendsParticipateType"`
// 分红类型,1订单分红,2退货冲销,3金额激励
DividendsType int32 `json:"dividendsType"`
// 分红类型名称
DividendsTypeName string `json:"dividendsTypeName"`
// 分红订单号或退货单号
OrderOrReturnedOrderNum string `json:"orderOrReturnedOrderNum"`
// 共创项目合约编号,自生成,生成规则:XM+6位年月日+#+3位流水,例XM210601#001
CooperationContractNumber string `json:"cooperationContractNumber"`
// 分红用户(共创参与)
DividendsUser struct {
// 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员
UserId int64 `json:"userId,string"`
// 用户基本id
UserBaseId int64 `json:"userBaseId,string"`
// 用户类型
UserType int32 `json:"userType"`
UserInfo struct {
UserAvatar string `json:"userAvatar"` // 用户头像
UserEmail string `json:"userEmail"` // 用户邮箱
UserName string `json:"userName"` // 共创人员姓名
UserPhone string `json:"userPhone"` // 用户手机号
UserAccount string `json:"userAccount"` // 用户账号,区别于手机号,冗余字段
UserCode string `json:"userCode"` // 用户编码
} `json:"userInfo,omitempty"`
} `json:"dividendsUser"`
// 分红阶段
DividendsStage int32 `json:"dividendsStage"`
// 操作时间
OperateTime time.Time `json:"operateTime"`
// 取消状态
IsCanceled bool `json:"isCanceled"`
}
//struct {
// // 承接人分红预算记录ID
// DividendsEstimateId int64 `json:"dividendsEstimateId,string"`
// // 分红结算状态,1待结算,2已结算
// DividendsAccountStatus int32 `json:"dividendsAccountStatus"`
// // 分红支付状态,1未支付,2已支付
// PaymentStatus int32 `json:"paymentStatus"`
// // 分红金额
// DividendsAmount float64 `json:"dividendsAmount"`
// // 承接人分红预算单号
// DividendsEstimateOrderNumber string `json:"dividendsEstimateOrderNumber"`
// // 分红预算时间
// DividendsEstimateTime time.Time `json:"dividendsEstimateTime"`
// // 参与分红类型,1承接人,2推荐人,3关联业务员
// DividendsParticipateType int32 `json:"dividendsParticipateType"`
// // 分红类型,1订单分红,2退货冲销,3金额激励
// DividendsType int32 `json:"dividendsType"`
// // 分红类型名称
// DividendsTypeName string `json:"dividendsTypeName"`
// // 分红订单号或退货单号
// OrderOrReturnedOrderNum string `json:"orderOrReturnedOrderNum"`
// // 共创项目合约编号,自生成,生成规则:XM+6位年月日+#+3位流水,例XM210601#001
// CooperationContractNumber string `json:"cooperationContractNumber"`
// // 共创合约承接人id
// CooperationContractUndertakerId int64 `json:"cooperationContractUndertakerId"`
// // 分红用户(共创参与)
// //DividendsUser *User `json:"dividendsUser"`
// // 分红比例
// DividendsPercentage float64 `json:"dividendsPercentage"`
// // 分红阶段
// DividendsStage int32 `json:"dividendsStage"`
// // 数据所属组织机构
// //Org *Org `json:"org"`
// // 公司
// //Company *Company `json:"company"`
// // 操作人
// //Operator *User `json:"operator"`
// // 操作时间
// //OperateTime time.Time `json:"operateTime"`
// // 取消状态
// IsCanceled bool `json:"isCanceled"`
// // 创建时间
// CreatedAt time.Time `json:"createdAt"`
// // 删除时间
// //DeletedAt time.Time `json:"deletedAt"`
// // 更新时间
// //UpdatedAt time.Time `json:"updatedAt"`
// // 订单产品ID
// OrderGoodId int64 `json:"orderGoodId"`
// // 订单产品金额
// OrderGoodAmount float64 `json:"orderGoodAmount"`
//}
)
... ...
... ... @@ -39,6 +39,37 @@ func (gateway HttplibAlliedCreationUser) AuthCompanySignUp(param ReqAuthCompanyS
return &data, err
}
// AuthUserSignUp 用户注册
func (gateway HttplibAlliedCreationUser) AuthUserSignUp(param ReqAuthUserSignUp) (*DataAuthUserSignUp, error) {
url := gateway.baseUrL + "/auth/user-sign-up"
method := "POST"
req := gateway.CreateRequest(url, method)
log.Logger.Debug("向用户模块请求数据:用户注册。", map[string]interface{}{
"api": method + ":" + url,
"param": param,
})
req, err := req.JSONBody(param)
if err != nil {
return nil, fmt.Errorf("请求用户注册失败:%w", err)
}
byteResult, err := req.Bytes()
if err != nil {
return nil, fmt.Errorf("获取用户注册失败:%w", err)
}
log.Logger.Debug("获取用户模块请求数据:用户注册。", map[string]interface{}{
"result": string(byteResult),
})
var result service_gateway.GatewayResponse
err = json.Unmarshal(byteResult, &result)
if err != nil {
return nil, fmt.Errorf("解析用户注册:%w", err)
}
var data DataAuthUserSignUp
err = gateway.GetResponseData(result, &data)
return &data, err
}
//AuthChangePassword 修改密码
func (gateway HttplibAlliedCreationUser) AuthChangePassword(param ReqAuthChangePassword) (*DataAuthChangePassword, error) {
url := gateway.baseUrL + "/auth/change-password"
... ...
package allied_creation_user
import (
"encoding/json"
"fmt"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/log"
)
func (gateway HttplibAlliedCreationUser) ListBlockChains(param ReqListBlockChain) (DataListBlockChain, error) {
// TODO:功能未开启
return []DataListBlockChainItem{}, nil
url := gateway.baseUrL + "/block-chains/"
method := "post"
req := gateway.CreateRequest(url, method)
moduleDesc := "获取区块链数据列表"
//TODO traceID
log.Logger.Debug("向用户模块请求数据:"+moduleDesc, map[string]interface{}{
"api": method + ":" + url,
"param": param,
})
req, err := req.JSONBody(param)
if err != nil {
return nil, fmt.Errorf("%v失败:%w", moduleDesc, err)
}
byteResult, err := req.Bytes()
if err != nil {
return nil, fmt.Errorf("%v失败:%w", moduleDesc, err)
}
var result service_gateway.GatewayResponse
err = json.Unmarshal(byteResult, &result)
if err != nil {
return nil, fmt.Errorf("解析错误:%w", err)
}
var data DataListBlockChain
err = gateway.GetResponseData(result, &data)
return data, err
}
func (gateway HttplibAlliedCreationUser) BlockChainsToken(param ReqBlockChainToken) (*DataBlockChainToken, error) {
url := gateway.baseUrL + "/block-chains/token"
method := "post"
req := gateway.CreateRequest(url, method)
moduleDesc := "获取区块链数据授权"
//TODO traceID
log.Logger.Debug("向用户模块请求数据:"+moduleDesc, map[string]interface{}{
"api": method + ":" + url,
"param": param,
})
req, err := req.JSONBody(param)
if err != nil {
return nil, fmt.Errorf("%v失败:%w", moduleDesc, err)
}
byteResult, err := req.Bytes()
if err != nil {
return nil, fmt.Errorf("%v失败:%w", moduleDesc, err)
}
var result service_gateway.GatewayResponse
err = json.Unmarshal(byteResult, &result)
if err != nil {
return nil, fmt.Errorf("解析错误:%w", err)
}
var data DataBlockChainToken
err = gateway.GetResponseData(result, &data)
return &data, err
}
... ...
... ... @@ -101,3 +101,33 @@ func (gateway HttplibAlliedCreationUser) FavoriteMenusGet(param ReqFavoriteMenus
err = gateway.GetResponseData(result, &data)
return &data, err
}
func (gateway HttplibAlliedCreationUser) FavoriteUpadate(param ReqFavoriteUpdate) (*DataFavoriteUpdate, error) {
url := gateway.baseUrL + "/user-base/favorite"
method := "post"
req := gateway.CreateRequest(url, method)
log.Logger.Debug("向用户模块请求数据:更新我喜欢。", map[string]interface{}{
"api": method + ":" + url,
"param": param,
})
req, err := req.JSONBody(param)
if err != nil {
return nil, fmt.Errorf("请求更新我喜欢失败:%w", err)
}
byteResult, err := req.Bytes()
if err != nil {
return nil, fmt.Errorf("获取更新我喜欢失败:%w", err)
}
log.Logger.Debug("获取用户模块请求数据:更新我喜欢。", map[string]interface{}{
"result": string(byteResult),
})
var result service_gateway.GatewayResponse
err = json.Unmarshal(byteResult, &result)
if err != nil {
return nil, fmt.Errorf("解析更新我喜欢:%w", err)
}
var data DataFavoriteUpdate
err = gateway.GetResponseData(result, &data)
return &data, err
}
... ...
... ... @@ -15,6 +15,21 @@ type (
}
)
//企业注册
type (
ReqAuthUserSignUp struct {
// 企业名称
Name string `cname:"用户姓名" json:"name" valid:"Required"`
// 手机号码
Phone string `cname:"手机号码" json:"phone" valid:"Required"`
// 密码
Password string `cname:"密码" json:"password" valid:"Required"`
}
DataAuthUserSignUp struct {
}
)
//修改密码
type (
ReqAuthChangePassword struct {
... ... @@ -97,8 +112,10 @@ type (
ReqAuthUserBase struct {
// 手机号码
Account string `cname:"账号" json:"account" valid:"Required"`
UserBaseId int64 `json:"userBaseId"`
}
DataAuthUserBase struct {
UserID int `json:"userId"`
UserBaseID int `json:"userBaseId"`
UserInfo struct {
UserName string `json:"userName"`
... ... @@ -113,5 +130,26 @@ type (
ImToken string `json:"imToken"`
CsAccountID string `json:"csAccountId"`
} `json:"im"`
Favorite struct {
OrgItems []int64 `json:"orgItems"`
} `json:"favorite"`
}
)
func (user *DataAuthUserBase) CheckOrgStarred(orgId int64) bool {
var starred bool = false
for i := range user.Favorite.OrgItems {
if user.Favorite.OrgItems[i] == orgId {
starred = true
return starred
}
}
return false
}
func (user *DataAuthUserBase) FavoriteOrg() []int64 {
if user == nil {
return []int64{}
}
return user.Favorite.OrgItems
}
... ...
package allied_creation_user
type (
ReqListBlockChain struct {
DisableLimit bool `json:"disableLimit"`
EnableDistinctPrimaryID bool `json:"enableDistinctPrimaryId"`
PrimaryIDList []string `json:"primaryIdList"`
Source string `json:"source"`
}
DataListBlockChain []DataListBlockChainItem
DataListBlockChainItem struct {
UpChainID int `json:"upChainId"`
PrimaryID string `json:"primaryId"`
BlockHash string `json:"blockHash"`
}
ReqBlockChainToken struct {
Type int `json:"type"`
UpChainID int `json:"upChainId"`
}
DataBlockChainToken struct {
BrowseURL string `json:"browseUrl"`
Token string `json:"token"`
}
)
func (d DataListBlockChain) ToMap() map[string]DataListBlockChainItem {
mapItems := make(map[string]DataListBlockChainItem)
if d == nil || len(d) == 0 {
return mapItems
}
for i := range d {
mapItems[(d[i]).PrimaryID] = d[i]
}
return mapItems
}
... ...
... ... @@ -34,3 +34,18 @@ type (
FavoriteMenus []string `json:"favoriteMenus"`
}
)
type (
ReqFavoriteUpdate struct {
UserBaseId int64 `json:"userBaseId" valid:"Required"`
// 菜单编码列表
Item string `json:"item" valid:"Required"`
// 项唯一标识
ItemId int64 `cname:"项唯一标识" json:"itemId" valid:"Required"`
// 用户Id 用户唯一标识
Action int64 `cname:"操作类型 1:关注 2:取消关注 " json:"action" valid:"Required"`
}
DataFavoriteUpdate struct {
}
)
... ...
... ... @@ -106,6 +106,9 @@ type (
EnableStatus int `cname:"状态(1:启用 2:禁用 3:注销)" json:"enableStatus,omitempty"`
// 状态(1:启用 2:禁用 3:注销)
InEnableStatus []int `cname:"状态(1:启用 2:禁用 3:注销)" json:"inEnableStatus,omitempty"`
// 自定义高级查询
AdvancedQuery string `json:"advancedQuery"`
}
//DataUserSearch 搜索用户列表
... ...
package service_gateway
import (
"encoding/json"
rawjson "encoding/json"
"fmt"
"github.com/linmadan/egglib-go/utils/json"
"strconv"
"time"
... ... @@ -18,7 +19,7 @@ type MessageCode struct {
//GatewayResponse 统一消息返回格式
type GatewayResponse struct {
MessageCode
Data json.RawMessage `json:"data"`
Data rawjson.RawMessage `json:"data"`
}
type BaseServiceGateway struct {
... ...
... ... @@ -48,7 +48,8 @@ func (gateway HttpLibVersionServer) GetLatestVersion(rc *http.Request, param Req
req.Header(k, vs[i])
}
}
req.Header("X-MMM-AppProject", "AlliedCreation")
req.Header("X-MMM-AppName", "com.mmm.alliedcreation")
byteResult, err := req.Bytes()
if err != nil {
return nil, fmt.Errorf("获取版本失败:%w", err)
... ...
... ... @@ -137,6 +137,18 @@ func (controller *AuthController) CompanySignUp() {
controller.Response(data, err)
}
func (controller *AuthController) UserSignUp() {
authService := service.AuthService{}
cmd := &command.UserSignUpCommand{}
err := controller.Unmarshal(cmd)
if err != nil {
controller.Response(nil, err)
return
}
data, err := authService.UserSignUp(cmd)
controller.Response(data, err)
}
func (controller *AuthController) ResetPassword() {
authService := service.AuthService{}
userOrgCommand := &command.ResetPasswordCommand{}
... ...
... ... @@ -118,12 +118,25 @@ func (controller *BaseController) GetExcelFile() (io.Reader, error) {
return nil, fmt.Errorf("上传文件不存在")
}
ext := filepath.Ext(fileHeader.Filename)
if !(ext == ".xlsx" || ext == ".xls") {
return nil, fmt.Errorf("仅支持上传文件格式 xls/xlsx")
if !(ext == ".xlsx" || ext == ".xls" || ext == ".csv") {
return nil, fmt.Errorf("仅支持上传文件格式 xls/xlsx/csv")
}
return excelFile, nil
}
func (controller *BaseController) GetFileWithExt() (io.Reader, string, error) {
excelFile, fileHeader, err := controller.GetFile("file")
if err != nil {
log.Logger.Error(err.Error())
return nil, "", fmt.Errorf("上传文件不存在")
}
ext := filepath.Ext(fileHeader.Filename)
if !(ext == ".xlsx" || ext == ".xls" || ext == ".csv") {
return nil, "", fmt.Errorf("仅支持上传文件格式 xls/xlsx/csv")
}
return excelFile, ext, nil
}
func Must(err error) {
if err != nil {
log.Logger.Error(err.Error())
... ...
... ... @@ -30,6 +30,14 @@ func (controller *CommonController) LatestVersionInfo() {
controller.Response(data, err)
}
func (controller *CommonController) AdvancedSetting() {
commonService := service.NewCommonService(nil)
queryParam := &query.GetAdvancedSettingQuery{}
_ = controller.Unmarshal(queryParam)
data, err := commonService.AdvancedSetting(queryParam)
controller.Response(data, err)
}
func (controller *CommonController) AppSharing() {
commonService := service.NewCommonService(nil)
queryParam := &query.GetLatestVersionQuery{}
... ... @@ -40,6 +48,14 @@ func (controller *CommonController) AppSharing() {
controller.Response(data, err)
}
func (controller *CommonController) BlockChainBrowser() {
commonService := service.NewCommonService(nil)
queryParam := &query.GetBlockChainTokenQuery{}
_ = controller.Unmarshal(queryParam)
data, err := commonService.BlockChainBrowser(queryParam)
controller.Response(data, err)
}
func (controller *CommonController) LogData() {
bytes, _ := ioutil.ReadFile("./app.log")
controller.Ctx.WriteString(string(bytes))
... ...
... ... @@ -214,6 +214,19 @@ func (controller *CooperationController) SearchCooperationProject() {
controller.ReturnPageListData(int64(total), data, err, cmd.PageNumber)
}
func (controller *CooperationController) SearchCooperationProjectContracts() {
svr := service.CooperationProjectService{}
cmd := &command.SearchCooperationProjectContractQuery{}
err := controller.Unmarshal(cmd)
if err != nil {
controller.Response(nil, err)
return
}
cmd.Operator = controller.GetOperator()
total, data, err := svr.SearchCooperationProjectContracts(cmd)
controller.ReturnPageListData(int64(total), data, err, cmd.PageNumber)
}
func (controller *CooperationController) PersonSearchCooperationProject() {
svr := service.CooperationProjectService{}
cmd := &command.PersonSearchCooperationProjectQuery{}
... ... @@ -227,6 +240,45 @@ func (controller *CooperationController) PersonSearchCooperationProject() {
controller.ReturnPageListData(int64(total), data, err, cmd.PageNumber)
}
func (controller *CooperationController) PersonSearchCooperationProjectStarred() {
svr := service.CooperationProjectService{}
cmd := &command.PersonSearchCooperationProjectQuery{}
err := controller.Unmarshal(cmd)
if err != nil {
controller.Response(nil, err)
return
}
cmd.Operator = controller.GetOperator()
total, data, err := svr.PersonSearchCooperationProjectStarred(cmd)
controller.ReturnPageListData(int64(total), data, err, cmd.PageNumber)
}
func (controller *CooperationController) PersonCooperationProjectSharedInfo() {
svr := service.CooperationProjectService{}
cmd := &command.GetCooperationProjectQuery{}
err := controller.Unmarshal(cmd)
if err != nil {
controller.Response(nil, err)
return
}
cmd.Operator = controller.GetOperator()
data, err := svr.PersonSearchCooperationProjectShareInfo(cmd)
controller.Response(data, err)
}
func (controller *CooperationController) PersonCooperationProjectSharedInfoAttachment() {
svr := service.CooperationProjectService{}
cmd := &command.PersonCooperationProjectSharedInfoAttachmentQuery{}
err := controller.Unmarshal(cmd)
if err != nil {
controller.Response(nil, err)
return
}
cmd.Operator = controller.GetOperator()
data, err := svr.PersonSearchCooperationProjectShareInfoAttachment(cmd)
controller.Response(data, err)
}
//func (controller *CooperationController) PersonRecommendCooperationProject() {
// svr := service.CooperationProjectService{}
// cmd := &command.PersonSearchCooperationProjectQuery{}
... ...
package mobile_client
import (
"net/http"
"net/http/httputil"
"net/url"
"strings"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/constant"
)
//代理请求转发
type ReverseProxyController struct {
baseController
}
func (controller *ReverseProxyController) SuplusSaleApp() {
// proxyHostUrl := constant.SUPLUS_SALE_APP + "/v1/platform/district"
// req := httplib.Post(proxyHostUrl)
// req.Header("Content-Type", "application/json")
// req = req.Body(controller.Ctx.Input.RequestBody)
// respData, err := req.Bytes()
// if err != nil {
// controller.Response(nil, err)
// return
// }
// controller.Ctx.Output.Header("Content-Type", "application/json; charset=utf-8")
// controller.Ctx.Output.Body(respData)
target, err := url.Parse(constant.SUPLUS_SALE_APP)
if err != nil {
panic(err)
}
controller.Ctx.Request.URL.Path = strings.Replace(controller.Ctx.Request.URL.Path, "/suplus-sale-app", "", 1)
newProxy := httputil.NewSingleHostReverseProxy(target)
directorFunc := newProxy.Director
newDirectorFunc := func(r *http.Request) {
directorFunc(r)
r.Host = target.Host
}
newProxy.Director = newDirectorFunc
newProxy.ServeHTTP(controller.Ctx.ResponseWriter, controller.Ctx.Request)
}
... ...
... ... @@ -145,3 +145,16 @@ func (controller *UserController) CooperationOrg() {
data, err := svr.CooperationOrg(operator)
controller.Response(data, err)
}
func (controller *UserController) UpdateOrgFavorite() {
svr := service.UserService{}
cmd := &command.UpdateFavoriteCommand{}
err := controller.Unmarshal(cmd)
if err != nil {
controller.Response(nil, err)
return
}
cmd.Operator = controller.GetOperator()
data, err := svr.UpdateFavorite(cmd)
controller.Response(data, err)
}
... ...
... ... @@ -46,11 +46,11 @@ func (controller *ExcelDataController) fieldValueAllEmpty(param map[string]strin
}
// ImportDividendsOrder 导入分红订单
func (controller ExcelDataController) ImportDividendsOrder() {
func (controller *ExcelDataController) ImportDividendsOrder() {
importDividendsOrder(controller)
}
func importDividendsOrder(controller ExcelDataController) {
func importDividendsOrder(controller *ExcelDataController) {
fileReader, err := controller.GetExcelFile()
if err != nil {
... ... @@ -109,11 +109,11 @@ func importDividendsOrder(controller ExcelDataController) {
}
// ImportDividendsReturnedOrder 导入分红退货单
func (controller ExcelDataController) ImportDividendsReturnedOrder() {
func (controller *ExcelDataController) ImportDividendsReturnedOrder() {
importDividendsReturnedOrder(controller)
}
func importDividendsReturnedOrder(controller ExcelDataController) {
func importDividendsReturnedOrder(controller *ExcelDataController) {
fileReader, err := controller.GetExcelFile()
if err != nil {
... ... @@ -172,7 +172,7 @@ func importDividendsReturnedOrder(controller ExcelDataController) {
}
// FileImport 文件导入
func (controller ExcelDataController) FileImport() {
func (controller *ExcelDataController) FileImport() {
code := controller.GetString("code")
switch code {
case domain.ImportDividendsOrders:
... ... @@ -184,14 +184,15 @@ func (controller ExcelDataController) FileImport() {
}
}
func defaultImport(controller ExcelDataController) {
func defaultImport(controller *ExcelDataController) {
var (
data interface{}
err error
r io.Reader
ext string
)
excelService := service.NewExcelDataService(nil)
r, err = controller.GetExcelFile()
r, ext, err = controller.GetFileWithExt()
if err != nil {
controller.Response(nil, err)
return
... ... @@ -200,6 +201,7 @@ func defaultImport(controller ExcelDataController) {
controller.ParseForm(cmd)
cmd.Operator = controller.GetOperator()
cmd.Reader = r
cmd.FileExt = ext
switch cmd.Code {
case domain.ImportCompanyUser:
data, err = excelService.ImportCompanyUser(cmd)
... ... @@ -213,7 +215,7 @@ func defaultImport(controller ExcelDataController) {
controller.Response(data, err)
}
func (controller ExcelDataController) FileImportTemplate() {
func (controller *ExcelDataController) FileImportTemplate() {
excelService := service.NewExcelDataService(nil)
cmd := &command.ImportDataCommand{}
code := controller.GetString(":code")
... ... @@ -224,11 +226,11 @@ func (controller ExcelDataController) FileImportTemplate() {
}
// FileExport 文件导出
func (controller ExcelDataController) FileExport() {
func (controller *ExcelDataController) FileExport() {
fileExport(controller, "")
}
func fileExport(controller ExcelDataController, code string) {
func fileExport(controller *ExcelDataController, code string) {
// 1.读取command
exportDataCommand := &command.ExportDataCommand{}
err := controller.Unmarshal(exportDataCommand)
... ... @@ -280,11 +282,16 @@ func fileExport(controller ExcelDataController, code string) {
}
// ExportCompanyUser 导出公司用户
func (controller ExcelDataController) ExportCompanyUser() {
func (controller *ExcelDataController) ExportCompanyUser() {
fileExport(controller, domain.ExportCompanyUser)
}
// ExportCooperationUser 导出共创用户
func (controller ExcelDataController) ExportCooperationUser() {
func (controller *ExcelDataController) ExportCooperationUser() {
fileExport(controller, domain.ExportCooperationUser)
}
//GetExcelDataFields 获取导出excel数据的可选字段
func (controller *ExcelDataController) GetExcelDataFields() {
}
... ...
... ... @@ -114,6 +114,8 @@ func CheckAccessToken2() web.FilterFunc {
"/v1/common/dictionary/search": "",
"/v1/common/app-sharing": "",
"/v1/user/cooperation-org": "",
"/v1/app/cooperation-projects/person/shared-info": "", //共创项目详情 - 未登录可以查看
"/v1/app/cooperation-projects/person/shared-info/attachment": "",
}
var err error
if filterUrl, err := url.Parse(ctx.Request.RequestURI); err == nil {
... ...
... ... @@ -18,6 +18,7 @@ func init() {
//web.Router("/v1/auth/access-token", &controllers.AuthController{}, "Post:GetAuthAccessToken")
web.Router("/v1/auth/refresh-token", &controllers.AuthController{}, "Post:RefreshAuthAccessToken")
web.Router("/v1/auth/company-sign-up", &controllers.AuthController{}, "Post:CompanySignUp") //公司用户注册
web.Router("/v1/auth/user-sign-up", &controllers.AuthController{}, "Post:UserSignUp")
web.Router("/v1/auth/reset-password", &controllers.AuthController{}, "Post:ResetPassword") //公司重置密码
web.Router("/v1/auth/org-switch", &controllers.AuthController{}, "Post:OrgSwitch")
}
... ...
... ... @@ -7,7 +7,9 @@ import (
func init() {
web.Router("/v1/common/dictionary/search", &controllers.CommonController{}, "Post:GetDictionaryByCode")
web.Router("/v1/common/advanced-query/setting", &controllers.CommonController{}, "Post:AdvancedSetting")
web.Router("/v1/common/version/getLatestVersionInfo", &controllers.CommonController{}, "Post:LatestVersionInfo")
web.Router("/v1/common/app-sharing", &controllers.CommonController{}, "Post:AppSharing")
web.Router("/v1/common/block-chain-browser", &controllers.CommonController{}, "Post:BlockChainBrowser")
web.Router("/log", &controllers.CommonController{}, "Get:LogData")
}
... ...
... ... @@ -2,9 +2,11 @@ package routers
import (
"github.com/beego/beego/v2/server/web"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/constant"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/port/beego/controllers"
)
func init() {
web.Router("/log", &controllers.LoggerController{}, "Get:Index")
web.SetStaticPath("/static", constant.FileStatic)
}
... ...
... ... @@ -32,10 +32,14 @@ func init() {
web.Router("/v1/app/cooperation-projects/:projectId", &mobile_client.CooperationController{}, "Put:UpdateCooperationProject")
web.Router("/v1/app/cooperation-projects/end", &mobile_client.CooperationController{}, "Post:EndCooperationProject")
web.Router("/v1/app/cooperation-projects/search", &mobile_client.CooperationController{}, "Post:SearchCooperationProject")
web.Router("/v1/app/cooperation-projects/contracts", &mobile_client.CooperationController{}, "Post:SearchCooperationProjectContracts")
web.Router("/v1/app/cooperation-modes", &web_client.CooperationModeController{}, "Get:ListCooperationMode")
web.Router("/v1/common/cooperation/mode", &web_client.CooperationModeController{}, "Get:ListCooperationMode")
web.Router("/v1/app/cooperation-projects/person/search", &mobile_client.CooperationController{}, "Post:PersonSearchCooperationProject")
web.Router("/v1/app/cooperation-projects/person/search-starred", &mobile_client.CooperationController{}, "Post:PersonSearchCooperationProjectStarred")
web.Router("/v1/app/cooperation-projects/person/shared-info", &mobile_client.CooperationController{}, "Post:PersonCooperationProjectSharedInfo")
web.Router("/v1/app/cooperation-projects/person/shared-info/attachment", &mobile_client.CooperationController{}, "Post:PersonCooperationProjectSharedInfoAttachment")
/***** CompanyDividends 账期结算 *****/
web.Router("/v1/app/company/credit-accounts/search", &mobile_client.CooperationController{}, "Post:CreditAccountSearch")
... ...
package routers
import (
"github.com/beego/beego/v2/server/web"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/port/beego/controllers/mobile_client"
)
func init() {
/***** 转发销售导航的请求*****/
web.Router("/suplus-sale-app/v1/platform/district", &mobile_client.ReverseProxyController{}, "post:SuplusSaleApp")
web.Router("/suplus-sale-app/v1/platform/page", &mobile_client.ReverseProxyController{}, "post:SuplusSaleApp")
}
... ...
... ... @@ -15,6 +15,7 @@ func init() {
web.Router("/v1/user/user-menu", &controllers.AuthController{}, "Post:GetUserMenus")
web.Router("/v1/user/favorite-menus", &controllers.AuthController{}, "Get:GetFavoriteMenus")
web.Router("/v1/user/favorite-menus", &mobile_client.UserController{}, "Post:UpdateMenuFavorite")
web.Router("/v1/user/favorite", &mobile_client.UserController{}, "Post:UpdateOrgFavorite")
web.Router("/v1/user/change-password", &mobile_client.UserController{}, "Post:ChangePassword")
web.Router("/v1/user/change-phone", &mobile_client.UserController{}, "Post:ChangePhone")
... ...
package advance
import (
"github.com/stretchr/testify/assert"
"sort"
"testing"
)
var exprNumberTable = [][]Expr{
[]Expr{
{OpChar: Eq, Value: []interface{}{100, 200, 600}},
//{OpChar: Eq, Value: []interface{}{500}},
{OpChar: Range, Value: []interface{}{50, 200}, LeftOp: GreaterThan, RightOp: LessThan},
{OpChar: LessThanEqual, Value: []interface{}{Infinity, 50}},
{OpChar: LessThan, Value: []interface{}{Infinity, 250}},
{OpChar: Range, Value: []interface{}{60, 100}},
{OpChar: Range, Value: []interface{}{60, 70}},
{OpChar: NotEqual, Value: []interface{}{60, 61, 62}},
},
[]Expr{
{OpChar: Range, Value: []interface{}{100, 200}, LeftOp: GreaterThan, RightOp: LessThanEqual},
{OpChar: Range, Value: []interface{}{Infinity, 50}, LeftOp: GreaterThan, RightOp: LessThanEqual},
{OpChar: Range, Value: []interface{}{50, 90}, LeftOp: GreaterThan, RightOp: LessThanEqual},
{OpChar: Range, Value: []interface{}{150, 300}, LeftOp: GreaterThan, RightOp: LessThanEqual},
},
}
var exprDateTable = [][]Expr{
[]Expr{
{OpChar: Range, Value: []interface{}{1611731000, 1611735000}},
{OpChar: LessThanEqual, Value: []interface{}{Infinity, 1611721000}},
{OpChar: Range, Value: []interface{}{1611734000, 1611737000}},
},
[]Expr{
{OpChar: Range, Value: []interface{}{1611731000, 1611735000}},
{OpChar: LessThanEqual, Value: []interface{}{Infinity, 1611721000}},
{OpChar: Range, Value: []interface{}{1611734000, 1611737000}},
{OpChar: Recent, Value: []interface{}{5}},
},
}
var exprCharsTable = [][]Expr{
[]Expr{
{OpChar: In, Value: []interface{}{"abc", "abd"}},
{OpChar: Eq, Value: []interface{}{"abc"}},
},
[]Expr{
{OpChar: In, Value: []interface{}{"华南", "华北"}},
{OpChar: Eq, Value: []interface{}{"华北"}},
{OpChar: Like, Value: []interface{}{"华"}},
{OpChar: Like, Value: []interface{}{"中"}},
},
}
var columnChar = Column{
Column: "userName",
Name: "姓名",
DbAlias: "ext->>'userName'",
ValueType: ValueChars,
}
var columnNumber = Column{
Column: "age",
Name: "年龄",
DbAlias: "age",
ValueType: ValueNumber,
}
// 数字表达式合并
func TestJoinNumberColumnExpr(t *testing.T) {
for i := range exprNumberTable {
out := JoinColumnExprNumber(exprNumberTable[i])
t.Log(out)
}
}
// 时间表达式合并
func TestJoinDateColumnExpr(t *testing.T) {
for i := range exprDateTable {
out := JoinColumnExprDate(exprDateTable[i])
t.Log(out)
}
}
// 字符串表达式合并
func TestJoinCharsColumnExpr(t *testing.T) {
for i := range exprCharsTable {
out := JoinColumnExprChars(exprCharsTable[i])
t.Log(out)
}
}
// 排序测试
func TestSortExprList(t *testing.T) {
rec := RangeNumberExprCompute{valueType: ValueNumber}
expr := exprNumberTable[0]
for i := range expr {
if expr[i].OpChar == Range || expr[i].OpChar == LessThanEqual || expr[i].OpChar == GreaterThanEqual {
rec.expr = append(rec.expr, expr[i])
}
}
var exprSort = exprSortable(rec.expr)
//log.Info("before:", exprSort)
sort.Sort(exprSort)
//log.Info("after:", exprSort)
rec.expr = exprSort
}
func TestAdvancedQuerySqlNormal(t *testing.T) {
inputs := []AdvancedQuery{
{
Column: columnChar,
Exprs: exprCharsTable[1],
},
{
Column: columnNumber,
Exprs: exprNumberTable[0],
},
}
sql, _ := AdvancedQuerySql(inputs)
t.Log(sql)
}
func TestAdvancedQuerySqlMerge(t *testing.T) {
inputs := []AdvancedQuery{
{
Column: columnChar,
Exprs: exprCharsTable[1],
},
{
Column: columnNumber,
Exprs: exprCharsTable[1],
},
}
sql, _ := AdvancedQuerySql(inputs)
t.Log(sql)
}
func TestAdvancedQuerySqlNumber(t *testing.T) {
inputs := []AdvancedQuery{
{
Column: columnChar,
Exprs: exprCharsTable[1],
},
{
Column: columnNumber,
Exprs: exprNumberTable[1],
},
}
sql, _ := AdvancedQuerySql(inputs)
t.Log(sql)
}
func TestAdvancedQuerySql_PG(t *testing.T) {
tables := []struct {
name string
col Column
ins []Expr
except interface{}
exceptSql string
ok bool
}{
// in (equal)
{
col: columnChar,
name: "in zero item",
ins: []Expr{
{OpChar: In, Value: []interface{}{}},
},
except: nil,
exceptSql: "",
ok: false,
},
{
col: columnChar,
name: "in one item",
ins: []Expr{
{OpChar: In, Value: []interface{}{"foo"}},
},
except: nil,
exceptSql: "(ext->>'userName' in ('foo'))",
ok: true,
},
{
col: columnChar,
name: "in many item",
ins: []Expr{
{OpChar: In, Value: []interface{}{"bar", "ccc", "foo", "ele"}},
},
except: nil,
exceptSql: "(ext->>'userName' in ('bar','ccc','ele','foo'))",
ok: true,
},
{
col: columnNumber,
name: "in many item (number)",
ins: []Expr{
{OpChar: In, Value: []interface{}{1, 2, 3, 4}},
},
except: nil,
exceptSql: "(age in (1,2,3,4))",
ok: true,
},
{
col: columnNumber,
name: "in many item (number)",
ins: []Expr{
{OpChar: In, Value: []interface{}{1, 2, 3, 4}},
},
except: nil,
exceptSql: "(age in (1,2,3,4))",
ok: true,
},
// not in (not equal)
{
col: columnNumber,
name: "not equal many item (number)",
ins: []Expr{
{OpChar: NotEqual, Value: []interface{}{1, 2, 3, 4}},
{OpChar: NotEqual, Value: []interface{}{5, 6}},
},
except: nil,
exceptSql: "(age not in (1,2,3,4,5,6))",
ok: true,
},
// range
{
col: columnChar,
name: "range one item",
ins: []Expr{
{OpChar: LessThanEqual, Value: []interface{}{Infinity, 60}},
},
except: nil,
exceptSql: "",
ok: true,
},
{
col: columnNumber,
name: "range one item",
ins: []Expr{
{OpChar: LessThanEqual, Value: []interface{}{Infinity, 60}},
},
except: nil,
exceptSql: "(( age <= 60 ))",
ok: true,
},
{
col: columnNumber,
name: "range many item (LessThanEqual)",
ins: []Expr{
{OpChar: LessThanEqual, Value: []interface{}{Infinity, 60}},
{OpChar: LessThanEqual, Value: []interface{}{Infinity, 80}},
},
except: nil,
exceptSql: "(( age <= 60 ))",
ok: true,
},
{
col: columnNumber,
name: "range many item (GreaterThanEqual)",
ins: []Expr{
{OpChar: LessThanEqual, Value: []interface{}{Infinity, 60}},
{OpChar: GreaterThanEqual, Value: []interface{}{80, Infinity}},
{OpChar: GreaterThanEqual, Value: []interface{}{200, Infinity}},
{OpChar: LessThanEqual, Value: []interface{}{Infinity, 70}},
},
except: nil,
exceptSql: "", // 或集 (( age <= 70 ) or ( age >= 80 )) 并集 ""
ok: true,
},
{
col: columnNumber,
name: "range many item (Between $<=n<=$)",
ins: []Expr{
{OpChar: GreaterThanEqual, Value: []interface{}{80, Infinity}},
{OpChar: LessThanEqual, Value: []interface{}{Infinity, 200}},
{OpChar: LessThan, Value: []interface{}{Infinity, 150}},
},
except: nil,
exceptSql: "(( age >= 80 and age < 150 ))",
ok: true,
},
{
col: columnNumber,
name: "range many item (100<=n<=200)",
ins: []Expr{
{OpChar: Range, Value: []interface{}{100, 200}, LeftOp: GreaterThanEqual, RightOp: LessThanEqual},
},
except: nil,
exceptSql: "(( age >= 100 and age <= 200 ))",
ok: true,
},
{
col: columnNumber,
name: "range many item (80<n<220)",
ins: []Expr{
{OpChar: Range, Value: []interface{}{"150", "180"}, LeftOp: GreaterThanEqual, RightOp: LessThanEqual},
{OpChar: Range, Value: []interface{}{"120", "220"}, LeftOp: GreaterThanEqual, RightOp: LessThan},
{OpChar: Range, Value: []interface{}{"100", "200"}, LeftOp: GreaterThanEqual, RightOp: LessThanEqual},
{OpChar: Range, Value: []interface{}{"80", "100"}, LeftOp: GreaterThan, RightOp: LessThanEqual},
{OpChar: Range, Value: []interface{}{"300", "500"}, LeftOp: GreaterThan, RightOp: LessThanEqual},
},
except: nil,
exceptSql: "(( age > 80 and age < 220 ) or ( age > 300 and age <= 500 ))",
ok: true,
},
// like
{
col: columnChar,
name: "like zero item",
ins: []Expr{
{OpChar: Like, Value: []interface{}{}},
},
except: nil,
exceptSql: "",
ok: false,
},
{
col: columnChar,
name: "like one item",
ins: []Expr{
{OpChar: Like, Value: []interface{}{"foo"}},
},
except: nil,
exceptSql: "((ext->>'userName' like '%foo%'))",
ok: true,
},
{
col: columnChar,
name: "like many item",
ins: []Expr{
{OpChar: Like, Value: []interface{}{"bar", "ccc"}},
},
except: nil,
exceptSql: "((ext->>'userName' like '%bar%' or ext->>'userName' like '%ccc%'))",
ok: true,
},
{
col: columnNumber,
name: "like many item (number)",
ins: []Expr{
{OpChar: Like, Value: []interface{}{10, 20}},
},
except: nil,
exceptSql: "((age::text like '%10%' or age::text like '%20%'))",
ok: true,
},
// error input
{
col: columnChar,
name: "invalid input",
ins: []Expr{
{OpChar: Like, Value: []interface{}{"dsger?*"}},
},
except: nil,
exceptSql: "",
ok: false,
},
}
for i := range tables {
q := []AdvancedQuery{
{
Column: tables[i].col,
Exprs: tables[i].ins,
},
}
t.Run(tables[i].name, func(t *testing.T) {
sql, err := AdvancedQuerySql(q)
assert.Equal(t, tables[i].exceptSql, sql)
if tables[i].ok {
assert.Nil(t, err)
}
})
}
}
... ...
package advance
import (
"bytes"
"fmt"
"regexp"
"strconv"
"strings"
)
type (
Model struct {
mc MapColumn
name string
}
AdvancedQuery struct {
Column Column `json:"column"`
Exprs []Expr `json:"exprs"`
}
ColumnExprResult struct {
Column Column
Result []ExprResult
}
// 高级查询参数
AdvancedQueries []AdvancedQuery
)
var registerModels = make(map[string]Model)
func RegisModel(m Model) {
if _, ok := registerModels[m.name]; ok {
panic("register modes exists:" + m.name)
}
registerModels[m.name] = m
}
func NewModel(name string, columns []Column) Model {
return Model{
name: name,
mc: NewMapColumn(columns),
}
}
func ComputeColumnExpr(queries []AdvancedQuery) []ColumnExprResult {
var result = make([]ColumnExprResult, 0)
queries = mergeQuery(queries)
for i := range queries {
q := queries[i]
var tmpResult []ExprResult
switch q.Column.ValueType {
case ValueNumber:
tmpResult = append(JoinColumnExprNumber(q.Exprs))
case ValueChars:
tmpResult = append(JoinColumnExprChars(q.Exprs))
case ValueDate:
tmpResult = append(JoinColumnExprDate(q.Exprs))
}
if len(tmpResult) == 0 {
continue
}
result = append(result, ColumnExprResult{
Column: q.Column,
Result: tmpResult,
})
}
return result
}
func JoinColumnExprNumber(expr []Expr) []ExprResult {
var ec = []exprCompute{NewInExprCompute(expr, ValueNumber), NewRangeExprCompute(expr, ValueNumber), NewLessGreaterExprCompute(expr, ValueNumber), NewNotEqualExprCompute(expr, ValueNumber), NewLikeExprCompute(expr, ValueNumber)}
return joinExprResult(ec)
}
func JoinColumnExprDate(expr []Expr) []ExprResult {
var ec = []exprCompute{NewRangeExprCompute(expr, ValueDate), NewRecentDateExprCompute(expr, ValueDate), NewNotEqualExprCompute(expr, ValueChars)}
return joinExprResult(ec)
}
func JoinColumnExprChars(expr []Expr) []ExprResult {
var ec = []exprCompute{NewInExprCompute(expr, ValueChars), NewLikeExprCompute(expr, ValueChars), NewNotEqualExprCompute(expr, ValueChars)}
return joinExprResult(ec)
}
type MapColumn map[string]Column
func NewMapColumn(cols []Column) MapColumn {
mapColumn := make(map[string]Column)
for i := range cols {
mapColumn[cols[i].Column] = cols[i]
}
return mapColumn
}
func (m MapColumn) FindItem(col string) Column {
if item, ok := m[col]; ok {
return item
}
return Column{}
}
type PgSqlGenerator struct{}
func (p PgSqlGenerator) SqlGen(q ColumnExprResult) (string, error) {
sql := bytes.NewBuffer(nil)
sql.WriteString("(")
var wheres []string
for i := range q.Result {
item := q.Result[i]
if err := p.PreCheckAndFormat(&item); err != nil {
return "", err
}
var where string
switch item.OpChar {
case In:
where = p.In(q.Column, item.Value)
case NotIn:
where = p.NotIn(q.Column, item.Value)
case Like:
where = p.Like(q.Column, item.Value)
case Range:
where = p.Range(q.Column, item)
default:
where = fmt.Sprintf(" %s %s %v ", q.Column.DbAlias, item.OpChar, item.Value[0])
}
if len(where) == 0 {
continue
}
wheres = append(wheres, where)
}
sql.WriteString(strings.Join(wheres, sepOr))
sql.WriteString(")")
return sql.String(), nil
}
func (p PgSqlGenerator) PreCheckAndFormat(rs *ExprResult) error {
if rs.ValueType == ValueNumber || rs.ValueType == ValueDate {
for i := range rs.Value {
v := rs.Value[i]
if isInfinity(v) {
continue
}
if _, err := strconv.ParseFloat(fmt.Sprintf("%v", v), 64); err != nil {
return fmt.Errorf("不是有效的数值类型:%v", v)
}
}
}
if rs.ValueType == ValueChars {
for i := range rs.Value {
v, ok := rs.Value[i].(string)
err := fmt.Errorf("不是有效的字符串类型:%v", v)
if !ok {
return err
}
if ok, e := regexp.MatchString("[!%&()*+,-/=?^`'{|}~]", v); ok || e != nil {
return fmt.Errorf("非法字符:%v", v)
}
}
}
return nil
}
func (p PgSqlGenerator) In(c Column, values []interface{}) string {
if len(values) < 1 {
return ""
}
var ret []string
for i := range values {
if c.ValueType == ValueNumber {
ret = append(ret, fmt.Sprintf("%v", values[i]))
} else {
ret = append(ret, fmt.Sprintf("'%v'", values[i]))
}
}
return fmt.Sprintf("%s in (%s)", c.DbAlias, strings.Join(ret, ","))
}
func (p PgSqlGenerator) NotIn(c Column, values []interface{}) string {
if len(values) < 1 {
return ""
}
var ret []string
for i := range values {
if c.ValueType == ValueNumber {
ret = append(ret, fmt.Sprintf("%v", values[i]))
} else {
ret = append(ret, fmt.Sprintf("'%v'", values[i]))
}
}
return fmt.Sprintf("%s not in (%s)", c.DbAlias, strings.Join(ret, ","))
}
func (p PgSqlGenerator) Like(c Column, values []interface{}) string {
if len(values) < 1 {
return ""
}
sql := bytes.NewBuffer(nil)
sql.WriteString("(")
var wheres []string
for i := range values {
if c.ValueType == ValueNumber {
wheres = append(wheres, fmt.Sprintf("%s::text like '%%%v%%'", c.DbAlias, values[i]))
} else {
wheres = append(wheres, fmt.Sprintf("%s like '%%%v%%'", c.DbAlias, values[i]))
}
}
sql.WriteString(strings.Join(wheres, sepOr))
sql.WriteString(")")
return sql.String()
}
func (p PgSqlGenerator) Range(c Column, res ExprResult) string {
if len(res.Value) != 2 {
return ""
}
sql := bytes.NewBuffer(nil)
sql.WriteString("(")
var wheres []string
if !isInfinity(res.Value[0]) {
wheres = append(wheres, fmt.Sprintf(" %s %s %v ", c.DbAlias, res.LeftOp, res.Value[0]))
}
if !isInfinity(res.Value[1]) {
wheres = append(wheres, fmt.Sprintf(" %s %s %v ", c.DbAlias, res.RightOp, res.Value[1]))
}
sql.WriteString(strings.Join(wheres, sepAnd))
sql.WriteString(")")
return sql.String()
}
// AdvancedQuerySql 高级查询Sql生成器
func AdvancedQuerySql(queries []AdvancedQuery) (string, error) {
if len(queries) == 0 {
return "", nil
}
gen := PgSqlGenerator{}
results := ComputeColumnExpr(queries)
if len(results) == 0 {
return "", nil
}
sql := bytes.NewBuffer(nil)
var wheres []string
for i := range results {
condition, err := gen.SqlGen(results[i])
if err != nil {
return "", err
}
wheres = append(wheres, condition)
}
sql.WriteString(strings.Join(wheres, sepAnd))
// 空条件 ()
if sql.String() == "()" {
return "", nil
}
if sql.String() == "(())" {
return "", nil
}
return sql.String(), nil
}
func mergeQuery(queries []AdvancedQuery) []AdvancedQuery {
var rsp = make([]AdvancedQuery, 0)
var mapColumn = make(map[string]AdvancedQuery)
for i := range queries {
var item AdvancedQuery
var ok bool
if item, ok = mapColumn[queries[i].Column.Column]; !ok {
mapColumn[queries[i].Column.Column] = queries[i]
} else {
item.Exprs = append(item.Exprs, queries[i].Exprs...)
}
}
for _, v := range mapColumn {
rsp = append(rsp, v)
}
return rsp
}
... ...
package advance
import (
"fmt"
"math"
"sort"
"strconv"
"time"
)
const (
ValueNumber ValueType = "number"
ValueDate ValueType = "date"
ValueChars ValueType = "chars"
)
const (
daySec = 60 * 60 * 24 //一天的秒数
Infinity = "$" // 表示无穷
// 分隔符
sepAnd = " and "
sepOr = " or "
)
const (
Eq OpType = "=" //eq =>>in
LessThanEqual OpType = "<=" //le
GreaterThanEqual OpType = ">=" //ge
Like OpType = "like" //like
LessThan OpType = "<" //lt
GreaterThan OpType = ">" //gt
NotEqual OpType = "<>" //ne =>> not in
NotIn OpType = "not in"
In OpType = "in" //in
Range OpType = "range" //range
Recent OpType = "recent" //recent 近几天
)
type (
ValueType string
OpType string
Column struct {
// 字段 userName
Column string `json:"column"`
// 名称
Name string `json:"name"`
// 列别名 对应数据库字段 ext->>'userName'
DbAlias string `json:"-"`
// 值类型
ValueType ValueType `json:"valueType"`
}
Expr struct {
// 操作符
OpChar OpType `json:"op"`
// 如果 OpChar=range ,LeftOp、RightOp需要有值
LeftOp OpType `json:"lop"` // "<= <"
RightOp OpType `json:"rop"` // ">= >"
// 值
Value []interface{} `json:"values"`
}
ExprResult struct {
// 操作符
OpChar OpType
// 值类型
ValueType ValueType
// 值
Value []interface{}
// 如果 OpType=range ,LeftOp、RightOp需要有值
LeftOp OpType
RightOp OpType
}
)
type (
exprCompute interface {
Append(result []ExprResult) []ExprResult
}
sqlGenerator interface {
SqlGen(q ColumnExprResult) string
}
InExprCompute struct {
expr []Expr
valueType ValueType
OpType OpType
}
RangeNumberExprCompute struct {
expr []Expr
valueType ValueType
}
RecentDateExprCompute struct {
expr []Expr
valueType ValueType
}
NotEqualExprCompute struct {
expr []Expr
valueType ValueType
OpType OpType
}
LessGreaterExprCompute struct {
expr []Expr
valueType ValueType
}
)
// in合并
func NewInExprCompute(expr []Expr, valueType ValueType) exprCompute {
inExpr := InExprCompute{valueType: valueType}
for i := 0; i < len(expr); i++ {
if expr[i].OpChar == Eq || expr[i].OpChar == In {
inExpr.expr = append(inExpr.expr, expr[i])
}
}
if len(inExpr.expr) > 0 {
return inExpr
}
return nil
}
func (ex InExprCompute) Append(result []ExprResult) []ExprResult {
var res = ExprResult{
OpChar: In,
ValueType: ex.valueType,
}
if ex.OpType != "" {
res.OpChar = ex.OpType
}
for i := range ex.expr {
res.Value = combine(append(res.Value, ex.expr[i].Value...))
}
result = append(result, res)
return result
}
func combine(arr []interface{}) []interface{} {
var mapArr = make(map[string]interface{})
for i := range arr {
key := fmt.Sprintf("%v", arr[i])
if _, ok := mapArr[key]; !ok {
mapArr[key] = arr[i]
}
}
var keys []string
for k, _ := range mapArr {
keys = append(keys, k)
}
sort.Strings(keys)
var res []interface{}
for i := range keys {
res = append(res, mapArr[keys[i]])
}
return res
}
//范围合并
func NewRangeExprCompute(expr []Expr, valueType ValueType) exprCompute {
rec := RangeNumberExprCompute{valueType: valueType}
for i := range expr {
if expr[i].OpChar == Range { // || expr[i].OpChar == LessThanEqual || expr[i].OpChar == GreaterThanEqual || expr[i].OpChar == LessThan || expr[i].OpChar == GreaterThan
rec.expr = append(rec.expr, expr[i])
}
}
if len(rec.expr) == 0 {
return nil
}
var exprSort = exprSortable(rec.expr)
sort.Sort(exprSort)
rec.expr = exprSort
return rec
}
func (ex RangeNumberExprCompute) Append(result []ExprResult) []ExprResult {
arr := &ExprResult{
OpChar: Range,
ValueType: ex.valueType,
Value: ex.expr[0].Value,
LeftOp: ex.expr[0].OpChar,
RightOp: ex.expr[0].OpChar,
}
if len(ex.expr[0].LeftOp) != 0 {
arr.LeftOp = ex.expr[0].LeftOp
}
if len(ex.expr[0].RightOp) != 0 {
arr.RightOp = ex.expr[0].RightOp
}
for i := 1; i < len(ex.expr); i++ {
if !arr.Compare(ex.expr[i]) {
result = append(result, *arr)
arr.Value = ex.expr[i].Value
arr.LeftOp = ex.expr[i].OpChar
arr.RightOp = ex.expr[i].OpChar
if len(ex.expr[0].LeftOp) != 0 {
arr.LeftOp = ex.expr[0].LeftOp
}
if len(ex.expr[0].RightOp) != 0 {
arr.RightOp = ex.expr[0].RightOp
}
continue
}
}
result = append(result, *arr)
return result
}
//范围合并
func NewLessGreaterExprCompute(expr []Expr, valueType ValueType) exprCompute {
rec := LessGreaterExprCompute{valueType: valueType}
for i := range expr {
if expr[i].OpChar == LessThanEqual || expr[i].OpChar == LessThan || expr[i].OpChar == GreaterThanEqual || expr[i].OpChar == GreaterThan {
rec.expr = append(rec.expr, expr[i])
}
}
if len(rec.expr) == 0 {
return nil
}
var exprSort = exprSortable(rec.expr)
sort.Sort(exprSort)
rec.expr = exprSort
return rec
}
func (ex LessGreaterExprCompute) Append(result []ExprResult) []ExprResult {
arr := &ExprResult{
OpChar: Range,
ValueType: ex.valueType,
Value: ex.expr[0].Value,
LeftOp: ex.expr[0].OpChar,
RightOp: ex.expr[0].OpChar,
}
x0, x1 := toFloat64(arr.Value[0], arr.Value[1])
for i := 1; i < len(ex.expr); i++ {
compare := ex.expr[i]
y0, y1 := toFloat64(compare.Value[0], compare.Value[1])
if compare.OpChar == LessThanEqual || compare.OpChar == LessThan {
if isInfinity(x1) {
arr.Value[1] = y0
arr.RightOp = compare.OpChar
} else if x1 > y1 {
arr.Value[0] = y0
arr.LeftOp = compare.OpChar
}
}
if compare.OpChar == GreaterThan || compare.OpChar == GreaterThanEqual {
if isInfinity(x0) {
arr.Value[0] = y0
arr.LeftOp = compare.OpChar
} else if y0 > x0 {
arr.Value[0] = y0
arr.LeftOp = compare.OpChar
}
}
}
if _, ok := less(arr.Value[0], arr.Value[1]); !ok {
arr.Value[0], arr.Value[1] = Infinity, Infinity
}
result = append(result, *arr)
return result
}
// recent范围
func NewRecentDateExprCompute(expr []Expr, valueType ValueType) exprCompute {
inExpr := RecentDateExprCompute{valueType: valueType}
for i := 0; i < len(expr); i++ {
if expr[i].OpChar == Recent {
inExpr.expr = append(inExpr.expr, expr[i])
}
}
if len(inExpr.expr) > 0 {
return inExpr
}
return nil
}
func (ex RecentDateExprCompute) Append(result []ExprResult) []ExprResult {
var res = ExprResult{
OpChar: Recent,
ValueType: ex.valueType,
}
var recent int64 = 0
for i := range ex.expr {
v, _ := strconv.ParseInt(fmt.Sprintf("%v", ex.expr[i].Value[0]), 10, 64)
if v > recent {
recent = v
}
}
res.Value = append(res.Value, []interface{}{time.Now().Unix() - daySec*recent, Infinity})
result = append(result, res)
return result
}
// like 合并(跟in操作一致)
func NewLikeExprCompute(expr []Expr, valueType ValueType) exprCompute {
inExpr := InExprCompute{valueType: valueType, OpType: Like}
for i := 0; i < len(expr); i++ {
if expr[i].OpChar == Like {
inExpr.expr = append(inExpr.expr, expr[i])
}
}
if len(inExpr.expr) > 0 {
return inExpr
}
return nil
}
// not equal合并
func NewNotEqualExprCompute(expr []Expr, valueType ValueType) exprCompute {
notEqualExpr := NotEqualExprCompute{valueType: valueType, OpType: NotIn}
for i := 0; i < len(expr); i++ {
if expr[i].OpChar == NotEqual {
notEqualExpr.expr = append(notEqualExpr.expr, expr[i])
}
}
if len(notEqualExpr.expr) > 0 {
return notEqualExpr
}
return nil
}
func (ex NotEqualExprCompute) Append(result []ExprResult) []ExprResult {
var res = ExprResult{
OpChar: NotIn,
ValueType: ex.valueType,
}
if ex.OpType != "" {
res.OpChar = ex.OpType
}
for i := range ex.expr {
res.Value = append(res.Value, ex.expr[i].Value...)
}
result = append(result, res)
return result
}
// Compare 比较两个范围的值
// eg: [80,&] [&,200]
// 排序 [&,200]
// [80,&]
// false:开启新的范围
// true:继续这个范围
func (er *ExprResult) Compare(compare Expr) bool {
if len(compare.Value) != 2 {
return false
}
_, x1 := toFloat64(er.Value[0], er.Value[1])
y0, _ := toFloat64(compare.Value[0], compare.Value[1])
if y0 <= x1 {
er.Value[1] = max(er.Value[1], compare.Value[1])
if isEqual(er.Value[1], compare.Value[1]) {
er.RightOp = compare.OpChar
if len(compare.RightOp) != 0 {
er.RightOp = compare.RightOp
}
}
return true
}
if isInfinity(er.Value[1]) {
return true
}
if isInfinity(er.Value[0]) && isInfinity(er.Value[1]) {
return true
}
return false
}
type exprSortable []Expr
func (e exprSortable) Len() int {
return len(e)
}
func (e exprSortable) Less(i, j int) bool {
var a, b float64
initValue := func(vi, vj interface{}) {
a, _ = strconv.ParseFloat(fmt.Sprintf("%v", vi), 64)
b, _ = strconv.ParseFloat(fmt.Sprintf("%v", vj), 64)
}
if isInfinity(e[i].Value[0]) && !isInfinity(e[j].Value[0]) {
return true
}
if isInfinity(e[i].Value[0]) && isInfinity(e[j].Value[0]) {
initValue(e[i].Value[1], e[j].Value[1])
return a < b
}
if e[i].Value[0] == e[j].Value[0] {
initValue(e[i].Value[1], e[j].Value[1])
return a < b
}
initValue(e[i].Value[0], e[j].Value[0])
return a < b
}
func (e exprSortable) Swap(i, j int) {
e[i], e[j] = e[j], e[i]
}
func joinExprResult(ec []exprCompute) []ExprResult {
var result []ExprResult
for _, ecItem := range ec {
if ecItem != nil {
result = ecItem.Append(result)
}
}
return result
}
func toFloat64(vi, vj interface{}) (float64, float64) {
a, _ := strconv.ParseFloat(fmt.Sprintf("%v", vi), 64)
b, _ := strconv.ParseFloat(fmt.Sprintf("%v", vj), 64)
return a, b
}
func max(x, y interface{}) interface{} {
if isInfinity(x) {
return x
}
if isInfinity(y) {
return y
}
fx, fy := toFloat64(x, y)
return math.Max(fx, fy)
}
func less(x, y interface{}) (interface{}, bool) {
if isInfinity(x) {
return x, true
}
if isInfinity(y) {
return y, true
}
fx, fy := toFloat64(x, y)
if fx < fy {
return x, true
}
return fy, false
}
func isInfinity(val interface{}) bool {
v := fmt.Sprintf("%v", val)
inf := fmt.Sprintf("%v", Infinity)
return v == inf
}
func isEqual(v1, v2 interface{}) bool {
sv1 := fmt.Sprintf("%v", v1)
sv2 := fmt.Sprintf("%v", v2)
return sv1 == sv2
}
... ...