作者 陈志颖

feat:生成基础领域对象

正在显示 41 个修改的文件 包含 2670 行增加6 行删除
  1 +module gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation
  2 +
  3 +go 1.16
  4 +
  5 +require github.com/linmadan/egglib-go v0.0.0-20210527091316-06b0732fb5f6 // indirect
  1 +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
  2 +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
  3 +github.com/Knetic/govaluate v3.0.0+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0=
  4 +github.com/Shopify/sarama v1.25.0 h1:ch1ywjRLjfJtU+EaiJ+l0rWffQ6TRpyYmW4DX7Cb2SU=
  5 +github.com/Shopify/sarama v1.25.0/go.mod h1:y/CFFTO9eaMTNriwu/Q+W4eioLqiDMGkA1W+gmdfj8w=
  6 +github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI=
  7 +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
  8 +github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
  9 +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
  10 +github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
  11 +github.com/alicebob/gopher-json v0.0.0-20180125190556-5a6b3ba71ee6/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc=
  12 +github.com/alicebob/miniredis v2.5.0+incompatible/go.mod h1:8HZjEj4yU0dwhYHky+DxYx+6BMjkBbe5ONFIF1MXffk=
  13 +github.com/beego/beego/v2 v2.0.1/go.mod h1:8zyHi1FnWO1mZLwTn62aKRIZF/aIKvkCBB2JYs+eqQI=
  14 +github.com/beego/goyaml2 v0.0.0-20130207012346-5545475820dd/go.mod h1:1b+Y/CofkYwXMUU0OhQqGvsY2Bvgr4j6jfT699wyZKQ=
  15 +github.com/beego/x2j v0.0.0-20131220205130-a0352aadc542/go.mod h1:kSeGC/p1AbBiEp5kat81+DSQrZenVBZXklMLaELspWU=
  16 +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
  17 +github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
  18 +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
  19 +github.com/bradfitz/gomemcache v0.0.0-20180710155616-bc664df96737/go.mod h1:PmM6Mmwb0LSuEubjR8N7PtNe1KxZLtOUHtbeikc5h60=
  20 +github.com/casbin/casbin v1.7.0/go.mod h1:c67qKN6Oum3UF5Q1+BByfFxkwKvhwW57ITjqwtzR1KE=
  21 +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
  22 +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
  23 +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
  24 +github.com/cloudflare/golz4 v0.0.0-20150217214814-ef862a3cdc58/go.mod h1:EOBUe0h4xcZ5GoxqC5SDxFQ8gwyZPKQoEzownBlhI80=
  25 +github.com/coreos/etcd v3.3.25+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
  26 +github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
  27 +github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
  28 +github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
  29 +github.com/couchbase/go-couchbase v0.0.0-20200519150804-63f3cdb75e0d/go.mod h1:TWI8EKQMs5u5jLKW/tsb9VwauIrMIxQG1r5fMsswK5U=
  30 +github.com/couchbase/gomemcached v0.0.0-20200526233749-ec430f949808/go.mod h1:srVSlQLB8iXBVXHgnqemxUXqN6FCvClgCMPCsjBDR7c=
  31 +github.com/couchbase/goutils v0.0.0-20180530154633-e865a1461c8a/go.mod h1:BQwMFlJzDjFDG3DJUdU0KORxn88UlsOULuxLExMh3Hs=
  32 +github.com/cupcake/rdb v0.0.0-20161107195141-43ba34106c76/go.mod h1:vYwsqCOLxGiisLwp9rITslkFNpZD5rz43tf41QFkTWY=
  33 +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
  34 +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
  35 +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
  36 +github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
  37 +github.com/eapache/go-resiliency v1.1.0 h1:1NtRmCAqadE2FN4ZcN6g90TP3uk8cg9rn9eNK2197aU=
  38 +github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs=
  39 +github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21 h1:YEetp8/yCZMuEPMUDHG0CW/brkkEp8mzqk2+ODEitlw=
  40 +github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU=
  41 +github.com/eapache/queue v1.1.0 h1:YOEu7KNc61ntiQlcEeUIoDTJ2o8mQznoNvUhiigpIqc=
  42 +github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I=
  43 +github.com/edsrzf/mmap-go v0.0.0-20170320065105-0bce6a688712/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M=
  44 +github.com/elastic/go-elasticsearch/v6 v6.8.5/go.mod h1:UwaDJsD3rWLM5rKNFzv9hgox93HoX8utj1kxD9aFUcI=
  45 +github.com/elazarl/go-bindata-assetfs v1.0.0/go.mod h1:v+YaWX3bdea5J/mo8dSETolEo7R71Vk1u8bnjau5yw4=
  46 +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
  47 +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
  48 +github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g=
  49 +github.com/frankban/quicktest v1.4.1/go.mod h1:36zfPVQyHxymz4cH7wlDmVwDrJuljRB60qkgn7rorfQ=
  50 +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
  51 +github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
  52 +github.com/glendc/gopher-json v0.0.0-20170414221815-dc4743023d0c/go.mod h1:Gja1A+xZ9BoviGJNA2E9vFkPjjsl+CoJxSXiQM1UXtw=
  53 +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
  54 +github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
  55 +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
  56 +github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
  57 +github.com/go-pg/pg/v10 v10.7.7/go.mod h1:d0w17Xw5x2DtbD/UgB9rnZg3FAck3eDHXff0Srrzuuk=
  58 +github.com/go-pg/zerochecker v0.2.0/go.mod h1:NJZ4wKL0NmTtz0GKCoJ8kym6Xn/EQzXRl2OnAe7MmDo=
  59 +github.com/go-redis/redis v6.14.2+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA=
  60 +github.com/go-redis/redis/v7 v7.4.0/go.mod h1:JDNMw23GTyLNC4GZu9njt15ctBQVn7xjRfnwdHj/Dcg=
  61 +github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
  62 +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
  63 +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
  64 +github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
  65 +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
  66 +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
  67 +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
  68 +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
  69 +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
  70 +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
  71 +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
  72 +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
  73 +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
  74 +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
  75 +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
  76 +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
  77 +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
  78 +github.com/golang/snappy v0.0.0-20170215233205-553a64147049/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
  79 +github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
  80 +github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4=
  81 +github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
  82 +github.com/gomodule/redigo v2.0.0+incompatible/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4=
  83 +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
  84 +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
  85 +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
  86 +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
  87 +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
  88 +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
  89 +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
  90 +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
  91 +github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
  92 +github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
  93 +github.com/hashicorp/go-uuid v1.0.1 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE=
  94 +github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
  95 +github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
  96 +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
  97 +github.com/jcmturner/gofork v0.0.0-20190328161633-dc7c13fece03 h1:FUwcHNlEqkqLjLBdCp5PRlCFijNjvcYANOZXzCfXwCM=
  98 +github.com/jcmturner/gofork v0.0.0-20190328161633-dc7c13fece03/go.mod h1:MK8+TM0La+2rjBD4jE12Kj1pCCxK7d2LK/UM3ncEo0o=
  99 +github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
  100 +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
  101 +github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
  102 +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
  103 +github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=
  104 +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
  105 +github.com/klauspost/compress v1.9.7 h1:hYW1gP94JUmAhBtJ+LNz5My+gBobDxPR1iVuKug26aA=
  106 +github.com/klauspost/compress v1.9.7/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A=
  107 +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
  108 +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
  109 +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
  110 +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
  111 +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
  112 +github.com/ledisdb/ledisdb v0.0.0-20200510135210-d35789ec47e6/go.mod h1:n931TsDuKuq+uX4v1fulaMbA/7ZLLhjc85h7chZGBCQ=
  113 +github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
  114 +github.com/linmadan/egglib-go v0.0.0-20210527091316-06b0732fb5f6 h1:nyhVnOIXsESuhZ95Ak6VRSF+0fHeKlYWq0EvHByt5RU=
  115 +github.com/linmadan/egglib-go v0.0.0-20210527091316-06b0732fb5f6/go.mod h1:ZZuSWicGxpgN0OulARhuKwFJuJ9we0otaPVAJtz10yk=
  116 +github.com/magefile/mage v1.10.0/go.mod h1:z5UZb/iS3GoOSn0JgWuiw7dxlurVYTu+/jHXqQg881A=
  117 +github.com/mattn/go-sqlite3 v2.0.3+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
  118 +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
  119 +github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
  120 +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
  121 +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
  122 +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
  123 +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
  124 +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
  125 +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
  126 +github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
  127 +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
  128 +github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
  129 +github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg=
  130 +github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk=
  131 +github.com/onsi/ginkgo v1.14.2/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY=
  132 +github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
  133 +github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
  134 +github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
  135 +github.com/onsi/gomega v1.10.3/go.mod h1:V9xEwhxec5O8UDM77eCW8vLymOMltsqPVYWrpDsH8xc=
  136 +github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc=
  137 +github.com/pelletier/go-toml v1.0.1/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
  138 +github.com/pelletier/go-toml v1.8.1/go.mod h1:T2/BmBdy8dvIRq1a/8aqjN41wvWlN4lrapLU/GW4pbc=
  139 +github.com/peterh/liner v1.0.1-0.20171122030339-3681c2a91233/go.mod h1:xIteQHvHuaLYG9IFj6mSxM0fCKrs34IrEQUhOYuGPHc=
  140 +github.com/pierrec/lz4 v2.2.6+incompatible h1:6aCX4/YZ9v8q69hTyiR7dNLnTA3fgtKHVVW5BCd5Znw=
  141 +github.com/pierrec/lz4 v2.2.6+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
  142 +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
  143 +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
  144 +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
  145 +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
  146 +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
  147 +github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
  148 +github.com/prometheus/client_golang v1.7.0/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M=
  149 +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
  150 +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
  151 +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
  152 +github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
  153 +github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
  154 +github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo=
  155 +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
  156 +github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
  157 +github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU=
  158 +github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a h1:9ZKAASQSHhDYGoxY8uLVpewe1GDZ2vu2Tr/vTdVAkFQ=
  159 +github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
  160 +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
  161 +github.com/shiena/ansicolor v0.0.0-20151119151921-a422bbe96644/go.mod h1:nkxAfR/5quYxwPZhyDxgasBMnRtBZd0FCEpawpjMUFg=
  162 +github.com/siddontang/go v0.0.0-20170517070808-cb568a3e5cc0/go.mod h1:3yhqj7WBBfRhbBlzyOC3gUxftwsU0u8gqevxwIHQpMw=
  163 +github.com/siddontang/goredis v0.0.0-20150324035039-760763f78400/go.mod h1:DDcKzU3qCuvj/tPnimWSsZZzvk9qvkvrIL5naVBPh5s=
  164 +github.com/siddontang/rdb v0.0.0-20150307021120-fc89ed2e418d/go.mod h1:AMEsy7v5z92TR1JKMkLLoaOQk++LVnOKL3ScbJ8GNGA=
  165 +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
  166 +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
  167 +github.com/sirupsen/logrus v1.8.0/go.mod h1:4GuYW9TZmE769R5STWrRakJc4UqQ3+QQ95fyz7ENv1A=
  168 +github.com/ssdb/gossdb v0.0.0-20180723034631-88f6b59b84ec/go.mod h1:QBvMkMya+gXctz3kmljlUCu/yB3GZ6oee+dUozsezQE=
  169 +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
  170 +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
  171 +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
  172 +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
  173 +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
  174 +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
  175 +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
  176 +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
  177 +github.com/syndtr/goleveldb v0.0.0-20160425020131-cfa635847112/go.mod h1:Z4AUp2Km+PwemOoO/VB5AOx9XSsIItzFjoJlOSiYmn0=
  178 +github.com/syndtr/goleveldb v0.0.0-20181127023241-353a9fca669c/go.mod h1:Z4AUp2Km+PwemOoO/VB5AOx9XSsIItzFjoJlOSiYmn0=
  179 +github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc/go.mod h1:bciPuU6GHm1iF1pBvUfxfsH0Wmnc2VbpgvbI9ZWuIRs=
  180 +github.com/ugorji/go v0.0.0-20171122102828-84cb69a8af83/go.mod h1:hnLbHMwcvSihnDhEfx2/BzKp2xb0Y+ErdfYcrs9tkJQ=
  181 +github.com/vmihailenco/bufpool v0.1.11/go.mod h1:AFf/MOy3l2CFTKbxwt0mp2MwnqjNEs5H/UxrkA5jxTQ=
  182 +github.com/vmihailenco/msgpack/v5 v5.2.0/go.mod h1:fEM7KuHcnm0GvDCztRpw9hV0PuoO2ciTismP6vjggcM=
  183 +github.com/vmihailenco/tagparser v0.1.2/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI=
  184 +github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds=
  185 +github.com/wendal/errors v0.0.0-20130201093226-f66c77a7882b/go.mod h1:Q12BUT7DqIlHRmgv3RskH+UCM/4eqVMgI0EMmlSpAXc=
  186 +github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I=
  187 +github.com/xdg/stringprep v1.0.0/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y=
  188 +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
  189 +github.com/yuin/gopher-lua v0.0.0-20171031051903-609c9cd26973/go.mod h1:aEV29XrmTYFr3CiRxZeGHpkvbwq+prZduBqMaascyCU=
  190 +go.etcd.io/etcd v3.3.25+incompatible/go.mod h1:yaeTdrJi5lOmYerz05bd8+V7KubZs8YSFZfzsF9A6aI=
  191 +go.opentelemetry.io/otel v0.17.0/go.mod h1:Oqtdxmf7UtEvL037ohlgnaYa1h7GtMh0NcSd9eqkC9s=
  192 +go.opentelemetry.io/otel/metric v0.17.0/go.mod h1:hUz9lH1rNXyEwWAhIWCMFWKhYtpASgSnObJFnU26dJ0=
  193 +go.opentelemetry.io/otel/oteltest v0.17.0/go.mod h1:JT/LGFxPwpN+nlsTiinSYjdIx3hZIGqHCpChcIZmdoE=
  194 +go.opentelemetry.io/otel/trace v0.17.0/go.mod h1:bIujpqg6ZL6xUTubIUgziI1jSaUPthmabA/ygf/6Cfg=
  195 +go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
  196 +go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU=
  197 +go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA=
  198 +go.uber.org/zap v1.15.0/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc=
  199 +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
  200 +golang.org/x/crypto v0.0.0-20180910181607-0e37d006457b/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
  201 +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
  202 +golang.org/x/crypto v0.0.0-20190404164418-38d8ce5564a5/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE=
  203 +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
  204 +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
  205 +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
  206 +golang.org/x/crypto v0.0.0-20210218145215-b8e89b74b9df h1:y7QZzfUiTwWam+xBn29Ulb8CBwVN5UdzmMDavl9Whlw=
  207 +golang.org/x/crypto v0.0.0-20210218145215-b8e89b74b9df/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
  208 +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
  209 +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
  210 +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
  211 +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
  212 +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
  213 +golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
  214 +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
  215 +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
  216 +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
  217 +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
  218 +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
  219 +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
  220 +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
  221 +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
  222 +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
  223 +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
  224 +golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
  225 +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
  226 +golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
  227 +golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
  228 +golang.org/x/net v0.0.0-20201006153459-a7d1128ccaa0/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
  229 +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
  230 +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b h1:uwuIcX0g4Yl1NC5XAz37xsr2lTtcqevgzYNVt49waME=
  231 +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
  232 +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
  233 +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
  234 +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
  235 +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
  236 +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
  237 +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
  238 +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
  239 +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
  240 +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
  241 +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
  242 +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
  243 +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
  244 +golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
  245 +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
  246 +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
  247 +golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
  248 +golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
  249 +golang.org/x/sys v0.0.0-20191010194322-b09406accb47/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
  250 +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
  251 +golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
  252 +golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
  253 +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
  254 +golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
  255 +golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
  256 +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
  257 +golang.org/x/sys v0.0.0-20210218155724-8ebf48af031b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
  258 +golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
  259 +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
  260 +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
  261 +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
  262 +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
  263 +golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
  264 +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
  265 +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
  266 +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
  267 +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
  268 +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
  269 +golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
  270 +golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
  271 +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
  272 +golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
  273 +golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
  274 +golang.org/x/tools v0.0.0-20201211185031-d93e913c1a58/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
  275 +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
  276 +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
  277 +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
  278 +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
  279 +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
  280 +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
  281 +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
  282 +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
  283 +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
  284 +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
  285 +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
  286 +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
  287 +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
  288 +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
  289 +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
  290 +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
  291 +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
  292 +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
  293 +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
  294 +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
  295 +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
  296 +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
  297 +gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
  298 +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
  299 +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
  300 +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
  301 +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
  302 +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
  303 +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
  304 +gopkg.in/jcmturner/aescts.v1 v1.0.1 h1:cVVZBK2b1zY26haWB4vbBiZrfFQnfbTVrE3xZq6hrEw=
  305 +gopkg.in/jcmturner/aescts.v1 v1.0.1/go.mod h1:nsR8qBOg+OucoIW+WMhB3GspUQXq9XorLnQb9XtvcOo=
  306 +gopkg.in/jcmturner/dnsutils.v1 v1.0.1 h1:cIuC1OLRGZrld+16ZJvvZxVJeKPsvd5eUIvxfoN5hSM=
  307 +gopkg.in/jcmturner/dnsutils.v1 v1.0.1/go.mod h1:m3v+5svpVOhtFAP/wSz+yzh4Mc0Fg7eRhxkJMWSIz9Q=
  308 +gopkg.in/jcmturner/goidentity.v3 v3.0.0/go.mod h1:oG2kH0IvSYNIu80dVAyu/yoefjq1mNfM5bm88whjWx4=
  309 +gopkg.in/jcmturner/gokrb5.v7 v7.2.3 h1:hHMV/yKPwMnJhPuPx7pH2Uw/3Qyf+thJYlisUc44010=
  310 +gopkg.in/jcmturner/gokrb5.v7 v7.2.3/go.mod h1:l8VISx+WGYp+Fp7KRbsiUuXTTOnxIc3Tuvyavf11/WM=
  311 +gopkg.in/jcmturner/rpc.v1 v1.1.0 h1:QHIUxTX1ISuAv9dD2wJ9HWQVuWDX/Zc0PfeC2tjc4rU=
  312 +gopkg.in/jcmturner/rpc.v1 v1.1.0/go.mod h1:YIdkC4XfD6GXbzje11McwsDuOlZQSb9W4vfLvuNnlv8=
  313 +gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA=
  314 +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
  315 +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
  316 +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
  317 +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
  318 +gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
  319 +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
  320 +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
  321 +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
  322 +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
  323 +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
  324 +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
  325 +honnef.co/go/tools v0.0.1-2020.1.5/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
  326 +mellium.im/sasl v0.2.1/go.mod h1:ROaEDLQNuf9vjKqE1SrAfnsobm2YKXT1gnN1uDp1PjQ=
@@ -2,12 +2,12 @@ package factory @@ -2,12 +2,12 @@ package factory
2 2
3 import ( 3 import (
4 "fmt" 4 "fmt"
  5 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/log"
5 6
6 "github.com/linmadan/egglib-go/core/application" 7 "github.com/linmadan/egglib-go/core/application"
7 - "github.com/linmadan/egglib-go/message/publisher/kafkaMessage/sarama"  
8 - localMessagePublisher "github.com/linmadan/egglib-go/message/publisher/localMessage"  
9 - localMessageReceiver "github.com/linmadan/egglib-go/message/receiver/localMessage"  
10 - . "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation" 8 + "github.com/linmadan/egglib-go/message/publisher/kafka_message/sarama"
  9 + localMessagePublisher "github.com/linmadan/egglib-go/message/publisher/local_message"
  10 + localMessageReceiver "github.com/linmadan/egglib-go/message/receiver/local_message"
11 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/constant" 11 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/constant"
12 ) 12 )
13 13
@@ -27,7 +27,7 @@ func CreateMessagePublisher(options map[string]interface{}) (application.Message @@ -27,7 +27,7 @@ func CreateMessagePublisher(options map[string]interface{}) (application.Message
27 } 27 }
28 return localMessagePublisher.NewLocalMessagePublisher(storeType, storeOptions) 28 return localMessagePublisher.NewLocalMessagePublisher(storeType, storeOptions)
29 } else { 29 } else {
30 - return sarama.NewKafkaSaramaMessagePublisher(constant.KAFKA_HOSTS, Logger) 30 + return sarama.NewKafkaSaramaMessagePublisher(constant.KAFKA_HOSTS, log.Logger)
31 } 31 }
32 } 32 }
33 33
1 package factory 1 package factory
  2 +
  3 +func CreateCooperationModeRepository(options map[string]interface{}) (domain.CooperationModeRepository, error) {
  4 + var transactionContext *pg.TransactionContext
  5 + if value, ok := options["transactionContext"]; ok {
  6 + transactionContext = value.(*pg.TransactionContext)
  7 + }
  8 + return repository.NewCooperationModeRepository(transactionContext)
  9 +}
  10 +
  11 +func CreateCooperationProjectRepository(options map[string]interface{}) (domain.CooperationProjectRepository, error) {
  12 + var transactionContext *pg.TransactionContext
  13 + if value, ok := options["transactionContext"]; ok {
  14 + transactionContext = value.(*pg.TransactionContext)
  15 + }
  16 + return repository.NewCooperationProjectRepository(transactionContext)
  17 +}
  18 +
  19 +func CreateCooperationContractRepository(options map[string]interface{}) (domain.CooperationContractRepository, error) {
  20 + var transactionContext *pg.TransactionContext
  21 + if value, ok := options["transactionContext"]; ok {
  22 + transactionContext = value.(*pg.TransactionContext)
  23 + }
  24 + return repository.NewCooperationContractRepository(transactionContext)
  25 +}
  26 +
  27 +func CreateCooperationApplicationRepository(options map[string]interface{}) (domain.CooperationApplicationRepository, error) {
  28 + var transactionContext *pg.TransactionContext
  29 + if value, ok := options["transactionContext"]; ok {
  30 + transactionContext = value.(*pg.TransactionContext)
  31 + }
  32 + return repository.NewCooperationApplicationRepository(transactionContext)
  33 +}
  34 +
  35 +func CreateContractUndertakerFeedbackRepository(options map[string]interface{}) (domain.ContractUndertakerFeedbackRepository, error) {
  36 + var transactionContext *pg.TransactionContext
  37 + if value, ok := options["transactionContext"]; ok {
  38 + transactionContext = value.(*pg.TransactionContext)
  39 + }
  40 + return repository.NewContractUndertakerFeedbackRepository(transactionContext)
  41 +}
@@ -3,6 +3,7 @@ package factory @@ -3,6 +3,7 @@ package factory
3 import ( 3 import (
4 "github.com/linmadan/egglib-go/core/application" 4 "github.com/linmadan/egglib-go/core/application"
5 pG "github.com/linmadan/egglib-go/transaction/pg" 5 pG "github.com/linmadan/egglib-go/transaction/pg"
  6 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/pg"
6 ) 7 )
7 8
8 func CreateTransactionContext(options map[string]interface{}) (application.TransactionContext, error) { 9 func CreateTransactionContext(options map[string]interface{}) (application.TransactionContext, error) {
  1 +package domain
  2 +
  3 +// 附件对象
  4 +type Attachment struct {
  5 + // 附件文件类型,jpg,pdf
  6 + FileType string `json:"fileType"`
  7 + // 附件名称
  8 + Name string `json:"name"`
  9 + // 附件地址
  10 + Url string `json:"url"`
  11 + // 附件文件大小
  12 + FileSize int64 `json:"fileSize,string"`
  13 +}
  1 +package domain
  2 +
  3 +// 公司值对象
  4 +type Company struct {
  5 + // 公司ID,通过集成REST上下文获取
  6 + CompanyId int64 `json:"companyId,string"`
  7 + // 公司logo
  8 + CompanyLogo string `json:"companyLogo"`
  9 + // 公司名称
  10 + CompanyName string `json:"companyName"`
  11 +}
  1 +package domain
  2 +
  3 +import "time"
  4 +
  5 +// 承接人反馈信息
  6 +type ContractUndertakerFeedback struct {
  7 + // 合约承接方反馈记录ID
  8 + FeedbackId int64 `json:"feedbackId,string"`
  9 + // 合约承接方反馈内容附件
  10 + FeedbackAttachment []*Attachment `json:"feedbackAttachment"`
  11 + // 合约承接方反馈内容
  12 + FeedbackContent string `json:"feedbackContent"`
  13 + // 共创合约编号
  14 + CooperationContractNumber string `json:"cooperationContractNumber"`
  15 + // 共创合约承接人
  16 + ContractUndertaker *User `json:"contractUndertaker"`
  17 + // 共创模式
  18 + CooperationMode *CooperationMode `json:"cooperationMode"`
  19 + // 数据所属组织机构
  20 + Org *Org `json:"org"`
  21 + // 公司
  22 + Company *Company `json:"company"`
  23 + // 更新时间
  24 + UpdatedAt time.Time `json:"updatedAt"`
  25 + // 删除时间
  26 + DeletedAt time.Time `json:"deletedAt"`
  27 + // 反馈创建时间,同时也作为反馈时间
  28 + CreatedAt time.Time `json:"createdAt"`
  29 +}
  30 +
  31 +type ContractUndertakerFeedbackRepository interface {
  32 + Save(contractUndertakerFeedback *ContractUndertakerFeedback) (*ContractUndertakerFeedback, error)
  33 + Remove(contractUndertakerFeedback *ContractUndertakerFeedback) (*ContractUndertakerFeedback, error)
  34 + FindOne(queryOptions map[string]interface{}) (*ContractUndertakerFeedback, error)
  35 + Find(queryOptions map[string]interface{}) (int64, []*ContractUndertakerFeedback, error)
  36 +}
  37 +
  38 +func (contractUndertakerFeedback *ContractUndertakerFeedback) Identify() interface{} {
  39 + if contractUndertakerFeedback.FeedbackId == 0 {
  40 + return nil
  41 + }
  42 + return contractUndertakerFeedback.FeedbackId
  43 +}
  44 +
  45 +func (contractUndertakerFeedback *ContractUndertakerFeedback) Update(data map[string]interface{}) error {
  46 + if feedbackAttachment, ok := data["feedbackAttachment"]; ok {
  47 + contractUndertakerFeedback.FeedbackAttachment = feedbackAttachment.([]*Attachment)
  48 + }
  49 + if feedbackContent, ok := data["feedbackContent"]; ok {
  50 + contractUndertakerFeedback.FeedbackContent = feedbackContent.(string)
  51 + }
  52 + if cooperationContractNumber, ok := data["cooperationContractNumber"]; ok {
  53 + contractUndertakerFeedback.CooperationContractNumber = cooperationContractNumber.(string)
  54 + }
  55 + if userId, ok := data["userId"]; ok {
  56 + contractUndertakerFeedback.ContractUndertaker.UserId = userId.(int64)
  57 + }
  58 + if userBaseId, ok := data["userBaseId"]; ok {
  59 + contractUndertakerFeedback.ContractUndertaker.UserBaseId = userBaseId.(int64)
  60 + }
  61 + if orgId, ok := data["orgId"]; ok {
  62 + contractUndertakerFeedback.ContractUndertaker.Org.OrgId = orgId.(int64)
  63 + }
  64 + if orgName, ok := data["orgName"]; ok {
  65 + contractUndertakerFeedback.ContractUndertaker.Org.OrgName = orgName.(string)
  66 + }
  67 + if companyId, ok := data["companyId"]; ok {
  68 + contractUndertakerFeedback.ContractUndertaker.Org.Company.CompanyId = companyId.(int64)
  69 + }
  70 + if companyLogo, ok := data["companyLogo"]; ok {
  71 + contractUndertakerFeedback.ContractUndertaker.Org.Company.CompanyLogo = companyLogo.(string)
  72 + }
  73 + if companyName, ok := data["companyName"]; ok {
  74 + contractUndertakerFeedback.ContractUndertaker.Org.Company.CompanyName = companyName.(string)
  75 + }
  76 + if orgs, ok := data["orgs"]; ok {
  77 + contractUndertakerFeedback.ContractUndertaker.Orgs = orgs.([]*Org)
  78 + }
  79 + if departmentId, ok := data["departmentId"]; ok {
  80 + contractUndertakerFeedback.ContractUndertaker.Department.DepartmentId = departmentId.(int64)
  81 + }
  82 + if departmentName, ok := data["departmentName"]; ok {
  83 + contractUndertakerFeedback.ContractUndertaker.Department.DepartmentName = departmentName.(string)
  84 + }
  85 + if departmentNumber, ok := data["departmentNumber"]; ok {
  86 + contractUndertakerFeedback.ContractUndertaker.Department.DepartmentNumber = departmentNumber.(string)
  87 + }
  88 + if isOrganization, ok := data["isOrganization"]; ok {
  89 + contractUndertakerFeedback.ContractUndertaker.Department.IsOrganization = isOrganization.(bool)
  90 + }
  91 + if roleId, ok := data["roleId"]; ok {
  92 + contractUndertakerFeedback.ContractUndertaker.Role.RoleId = roleId.(int64)
  93 + }
  94 + if roleName, ok := data["roleName"]; ok {
  95 + contractUndertakerFeedback.ContractUndertaker.Role.RoleName = roleName.(string)
  96 + }
  97 + if userAvatar, ok := data["userAvatar"]; ok {
  98 + contractUndertakerFeedback.ContractUndertaker.UserInfo.UserAvatar = userAvatar.(string)
  99 + }
  100 + if userEmail, ok := data["userEmail"]; ok {
  101 + contractUndertakerFeedback.ContractUndertaker.UserInfo.UserEmail = userEmail.(string)
  102 + }
  103 + if userName, ok := data["userName"]; ok {
  104 + contractUndertakerFeedback.ContractUndertaker.UserInfo.UserName = userName.(string)
  105 + }
  106 + if userPhone, ok := data["userPhone"]; ok {
  107 + contractUndertakerFeedback.ContractUndertaker.UserInfo.UserPhone = userPhone.(string)
  108 + }
  109 + if userAccount, ok := data["userAccount"]; ok {
  110 + contractUndertakerFeedback.ContractUndertaker.UserInfo.UserAccount = userAccount.(string)
  111 + }
  112 + if userType, ok := data["userType"]; ok {
  113 + contractUndertakerFeedback.ContractUndertaker.UserType = userType.(int32)
  114 + }
  115 + if status, ok := data["status"]; ok {
  116 + contractUndertakerFeedback.ContractUndertaker.Status = status.(int32)
  117 + }
  118 + if cooperationModeId, ok := data["cooperationModeId"]; ok {
  119 + contractUndertakerFeedback.CooperationMode.CooperationModeId = cooperationModeId.(int64)
  120 + }
  121 + if cooperationModeNumber, ok := data["cooperationModeNumber"]; ok {
  122 + contractUndertakerFeedback.CooperationMode.CooperationModeNumber = cooperationModeNumber.(string)
  123 + }
  124 + if cooperationModeName, ok := data["cooperationModeName"]; ok {
  125 + contractUndertakerFeedback.CooperationMode.CooperationModeName = cooperationModeName.(string)
  126 + }
  127 + if status, ok := data["status"]; ok {
  128 + contractUndertakerFeedback.CooperationMode.Status = status.(int32)
  129 + }
  130 + if remarks, ok := data["remarks"]; ok {
  131 + contractUndertakerFeedback.CooperationMode.Remarks = remarks.(string)
  132 + }
  133 + if operateTime, ok := data["operateTime"]; ok {
  134 + contractUndertakerFeedback.CooperationMode.OperateTime = operateTime.(time.Time)
  135 + }
  136 + if updatedAt, ok := data["updatedAt"]; ok {
  137 + contractUndertakerFeedback.CooperationMode.UpdatedAt = updatedAt.(time.Time)
  138 + }
  139 + if deletedAt, ok := data["deletedAt"]; ok {
  140 + contractUndertakerFeedback.CooperationMode.DeletedAt = deletedAt.(time.Time)
  141 + }
  142 + if createdAt, ok := data["createdAt"]; ok {
  143 + contractUndertakerFeedback.CooperationMode.CreatedAt = createdAt.(time.Time)
  144 + }
  145 + return nil
  146 +}
  1 +package domain
  2 +
  3 +import "time"
  4 +
  5 +// 共创申请实体
  6 +type CooperationApplication struct {
  7 + // 共创申请ID
  8 + CooperationApplicationId int64 `json:"cooperationApplicationId,string"`
  9 + // 共创申请人
  10 + CooperationApplicationApplicant *User `json:"cooperationApplicationApplicant"`
  11 + // 共创申请描述附件
  12 + CooperationApplicationAttachment []*Attachment `json:"cooperationApplicationAttachment"`
  13 + // 共创申请描述
  14 + CooperationApplicationDescription string `json:"cooperationApplicationDescription"`
  15 + // 共创申请审核状态,1待审核,2已同意,3已拒绝
  16 + CooperationApplicationStatus int32 `json:"cooperationApplicationStatus"`
  17 + // 共创申请审核人
  18 + CooperationApplicationVerifier *User `json:"cooperationApplicationVerifier"`
  19 + // 共创申请审核描述
  20 + CooperationApplicationVerifyDescription string `json:"cooperationApplicationVerifyDescription"`
  21 + // 共创申请审核时间
  22 + CooperationApplicationVerifyTime time.Time `json:"cooperationApplicationVerifyTime"`
  23 + // 共创申请时间
  24 + CooperationApplyTime time.Time `json:"cooperationApplyTime"`
  25 + // 共创项目编号
  26 + CooperationProject *CooperationProject `json:"cooperationProject"`
  27 + // 数据所属组织机构
  28 + Org *Org `json:"org"`
  29 + // 公司
  30 + Company *Company `json:"company"`
  31 + // 创建时间
  32 + CreatedAt time.Time `json:"createdAt"`
  33 + // 删除时间
  34 + DeletedAt time.Time `json:"deletedAt"`
  35 + // 更新时间
  36 + UpdatedAt time.Time `json:"updatedAt"`
  37 +}
  38 +
  39 +type CooperationApplicationRepository interface {
  40 + Save(cooperationApplication *CooperationApplication) (*CooperationApplication, error)
  41 + Remove(cooperationApplication *CooperationApplication) (*CooperationApplication, error)
  42 + FindOne(queryOptions map[string]interface{}) (*CooperationApplication, error)
  43 + Find(queryOptions map[string]interface{}) (int64, []*CooperationApplication, error)
  44 +}
  45 +
  46 +func (cooperationApplication *CooperationApplication) Identify() interface{} {
  47 + if cooperationApplication.CooperationApplicationId == 0 {
  48 + return nil
  49 + }
  50 + return cooperationApplication.CooperationApplicationId
  51 +}
  52 +
  53 +func (cooperationApplication *CooperationApplication) Update(data map[string]interface{}) error {
  54 + if userId, ok := data["userId"]; ok {
  55 + cooperationApplication.CooperationApplicationApplicant.UserId = userId.(int64)
  56 + }
  57 + if userBaseId, ok := data["userBaseId"]; ok {
  58 + cooperationApplication.CooperationApplicationApplicant.UserBaseId = userBaseId.(int64)
  59 + }
  60 + if orgId, ok := data["orgId"]; ok {
  61 + cooperationApplication.CooperationApplicationApplicant.Org.OrgId = orgId.(int64)
  62 + }
  63 + if orgName, ok := data["orgName"]; ok {
  64 + cooperationApplication.CooperationApplicationApplicant.Org.OrgName = orgName.(string)
  65 + }
  66 + if companyId, ok := data["companyId"]; ok {
  67 + cooperationApplication.CooperationApplicationApplicant.Org.Company.CompanyId = companyId.(int64)
  68 + }
  69 + if companyLogo, ok := data["companyLogo"]; ok {
  70 + cooperationApplication.CooperationApplicationApplicant.Org.Company.CompanyLogo = companyLogo.(string)
  71 + }
  72 + if companyName, ok := data["companyName"]; ok {
  73 + cooperationApplication.CooperationApplicationApplicant.Org.Company.CompanyName = companyName.(string)
  74 + }
  75 + if orgs, ok := data["orgs"]; ok {
  76 + cooperationApplication.CooperationApplicationApplicant.Orgs = orgs.([]*Org)
  77 + }
  78 + if departmentId, ok := data["departmentId"]; ok {
  79 + cooperationApplication.CooperationApplicationApplicant.Department.DepartmentId = departmentId.(int64)
  80 + }
  81 + if departmentName, ok := data["departmentName"]; ok {
  82 + cooperationApplication.CooperationApplicationApplicant.Department.DepartmentName = departmentName.(string)
  83 + }
  84 + if departmentNumber, ok := data["departmentNumber"]; ok {
  85 + cooperationApplication.CooperationApplicationApplicant.Department.DepartmentNumber = departmentNumber.(string)
  86 + }
  87 + if isOrganization, ok := data["isOrganization"]; ok {
  88 + cooperationApplication.CooperationApplicationApplicant.Department.IsOrganization = isOrganization.(bool)
  89 + }
  90 + if roleId, ok := data["roleId"]; ok {
  91 + cooperationApplication.CooperationApplicationApplicant.Role.RoleId = roleId.(int64)
  92 + }
  93 + if roleName, ok := data["roleName"]; ok {
  94 + cooperationApplication.CooperationApplicationApplicant.Role.RoleName = roleName.(string)
  95 + }
  96 + if userAvatar, ok := data["userAvatar"]; ok {
  97 + cooperationApplication.CooperationApplicationApplicant.UserInfo.UserAvatar = userAvatar.(string)
  98 + }
  99 + if userEmail, ok := data["userEmail"]; ok {
  100 + cooperationApplication.CooperationApplicationApplicant.UserInfo.UserEmail = userEmail.(string)
  101 + }
  102 + if userName, ok := data["userName"]; ok {
  103 + cooperationApplication.CooperationApplicationApplicant.UserInfo.UserName = userName.(string)
  104 + }
  105 + if userPhone, ok := data["userPhone"]; ok {
  106 + cooperationApplication.CooperationApplicationApplicant.UserInfo.UserPhone = userPhone.(string)
  107 + }
  108 + if userAccount, ok := data["userAccount"]; ok {
  109 + cooperationApplication.CooperationApplicationApplicant.UserInfo.UserAccount = userAccount.(string)
  110 + }
  111 + if userType, ok := data["userType"]; ok {
  112 + cooperationApplication.CooperationApplicationApplicant.UserType = userType.(int32)
  113 + }
  114 + if status, ok := data["status"]; ok {
  115 + cooperationApplication.CooperationApplicationApplicant.Status = status.(int32)
  116 + }
  117 + if cooperationApplicationAttachment, ok := data["cooperationApplicationAttachment"]; ok {
  118 + cooperationApplication.CooperationApplicationAttachment = cooperationApplicationAttachment.([]*Attachment)
  119 + }
  120 + if cooperationApplicationDescription, ok := data["cooperationApplicationDescription"]; ok {
  121 + cooperationApplication.CooperationApplicationDescription = cooperationApplicationDescription.(string)
  122 + }
  123 + if cooperationApplicationStatus, ok := data["cooperationApplicationStatus"]; ok {
  124 + cooperationApplication.CooperationApplicationStatus = cooperationApplicationStatus.(int32)
  125 + }
  126 + if cooperationApplicationVerifyDescription, ok := data["cooperationApplicationVerifyDescription"]; ok {
  127 + cooperationApplication.CooperationApplicationVerifyDescription = cooperationApplicationVerifyDescription.(string)
  128 + }
  129 + if cooperationApplicationVerifyTime, ok := data["cooperationApplicationVerifyTime"]; ok {
  130 + cooperationApplication.CooperationApplicationVerifyTime = cooperationApplicationVerifyTime.(time.Time)
  131 + }
  132 + if cooperationApplyTime, ok := data["cooperationApplyTime"]; ok {
  133 + cooperationApplication.CooperationApplyTime = cooperationApplyTime.(time.Time)
  134 + }
  135 + if cooperationProjectId, ok := data["cooperationProjectId"]; ok {
  136 + cooperationApplication.CooperationProject.CooperationProjectId = cooperationProjectId.(int64)
  137 + }
  138 + if cooperationProjectNumber, ok := data["cooperationProjectNumber"]; ok {
  139 + cooperationApplication.CooperationProject.CooperationProjectNumber = cooperationProjectNumber.(string)
  140 + }
  141 + if cooperationProjectDescription, ok := data["cooperationProjectDescription"]; ok {
  142 + cooperationApplication.CooperationProject.CooperationProjectDescription = cooperationProjectDescription.(string)
  143 + }
  144 + if cooperationProjectName, ok := data["cooperationProjectName"]; ok {
  145 + cooperationApplication.CooperationProject.CooperationProjectName = cooperationProjectName.(string)
  146 + }
  147 + if cooperationProjectPublishTime, ok := data["cooperationProjectPublishTime"]; ok {
  148 + cooperationApplication.CooperationProject.CooperationProjectPublishTime = cooperationProjectPublishTime.(time.Time)
  149 + }
  150 + if operateTime, ok := data["operateTime"]; ok {
  151 + cooperationApplication.CooperationProject.OperateTime = operateTime.(time.Time)
  152 + }
  153 + if status, ok := data["status"]; ok {
  154 + cooperationApplication.CooperationProject.Status = status.(int32)
  155 + }
  156 + return nil
  157 +}
  1 +package domain
  2 +
  3 +import "time"
  4 +
  5 +// 共创项目合约实体
  6 +type CooperationContract struct {
  7 + // 共创合约ID
  8 + CooperationContractId int64 `json:"cooperationContractId,string"`
  9 + // 共创合约描述
  10 + CooperationContractDescription string `json:"cooperationContractDescription"`
  11 + // 共创合约名称
  12 + CooperationContractName string `json:"cooperationContractName"`
  13 + // 共创合约编号
  14 + CooperationContractNumber string `json:"cooperationContractNumber"`
  15 + // 合约推荐人
  16 + CooperationContractReferrer *User `json:"cooperationContractReferrer"`
  17 + // 共创合约业务员
  18 + CooperationContractSalesman *User `json:"cooperationContractSalesman"`
  19 + // 共创合约承接对象,1员工,2共创用户,3公开
  20 + CooperationContractUndertakerType []int32 `json:"cooperationContractUndertakerType"`
  21 + // 共创合约发起人
  22 + CooperationContractSponsor *User `json:"cooperationContractSponsor"`
  23 + // 共创模式或者合伙模式
  24 + CooperationMode *CooperationMode `json:"cooperationMode"`
  25 + // 合约状态,1启用,2禁用
  26 + Status int32 `json:"status"`
  27 + // 数据所属组织机构
  28 + Org *Org `json:"org"`
  29 + // 公司
  30 + Company *Company `json:"company"`
  31 + // 操作人
  32 + Operator *User `json:"operator"`
  33 + // 操作时间
  34 + OperateTime time.Time `json:"operateTime"`
  35 + // 创建时间
  36 + CreatedAt time.Time `json:"createdAt"`
  37 + // 删除时间
  38 + DeletedAt time.Time `json:"deletedAt"`
  39 + // 更新时间
  40 + UpdatedAt time.Time `json:"updatedAt"`
  41 +}
  42 +
  43 +type CooperationContractRepository interface {
  44 + Save(cooperationContract *CooperationContract) (*CooperationContract, error)
  45 + Remove(cooperationContract *CooperationContract) (*CooperationContract, error)
  46 + FindOne(queryOptions map[string]interface{}) (*CooperationContract, error)
  47 + Find(queryOptions map[string]interface{}) (int64, []*CooperationContract, error)
  48 +}
  49 +
  50 +func (cooperationContract *CooperationContract) Identify() interface{} {
  51 + if cooperationContract.CooperationContractId == 0 {
  52 + return nil
  53 + }
  54 + return cooperationContract.CooperationContractId
  55 +}
  56 +
  57 +func (cooperationContract *CooperationContract) Update(data map[string]interface{}) error {
  58 + if cooperationContractId, ok := data["cooperationContractId"]; ok {
  59 + cooperationContract.CooperationContractId = cooperationContractId.(int64)
  60 + }
  61 + if cooperationContractDescription, ok := data["cooperationContractDescription"]; ok {
  62 + cooperationContract.CooperationContractDescription = cooperationContractDescription.(string)
  63 + }
  64 + if cooperationContractName, ok := data["cooperationContractName"]; ok {
  65 + cooperationContract.CooperationContractName = cooperationContractName.(string)
  66 + }
  67 + if cooperationContractNumber, ok := data["cooperationContractNumber"]; ok {
  68 + cooperationContract.CooperationContractNumber = cooperationContractNumber.(string)
  69 + }
  70 + if userId, ok := data["userId"]; ok {
  71 + cooperationContract.CooperationContractReferrer.UserId = userId.(int64)
  72 + }
  73 + if userBaseId, ok := data["userBaseId"]; ok {
  74 + cooperationContract.CooperationContractReferrer.UserBaseId = userBaseId.(int64)
  75 + }
  76 + if orgId, ok := data["orgId"]; ok {
  77 + cooperationContract.CooperationContractReferrer.Org.OrgId = orgId.(int64)
  78 + }
  79 + if orgName, ok := data["orgName"]; ok {
  80 + cooperationContract.CooperationContractReferrer.Org.OrgName = orgName.(string)
  81 + }
  82 + if companyId, ok := data["companyId"]; ok {
  83 + cooperationContract.CooperationContractReferrer.Org.Company.CompanyId = companyId.(int64)
  84 + }
  85 + if companyLogo, ok := data["companyLogo"]; ok {
  86 + cooperationContract.CooperationContractReferrer.Org.Company.CompanyLogo = companyLogo.(string)
  87 + }
  88 + if companyName, ok := data["companyName"]; ok {
  89 + cooperationContract.CooperationContractReferrer.Org.Company.CompanyName = companyName.(string)
  90 + }
  91 + if orgs, ok := data["orgs"]; ok {
  92 + cooperationContract.CooperationContractReferrer.Orgs = orgs.([]*Org)
  93 + }
  94 + if departmentId, ok := data["departmentId"]; ok {
  95 + cooperationContract.CooperationContractReferrer.Department.DepartmentId = departmentId.(int64)
  96 + }
  97 + if departmentName, ok := data["departmentName"]; ok {
  98 + cooperationContract.CooperationContractReferrer.Department.DepartmentName = departmentName.(string)
  99 + }
  100 + if departmentNumber, ok := data["departmentNumber"]; ok {
  101 + cooperationContract.CooperationContractReferrer.Department.DepartmentNumber = departmentNumber.(string)
  102 + }
  103 + if isOrganization, ok := data["isOrganization"]; ok {
  104 + cooperationContract.CooperationContractReferrer.Department.IsOrganization = isOrganization.(bool)
  105 + }
  106 + if roleId, ok := data["roleId"]; ok {
  107 + cooperationContract.CooperationContractReferrer.Role.RoleId = roleId.(int64)
  108 + }
  109 + if roleName, ok := data["roleName"]; ok {
  110 + cooperationContract.CooperationContractReferrer.Role.RoleName = roleName.(string)
  111 + }
  112 + if userAvatar, ok := data["userAvatar"]; ok {
  113 + cooperationContract.CooperationContractReferrer.UserInfo.UserAvatar = userAvatar.(string)
  114 + }
  115 + if userEmail, ok := data["userEmail"]; ok {
  116 + cooperationContract.CooperationContractReferrer.UserInfo.UserEmail = userEmail.(string)
  117 + }
  118 + if userName, ok := data["userName"]; ok {
  119 + cooperationContract.CooperationContractReferrer.UserInfo.UserName = userName.(string)
  120 + }
  121 + if userPhone, ok := data["userPhone"]; ok {
  122 + cooperationContract.CooperationContractReferrer.UserInfo.UserPhone = userPhone.(string)
  123 + }
  124 + if userAccount, ok := data["userAccount"]; ok {
  125 + cooperationContract.CooperationContractReferrer.UserInfo.UserAccount = userAccount.(string)
  126 + }
  127 + if userType, ok := data["userType"]; ok {
  128 + cooperationContract.CooperationContractReferrer.UserType = userType.(int32)
  129 + }
  130 + if status, ok := data["status"]; ok {
  131 + cooperationContract.CooperationContractReferrer.Status = status.(int32)
  132 + }
  133 + if cooperationContractUndertakerType, ok := data["cooperationContractUndertakerType"]; ok {
  134 + cooperationContract.CooperationContractUndertakerType = cooperationContractUndertakerType.([]int32)
  135 + }
  136 + if cooperationModeId, ok := data["cooperationModeId"]; ok {
  137 + cooperationContract.CooperationMode.CooperationModeId = cooperationModeId.(int64)
  138 + }
  139 + if cooperationModeNumber, ok := data["cooperationModeNumber"]; ok {
  140 + cooperationContract.CooperationMode.CooperationModeNumber = cooperationModeNumber.(string)
  141 + }
  142 + if cooperationModeName, ok := data["cooperationModeName"]; ok {
  143 + cooperationContract.CooperationMode.CooperationModeName = cooperationModeName.(string)
  144 + }
  145 + if status, ok := data["status"]; ok {
  146 + cooperationContract.CooperationMode.Status = status.(int32)
  147 + }
  148 + if remarks, ok := data["remarks"]; ok {
  149 + cooperationContract.CooperationMode.Remarks = remarks.(string)
  150 + }
  151 + if operateTime, ok := data["operateTime"]; ok {
  152 + cooperationContract.CooperationMode.OperateTime = operateTime.(time.Time)
  153 + }
  154 + if updatedAt, ok := data["updatedAt"]; ok {
  155 + cooperationContract.CooperationMode.UpdatedAt = updatedAt.(time.Time)
  156 + }
  157 + if deletedAt, ok := data["deletedAt"]; ok {
  158 + cooperationContract.CooperationMode.DeletedAt = deletedAt.(time.Time)
  159 + }
  160 + if createdAt, ok := data["createdAt"]; ok {
  161 + cooperationContract.CooperationMode.CreatedAt = createdAt.(time.Time)
  162 + }
  163 + if status, ok := data["status"]; ok {
  164 + cooperationContract.Status = status.(int32)
  165 + }
  166 + if operateTime, ok := data["operateTime"]; ok {
  167 + cooperationContract.OperateTime = operateTime.(time.Time)
  168 + }
  169 + if createdAt, ok := data["createdAt"]; ok {
  170 + cooperationContract.CreatedAt = createdAt.(time.Time)
  171 + }
  172 + if deletedAt, ok := data["deletedAt"]; ok {
  173 + cooperationContract.DeletedAt = deletedAt.(time.Time)
  174 + }
  175 + if updatedAt, ok := data["updatedAt"]; ok {
  176 + cooperationContract.UpdatedAt = updatedAt.(time.Time)
  177 + }
  178 + return nil
  179 +}
  1 +package domain
  2 +
  3 +import "time"
  4 +
  5 +// 共创模式实体
  6 +type CooperationMode struct {
  7 + // 共创模式ID
  8 + CooperationModeId int64 `json:"cooperationModeId,string"`
  9 + // 共创模式编码,唯一确定
  10 + CooperationModeNumber string `json:"cooperationModeNumber"`
  11 + // 模式名称,唯一确定
  12 + CooperationModeName string `json:"cooperationModeName"`
  13 + // 共创模式状态,1启用,2禁用
  14 + Status int32 `json:"status"`
  15 + // 数据所属组织机构
  16 + Org *Org `json:"org"`
  17 + // 公司
  18 + Company *Company `json:"company"`
  19 + // 备注
  20 + Remarks string `json:"remarks"`
  21 + // 操作人
  22 + Operator *User `json:"operator"`
  23 + // 操作时间
  24 + OperateTime time.Time `json:"operateTime"`
  25 + // 更新时间
  26 + UpdatedAt time.Time `json:"updatedAt"`
  27 + // 删除时间
  28 + DeletedAt time.Time `json:"deletedAt"`
  29 + // 创建时间
  30 + CreatedAt time.Time `json:"createdAt"`
  31 +}
  32 +
  33 +type CooperationModeRepository interface {
  34 + Save(cooperationMode *CooperationMode) (*CooperationMode, error)
  35 + Remove(cooperationMode *CooperationMode) (*CooperationMode, error)
  36 + FindOne(queryOptions map[string]interface{}) (*CooperationMode, error)
  37 + Find(queryOptions map[string]interface{}) (int64, []*CooperationMode, error)
  38 +}
  39 +
  40 +func (cooperationMode *CooperationMode) Identify() interface{} {
  41 + if cooperationMode.CooperationModeId == 0 {
  42 + return nil
  43 + }
  44 + return cooperationMode.CooperationModeId
  45 +}
  46 +
  47 +func (cooperationMode *CooperationMode) Update(data map[string]interface{}) error {
  48 + if cooperationModeId, ok := data["cooperationModeId"]; ok {
  49 + cooperationMode.CooperationModeId = cooperationModeId.(int64)
  50 + }
  51 + if cooperationModeNumber, ok := data["cooperationModeNumber"]; ok {
  52 + cooperationMode.CooperationModeNumber = cooperationModeNumber.(string)
  53 + }
  54 + if cooperationModeName, ok := data["cooperationModeName"]; ok {
  55 + cooperationMode.CooperationModeName = cooperationModeName.(string)
  56 + }
  57 + if status, ok := data["status"]; ok {
  58 + cooperationMode.Status = status.(int32)
  59 + }
  60 + if orgId, ok := data["orgId"]; ok {
  61 + cooperationMode.Org.OrgId = orgId.(int64)
  62 + }
  63 + if orgName, ok := data["orgName"]; ok {
  64 + cooperationMode.Org.OrgName = orgName.(string)
  65 + }
  66 + if companyId, ok := data["companyId"]; ok {
  67 + cooperationMode.Org.Company.CompanyId = companyId.(int64)
  68 + }
  69 + if companyLogo, ok := data["companyLogo"]; ok {
  70 + cooperationMode.Org.Company.CompanyLogo = companyLogo.(string)
  71 + }
  72 + if companyName, ok := data["companyName"]; ok {
  73 + cooperationMode.Org.Company.CompanyName = companyName.(string)
  74 + }
  75 + if companyId, ok := data["companyId"]; ok {
  76 + cooperationMode.Company.CompanyId = companyId.(int64)
  77 + }
  78 + if companyLogo, ok := data["companyLogo"]; ok {
  79 + cooperationMode.Company.CompanyLogo = companyLogo.(string)
  80 + }
  81 + if companyName, ok := data["companyName"]; ok {
  82 + cooperationMode.Company.CompanyName = companyName.(string)
  83 + }
  84 + if remarks, ok := data["remarks"]; ok {
  85 + cooperationMode.Remarks = remarks.(string)
  86 + }
  87 + if userId, ok := data["userId"]; ok {
  88 + cooperationMode.Operator.UserId = userId.(int64)
  89 + }
  90 + if userBaseId, ok := data["userBaseId"]; ok {
  91 + cooperationMode.Operator.UserBaseId = userBaseId.(int64)
  92 + }
  93 + if orgId, ok := data["orgId"]; ok {
  94 + cooperationMode.Operator.Org.OrgId = orgId.(int64)
  95 + }
  96 + if orgName, ok := data["orgName"]; ok {
  97 + cooperationMode.Operator.Org.OrgName = orgName.(string)
  98 + }
  99 + if companyId, ok := data["companyId"]; ok {
  100 + cooperationMode.Operator.Org.Company.CompanyId = companyId.(int64)
  101 + }
  102 + if companyLogo, ok := data["companyLogo"]; ok {
  103 + cooperationMode.Operator.Org.Company.CompanyLogo = companyLogo.(string)
  104 + }
  105 + if companyName, ok := data["companyName"]; ok {
  106 + cooperationMode.Operator.Org.Company.CompanyName = companyName.(string)
  107 + }
  108 + if orgs, ok := data["orgs"]; ok {
  109 + cooperationMode.Operator.Orgs = orgs.([]*Org)
  110 + }
  111 + if departmentId, ok := data["departmentId"]; ok {
  112 + cooperationMode.Operator.Department.DepartmentId = departmentId.(int64)
  113 + }
  114 + if departmentName, ok := data["departmentName"]; ok {
  115 + cooperationMode.Operator.Department.DepartmentName = departmentName.(string)
  116 + }
  117 + if departmentNumber, ok := data["departmentNumber"]; ok {
  118 + cooperationMode.Operator.Department.DepartmentNumber = departmentNumber.(string)
  119 + }
  120 + if isOrganization, ok := data["isOrganization"]; ok {
  121 + cooperationMode.Operator.Department.IsOrganization = isOrganization.(bool)
  122 + }
  123 + if roleId, ok := data["roleId"]; ok {
  124 + cooperationMode.Operator.Role.RoleId = roleId.(int64)
  125 + }
  126 + if roleName, ok := data["roleName"]; ok {
  127 + cooperationMode.Operator.Role.RoleName = roleName.(string)
  128 + }
  129 + if userAvatar, ok := data["userAvatar"]; ok {
  130 + cooperationMode.Operator.UserInfo.UserAvatar = userAvatar.(string)
  131 + }
  132 + if userEmail, ok := data["userEmail"]; ok {
  133 + cooperationMode.Operator.UserInfo.UserEmail = userEmail.(string)
  134 + }
  135 + if userName, ok := data["userName"]; ok {
  136 + cooperationMode.Operator.UserInfo.UserName = userName.(string)
  137 + }
  138 + if userPhone, ok := data["userPhone"]; ok {
  139 + cooperationMode.Operator.UserInfo.UserPhone = userPhone.(string)
  140 + }
  141 + if userAccount, ok := data["userAccount"]; ok {
  142 + cooperationMode.Operator.UserInfo.UserAccount = userAccount.(string)
  143 + }
  144 + if userType, ok := data["userType"]; ok {
  145 + cooperationMode.Operator.UserType = userType.(int32)
  146 + }
  147 + if status, ok := data["status"]; ok {
  148 + cooperationMode.Operator.Status = status.(int32)
  149 + }
  150 + if companyId, ok := data["companyId"]; ok {
  151 + cooperationMode.Operator.Company.CompanyId = companyId.(int64)
  152 + }
  153 + if companyLogo, ok := data["companyLogo"]; ok {
  154 + cooperationMode.Operator.Company.CompanyLogo = companyLogo.(string)
  155 + }
  156 + if companyName, ok := data["companyName"]; ok {
  157 + cooperationMode.Operator.Company.CompanyName = companyName.(string)
  158 + }
  159 + if operateTime, ok := data["operateTime"]; ok {
  160 + cooperationMode.OperateTime = operateTime.(time.Time)
  161 + }
  162 + if updatedAt, ok := data["updatedAt"]; ok {
  163 + cooperationMode.UpdatedAt = updatedAt.(time.Time)
  164 + }
  165 + if deletedAt, ok := data["deletedAt"]; ok {
  166 + cooperationMode.DeletedAt = deletedAt.(time.Time)
  167 + }
  168 + if createdAt, ok := data["createdAt"]; ok {
  169 + cooperationMode.CreatedAt = createdAt.(time.Time)
  170 + }
  171 + return nil
  172 +}
  1 +package domain
  2 +
  3 +import "time"
  4 +
  5 +// 共创项目实体
  6 +type CooperationProject struct {
  7 + // 共创项目ID
  8 + CooperationProjectId int64 `json:"cooperationProjectId,string"`
  9 + // 共创项目编号
  10 + CooperationProjectNumber string `json:"cooperationProjectNumber"`
  11 + // 共创项目描述
  12 + CooperationProjectDescription string `json:"cooperationProjectDescription"`
  13 + // 共创项目名称
  14 + CooperationProjectName string `json:"cooperationProjectName"`
  15 + // 共创项目发布时间
  16 + CooperationProjectPublishTime time.Time `json:"cooperationProjectPublishTime"`
  17 + // 共创项目发布人
  18 + CooperationProjectPublisher *User `json:"cooperationProjectPublisher"`
  19 + // 共创项目发起人
  20 + CooperationProjectSponsor *User `json:"cooperationProjectSponsor"`
  21 + // 共创项目承接对象,1员工,2共创用户,3公开,可以多选
  22 + CooperationProjectUndertakerType []int32 `json:"cooperationProjectUndertakerType"`
  23 + // 数据所属组织机构
  24 + Org *Org `json:"org"`
  25 + // 公司
  26 + Company *Company `json:"company"`
  27 + // 操作人
  28 + Operator *User `json:"operator"`
  29 + // 操作时间
  30 + OperateTime time.Time `json:"operateTime"`
  31 + // 共创项目状态,1招标中,2结束
  32 + Status int32 `json:"status"`
  33 + // 更新时间
  34 + UpdatedAt time.Time `json:"updatedAt"`
  35 + // 删除时间
  36 + DeletedAt time.Time `json:"deletedAt"`
  37 + // 创建时间
  38 + CreatedAt time.Time `json:"createdAt"`
  39 +}
  40 +
  41 +type CooperationProjectRepository interface {
  42 + Save(cooperationProject *CooperationProject) (*CooperationProject, error)
  43 + Remove(cooperationProject *CooperationProject) (*CooperationProject, error)
  44 + FindOne(queryOptions map[string]interface{}) (*CooperationProject, error)
  45 + Find(queryOptions map[string]interface{}) (int64, []*CooperationProject, error)
  46 +}
  47 +
  48 +func (cooperationProject *CooperationProject) Identify() interface{} {
  49 + if cooperationProject.CooperationProjectId == 0 {
  50 + return nil
  51 + }
  52 + return cooperationProject.CooperationProjectId
  53 +}
  54 +
  55 +func (cooperationProject *CooperationProject) Update(data map[string]interface{}) error {
  56 + if cooperationProjectNumber, ok := data["cooperationProjectNumber"]; ok {
  57 + cooperationProject.CooperationProjectNumber = cooperationProjectNumber.(string)
  58 + }
  59 + if cooperationProjectDescription, ok := data["cooperationProjectDescription"]; ok {
  60 + cooperationProject.CooperationProjectDescription = cooperationProjectDescription.(string)
  61 + }
  62 + if cooperationProjectName, ok := data["cooperationProjectName"]; ok {
  63 + cooperationProject.CooperationProjectName = cooperationProjectName.(string)
  64 + }
  65 + if cooperationProjectPublishTime, ok := data["cooperationProjectPublishTime"]; ok {
  66 + cooperationProject.CooperationProjectPublishTime = cooperationProjectPublishTime.(time.Time)
  67 + }
  68 + if userId, ok := data["userId"]; ok {
  69 + cooperationProject.CooperationProjectPublisher.UserId = userId.(int64)
  70 + }
  71 + if userBaseId, ok := data["userBaseId"]; ok {
  72 + cooperationProject.CooperationProjectPublisher.UserBaseId = userBaseId.(int64)
  73 + }
  74 + if orgId, ok := data["orgId"]; ok {
  75 + cooperationProject.CooperationProjectPublisher.Org.OrgId = orgId.(int64)
  76 + }
  77 + if orgName, ok := data["orgName"]; ok {
  78 + cooperationProject.CooperationProjectPublisher.Org.OrgName = orgName.(string)
  79 + }
  80 + if companyId, ok := data["companyId"]; ok {
  81 + cooperationProject.CooperationProjectPublisher.Org.Company.CompanyId = companyId.(int64)
  82 + }
  83 + if companyLogo, ok := data["companyLogo"]; ok {
  84 + cooperationProject.CooperationProjectPublisher.Org.Company.CompanyLogo = companyLogo.(string)
  85 + }
  86 + if companyName, ok := data["companyName"]; ok {
  87 + cooperationProject.CooperationProjectPublisher.Org.Company.CompanyName = companyName.(string)
  88 + }
  89 + if orgs, ok := data["orgs"]; ok {
  90 + cooperationProject.CooperationProjectPublisher.Orgs = orgs.([]*Org)
  91 + }
  92 + if departmentId, ok := data["departmentId"]; ok {
  93 + cooperationProject.CooperationProjectPublisher.Department.DepartmentId = departmentId.(int64)
  94 + }
  95 + if departmentName, ok := data["departmentName"]; ok {
  96 + cooperationProject.CooperationProjectPublisher.Department.DepartmentName = departmentName.(string)
  97 + }
  98 + if departmentNumber, ok := data["departmentNumber"]; ok {
  99 + cooperationProject.CooperationProjectPublisher.Department.DepartmentNumber = departmentNumber.(string)
  100 + }
  101 + if isOrganization, ok := data["isOrganization"]; ok {
  102 + cooperationProject.CooperationProjectPublisher.Department.IsOrganization = isOrganization.(bool)
  103 + }
  104 + if roleId, ok := data["roleId"]; ok {
  105 + cooperationProject.CooperationProjectPublisher.Role.RoleId = roleId.(int64)
  106 + }
  107 + if roleName, ok := data["roleName"]; ok {
  108 + cooperationProject.CooperationProjectPublisher.Role.RoleName = roleName.(string)
  109 + }
  110 + if userAvatar, ok := data["userAvatar"]; ok {
  111 + cooperationProject.CooperationProjectPublisher.UserInfo.UserAvatar = userAvatar.(string)
  112 + }
  113 + if userEmail, ok := data["userEmail"]; ok {
  114 + cooperationProject.CooperationProjectPublisher.UserInfo.UserEmail = userEmail.(string)
  115 + }
  116 + if userName, ok := data["userName"]; ok {
  117 + cooperationProject.CooperationProjectPublisher.UserInfo.UserName = userName.(string)
  118 + }
  119 + if userPhone, ok := data["userPhone"]; ok {
  120 + cooperationProject.CooperationProjectPublisher.UserInfo.UserPhone = userPhone.(string)
  121 + }
  122 + if userAccount, ok := data["userAccount"]; ok {
  123 + cooperationProject.CooperationProjectPublisher.UserInfo.UserAccount = userAccount.(string)
  124 + }
  125 + if userType, ok := data["userType"]; ok {
  126 + cooperationProject.CooperationProjectPublisher.UserType = userType.(int32)
  127 + }
  128 + if status, ok := data["status"]; ok {
  129 + cooperationProject.CooperationProjectPublisher.Status = status.(int32)
  130 + }
  131 + if companyId, ok := data["companyId"]; ok {
  132 + cooperationProject.CooperationProjectPublisher.Company.CompanyId = companyId.(int64)
  133 + }
  134 + if companyLogo, ok := data["companyLogo"]; ok {
  135 + cooperationProject.CooperationProjectPublisher.Company.CompanyLogo = companyLogo.(string)
  136 + }
  137 + if companyName, ok := data["companyName"]; ok {
  138 + cooperationProject.CooperationProjectPublisher.Company.CompanyName = companyName.(string)
  139 + }
  140 + if userId, ok := data["userId"]; ok {
  141 + cooperationProject.CooperationProjectSponsor.UserId = userId.(int64)
  142 + }
  143 + if userBaseId, ok := data["userBaseId"]; ok {
  144 + cooperationProject.CooperationProjectSponsor.UserBaseId = userBaseId.(int64)
  145 + }
  146 + if orgId, ok := data["orgId"]; ok {
  147 + cooperationProject.CooperationProjectSponsor.Org.OrgId = orgId.(int64)
  148 + }
  149 + if orgName, ok := data["orgName"]; ok {
  150 + cooperationProject.CooperationProjectSponsor.Org.OrgName = orgName.(string)
  151 + }
  152 + if companyId, ok := data["companyId"]; ok {
  153 + cooperationProject.CooperationProjectSponsor.Company.CompanyId = companyId.(int64)
  154 + }
  155 + if cooperationProjectUndertakerType, ok := data["cooperationProjectUndertakerType"]; ok {
  156 + cooperationProject.CooperationProjectUndertakerType = cooperationProjectUndertakerType.([]int32)
  157 + }
  158 + if operateTime, ok := data["operateTime"]; ok {
  159 + cooperationProject.OperateTime = operateTime.(time.Time)
  160 + }
  161 + if status, ok := data["status"]; ok {
  162 + cooperationProject.Status = status.(int32)
  163 + }
  164 + if updatedAt, ok := data["updatedAt"]; ok {
  165 + cooperationProject.UpdatedAt = updatedAt.(time.Time)
  166 + }
  167 + if deletedAt, ok := data["deletedAt"]; ok {
  168 + cooperationProject.DeletedAt = deletedAt.(time.Time)
  169 + }
  170 + if createdAt, ok := data["createdAt"]; ok {
  171 + cooperationProject.CreatedAt = createdAt.(time.Time)
  172 + }
  173 + return nil
  174 +}
  1 +package domain
  2 +
  3 +// 部门值对象
  4 +type Department struct {
  5 + // 部门ID,通过REST集成上下文获取
  6 + DepartmentId int64 `json:"departmentId,string"`
  7 + // 部门名称
  8 + DepartmentName string `json:"departmentName"`
  9 + // 部门编码
  10 + DepartmentNumber string `json:"departmentNumber"`
  11 + // 是否组织机构标识,1为是,2为否,默认为否
  12 + IsOrganization bool `json:"isOrganization"`
  13 +}
  1 +package domain
  2 +
  3 +// 分红明细
  4 +type DividendsDetails struct {
  5 + // 分红支出
  6 + DividendsExpense float64 `json:"dividendsExpense"`
  7 + // 具体分红类型支出
  8 + DividendsExpenseByTypes []*DividendsExpenseByType `json:"dividendsExpenseByTypes"`
  9 +}
  1 +package domain
  2 +
  3 +// 具体分红类型支出
  4 +type DividendsExpenseByType struct {
  5 + // 具体分红类型支出
  6 + DividendsExpenseByType string `json:"dividendsExpenseByType"`
  7 + // 分红类型名称
  8 + DividendsTypeName string `json:"dividendsTypeName"`
  9 +}
  1 +package domain
  2 +
  3 +// 组织机构值对象
  4 +type Org struct {
  5 + // 组织机构ID
  6 + OrgId int64 `json:"orgId,string"`
  7 + // 组织名称
  8 + OrgName string `json:"orgName"`
  9 + // 公司
  10 + Company *Company `json:"company"`
  11 +}
  1 +package domain
  2 +
  3 +// 推荐人值对象
  4 +type Referrer struct {
  5 + // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员
  6 + UserId int64 `json:"userId,string"`
  7 + // 用户基本id
  8 + UserBaseId int64 `json:"userBaseId,string"`
  9 + // 用户角色
  10 + Role *Role `json:"role"`
  11 + // 用户关联的组织机构
  12 + Orgs []*Org `json:"orgs"`
  13 + // 用户所属的组织机构
  14 + Org *Org `json:"org"`
  15 + // 用户所属的部门
  16 + Department *Department `json:"department"`
  17 + // 公司
  18 + Company *Company `json:"company"`
  19 + // 冗余字段,jsonb格式,不限制存放内容
  20 + UserInfo *UserInfo `json:"userInfo"`
  21 + // 用户类型,1员工,2共创用户,3公开
  22 + UserType int32 `json:"userType"`
  23 +}
  1 +package domain
  2 +
  3 +// 区域信息值对象
  4 +type RegionInfo struct {
  5 + // 区域编号
  6 + RegionNumber string `json:"regionNumber"`
  7 + // 区域名称
  8 + RegionName string `json:"regionName"`
  9 +}
  1 +package domain
  2 +
  3 +// 共创合约相关人值对象
  4 +type Relevant struct {
  5 + // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员
  6 + UserId int64 `json:"userId,string"`
  7 + // 用户基本id
  8 + UserBaseId int64 `json:"userBaseId,string"`
  9 + // 用户所属的组织机构
  10 + Org *Org `json:"org"`
  11 + // 用户关联的组织机构
  12 + Orgs []*Org `json:"orgs"`
  13 + // 用户所属的部门
  14 + Department *Department `json:"department"`
  15 + // 用户角色
  16 + Role *Role `json:"role"`
  17 + // 冗余字段,jsonb格式,不限制存放内容
  18 + UserInfo *UserInfo `json:"userInfo"`
  19 + // 用户类型,1员工,2共创用户,3公开
  20 + UserType int32 `json:"userType"`
  21 + // 状态
  22 + Status int32 `json:"status"`
  23 + // 公司
  24 + Company *Company `json:"company"`
  25 +}
  1 +package domain
  2 +
  3 +// 用户角色值对象
  4 +type Role struct {
  5 + // 角色ID
  6 + RoleId int64 `json:"roleId,string"`
  7 + // 角色名称
  8 + RoleName string `json:"roleName"`
  9 +}
  1 +package domain
  2 +
  3 +// 业务员值对象
  4 +type Salesman struct {
  5 + // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员
  6 + UserId int64 `json:"userId,string"`
  7 + // 用户基本id
  8 + UserBaseId int64 `json:"userBaseId,string"`
  9 + // 用户角色
  10 + Role *Role `json:"role"`
  11 + // 用户关联的组织机构
  12 + Orgs []*Org `json:"orgs"`
  13 + // 用户所属的组织机构
  14 + Org *Org `json:"org"`
  15 + // 用户所属的部门
  16 + Department *Department `json:"department"`
  17 + // 公司
  18 + Company *Company `json:"company"`
  19 + // 冗余字段,jsonb格式,不限制存放内容
  20 + UserInfo *UserInfo `json:"userInfo"`
  21 + // 用户类型,1员工,2共创用户,3公开
  22 + UserType int32 `json:"userType"`
  23 +}
  1 +package domain
  2 +
  3 +// 共创合约承接方值对象
  4 +type Undertaker struct {
  5 + // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员
  6 + UserId int64 `json:"userId,string"`
  7 + // 用户基本id
  8 + UserBaseId int64 `json:"userBaseId,string"`
  9 + // 用户所属组织机构
  10 + Org *Org `json:"org"`
  11 + // 用户关联的组织机构
  12 + Orgs []*Org `json:"orgs"`
  13 + // 用户所属的部门
  14 + Department *Department `json:"department"`
  15 + // 用户角色
  16 + Role *Role `json:"role"`
  17 + // 冗余字段,jsonb格式,不限制存放内容
  18 + UserInfo *UserInfo `json:"userInfo"`
  19 + // 用户类型,1员工,2共创用户,3公开
  20 + UserType int32 `json:"userType"`
  21 + // 状态
  22 + Status int32 `json:"status"`
  23 + // 公司
  24 + Company *Company `json:"company"`
  25 + // 合同附件
  26 + ContractAttachment []*Attachment `json:"contractAttachment"`
  27 +}
  1 +package domain
  2 +
  3 +// 用户第三方服务防腐模型
  4 +type User struct {
  5 + // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员
  6 + UserId int64 `json:"userId,string"`
  7 + // 用户基本id
  8 + UserBaseId int64 `json:"userBaseId,string"`
  9 + // 用户所属组织机构
  10 + Org *Org `json:"org"`
  11 + // 用户关联的组织机构
  12 + Orgs []*Org `json:"orgs"`
  13 + // 用户所属的部门
  14 + Department *Department `json:"department"`
  15 + // 用户角色
  16 + Role *Role `json:"role"`
  17 + // 冗余字段,jsonb格式,不限制存放内容
  18 + UserInfo *UserInfo `json:"userInfo"`
  19 + // 用户类型
  20 + UserType int32 `json:"userType"`
  21 + // 状态
  22 + Status int32 `json:"status"`
  23 + // 用户关联公司信息
  24 + Company *Company `json:"company"`
  25 +}
  1 +package domain
  2 +
  3 +// 用户信息值对象
  4 +type UserInfo struct {
  5 + // 用户头像
  6 + UserAvatar string `json:"userAvatar"`
  7 + // 用户邮箱
  8 + UserEmail string `json:"userEmail"`
  9 + // 共创人员姓名
  10 + UserName string `json:"userName"`
  11 + // 用户手机号
  12 + UserPhone string `json:"userPhone"`
  13 + // 用户账号,区别于手机号,冗余字段
  14 + UserAccount string `json:"userAccount"`
  15 +}
  1 +package models
  2 +
  3 +type ContractUndertakerFeedback struct {
  4 + tableName string `comment:"承接人反馈信息" pg:"contract_undertaker_feedbacks,alias:contract_undertaker_feedback"`
  5 + // 合约承接方反馈记录ID
  6 + FeedbackId int64 `comment:"合约承接方反馈记录ID"`
  7 + // 合约承接方反馈内容附件
  8 + FeedbackAttachment []*Attachment `comment:"合约承接方反馈内容附件" pg:",array"`
  9 + // 合约承接方反馈内容
  10 + FeedbackContent string `comment:"合约承接方反馈内容"`
  11 + // 共创合约编号
  12 + CooperationContractNumber string `comment:"共创合约编号"`
  13 + // 共创合约承接人
  14 + ContractUndertaker *User `comment:"共创合约承接人"`
  15 + // 共创模式
  16 + CooperationMode *CooperationMode `comment:"共创模式"`
  17 + // 数据所属组织机构
  18 + Org *Org `comment:"数据所属组织机构"`
  19 + // 公司
  20 + Company *Company `comment:"公司"`
  21 + // 更新时间
  22 + UpdatedAt time.Time `comment:"更新时间"`
  23 + // 删除时间
  24 + DeletedAt time.Time `comment:"删除时间"`
  25 + // 反馈创建时间,同时也作为反馈时间
  26 + CreatedAt time.Time `comment:"反馈创建时间,同时也作为反馈时间"`
  27 +}
  1 +package models
  2 +
  3 +type CooperationApplication struct {
  4 + tableName string `comment:"共创申请实体" pg:"cooperation_applications,alias:cooperation_application"`
  5 + // 共创申请ID
  6 + CooperationApplicationId int64 `comment:"共创申请ID" pg:"pk:cooperation_application_id"`
  7 + // 共创申请人
  8 + CooperationApplicationApplicant *User `comment:"共创申请人"`
  9 + // 共创申请描述附件
  10 + CooperationApplicationAttachment []*Attachment `comment:"共创申请描述附件" pg:",array"`
  11 + // 共创申请描述
  12 + CooperationApplicationDescription string `comment:"共创申请描述"`
  13 + // 共创申请审核状态,1待审核,2已同意,3已拒绝
  14 + CooperationApplicationStatus int32 `comment:"共创申请审核状态,1待审核,2已同意,3已拒绝"`
  15 + // 共创申请审核人
  16 + CooperationApplicationVerifier *User `comment:"共创申请审核人"`
  17 + // 共创申请审核描述
  18 + CooperationApplicationVerifyDescription string `comment:"共创申请审核描述"`
  19 + // 共创申请审核时间
  20 + CooperationApplicationVerifyTime time.Time `comment:"共创申请审核时间"`
  21 + // 共创申请时间
  22 + CooperationApplyTime time.Time `comment:"共创申请时间"`
  23 + // 共创项目编号
  24 + CooperationProject *CooperationProject `comment:"共创项目编号"`
  25 + // 数据所属组织机构
  26 + Org *Org `comment:"数据所属组织机构"`
  27 + // 公司
  28 + Company *Company `comment:"公司"`
  29 + // 创建时间
  30 + CreatedAt time.Time `comment:"创建时间"`
  31 + // 删除时间
  32 + DeletedAt time.Time `comment:"删除时间"`
  33 + // 更新时间
  34 + UpdatedAt time.Time `comment:"更新时间"`
  35 +}
  1 +package models
  2 +
  3 +type CooperationContract struct {
  4 + tableName string `comment:"共创项目合约实体" pg:"cooperation_contracts,alias:cooperation_contract"`
  5 + // 共创合约ID
  6 + CooperationContractId int64 `comment:"共创合约ID" pg:"pk:cooperation_contract_id"`
  7 + // 共创合约描述
  8 + CooperationContractDescription string `comment:"共创合约描述"`
  9 + // 共创合约名称
  10 + CooperationContractName string `comment:"共创合约名称"`
  11 + // 共创合约编号
  12 + CooperationContractNumber string `comment:"共创合约编号"`
  13 + // 合约推荐人
  14 + CooperationContractReferrer *User `comment:"合约推荐人"`
  15 + // 共创合约业务员
  16 + CooperationContractSalesman *User `comment:"共创合约业务员"`
  17 + // 共创合约承接对象,1员工,2共创用户,3公开
  18 + CooperationContractUndertakerType []int32 `comment:"共创合约承接对象,1员工,2共创用户,3公开" pg:",array"`
  19 + // 共创合约发起人
  20 + CooperationContractSponsor *User `comment:"共创合约发起人"`
  21 + // 共创模式或者合伙模式
  22 + CooperationMode *CooperationMode `comment:"共创模式或者合伙模式"`
  23 + // 合约状态,1启用,2禁用
  24 + Status int32 `comment:"合约状态,1启用,2禁用"`
  25 + // 数据所属组织机构
  26 + Org *Org `comment:"数据所属组织机构"`
  27 + // 公司
  28 + Company *Company `comment:"公司"`
  29 + // 操作人
  30 + Operator *User `comment:"操作人"`
  31 + // 操作时间
  32 + OperateTime time.Time `comment:"操作时间"`
  33 + // 创建时间
  34 + CreatedAt time.Time `comment:"创建时间"`
  35 + // 删除时间
  36 + DeletedAt time.Time `comment:"删除时间"`
  37 + // 更新时间
  38 + UpdatedAt time.Time `comment:"更新时间"`
  39 +}
  1 +package models
  2 +
  3 +import (
  4 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/domain"
  5 + "time"
  6 +)
  7 +
  8 +type CooperationMode struct {
  9 + tableName string `comment:"共创模式实体" pg:"cooperation_modes,alias:cooperation_mode"`
  10 + // 共创模式ID
  11 + CooperationModeId int64 `comment:"共创模式ID" pg:"pk:cooperation_mode_id"`
  12 + // 共创模式编码,唯一确定
  13 + CooperationModeNumber string `comment:"共创模式编码,唯一确定"`
  14 + // 模式名称,唯一确定
  15 + CooperationModeName string `comment:"模式名称,唯一确定"`
  16 + // 共创模式状态,1启用,2禁用
  17 + Status int32 `comment:"共创模式状态,1启用,2禁用"`
  18 + // 数据所属组织机构
  19 + Org *domain.Org `comment:"数据所属组织机构"`
  20 + // 公司
  21 + Company *domain.Company `comment:"公司"`
  22 + // 备注
  23 + Remarks string `comment:"备注"`
  24 + // 操作人
  25 + Operator *domain.User `comment:"操作人"`
  26 + // 操作时间
  27 + OperateTime time.Time `comment:"操作时间"`
  28 + // 更新时间
  29 + UpdatedAt time.Time `comment:"更新时间"`
  30 + // 删除时间
  31 + DeletedAt time.Time `comment:"删除时间"`
  32 + // 创建时间
  33 + CreatedAt time.Time `comment:"创建时间"`
  34 +}
  1 +package models
  2 +
  3 +import (
  4 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/domain"
  5 + "time"
  6 +)
  7 +
  8 +type CooperationProject struct {
  9 + tableName string `comment:"共创项目实体" pg:"cooperation_projects,alias:cooperation_project"`
  10 + // 共创项目ID
  11 + CooperationProjectId int64 `comment:"共创项目ID" pg:"pk:cooperation_project_id"`
  12 + // 共创项目编号
  13 + CooperationProjectNumber string `comment:"共创项目编号"`
  14 + // 共创项目描述
  15 + CooperationProjectDescription string `comment:"共创项目描述"`
  16 + // 共创项目名称
  17 + CooperationProjectName string `comment:"共创项目名称"`
  18 + // 共创项目发布时间
  19 + CooperationProjectPublishTime time.Time `comment:"共创项目发布时间"`
  20 + // 共创项目发布人
  21 + CooperationProjectPublisher *domain.User `comment:"共创项目发布人"`
  22 + // 共创项目发起人
  23 + CooperationProjectSponsor *domain.User `comment:"共创项目发起人"`
  24 + // 共创项目承接对象,1员工,2共创用户,3公开,可以多选
  25 + CooperationProjectUndertakerType []int32 `comment:"共创项目承接对象,1员工,2共创用户,3公开,可以多选" pg:",array"`
  26 + // 数据所属组织机构
  27 + Org *domain.Org `comment:"数据所属组织机构"`
  28 + // 公司
  29 + Company *domain.Company `comment:"公司"`
  30 + // 操作人
  31 + Operator *domain.User `comment:"操作人"`
  32 + // 操作时间
  33 + OperateTime time.Time `comment:"操作时间"`
  34 + // 共创项目状态,1招标中,2结束
  35 + Status int32 `comment:"共创项目状态,1招标中,2结束"`
  36 + // 更新时间
  37 + UpdatedAt time.Time `comment:"更新时间"`
  38 + // 删除时间
  39 + DeletedAt time.Time `comment:"删除时间"`
  40 + // 创建时间
  41 + CreatedAt time.Time `comment:"创建时间"`
  42 +}
  1 +package transform
  2 +
  3 +import (
  4 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/domain"
  5 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/pg/models"
  6 +)
  7 +
  8 +func TransformToContractUndertakerFeedbackDomainModelFromPgModels(contractUndertakerFeedbackModel *models.ContractUndertakerFeedback) (*domain.ContractUndertakerFeedback, error) {
  9 + return &domain.ContractUndertakerFeedback{
  10 + FeedbackId: contractUndertakerFeedbackModel.FeedbackId,
  11 + FeedbackAttachment: contractUndertakerFeedbackModel.FeedbackAttachment,
  12 + FeedbackContent: contractUndertakerFeedbackModel.FeedbackContent,
  13 + CooperationContractNumber: contractUndertakerFeedbackModel.CooperationContractNumber,
  14 + ContractUndertaker: contractUndertakerFeedbackModel.ContractUndertaker,
  15 + CooperationMode: contractUndertakerFeedbackModel.CooperationMode,
  16 + Org: contractUndertakerFeedbackModel.Org,
  17 + Company: contractUndertakerFeedbackModel.Company,
  18 + UpdatedAt: contractUndertakerFeedbackModel.UpdatedAt,
  19 + DeletedAt: contractUndertakerFeedbackModel.DeletedAt,
  20 + CreatedAt: contractUndertakerFeedbackModel.CreatedAt,
  21 + }, nil
  22 +}
  1 +package transform
  2 +
  3 +import (
  4 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/domain"
  5 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/pg/models"
  6 +)
  7 +
  8 +func TransformToCooperationApplicationDomainModelFromPgModels(cooperationApplicationModel *models.CooperationApplication) (*domain.CooperationApplication, error) {
  9 + return &domain.CooperationApplication{
  10 + CooperationApplicationId: cooperationApplicationModel.CooperationApplicationId,
  11 + CooperationApplicationApplicant: cooperationApplicationModel.CooperationApplicationApplicant,
  12 + CooperationApplicationAttachment: cooperationApplicationModel.CooperationApplicationAttachment,
  13 + CooperationApplicationDescription: cooperationApplicationModel.CooperationApplicationDescription,
  14 + CooperationApplicationStatus: cooperationApplicationModel.CooperationApplicationStatus,
  15 + CooperationApplicationVerifier: cooperationApplicationModel.CooperationApplicationVerifier,
  16 + CooperationApplicationVerifyDescription: cooperationApplicationModel.CooperationApplicationVerifyDescription,
  17 + CooperationApplicationVerifyTime: cooperationApplicationModel.CooperationApplicationVerifyTime,
  18 + CooperationApplyTime: cooperationApplicationModel.CooperationApplyTime,
  19 + CooperationProject: cooperationApplicationModel.CooperationProject,
  20 + Org: cooperationApplicationModel.Org,
  21 + Company: cooperationApplicationModel.Company,
  22 + CreatedAt: cooperationApplicationModel.CreatedAt,
  23 + DeletedAt: cooperationApplicationModel.DeletedAt,
  24 + UpdatedAt: cooperationApplicationModel.UpdatedAt,
  25 + }, nil
  26 +}
  1 +package transform
  2 +
  3 +import (
  4 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/domain"
  5 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/pg/models"
  6 +)
  7 +
  8 +func TransformToCooperationContractDomainModelFromPgModels(cooperationContractModel *models.CooperationContract) (*domain.CooperationContract, error) {
  9 + return &domain.CooperationContract{
  10 + CooperationContractId: cooperationContractModel.CooperationContractId,
  11 + CooperationContractDescription: cooperationContractModel.CooperationContractDescription,
  12 + CooperationContractName: cooperationContractModel.CooperationContractName,
  13 + CooperationContractNumber: cooperationContractModel.CooperationContractNumber,
  14 + CooperationContractReferrer: cooperationContractModel.CooperationContractReferrer,
  15 + CooperationContractSalesman: cooperationContractModel.CooperationContractSalesman,
  16 + CooperationContractUndertakerType: cooperationContractModel.CooperationContractUndertakerType,
  17 + CooperationContractSponsor: cooperationContractModel.CooperationContractSponsor,
  18 + CooperationMode: cooperationContractModel.CooperationMode,
  19 + Status: cooperationContractModel.Status,
  20 + Org: cooperationContractModel.Org,
  21 + Company: cooperationContractModel.Company,
  22 + Operator: cooperationContractModel.Operator,
  23 + OperateTime: cooperationContractModel.OperateTime,
  24 + CreatedAt: cooperationContractModel.CreatedAt,
  25 + DeletedAt: cooperationContractModel.DeletedAt,
  26 + UpdatedAt: cooperationContractModel.UpdatedAt,
  27 + }, nil
  28 +}
  1 +package transform
  2 +
  3 +import (
  4 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/domain"
  5 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/pg/models"
  6 +)
  7 +
  8 +func TransformToCooperationModeDomainModelFromPgModels(cooperationModeModel *models.CooperationMode) (*domain.CooperationMode, error) {
  9 + return &domain.CooperationMode{
  10 + CooperationModeId: cooperationModeModel.CooperationModeId,
  11 + CooperationModeNumber: cooperationModeModel.CooperationModeNumber,
  12 + CooperationModeName: cooperationModeModel.CooperationModeName,
  13 + Status: cooperationModeModel.Status,
  14 + Org: cooperationModeModel.Org,
  15 + Company: cooperationModeModel.Company,
  16 + Remarks: cooperationModeModel.Remarks,
  17 + Operator: cooperationModeModel.Operator,
  18 + OperateTime: cooperationModeModel.OperateTime,
  19 + UpdatedAt: cooperationModeModel.UpdatedAt,
  20 + DeletedAt: cooperationModeModel.DeletedAt,
  21 + CreatedAt: cooperationModeModel.CreatedAt,
  22 + }, nil
  23 +}
  1 +package transform
  2 +
  3 +import (
  4 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/domain"
  5 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/pg/models"
  6 +)
  7 +
  8 +func TransformToCooperationProjectDomainModelFromPgModels(cooperationProjectModel *models.CooperationProject) (*domain.CooperationProject, error) {
  9 + return &domain.CooperationProject{
  10 + CooperationProjectId: cooperationProjectModel.CooperationProjectId,
  11 + CooperationProjectNumber: cooperationProjectModel.CooperationProjectNumber,
  12 + CooperationProjectDescription: cooperationProjectModel.CooperationProjectDescription,
  13 + CooperationProjectName: cooperationProjectModel.CooperationProjectName,
  14 + CooperationProjectPublishTime: cooperationProjectModel.CooperationProjectPublishTime,
  15 + CooperationProjectPublisher: cooperationProjectModel.CooperationProjectPublisher,
  16 + CooperationProjectSponsor: cooperationProjectModel.CooperationProjectSponsor,
  17 + CooperationProjectUndertakerType: cooperationProjectModel.CooperationProjectUndertakerType,
  18 + Org: cooperationProjectModel.Org,
  19 + Company: cooperationProjectModel.Company,
  20 + Operator: cooperationProjectModel.Operator,
  21 + OperateTime: cooperationProjectModel.OperateTime,
  22 + Status: cooperationProjectModel.Status,
  23 + UpdatedAt: cooperationProjectModel.UpdatedAt,
  24 + DeletedAt: cooperationProjectModel.DeletedAt,
  25 + CreatedAt: cooperationProjectModel.CreatedAt,
  26 + }, nil
  27 +}
  1 +package repository
  2 +
  3 +import (
  4 + "fmt"
  5 +
  6 + "github.com/linmadan/egglib-go/persistent/pg/sqlbuilder"
  7 + pgTransaction "github.com/linmadan/egglib-go/transaction/pg"
  8 + "github.com/linmadan/egglib-go/utils/snowflake"
  9 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/domain"
  10 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/pg/models"
  11 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/pg/transform"
  12 +)
  13 +
  14 +type ContractUndertakerFeedbackRepository struct {
  15 + transactionContext *pgTransaction.TransactionContext
  16 +}
  17 +
  18 +func (repository *ContractUndertakerFeedbackRepository) nextIdentify() (int64, error) {
  19 + IdWorker, err := snowflake.NewIdWorker(1)
  20 + if err != nil {
  21 + return 0, err
  22 + }
  23 + id, err := IdWorker.NextId()
  24 + return id, err
  25 +}
  26 +func (repository *ContractUndertakerFeedbackRepository) Save(contractUndertakerFeedback *domain.ContractUndertakerFeedback) (*domain.ContractUndertakerFeedback, error) {
  27 + sqlBuildFields := []string{
  28 + "feedback_id",
  29 + "feedback_attachment",
  30 + "feedback_content",
  31 + "cooperation_contract_number",
  32 + "contract_undertaker",
  33 + "cooperation_mode",
  34 + "org",
  35 + "company",
  36 + "updated_at",
  37 + "deleted_at",
  38 + "created_at",
  39 + }
  40 + insertFieldsSnippet := sqlbuilder.SqlFieldsSnippet(sqlBuildFields)
  41 + insertPlaceHoldersSnippet := sqlbuilder.SqlPlaceHoldersSnippet(sqlBuildFields)
  42 + returningFieldsSnippet := sqlbuilder.SqlFieldsSnippet(sqlBuildFields)
  43 + updateFields := sqlbuilder.RemoveSqlFields(sqlBuildFields, "contractUndertakerFeedback_id")
  44 + updateFieldsSnippet := sqlbuilder.SqlUpdateFieldsSnippet(updateFields)
  45 + tx := repository.transactionContext.PgTx
  46 + if contractUndertakerFeedback.Identify() == nil {
  47 + contractUndertakerFeedbackId, err := repository.nextIdentify()
  48 + if err != nil {
  49 + return contractUndertakerFeedback, err
  50 + } else {
  51 + contractUndertakerFeedback.ContractUndertakerFeedbackId = contractUndertakerFeedbackId
  52 + }
  53 + if _, err := tx.QueryOne(
  54 + pg.Scan(
  55 + &contractUndertakerFeedback.FeedbackId,
  56 + pg.Array(&contractUndertakerFeedback.FeedbackAttachment),
  57 + &contractUndertakerFeedback.FeedbackContent,
  58 + &contractUndertakerFeedback.CooperationContractNumber,
  59 + &contractUndertakerFeedback.ContractUndertaker,
  60 + &contractUndertakerFeedback.CooperationMode,
  61 + &contractUndertakerFeedback.Org,
  62 + &contractUndertakerFeedback.Company,
  63 + &contractUndertakerFeedback.UpdatedAt,
  64 + &contractUndertakerFeedback.DeletedAt,
  65 + &contractUndertakerFeedback.CreatedAt,
  66 + ),
  67 + fmt.Sprintf("INSERT INTO contract_undertaker_feedbacks (%s) VALUES (%s) RETURNING %s", insertFieldsSnippet, insertPlaceHoldersSnippet, returningFieldsSnippet),
  68 + contractUndertakerFeedback.FeedbackId,
  69 + pg.Array(contractUndertakerFeedback.FeedbackAttachment),
  70 + contractUndertakerFeedback.FeedbackContent,
  71 + contractUndertakerFeedback.CooperationContractNumber,
  72 + contractUndertakerFeedback.ContractUndertaker,
  73 + contractUndertakerFeedback.CooperationMode,
  74 + contractUndertakerFeedback.Org,
  75 + contractUndertakerFeedback.Company,
  76 + contractUndertakerFeedback.UpdatedAt,
  77 + contractUndertakerFeedback.DeletedAt,
  78 + contractUndertakerFeedback.CreatedAt,
  79 + ); err != nil {
  80 + return contractUndertakerFeedback, err
  81 + }
  82 + } else {
  83 + if _, err := tx.QueryOne(
  84 + pg.Scan(
  85 + &contractUndertakerFeedback.FeedbackId,
  86 + pg.Array(&contractUndertakerFeedback.FeedbackAttachment),
  87 + &contractUndertakerFeedback.FeedbackContent,
  88 + &contractUndertakerFeedback.CooperationContractNumber,
  89 + &contractUndertakerFeedback.ContractUndertaker,
  90 + &contractUndertakerFeedback.CooperationMode,
  91 + &contractUndertakerFeedback.Org,
  92 + &contractUndertakerFeedback.Company,
  93 + &contractUndertakerFeedback.UpdatedAt,
  94 + &contractUndertakerFeedback.DeletedAt,
  95 + &contractUndertakerFeedback.CreatedAt,
  96 + ),
  97 + fmt.Sprintf("UPDATE contract_undertaker_feedbacks SET %s WHERE contract_undertaker_feedback_id=? RETURNING %s", updateFieldsSnippet, returningFieldsSnippet),
  98 + contractUndertakerFeedback.FeedbackId,
  99 + pg.Array(contractUndertakerFeedback.FeedbackAttachment),
  100 + contractUndertakerFeedback.FeedbackContent,
  101 + contractUndertakerFeedback.CooperationContractNumber,
  102 + contractUndertakerFeedback.ContractUndertaker,
  103 + contractUndertakerFeedback.CooperationMode,
  104 + contractUndertakerFeedback.Org,
  105 + contractUndertakerFeedback.Company,
  106 + contractUndertakerFeedback.UpdatedAt,
  107 + contractUndertakerFeedback.DeletedAt,
  108 + contractUndertakerFeedback.CreatedAt,
  109 + contractUndertakerFeedback.Identify(),
  110 + ); err != nil {
  111 + return contractUndertakerFeedback, err
  112 + }
  113 + }
  114 + return contractUndertakerFeedback, nil
  115 +}
  116 +func (repository *ContractUndertakerFeedbackRepository) Remove(contractUndertakerFeedback *domain.ContractUndertakerFeedback) (*domain.ContractUndertakerFeedback, error) {
  117 + tx := repository.transactionContext.PgTx
  118 + contractUndertakerFeedbackModel := new(models.ContractUndertakerFeedback)
  119 + contractUndertakerFeedbackModel.ContractUndertakerFeedbackId = contractUndertakerFeedback.Identify().(int64)
  120 + if _, err := tx.Model(contractUndertakerFeedbackModel).WherePK().Delete(); err != nil {
  121 + return contractUndertakerFeedback, err
  122 + }
  123 + return contractUndertakerFeedback, nil
  124 +}
  125 +func (repository *ContractUndertakerFeedbackRepository) FindOne(queryOptions map[string]interface{}) (*domain.ContractUndertakerFeedback, error) {
  126 + tx := repository.transactionContext.PgTx
  127 + contractUndertakerFeedbackModel := new(models.ContractUndertakerFeedback)
  128 + query := sqlbuilder.BuildQuery(tx.Model(contractUndertakerFeedbackModel), queryOptions)
  129 + query.SetWhereByQueryOption("contract_undertaker_feedback.contract_undertaker_feedback_id = ?", "contractUndertakerFeedbackId")
  130 + if err := query.First(); err != nil {
  131 + if err.Error() == "pg: no rows in result set" {
  132 + return nil, fmt.Errorf("没有此资源")
  133 + } else {
  134 + return nil, err
  135 + }
  136 + }
  137 + if contractUndertakerFeedbackModel.ContractUndertakerFeedbackId == 0 {
  138 + return nil, nil
  139 + } else {
  140 + return transform.TransformToContractUndertakerFeedbackDomainModelFromPgModels(contractUndertakerFeedbackModel)
  141 + }
  142 +}
  143 +func (repository *ContractUndertakerFeedbackRepository) Find(queryOptions map[string]interface{}) (int64, []*domain.ContractUndertakerFeedback, error) {
  144 + tx := repository.transactionContext.PgTx
  145 + var contractUndertakerFeedbackModels []*models.ContractUndertakerFeedback
  146 + contractUndertakerFeedbacks := make([]*domain.ContractUndertakerFeedback, 0)
  147 + query := sqlbuilder.BuildQuery(tx.Model(&contractUndertakerFeedbackModels), queryOptions)
  148 + query.SetOffsetAndLimit(20)
  149 + query.SetOrderDirect("contract_undertaker_feedback_id", "DESC")
  150 + if count, err := query.SelectAndCount(); err != nil {
  151 + return 0, contractUndertakerFeedbacks, err
  152 + } else {
  153 + for _, contractUndertakerFeedbackModel := range contractUndertakerFeedbackModels {
  154 + if contractUndertakerFeedback, err := transform.TransformToContractUndertakerFeedbackDomainModelFromPgModels(contractUndertakerFeedbackModel); err != nil {
  155 + return 0, contractUndertakerFeedbacks, err
  156 + } else {
  157 + contractUndertakerFeedbacks = append(contractUndertakerFeedbacks, contractUndertakerFeedback)
  158 + }
  159 + }
  160 + return int64(count), contractUndertakerFeedbacks, nil
  161 + }
  162 +}
  163 +func NewContractUndertakerFeedbackRepository(transactionContext *pgTransaction.TransactionContext) (*ContractUndertakerFeedbackRepository, error) {
  164 + if transactionContext == nil {
  165 + return nil, fmt.Errorf("transactionContext参数不能为nil")
  166 + } else {
  167 + return &ContractUndertakerFeedbackRepository{
  168 + transactionContext: transactionContext,
  169 + }, nil
  170 + }
  171 +}
  1 +package repository
  2 +
  3 +import (
  4 + "fmt"
  5 +
  6 + "github.com/linmadan/egglib-go/persistent/pg/sqlbuilder"
  7 + pgTransaction "github.com/linmadan/egglib-go/transaction/pg"
  8 + "github.com/linmadan/egglib-go/utils/snowflake"
  9 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/domain"
  10 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/pg/models"
  11 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/pg/transform"
  12 +)
  13 +
  14 +type CooperationApplicationRepository struct {
  15 + transactionContext *pgTransaction.TransactionContext
  16 +}
  17 +
  18 +func (repository *CooperationApplicationRepository) nextIdentify() (int64, error) {
  19 + IdWorker, err := snowflake.NewIdWorker(1)
  20 + if err != nil {
  21 + return 0, err
  22 + }
  23 + id, err := IdWorker.NextId()
  24 + return id, err
  25 +}
  26 +func (repository *CooperationApplicationRepository) Save(cooperationApplication *domain.CooperationApplication) (*domain.CooperationApplication, error) {
  27 + sqlBuildFields := []string{
  28 + "cooperation_application_id",
  29 + "cooperation_application_applicant",
  30 + "cooperation_application_attachment",
  31 + "cooperation_application_description",
  32 + "cooperation_application_status",
  33 + "cooperation_application_verifier",
  34 + "cooperation_application_verify_description",
  35 + "cooperation_application_verify_time",
  36 + "cooperation_apply_time",
  37 + "cooperation_project",
  38 + "org",
  39 + "company",
  40 + "created_at",
  41 + "deleted_at",
  42 + "updated_at",
  43 + }
  44 + insertFieldsSnippet := sqlbuilder.SqlFieldsSnippet(sqlBuildFields)
  45 + insertPlaceHoldersSnippet := sqlbuilder.SqlPlaceHoldersSnippet(sqlBuildFields)
  46 + returningFieldsSnippet := sqlbuilder.SqlFieldsSnippet(sqlBuildFields)
  47 + updateFields := sqlbuilder.RemoveSqlFields(sqlBuildFields, "cooperationApplication_id")
  48 + updateFieldsSnippet := sqlbuilder.SqlUpdateFieldsSnippet(updateFields)
  49 + tx := repository.transactionContext.PgTx
  50 + if cooperationApplication.Identify() == nil {
  51 + cooperationApplicationId, err := repository.nextIdentify()
  52 + if err != nil {
  53 + return cooperationApplication, err
  54 + } else {
  55 + cooperationApplication.CooperationApplicationId = cooperationApplicationId
  56 + }
  57 + if _, err := tx.QueryOne(
  58 + pg.Scan(
  59 + &cooperationApplication.CooperationApplicationId,
  60 + &cooperationApplication.CooperationApplicationApplicant,
  61 + pg.Array(&cooperationApplication.CooperationApplicationAttachment),
  62 + &cooperationApplication.CooperationApplicationDescription,
  63 + &cooperationApplication.CooperationApplicationStatus,
  64 + &cooperationApplication.CooperationApplicationVerifier,
  65 + &cooperationApplication.CooperationApplicationVerifyDescription,
  66 + &cooperationApplication.CooperationApplicationVerifyTime,
  67 + &cooperationApplication.CooperationApplyTime,
  68 + &cooperationApplication.CooperationProject,
  69 + &cooperationApplication.Org,
  70 + &cooperationApplication.Company,
  71 + &cooperationApplication.CreatedAt,
  72 + &cooperationApplication.DeletedAt,
  73 + &cooperationApplication.UpdatedAt,
  74 + ),
  75 + fmt.Sprintf("INSERT INTO cooperation_applications (%s) VALUES (%s) RETURNING %s", insertFieldsSnippet, insertPlaceHoldersSnippet, returningFieldsSnippet),
  76 + cooperationApplication.CooperationApplicationId,
  77 + cooperationApplication.CooperationApplicationApplicant,
  78 + pg.Array(cooperationApplication.CooperationApplicationAttachment),
  79 + cooperationApplication.CooperationApplicationDescription,
  80 + cooperationApplication.CooperationApplicationStatus,
  81 + cooperationApplication.CooperationApplicationVerifier,
  82 + cooperationApplication.CooperationApplicationVerifyDescription,
  83 + cooperationApplication.CooperationApplicationVerifyTime,
  84 + cooperationApplication.CooperationApplyTime,
  85 + cooperationApplication.CooperationProject,
  86 + cooperationApplication.Org,
  87 + cooperationApplication.Company,
  88 + cooperationApplication.CreatedAt,
  89 + cooperationApplication.DeletedAt,
  90 + cooperationApplication.UpdatedAt,
  91 + ); err != nil {
  92 + return cooperationApplication, err
  93 + }
  94 + } else {
  95 + if _, err := tx.QueryOne(
  96 + pg.Scan(
  97 + &cooperationApplication.CooperationApplicationId,
  98 + &cooperationApplication.CooperationApplicationApplicant,
  99 + pg.Array(&cooperationApplication.CooperationApplicationAttachment),
  100 + &cooperationApplication.CooperationApplicationDescription,
  101 + &cooperationApplication.CooperationApplicationStatus,
  102 + &cooperationApplication.CooperationApplicationVerifier,
  103 + &cooperationApplication.CooperationApplicationVerifyDescription,
  104 + &cooperationApplication.CooperationApplicationVerifyTime,
  105 + &cooperationApplication.CooperationApplyTime,
  106 + &cooperationApplication.CooperationProject,
  107 + &cooperationApplication.Org,
  108 + &cooperationApplication.Company,
  109 + &cooperationApplication.CreatedAt,
  110 + &cooperationApplication.DeletedAt,
  111 + &cooperationApplication.UpdatedAt,
  112 + ),
  113 + fmt.Sprintf("UPDATE cooperation_applications SET %s WHERE cooperation_application_id=? RETURNING %s", updateFieldsSnippet, returningFieldsSnippet),
  114 + cooperationApplication.CooperationApplicationId,
  115 + cooperationApplication.CooperationApplicationApplicant,
  116 + pg.Array(cooperationApplication.CooperationApplicationAttachment),
  117 + cooperationApplication.CooperationApplicationDescription,
  118 + cooperationApplication.CooperationApplicationStatus,
  119 + cooperationApplication.CooperationApplicationVerifier,
  120 + cooperationApplication.CooperationApplicationVerifyDescription,
  121 + cooperationApplication.CooperationApplicationVerifyTime,
  122 + cooperationApplication.CooperationApplyTime,
  123 + cooperationApplication.CooperationProject,
  124 + cooperationApplication.Org,
  125 + cooperationApplication.Company,
  126 + cooperationApplication.CreatedAt,
  127 + cooperationApplication.DeletedAt,
  128 + cooperationApplication.UpdatedAt,
  129 + cooperationApplication.Identify(),
  130 + ); err != nil {
  131 + return cooperationApplication, err
  132 + }
  133 + }
  134 + return cooperationApplication, nil
  135 +}
  136 +func (repository *CooperationApplicationRepository) Remove(cooperationApplication *domain.CooperationApplication) (*domain.CooperationApplication, error) {
  137 + tx := repository.transactionContext.PgTx
  138 + cooperationApplicationModel := new(models.CooperationApplication)
  139 + cooperationApplicationModel.CooperationApplicationId = cooperationApplication.Identify().(int64)
  140 + if _, err := tx.Model(cooperationApplicationModel).WherePK().Delete(); err != nil {
  141 + return cooperationApplication, err
  142 + }
  143 + return cooperationApplication, nil
  144 +}
  145 +func (repository *CooperationApplicationRepository) FindOne(queryOptions map[string]interface{}) (*domain.CooperationApplication, error) {
  146 + tx := repository.transactionContext.PgTx
  147 + cooperationApplicationModel := new(models.CooperationApplication)
  148 + query := sqlbuilder.BuildQuery(tx.Model(cooperationApplicationModel), queryOptions)
  149 + query.SetWhereByQueryOption("cooperation_application.cooperation_application_id = ?", "cooperationApplicationId")
  150 + if err := query.First(); err != nil {
  151 + if err.Error() == "pg: no rows in result set" {
  152 + return nil, fmt.Errorf("没有此资源")
  153 + } else {
  154 + return nil, err
  155 + }
  156 + }
  157 + if cooperationApplicationModel.CooperationApplicationId == 0 {
  158 + return nil, nil
  159 + } else {
  160 + return transform.TransformToCooperationApplicationDomainModelFromPgModels(cooperationApplicationModel)
  161 + }
  162 +}
  163 +func (repository *CooperationApplicationRepository) Find(queryOptions map[string]interface{}) (int64, []*domain.CooperationApplication, error) {
  164 + tx := repository.transactionContext.PgTx
  165 + var cooperationApplicationModels []*models.CooperationApplication
  166 + cooperationApplications := make([]*domain.CooperationApplication, 0)
  167 + query := sqlbuilder.BuildQuery(tx.Model(&cooperationApplicationModels), queryOptions)
  168 + query.SetOffsetAndLimit(20)
  169 + query.SetOrderDirect("cooperation_application_id", "DESC")
  170 + if count, err := query.SelectAndCount(); err != nil {
  171 + return 0, cooperationApplications, err
  172 + } else {
  173 + for _, cooperationApplicationModel := range cooperationApplicationModels {
  174 + if cooperationApplication, err := transform.TransformToCooperationApplicationDomainModelFromPgModels(cooperationApplicationModel); err != nil {
  175 + return 0, cooperationApplications, err
  176 + } else {
  177 + cooperationApplications = append(cooperationApplications, cooperationApplication)
  178 + }
  179 + }
  180 + return int64(count), cooperationApplications, nil
  181 + }
  182 +}
  183 +func NewCooperationApplicationRepository(transactionContext *pgTransaction.TransactionContext) (*CooperationApplicationRepository, error) {
  184 + if transactionContext == nil {
  185 + return nil, fmt.Errorf("transactionContext参数不能为nil")
  186 + } else {
  187 + return &CooperationApplicationRepository{
  188 + transactionContext: transactionContext,
  189 + }, nil
  190 + }
  191 +}
  1 +package repository
  2 +
  3 +import (
  4 + "fmt"
  5 +
  6 + "github.com/linmadan/egglib-go/persistent/pg/sqlbuilder"
  7 + pgTransaction "github.com/linmadan/egglib-go/transaction/pg"
  8 + "github.com/linmadan/egglib-go/utils/snowflake"
  9 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/domain"
  10 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/pg/models"
  11 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/pg/transform"
  12 +)
  13 +
  14 +type CooperationContractRepository struct {
  15 + transactionContext *pgTransaction.TransactionContext
  16 +}
  17 +
  18 +func (repository *CooperationContractRepository) nextIdentify() (int64, error) {
  19 + IdWorker, err := snowflake.NewIdWorker(1)
  20 + if err != nil {
  21 + return 0, err
  22 + }
  23 + id, err := IdWorker.NextId()
  24 + return id, err
  25 +}
  26 +func (repository *CooperationContractRepository) Save(cooperationContract *domain.CooperationContract) (*domain.CooperationContract, error) {
  27 + sqlBuildFields := []string{
  28 + "cooperation_contract_id",
  29 + "cooperation_contract_description",
  30 + "cooperation_contract_name",
  31 + "cooperation_contract_number",
  32 + "cooperation_contract_referrer",
  33 + "cooperation_contract_salesman",
  34 + "cooperation_contract_undertaker_type",
  35 + "cooperation_contract_sponsor",
  36 + "cooperation_mode",
  37 + "status",
  38 + "org",
  39 + "company",
  40 + "operator",
  41 + "operate_time",
  42 + "created_at",
  43 + "deleted_at",
  44 + "updated_at",
  45 + }
  46 + insertFieldsSnippet := sqlbuilder.SqlFieldsSnippet(sqlBuildFields)
  47 + insertPlaceHoldersSnippet := sqlbuilder.SqlPlaceHoldersSnippet(sqlBuildFields)
  48 + returningFieldsSnippet := sqlbuilder.SqlFieldsSnippet(sqlBuildFields)
  49 + updateFields := sqlbuilder.RemoveSqlFields(sqlBuildFields, "cooperationContract_id")
  50 + updateFieldsSnippet := sqlbuilder.SqlUpdateFieldsSnippet(updateFields)
  51 + tx := repository.transactionContext.PgTx
  52 + if cooperationContract.Identify() == nil {
  53 + cooperationContractId, err := repository.nextIdentify()
  54 + if err != nil {
  55 + return cooperationContract, err
  56 + } else {
  57 + cooperationContract.CooperationContractId = cooperationContractId
  58 + }
  59 + if _, err := tx.QueryOne(
  60 + pg.Scan(
  61 + &cooperationContract.CooperationContractId,
  62 + &cooperationContract.CooperationContractDescription,
  63 + &cooperationContract.CooperationContractName,
  64 + &cooperationContract.CooperationContractNumber,
  65 + &cooperationContract.CooperationContractReferrer,
  66 + &cooperationContract.CooperationContractSalesman,
  67 + pg.Array(&cooperationContract.CooperationContractUndertakerType),
  68 + &cooperationContract.CooperationContractSponsor,
  69 + &cooperationContract.CooperationMode,
  70 + &cooperationContract.Status,
  71 + &cooperationContract.Org,
  72 + &cooperationContract.Company,
  73 + &cooperationContract.Operator,
  74 + &cooperationContract.OperateTime,
  75 + &cooperationContract.CreatedAt,
  76 + &cooperationContract.DeletedAt,
  77 + &cooperationContract.UpdatedAt,
  78 + ),
  79 + fmt.Sprintf("INSERT INTO cooperation_contracts (%s) VALUES (%s) RETURNING %s", insertFieldsSnippet, insertPlaceHoldersSnippet, returningFieldsSnippet),
  80 + cooperationContract.CooperationContractId,
  81 + cooperationContract.CooperationContractDescription,
  82 + cooperationContract.CooperationContractName,
  83 + cooperationContract.CooperationContractNumber,
  84 + cooperationContract.CooperationContractReferrer,
  85 + cooperationContract.CooperationContractSalesman,
  86 + pg.Array(cooperationContract.CooperationContractUndertakerType),
  87 + cooperationContract.CooperationContractSponsor,
  88 + cooperationContract.CooperationMode,
  89 + cooperationContract.Status,
  90 + cooperationContract.Org,
  91 + cooperationContract.Company,
  92 + cooperationContract.Operator,
  93 + cooperationContract.OperateTime,
  94 + cooperationContract.CreatedAt,
  95 + cooperationContract.DeletedAt,
  96 + cooperationContract.UpdatedAt,
  97 + ); err != nil {
  98 + return cooperationContract, err
  99 + }
  100 + } else {
  101 + if _, err := tx.QueryOne(
  102 + pg.Scan(
  103 + &cooperationContract.CooperationContractId,
  104 + &cooperationContract.CooperationContractDescription,
  105 + &cooperationContract.CooperationContractName,
  106 + &cooperationContract.CooperationContractNumber,
  107 + &cooperationContract.CooperationContractReferrer,
  108 + &cooperationContract.CooperationContractSalesman,
  109 + pg.Array(&cooperationContract.CooperationContractUndertakerType),
  110 + &cooperationContract.CooperationContractSponsor,
  111 + &cooperationContract.CooperationMode,
  112 + &cooperationContract.Status,
  113 + &cooperationContract.Org,
  114 + &cooperationContract.Company,
  115 + &cooperationContract.Operator,
  116 + &cooperationContract.OperateTime,
  117 + &cooperationContract.CreatedAt,
  118 + &cooperationContract.DeletedAt,
  119 + &cooperationContract.UpdatedAt,
  120 + ),
  121 + fmt.Sprintf("UPDATE cooperation_contracts SET %s WHERE cooperation_contract_id=? RETURNING %s", updateFieldsSnippet, returningFieldsSnippet),
  122 + cooperationContract.CooperationContractId,
  123 + cooperationContract.CooperationContractDescription,
  124 + cooperationContract.CooperationContractName,
  125 + cooperationContract.CooperationContractNumber,
  126 + cooperationContract.CooperationContractReferrer,
  127 + cooperationContract.CooperationContractSalesman,
  128 + pg.Array(cooperationContract.CooperationContractUndertakerType),
  129 + cooperationContract.CooperationContractSponsor,
  130 + cooperationContract.CooperationMode,
  131 + cooperationContract.Status,
  132 + cooperationContract.Org,
  133 + cooperationContract.Company,
  134 + cooperationContract.Operator,
  135 + cooperationContract.OperateTime,
  136 + cooperationContract.CreatedAt,
  137 + cooperationContract.DeletedAt,
  138 + cooperationContract.UpdatedAt,
  139 + cooperationContract.Identify(),
  140 + ); err != nil {
  141 + return cooperationContract, err
  142 + }
  143 + }
  144 + return cooperationContract, nil
  145 +}
  146 +func (repository *CooperationContractRepository) Remove(cooperationContract *domain.CooperationContract) (*domain.CooperationContract, error) {
  147 + tx := repository.transactionContext.PgTx
  148 + cooperationContractModel := new(models.CooperationContract)
  149 + cooperationContractModel.CooperationContractId = cooperationContract.Identify().(int64)
  150 + if _, err := tx.Model(cooperationContractModel).WherePK().Delete(); err != nil {
  151 + return cooperationContract, err
  152 + }
  153 + return cooperationContract, nil
  154 +}
  155 +func (repository *CooperationContractRepository) FindOne(queryOptions map[string]interface{}) (*domain.CooperationContract, error) {
  156 + tx := repository.transactionContext.PgTx
  157 + cooperationContractModel := new(models.CooperationContract)
  158 + query := sqlbuilder.BuildQuery(tx.Model(cooperationContractModel), queryOptions)
  159 + query.SetWhereByQueryOption("cooperation_contract.cooperation_contract_id = ?", "cooperationContractId")
  160 + if err := query.First(); err != nil {
  161 + if err.Error() == "pg: no rows in result set" {
  162 + return nil, fmt.Errorf("没有此资源")
  163 + } else {
  164 + return nil, err
  165 + }
  166 + }
  167 + if cooperationContractModel.CooperationContractId == 0 {
  168 + return nil, nil
  169 + } else {
  170 + return transform.TransformToCooperationContractDomainModelFromPgModels(cooperationContractModel)
  171 + }
  172 +}
  173 +func (repository *CooperationContractRepository) Find(queryOptions map[string]interface{}) (int64, []*domain.CooperationContract, error) {
  174 + tx := repository.transactionContext.PgTx
  175 + var cooperationContractModels []*models.CooperationContract
  176 + cooperationContracts := make([]*domain.CooperationContract, 0)
  177 + query := sqlbuilder.BuildQuery(tx.Model(&cooperationContractModels), queryOptions)
  178 + query.SetOffsetAndLimit(20)
  179 + query.SetOrderDirect("cooperation_contract_id", "DESC")
  180 + if count, err := query.SelectAndCount(); err != nil {
  181 + return 0, cooperationContracts, err
  182 + } else {
  183 + for _, cooperationContractModel := range cooperationContractModels {
  184 + if cooperationContract, err := transform.TransformToCooperationContractDomainModelFromPgModels(cooperationContractModel); err != nil {
  185 + return 0, cooperationContracts, err
  186 + } else {
  187 + cooperationContracts = append(cooperationContracts, cooperationContract)
  188 + }
  189 + }
  190 + return int64(count), cooperationContracts, nil
  191 + }
  192 +}
  193 +func NewCooperationContractRepository(transactionContext *pgTransaction.TransactionContext) (*CooperationContractRepository, error) {
  194 + if transactionContext == nil {
  195 + return nil, fmt.Errorf("transactionContext参数不能为nil")
  196 + } else {
  197 + return &CooperationContractRepository{
  198 + transactionContext: transactionContext,
  199 + }, nil
  200 + }
  201 +}
  1 +package repository
  2 +
  3 +import (
  4 + "fmt"
  5 + "github.com/go-pg/pg/v10"
  6 +
  7 + "github.com/linmadan/egglib-go/persistent/pg/sqlbuilder"
  8 + pgTransaction "github.com/linmadan/egglib-go/transaction/pg"
  9 + "github.com/linmadan/egglib-go/utils/snowflake"
  10 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/domain"
  11 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/pg/models"
  12 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/pg/transform"
  13 +)
  14 +
  15 +type CooperationModeRepository struct {
  16 + transactionContext *pgTransaction.TransactionContext
  17 +}
  18 +
  19 +func (repository *CooperationModeRepository) nextIdentify() (int64, error) {
  20 + IdWorker, err := snowflake.NewIdWorker(1)
  21 + if err != nil {
  22 + return 0, err
  23 + }
  24 + id, err := IdWorker.NextId()
  25 + return id, err
  26 +}
  27 +func (repository *CooperationModeRepository) Save(cooperationMode *domain.CooperationMode) (*domain.CooperationMode, error) {
  28 + sqlBuildFields := []string{
  29 + "cooperation_mode_id",
  30 + "cooperation_mode_number",
  31 + "cooperation_mode_name",
  32 + "status",
  33 + "org",
  34 + "company",
  35 + "remarks",
  36 + "operator",
  37 + "operate_time",
  38 + "updated_at",
  39 + "deleted_at",
  40 + "created_at",
  41 + }
  42 + insertFieldsSnippet := sqlbuilder.SqlFieldsSnippet(sqlBuildFields)
  43 + insertPlaceHoldersSnippet := sqlbuilder.SqlPlaceHoldersSnippet(sqlBuildFields)
  44 + returningFieldsSnippet := sqlbuilder.SqlFieldsSnippet(sqlBuildFields)
  45 + updateFields := sqlbuilder.RemoveSqlFields(sqlBuildFields, "cooperationMode_id")
  46 + updateFieldsSnippet := sqlbuilder.SqlUpdateFieldsSnippet(updateFields)
  47 + tx := repository.transactionContext.PgTx
  48 + if cooperationMode.Identify() == nil {
  49 + cooperationModeId, err := repository.nextIdentify()
  50 + if err != nil {
  51 + return cooperationMode, err
  52 + } else {
  53 + cooperationMode.CooperationModeId = cooperationModeId
  54 + }
  55 + if _, err := tx.QueryOne(
  56 + pg.Scan(
  57 + &cooperationMode.CooperationModeId,
  58 + &cooperationMode.CooperationModeNumber,
  59 + &cooperationMode.CooperationModeName,
  60 + &cooperationMode.Status,
  61 + &cooperationMode.Org,
  62 + &cooperationMode.Company,
  63 + &cooperationMode.Remarks,
  64 + &cooperationMode.Operator,
  65 + &cooperationMode.OperateTime,
  66 + &cooperationMode.UpdatedAt,
  67 + &cooperationMode.DeletedAt,
  68 + &cooperationMode.CreatedAt,
  69 + ),
  70 + fmt.Sprintf("INSERT INTO cooperation_modes (%s) VALUES (%s) RETURNING %s", insertFieldsSnippet, insertPlaceHoldersSnippet, returningFieldsSnippet),
  71 + cooperationMode.CooperationModeId,
  72 + cooperationMode.CooperationModeNumber,
  73 + cooperationMode.CooperationModeName,
  74 + cooperationMode.Status,
  75 + cooperationMode.Org,
  76 + cooperationMode.Company,
  77 + cooperationMode.Remarks,
  78 + cooperationMode.Operator,
  79 + cooperationMode.OperateTime,
  80 + cooperationMode.UpdatedAt,
  81 + cooperationMode.DeletedAt,
  82 + cooperationMode.CreatedAt,
  83 + ); err != nil {
  84 + return cooperationMode, err
  85 + }
  86 + } else {
  87 + if _, err := tx.QueryOne(
  88 + pg.Scan(
  89 + &cooperationMode.CooperationModeId,
  90 + &cooperationMode.CooperationModeNumber,
  91 + &cooperationMode.CooperationModeName,
  92 + &cooperationMode.Status,
  93 + &cooperationMode.Org,
  94 + &cooperationMode.Company,
  95 + &cooperationMode.Remarks,
  96 + &cooperationMode.Operator,
  97 + &cooperationMode.OperateTime,
  98 + &cooperationMode.UpdatedAt,
  99 + &cooperationMode.DeletedAt,
  100 + &cooperationMode.CreatedAt,
  101 + ),
  102 + fmt.Sprintf("UPDATE cooperation_modes SET %s WHERE cooperation_mode_id=? RETURNING %s", updateFieldsSnippet, returningFieldsSnippet),
  103 + cooperationMode.CooperationModeId,
  104 + cooperationMode.CooperationModeNumber,
  105 + cooperationMode.CooperationModeName,
  106 + cooperationMode.Status,
  107 + cooperationMode.Org,
  108 + cooperationMode.Company,
  109 + cooperationMode.Remarks,
  110 + cooperationMode.Operator,
  111 + cooperationMode.OperateTime,
  112 + cooperationMode.UpdatedAt,
  113 + cooperationMode.DeletedAt,
  114 + cooperationMode.CreatedAt,
  115 + cooperationMode.Identify(),
  116 + ); err != nil {
  117 + return cooperationMode, err
  118 + }
  119 + }
  120 + return cooperationMode, nil
  121 +}
  122 +func (repository *CooperationModeRepository) Remove(cooperationMode *domain.CooperationMode) (*domain.CooperationMode, error) {
  123 + tx := repository.transactionContext.PgTx
  124 + cooperationModeModel := new(models.CooperationMode)
  125 + cooperationModeModel.CooperationModeId = cooperationMode.Identify().(int64)
  126 + if _, err := tx.Model(cooperationModeModel).WherePK().Delete(); err != nil {
  127 + return cooperationMode, err
  128 + }
  129 + return cooperationMode, nil
  130 +}
  131 +func (repository *CooperationModeRepository) FindOne(queryOptions map[string]interface{}) (*domain.CooperationMode, error) {
  132 + tx := repository.transactionContext.PgTx
  133 + cooperationModeModel := new(models.CooperationMode)
  134 + query := sqlbuilder.BuildQuery(tx.Model(cooperationModeModel), queryOptions)
  135 + query.SetWhereByQueryOption("cooperation_mode.cooperation_mode_id = ?", "cooperationModeId")
  136 + if err := query.First(); err != nil {
  137 + if err.Error() == "pg: no rows in result set" {
  138 + return nil, fmt.Errorf("没有此资源")
  139 + } else {
  140 + return nil, err
  141 + }
  142 + }
  143 + if cooperationModeModel.CooperationModeId == 0 {
  144 + return nil, nil
  145 + } else {
  146 + return transform.TransformToCooperationModeDomainModelFromPgModels(cooperationModeModel)
  147 + }
  148 +}
  149 +func (repository *CooperationModeRepository) Find(queryOptions map[string]interface{}) (int64, []*domain.CooperationMode, error) {
  150 + tx := repository.transactionContext.PgTx
  151 + var cooperationModeModels []*models.CooperationMode
  152 + cooperationModes := make([]*domain.CooperationMode, 0)
  153 + query := sqlbuilder.BuildQuery(tx.Model(&cooperationModeModels), queryOptions)
  154 + query.SetOffsetAndLimit(20)
  155 + query.SetOrderDirect("cooperation_mode_id", "DESC")
  156 + if count, err := query.SelectAndCount(); err != nil {
  157 + return 0, cooperationModes, err
  158 + } else {
  159 + for _, cooperationModeModel := range cooperationModeModels {
  160 + if cooperationMode, err := transform.TransformToCooperationModeDomainModelFromPgModels(cooperationModeModel); err != nil {
  161 + return 0, cooperationModes, err
  162 + } else {
  163 + cooperationModes = append(cooperationModes, cooperationMode)
  164 + }
  165 + }
  166 + return int64(count), cooperationModes, nil
  167 + }
  168 +}
  169 +func NewCooperationModeRepository(transactionContext *pgTransaction.TransactionContext) (*CooperationModeRepository, error) {
  170 + if transactionContext == nil {
  171 + return nil, fmt.Errorf("transactionContext参数不能为nil")
  172 + } else {
  173 + return &CooperationModeRepository{
  174 + transactionContext: transactionContext,
  175 + }, nil
  176 + }
  177 +}
  1 +package repository
  2 +
  3 +import (
  4 + "fmt"
  5 + "github.com/go-pg/pg/v10"
  6 +
  7 + "github.com/linmadan/egglib-go/persistent/pg/sqlbuilder"
  8 + pgTransaction "github.com/linmadan/egglib-go/transaction/pg"
  9 + "github.com/linmadan/egglib-go/utils/snowflake"
  10 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/domain"
  11 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/pg/models"
  12 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/pg/transform"
  13 +)
  14 +
  15 +type CooperationProjectRepository struct {
  16 + transactionContext *pgTransaction.TransactionContext
  17 +}
  18 +
  19 +func (repository *CooperationProjectRepository) nextIdentify() (int64, error) {
  20 + IdWorker, err := snowflake.NewIdWorker(1)
  21 + if err != nil {
  22 + return 0, err
  23 + }
  24 + id, err := IdWorker.NextId()
  25 + return id, err
  26 +}
  27 +func (repository *CooperationProjectRepository) Save(cooperationProject *domain.CooperationProject) (*domain.CooperationProject, error) {
  28 + sqlBuildFields := []string{
  29 + "cooperation_project_id",
  30 + "cooperation_project_number",
  31 + "cooperation_project_description",
  32 + "cooperation_project_name",
  33 + "cooperation_project_publish_time",
  34 + "cooperation_project_publisher",
  35 + "cooperation_project_sponsor",
  36 + "cooperation_project_undertaker_type",
  37 + "org",
  38 + "company",
  39 + "operator",
  40 + "operate_time",
  41 + "status",
  42 + "updated_at",
  43 + "deleted_at",
  44 + "created_at",
  45 + }
  46 + insertFieldsSnippet := sqlbuilder.SqlFieldsSnippet(sqlBuildFields)
  47 + insertPlaceHoldersSnippet := sqlbuilder.SqlPlaceHoldersSnippet(sqlBuildFields)
  48 + returningFieldsSnippet := sqlbuilder.SqlFieldsSnippet(sqlBuildFields)
  49 + updateFields := sqlbuilder.RemoveSqlFields(sqlBuildFields, "cooperationProject_id")
  50 + updateFieldsSnippet := sqlbuilder.SqlUpdateFieldsSnippet(updateFields)
  51 + tx := repository.transactionContext.PgTx
  52 + if cooperationProject.Identify() == nil {
  53 + cooperationProjectId, err := repository.nextIdentify()
  54 + if err != nil {
  55 + return cooperationProject, err
  56 + } else {
  57 + cooperationProject.CooperationProjectId = cooperationProjectId
  58 + }
  59 + if _, err := tx.QueryOne(
  60 + pg.Scan(
  61 + &cooperationProject.CooperationProjectId,
  62 + &cooperationProject.CooperationProjectNumber,
  63 + &cooperationProject.CooperationProjectDescription,
  64 + &cooperationProject.CooperationProjectName,
  65 + &cooperationProject.CooperationProjectPublishTime,
  66 + &cooperationProject.CooperationProjectPublisher,
  67 + &cooperationProject.CooperationProjectSponsor,
  68 + pg.Array(&cooperationProject.CooperationProjectUndertakerType),
  69 + &cooperationProject.Org,
  70 + &cooperationProject.Company,
  71 + &cooperationProject.Operator,
  72 + &cooperationProject.OperateTime,
  73 + &cooperationProject.Status,
  74 + &cooperationProject.UpdatedAt,
  75 + &cooperationProject.DeletedAt,
  76 + &cooperationProject.CreatedAt,
  77 + ),
  78 + fmt.Sprintf("INSERT INTO cooperation_projects (%s) VALUES (%s) RETURNING %s", insertFieldsSnippet, insertPlaceHoldersSnippet, returningFieldsSnippet),
  79 + cooperationProject.CooperationProjectId,
  80 + cooperationProject.CooperationProjectNumber,
  81 + cooperationProject.CooperationProjectDescription,
  82 + cooperationProject.CooperationProjectName,
  83 + cooperationProject.CooperationProjectPublishTime,
  84 + cooperationProject.CooperationProjectPublisher,
  85 + cooperationProject.CooperationProjectSponsor,
  86 + pg.Array(cooperationProject.CooperationProjectUndertakerType),
  87 + cooperationProject.Org,
  88 + cooperationProject.Company,
  89 + cooperationProject.Operator,
  90 + cooperationProject.OperateTime,
  91 + cooperationProject.Status,
  92 + cooperationProject.UpdatedAt,
  93 + cooperationProject.DeletedAt,
  94 + cooperationProject.CreatedAt,
  95 + ); err != nil {
  96 + return cooperationProject, err
  97 + }
  98 + } else {
  99 + if _, err := tx.QueryOne(
  100 + pg.Scan(
  101 + &cooperationProject.CooperationProjectId,
  102 + &cooperationProject.CooperationProjectNumber,
  103 + &cooperationProject.CooperationProjectDescription,
  104 + &cooperationProject.CooperationProjectName,
  105 + &cooperationProject.CooperationProjectPublishTime,
  106 + &cooperationProject.CooperationProjectPublisher,
  107 + &cooperationProject.CooperationProjectSponsor,
  108 + pg.Array(&cooperationProject.CooperationProjectUndertakerType),
  109 + &cooperationProject.Org,
  110 + &cooperationProject.Company,
  111 + &cooperationProject.Operator,
  112 + &cooperationProject.OperateTime,
  113 + &cooperationProject.Status,
  114 + &cooperationProject.UpdatedAt,
  115 + &cooperationProject.DeletedAt,
  116 + &cooperationProject.CreatedAt,
  117 + ),
  118 + fmt.Sprintf("UPDATE cooperation_projects SET %s WHERE cooperation_project_id=? RETURNING %s", updateFieldsSnippet, returningFieldsSnippet),
  119 + cooperationProject.CooperationProjectId,
  120 + cooperationProject.CooperationProjectNumber,
  121 + cooperationProject.CooperationProjectDescription,
  122 + cooperationProject.CooperationProjectName,
  123 + cooperationProject.CooperationProjectPublishTime,
  124 + cooperationProject.CooperationProjectPublisher,
  125 + cooperationProject.CooperationProjectSponsor,
  126 + pg.Array(cooperationProject.CooperationProjectUndertakerType),
  127 + cooperationProject.Org,
  128 + cooperationProject.Company,
  129 + cooperationProject.Operator,
  130 + cooperationProject.OperateTime,
  131 + cooperationProject.Status,
  132 + cooperationProject.UpdatedAt,
  133 + cooperationProject.DeletedAt,
  134 + cooperationProject.CreatedAt,
  135 + cooperationProject.Identify(),
  136 + ); err != nil {
  137 + return cooperationProject, err
  138 + }
  139 + }
  140 + return cooperationProject, nil
  141 +}
  142 +func (repository *CooperationProjectRepository) Remove(cooperationProject *domain.CooperationProject) (*domain.CooperationProject, error) {
  143 + tx := repository.transactionContext.PgTx
  144 + cooperationProjectModel := new(models.CooperationProject)
  145 + cooperationProjectModel.CooperationProjectId = cooperationProject.Identify().(int64)
  146 + if _, err := tx.Model(cooperationProjectModel).WherePK().Delete(); err != nil {
  147 + return cooperationProject, err
  148 + }
  149 + return cooperationProject, nil
  150 +}
  151 +func (repository *CooperationProjectRepository) FindOne(queryOptions map[string]interface{}) (*domain.CooperationProject, error) {
  152 + tx := repository.transactionContext.PgTx
  153 + cooperationProjectModel := new(models.CooperationProject)
  154 + query := sqlbuilder.BuildQuery(tx.Model(cooperationProjectModel), queryOptions)
  155 + query.SetWhereByQueryOption("cooperation_project.cooperation_project_id = ?", "cooperationProjectId")
  156 + if err := query.First(); err != nil {
  157 + if err.Error() == "pg: no rows in result set" {
  158 + return nil, fmt.Errorf("没有此资源")
  159 + } else {
  160 + return nil, err
  161 + }
  162 + }
  163 + if cooperationProjectModel.CooperationProjectId == 0 {
  164 + return nil, nil
  165 + } else {
  166 + return transform.TransformToCooperationProjectDomainModelFromPgModels(cooperationProjectModel)
  167 + }
  168 +}
  169 +func (repository *CooperationProjectRepository) Find(queryOptions map[string]interface{}) (int64, []*domain.CooperationProject, error) {
  170 + tx := repository.transactionContext.PgTx
  171 + var cooperationProjectModels []*models.CooperationProject
  172 + cooperationProjects := make([]*domain.CooperationProject, 0)
  173 + query := sqlbuilder.BuildQuery(tx.Model(&cooperationProjectModels), queryOptions)
  174 + query.SetOffsetAndLimit(20)
  175 + query.SetOrderDirect("cooperation_project_id", "DESC")
  176 + if count, err := query.SelectAndCount(); err != nil {
  177 + return 0, cooperationProjects, err
  178 + } else {
  179 + for _, cooperationProjectModel := range cooperationProjectModels {
  180 + if cooperationProject, err := transform.TransformToCooperationProjectDomainModelFromPgModels(cooperationProjectModel); err != nil {
  181 + return 0, cooperationProjects, err
  182 + } else {
  183 + cooperationProjects = append(cooperationProjects, cooperationProject)
  184 + }
  185 + }
  186 + return int64(count), cooperationProjects, nil
  187 + }
  188 +}
  189 +func NewCooperationProjectRepository(transactionContext *pgTransaction.TransactionContext) (*CooperationProjectRepository, error) {
  190 + if transactionContext == nil {
  191 + return nil, fmt.Errorf("transactionContext参数不能为nil")
  192 + } else {
  193 + return &CooperationProjectRepository{
  194 + transactionContext: transactionContext,
  195 + }, nil
  196 + }
  197 +}
@@ -3,6 +3,8 @@ package beego @@ -3,6 +3,8 @@ package beego
3 import ( 3 import (
4 "github.com/beego/beego/v2/server/web" 4 "github.com/beego/beego/v2/server/web"
5 "github.com/linmadan/egglib-go/web/beego/filters" 5 "github.com/linmadan/egglib-go/web/beego/filters"
  6 + "os"
  7 + "strconv"
6 8
7 //_ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/port/beego/routers" 9 //_ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/port/beego/routers"
8 . "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/log" 10 . "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/log"
@@ -10,6 +10,6 @@ import ( @@ -10,6 +10,6 @@ import (
10 10
11 func Run() { 11 func Run() {
12 messageHandlerMap := make(map[string]func(message *sarama.ConsumerMessage) error) 12 messageHandlerMap := make(map[string]func(message *sarama.ConsumerMessage) error)
13 - messageHandlerMap[constant.PUSH_MESSAGE_COMMAND] = messageHandler.PushMessageCommandHandler 13 + //messageHandlerMap[constant.PUSH_MESSAGE_COMMAND] = messageHandler.PushMessageCommandHandler
14 saramaConsumer.StartConsume(constant.KAFKA_HOSTS, constant.SERVICE_NAME, messageHandlerMap, Logger) 14 saramaConsumer.StartConsume(constant.KAFKA_HOSTS, constant.SERVICE_NAME, messageHandlerMap, Logger)
15 } 15 }