作者 Administrator

合并分支 'dev' 到 'master'

Dev



查看合并请求 !17
@@ -52,7 +52,6 @@ github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfU @@ -52,7 +52,6 @@ github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfU
52 github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= 52 github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
53 github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 53 github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
54 github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 54 github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
55 -github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs=  
56 github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 55 github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
57 github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= 56 github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
58 github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= 57 github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
@@ -92,7 +91,6 @@ github.com/klauspost/compress v1.8.2 h1:Bx0qjetmNjdFXASH02NSAREKpiaDwkO1DRZ3dV2K @@ -92,7 +91,6 @@ github.com/klauspost/compress v1.8.2 h1:Bx0qjetmNjdFXASH02NSAREKpiaDwkO1DRZ3dV2K
92 github.com/klauspost/compress v1.8.2/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= 91 github.com/klauspost/compress v1.8.2/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A=
93 github.com/klauspost/cpuid v1.2.1 h1:vJi+O/nMdFt0vqm8NZBI6wzALWdA2X+egi0ogNyrC/w= 92 github.com/klauspost/cpuid v1.2.1 h1:vJi+O/nMdFt0vqm8NZBI6wzALWdA2X+egi0ogNyrC/w=
94 github.com/klauspost/cpuid v1.2.1/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= 93 github.com/klauspost/cpuid v1.2.1/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek=
95 -github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk=  
96 github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= 94 github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
97 github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= 95 github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
98 github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= 96 github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
@@ -137,7 +135,6 @@ github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFR @@ -137,7 +135,6 @@ github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFR
137 github.com/siddontang/go v0.0.0-20180604090527-bdc77568d726/go.mod h1:3yhqj7WBBfRhbBlzyOC3gUxftwsU0u8gqevxwIHQpMw= 135 github.com/siddontang/go v0.0.0-20180604090527-bdc77568d726/go.mod h1:3yhqj7WBBfRhbBlzyOC3gUxftwsU0u8gqevxwIHQpMw=
138 github.com/siddontang/ledisdb v0.0.0-20181029004158-becf5f38d373/go.mod h1:mF1DpOSOUiJRMR+FDqaqu3EBqrybQtrDDszLUZ6oxPg= 136 github.com/siddontang/ledisdb v0.0.0-20181029004158-becf5f38d373/go.mod h1:mF1DpOSOUiJRMR+FDqaqu3EBqrybQtrDDszLUZ6oxPg=
139 github.com/siddontang/rdb v0.0.0-20150307021120-fc89ed2e418d/go.mod h1:AMEsy7v5z92TR1JKMkLLoaOQk++LVnOKL3ScbJ8GNGA= 137 github.com/siddontang/rdb v0.0.0-20150307021120-fc89ed2e418d/go.mod h1:AMEsy7v5z92TR1JKMkLLoaOQk++LVnOKL3ScbJ8GNGA=
140 -github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4=  
141 github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= 138 github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
142 github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= 139 github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM=
143 github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= 140 github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
@@ -147,9 +144,7 @@ github.com/ssdb/gossdb v0.0.0-20180723034631-88f6b59b84ec/go.mod h1:QBvMkMya+gXc @@ -147,9 +144,7 @@ github.com/ssdb/gossdb v0.0.0-20180723034631-88f6b59b84ec/go.mod h1:QBvMkMya+gXc
147 github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= 144 github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
148 github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= 145 github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
149 github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= 146 github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
150 -github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=  
151 github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= 147 github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
152 -github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=  
153 github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= 148 github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
154 github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= 149 github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=
155 github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= 150 github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
@@ -184,7 +179,6 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk @@ -184,7 +179,6 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk
184 golang.org/x/crypto v0.0.0-20190404164418-38d8ce5564a5/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= 179 golang.org/x/crypto v0.0.0-20190404164418-38d8ce5564a5/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE=
185 golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 180 golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
186 golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 181 golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
187 -golang.org/x/crypto v0.0.0-20191029031824-8986dd9e96cf h1:fnPsqIDRbCSgumaMCRpoIoF2s4qxv0xSSS0BVZUE/ss=  
188 golang.org/x/crypto v0.0.0-20191029031824-8986dd9e96cf/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= 182 golang.org/x/crypto v0.0.0-20191029031824-8986dd9e96cf/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
189 golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= 183 golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
190 golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a h1:vclmkQCjlDX5OydZ9wv8rBCcS0QyQY66Mpf/7BZbInM= 184 golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a h1:vclmkQCjlDX5OydZ9wv8rBCcS0QyQY66Mpf/7BZbInM=
@@ -206,7 +200,6 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn @@ -206,7 +200,6 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn
206 golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= 200 golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
207 golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 201 golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
208 golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 202 golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
209 -golang.org/x/net v0.0.0-20190923162816-aa69164e4478 h1:l5EDrHhldLYb3ZRHDUhXF7Om7MvYXnkV9/iQNo1lX6g=  
210 golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 203 golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
211 golang.org/x/net v0.0.0-20200904194848-62affa334b73 h1:MXfv8rhZWmFeqX3GNZRsd6vOLoaCHjYEX3qkRo3YBUA= 204 golang.org/x/net v0.0.0-20200904194848-62affa334b73 h1:MXfv8rhZWmFeqX3GNZRsd6vOLoaCHjYEX3qkRo3YBUA=
212 golang.org/x/net v0.0.0-20200904194848-62affa334b73/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= 205 golang.org/x/net v0.0.0-20200904194848-62affa334b73/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
@@ -221,17 +214,13 @@ golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7w @@ -221,17 +214,13 @@ golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7w
221 golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 214 golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
222 golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 215 golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
223 golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 216 golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
224 -golang.org/x/sys v0.0.0-20191010194322-b09406accb47 h1:/XfQ9z7ib8eEJX2hdgFTZJ/ntt0swNk5oYBziWeTCvY=  
225 golang.org/x/sys v0.0.0-20191010194322-b09406accb47/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 217 golang.org/x/sys v0.0.0-20191010194322-b09406accb47/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
226 golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 218 golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
227 -golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae h1:/WDfKMnPU+m5M4xB+6x4kaepxRw6jWvR5iDRdvjHgy8=  
228 golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 219 golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
229 -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd h1:xhmwyvizuTgC2qz7ZlMluP20uW+C3Rm0FD/WLDX8884=  
230 golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 220 golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
231 golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e h1:AyodaIpKjppX+cBfTASF2E1US3H2JFBj920Ot3rtDjs= 221 golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e h1:AyodaIpKjppX+cBfTASF2E1US3H2JFBj920Ot3rtDjs=
232 golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 222 golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
233 golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 223 golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
234 -golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=  
235 golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= 224 golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
236 golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= 225 golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k=
237 golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= 226 golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
@@ -242,7 +231,6 @@ golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3 @@ -242,7 +231,6 @@ golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3
242 golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= 231 golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
243 golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= 232 golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
244 golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= 233 golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
245 -golang.org/x/tools v0.0.0-20200117065230-39095c1d176c h1:FodBYPZKH5tAN2O60HlglMwXGAeV/4k+NKbli79M/2c=  
246 golang.org/x/tools v0.0.0-20200117065230-39095c1d176c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 234 golang.org/x/tools v0.0.0-20200117065230-39095c1d176c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
247 golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 235 golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
248 golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= 236 golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
@@ -279,7 +267,6 @@ gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkep @@ -279,7 +267,6 @@ gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkep
279 gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= 267 gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
280 gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 268 gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
281 gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 269 gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
282 -gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I=  
283 gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 270 gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
284 gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= 271 gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
285 gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= 272 gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
  1 +package subscriber
  2 +
  3 +import (
  4 + "fmt"
  5 + "github.com/linmadan/egglib-go/core/domain"
  6 + "gitlab.fjmaimaimai.com/linmadan/mmm-worth/pkg/application/factory"
  7 + "gitlab.fjmaimaimai.com/linmadan/mmm-worth/pkg/domain/event"
  8 +)
  9 +
  10 +type WorthServiceSubscriber struct {
  11 +}
  12 +
  13 +func (subscriber *WorthServiceSubscriber) HandleEvent(domainEvent domain.DomainEvent) error {
  14 + worthServiceGateway, err := factory.CreateWorthServiceGateway(nil)
  15 + if err != nil {
  16 + fmt.Println(err.Error())
  17 + return nil
  18 + }
  19 + switch domainEvent.EventType() {
  20 + case event.USER_CHANGE_PHONE:
  21 + phoneChangedEvent := domainEvent.(*event.PhoneChanged)
  22 + data, err := worthServiceGateway.ChangePhoneCallback(phoneChangedEvent.OldPhone, phoneChangedEvent.NewPhone)
  23 + if err != nil {
  24 + fmt.Println(err.Error())
  25 + return nil
  26 + }
  27 + fmt.Println(data)
  28 + break
  29 + }
  30 + return nil
  31 +}
  32 +
  33 +func (subscriber *WorthServiceSubscriber) SubscribedToEventTypes() []string {
  34 + return []string{
  35 + event.USER_CHANGE_PHONE,
  36 + }
  37 +}
@@ -110,5 +110,10 @@ func CreateExchangeSuMoneyService(options map[string]interface{}) (service.Excha @@ -110,5 +110,10 @@ func CreateExchangeSuMoneyService(options map[string]interface{}) (service.Excha
110 return domainService.NewExchangeSuMoneyService(transactionContext) 110 return domainService.NewExchangeSuMoneyService(transactionContext)
111 } 111 }
112 112
113 -  
114 - 113 +func CreateChangePhoneService(options map[string]interface{}) (service.ChangePhoneService, error) {
  114 + var transactionContext *pgTransaction.TransactionContext
  115 + if value, ok := options["transactionContext"]; ok {
  116 + transactionContext = value.(*pgTransaction.TransactionContext)
  117 + }
  118 + return domainService.NewChangePhoneService(transactionContext)
  119 +}
@@ -9,3 +9,7 @@ func CreateAbilityServiceGateway(options map[string]interface{}) (serviceGateway @@ -9,3 +9,7 @@ func CreateAbilityServiceGateway(options map[string]interface{}) (serviceGateway
9 func CreateMmmOpenApiServiceGateway(options map[string]interface{}) (serviceGateway.MmmOpenApiServiceGateway, error) { 9 func CreateMmmOpenApiServiceGateway(options map[string]interface{}) (serviceGateway.MmmOpenApiServiceGateway, error) {
10 return serviceGateway.NewHttplibMmmOpenApiServiceGateway(), nil 10 return serviceGateway.NewHttplibMmmOpenApiServiceGateway(), nil
11 } 11 }
  12 +
  13 +func CreateWorthServiceGateway(options map[string]interface{}) (serviceGateway.WorthServiceGateway, error) {
  14 + return serviceGateway.NewHttplibWorthServiceGateway(), nil
  15 +}
@@ -62,7 +62,7 @@ func (cashPoolService *CashPoolService) CreateCashPool(createCashPoolCommand *co @@ -62,7 +62,7 @@ func (cashPoolService *CashPoolService) CreateCashPool(createCashPoolCommand *co
62 62
63 // 现金池仓储初始化 63 // 现金池仓储初始化
64 var cashPoolRepository domain.CashPoolRepository 64 var cashPoolRepository domain.CashPoolRepository
65 - if value, err := factory.CreateCashPoolRepository(map[string] interface{} { 65 + if value, err := factory.CreateCashPoolRepository(map[string]interface{}{
66 "transactionContext": transactionContext, 66 "transactionContext": transactionContext,
67 }); err != nil { 67 }); err != nil {
68 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 68 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
@@ -271,7 +271,7 @@ func (cashPoolService *CashPoolService) GetCashPool(getCashPoolQuery *query.GetC @@ -271,7 +271,7 @@ func (cashPoolService *CashPoolService) GetCashPool(getCashPoolQuery *query.GetC
271 271
272 // 现金池仓储初始化 272 // 现金池仓储初始化
273 var cashPoolRepository domain.CashPoolRepository 273 var cashPoolRepository domain.CashPoolRepository
274 - if value, err := factory.CreateCashPoolRepository(map[string] interface{} { 274 + if value, err := factory.CreateCashPoolRepository(map[string]interface{}{
275 "transactionContext": transactionContext, 275 "transactionContext": transactionContext,
276 }); err != nil { 276 }); err != nil {
277 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 277 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
@@ -338,7 +338,7 @@ func (cashPoolService *CashPoolService) GetCashPool(getCashPoolQuery *query.GetC @@ -338,7 +338,7 @@ func (cashPoolService *CashPoolService) GetCashPool(getCashPoolQuery *query.GetC
338 } 338 }
339 // 现金池为空时处理 339 // 现金池为空时处理
340 if count == 0 { 340 if count == 0 {
341 - return map[string] interface{} { 341 + return map[string]interface{}{
342 "cashPoolId": 0, 342 "cashPoolId": 0,
343 "cash": 0, 343 "cash": 0,
344 "companyId": getCashPoolQuery.CompanyId, 344 "companyId": getCashPoolQuery.CompanyId,
@@ -543,7 +543,7 @@ func (cashPoolService *CashPoolService) SearchExchangeCashActivity(activityComma @@ -543,7 +543,7 @@ func (cashPoolService *CashPoolService) SearchExchangeCashActivity(activityComma
543 var t2 = activity.Deadline 543 var t2 = activity.Deadline
544 544
545 // 获取兑换活动前先更新兑换活动倒计时命令 545 // 获取兑换活动前先更新兑换活动倒计时命令
546 - updateExchangeCashActivity := &command.UpdateExchangeCashActivityCommand { 546 + updateExchangeCashActivity := &command.UpdateExchangeCashActivityCommand{
547 ExchangeCashActivityId: activity.ActivityId, 547 ExchangeCashActivityId: activity.ActivityId,
548 CountDown: int64(math.Ceil(t2.Sub(t1).Hours() / 24)), // 计算倒计时 548 CountDown: int64(math.Ceil(t2.Sub(t1).Hours() / 24)), // 计算倒计时
549 Deadline: activity.Deadline, 549 Deadline: activity.Deadline,
@@ -579,7 +579,7 @@ func (cashPoolService *CashPoolService) SearchExchangeCashActivity(activityComma @@ -579,7 +579,7 @@ func (cashPoolService *CashPoolService) SearchExchangeCashActivity(activityComma
579 //suMoney, _ := strconv.ParseFloat(fmt.Sprintf("%.2f", activity.ExchangedSuMoney), 64) 579 //suMoney, _ := strconv.ParseFloat(fmt.Sprintf("%.2f", activity.ExchangedSuMoney), 64)
580 cash, _ := decimal.NewFromFloatWithExponent(activity.ExchangedCash, -2).Float64() 580 cash, _ := decimal.NewFromFloatWithExponent(activity.ExchangedCash, -2).Float64()
581 suMoney, _ := decimal.NewFromFloatWithExponent(activity.ExchangedSuMoney, -2).Float64() 581 suMoney, _ := decimal.NewFromFloatWithExponent(activity.ExchangedSuMoney, -2).Float64()
582 - activityFormat := map[string]interface{} { 582 + activityFormat := map[string]interface{}{
583 "activityId": activity.ActivityId, 583 "activityId": activity.ActivityId,
584 "exchangeActivityName": activity.ExchangeActivityName, 584 "exchangeActivityName": activity.ExchangeActivityName,
585 "companyId": activity.CompanyId, 585 "companyId": activity.CompanyId,
@@ -647,7 +647,7 @@ func (cashPoolService *CashPoolService) ListExchangeCashActivity(listExchangeCas @@ -647,7 +647,7 @@ func (cashPoolService *CashPoolService) ListExchangeCashActivity(listExchangeCas
647 var t2 = activityFound.Deadline.Local() 647 var t2 = activityFound.Deadline.Local()
648 648
649 // 更新兑换现金活动倒计时命令 649 // 更新兑换现金活动倒计时命令
650 - updateExchangeCashActivity := &command.UpdateExchangeCashActivityCommand { 650 + updateExchangeCashActivity := &command.UpdateExchangeCashActivityCommand{
651 ExchangeCashActivityId: activityFound.ActivityId, 651 ExchangeCashActivityId: activityFound.ActivityId,
652 CountDown: int64(math.Ceil(t2.Sub(t1).Hours() / 24)), 652 CountDown: int64(math.Ceil(t2.Sub(t1).Hours() / 24)),
653 Deadline: activityFound.Deadline.Local(), 653 Deadline: activityFound.Deadline.Local(),
@@ -684,7 +684,7 @@ func (cashPoolService *CashPoolService) ListExchangeCashActivity(listExchangeCas @@ -684,7 +684,7 @@ func (cashPoolService *CashPoolService) ListExchangeCashActivity(listExchangeCas
684 //suMoney, _ := strconv.ParseFloat(fmt.Sprintf("%.2f", activityFound.ExchangedSuMoney), 64) 684 //suMoney, _ := strconv.ParseFloat(fmt.Sprintf("%.2f", activityFound.ExchangedSuMoney), 64)
685 cash, _ := decimal.NewFromFloatWithExponent(activityFound.ExchangedCash, -2).Float64() 685 cash, _ := decimal.NewFromFloatWithExponent(activityFound.ExchangedCash, -2).Float64()
686 suMoney, _ := decimal.NewFromFloatWithExponent(activityFound.ExchangedSuMoney, -2).Float64() 686 suMoney, _ := decimal.NewFromFloatWithExponent(activityFound.ExchangedSuMoney, -2).Float64()
687 - activityWithTs := map[string]interface{} { 687 + activityWithTs := map[string]interface{}{
688 "activityId": activityFound.ActivityId, 688 "activityId": activityFound.ActivityId,
689 "exchangeActivityName": activityFound.ExchangeActivityName, 689 "exchangeActivityName": activityFound.ExchangeActivityName,
690 "companyId": activityFound.CompanyId, 690 "companyId": activityFound.CompanyId,
@@ -798,7 +798,7 @@ func (cashPoolService *CashPoolService) GetExchangeCashActivity(getExchangeCashA @@ -798,7 +798,7 @@ func (cashPoolService *CashPoolService) GetExchangeCashActivity(getExchangeCashA
798 var t2 = activityFound.Deadline 798 var t2 = activityFound.Deadline
799 799
800 // 更新兑换现金活动倒计时命令 800 // 更新兑换现金活动倒计时命令
801 - updateExchangeCashActivity := &command.UpdateExchangeCashActivityCommand { 801 + updateExchangeCashActivity := &command.UpdateExchangeCashActivityCommand{
802 ExchangeCashActivityId: activityFound.ActivityId, 802 ExchangeCashActivityId: activityFound.ActivityId,
803 CountDown: int64(math.Ceil(t2.Sub(t1).Hours() / 24)), 803 CountDown: int64(math.Ceil(t2.Sub(t1).Hours() / 24)),
804 Deadline: activityFound.Deadline, 804 Deadline: activityFound.Deadline,
@@ -877,7 +877,7 @@ func (cashPoolService *CashPoolService) UpdateExchangeCashActivity(updateExchang @@ -877,7 +877,7 @@ func (cashPoolService *CashPoolService) UpdateExchangeCashActivity(updateExchang
877 877
878 // 现金池仓储初始化 878 // 现金池仓储初始化
879 var cashPoolRepository domain.CashPoolRepository 879 var cashPoolRepository domain.CashPoolRepository
880 - if value, err := factory.CreateCashPoolRepository(map[string] interface{} { 880 + if value, err := factory.CreateCashPoolRepository(map[string]interface{}{
881 "transactionContext": transactionContext, 881 "transactionContext": transactionContext,
882 }); err != nil { 882 }); err != nil {
883 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 883 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
@@ -970,7 +970,7 @@ func (cashPoolService *CashPoolService) UpdateExchangeCashActivity(updateExchang @@ -970,7 +970,7 @@ func (cashPoolService *CashPoolService) UpdateExchangeCashActivity(updateExchang
970 970
971 if updateExchangeCashActivityCommand.ExchangeRate != activityFoundRate && updateExchangeCashActivityCommand.ExchangeRate != 0 { // 更新兑换活动兑换汇率 971 if updateExchangeCashActivityCommand.ExchangeRate != activityFoundRate && updateExchangeCashActivityCommand.ExchangeRate != 0 { // 更新兑换活动兑换汇率
972 // 判断兑换活动清单中现金总金额是否超过平台未兑换现金值 972 // 判断兑换活动清单中现金总金额是否超过平台未兑换现金值
973 - if activityFoundExchangedSuMoney * updateExchangeCashActivityCommand.ExchangeRate > cashPoolFoundUnExchangeCash { 973 + if activityFoundExchangedSuMoney*updateExchangeCashActivityCommand.ExchangeRate > cashPoolFoundUnExchangeCash {
974 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "已超过投入现金池的未兑换现金") 974 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "已超过投入现金池的未兑换现金")
975 } 975 }
976 976
@@ -988,7 +988,7 @@ func (cashPoolService *CashPoolService) UpdateExchangeCashActivity(updateExchang @@ -988,7 +988,7 @@ func (cashPoolService *CashPoolService) UpdateExchangeCashActivity(updateExchang
988 988
989 // 更新兑换清单命令 989 // 更新兑换清单命令
990 exchangeCash, _ := decimal.NewFromFloat(updateExchangeCashActivityCommand.ExchangeRate).Mul(decimal.NewFromFloat(personFoundExchangedSuMoney)).Float64() 990 exchangeCash, _ := decimal.NewFromFloat(updateExchangeCashActivityCommand.ExchangeRate).Mul(decimal.NewFromFloat(personFoundExchangedSuMoney)).Float64()
991 - updateExchangeCashPerson := &command.UpdateExchangeCashPersonCommand { 991 + updateExchangeCashPerson := &command.UpdateExchangeCashPersonCommand{
992 //ExchangedCash: updateExchangeCashActivityCommand.ExchangeRate * personFoundExchangedSuMoney, 992 //ExchangedCash: updateExchangeCashActivityCommand.ExchangeRate * personFoundExchangedSuMoney,
993 ExchangedCash: exchangeCash, 993 ExchangedCash: exchangeCash,
994 ExchangedSuMoney: personFoundExchangedSuMoney, 994 ExchangedSuMoney: personFoundExchangedSuMoney,
@@ -1000,7 +1000,7 @@ func (cashPoolService *CashPoolService) UpdateExchangeCashActivity(updateExchang @@ -1000,7 +1000,7 @@ func (cashPoolService *CashPoolService) UpdateExchangeCashActivity(updateExchang
1000 } 1000 }
1001 1001
1002 // 保存素币兑换清单更新 1002 // 保存素币兑换清单更新
1003 - if _, err := exchangeCashPersonListRepository.Save(personFound);err != nil { 1003 + if _, err := exchangeCashPersonListRepository.Save(personFound); err != nil {
1004 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 1004 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
1005 } 1005 }
1006 } 1006 }
@@ -1169,7 +1169,7 @@ func (cashPoolService *CashPoolService) UpdateExchangeCashPerson(updateExchangeC @@ -1169,7 +1169,7 @@ func (cashPoolService *CashPoolService) UpdateExchangeCashPerson(updateExchangeC
1169 1169
1170 // 现金池仓储初始化 1170 // 现金池仓储初始化
1171 var cashPoolRepository domain.CashPoolRepository 1171 var cashPoolRepository domain.CashPoolRepository
1172 - if value, err := factory.CreateCashPoolRepository(map[string] interface{} { 1172 + if value, err := factory.CreateCashPoolRepository(map[string]interface{}{
1173 "transactionContext": transactionContext, 1173 "transactionContext": transactionContext,
1174 }); err != nil { 1174 }); err != nil {
1175 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 1175 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
@@ -1218,9 +1218,10 @@ func (cashPoolService *CashPoolService) UpdateExchangeCashPerson(updateExchangeC @@ -1218,9 +1218,10 @@ func (cashPoolService *CashPoolService) UpdateExchangeCashPerson(updateExchangeC
1218 activityFoundExchangedSuMoney := activityFound.ExchangedSuMoney 1218 activityFoundExchangedSuMoney := activityFound.ExchangedSuMoney
1219 activityFoundExchangedCash := activityFound.ExchangedCash 1219 activityFoundExchangedCash := activityFound.ExchangedCash
1220 1220
1221 - // TODO 更改:根据uid和companyId,判断当前员工是否有效 1221 + //更改:根据uid和companyId,判断当前员工是否有效
1222 getEmployee := map[string]interface{}{ 1222 getEmployee := map[string]interface{}{
1223 - "account": personFound.EmployeeInfo.EmployeeAccount, 1223 + "uid": personFound.EmployeeInfo.Uid,
  1224 + //"account": personFound.EmployeeInfo.EmployeeAccount,
1224 "companyId": activityFound.CompanyId, 1225 "companyId": activityFound.CompanyId,
1225 } 1226 }
1226 employeeFound, err := employeeRepository.FindOne(getEmployee) 1227 employeeFound, err := employeeRepository.FindOne(getEmployee)
@@ -1338,7 +1339,7 @@ func (cashPoolService *CashPoolService) UpdateExchangeCashPerson(updateExchangeC @@ -1338,7 +1339,7 @@ func (cashPoolService *CashPoolService) UpdateExchangeCashPerson(updateExchangeC
1338 1339
1339 // 判断是否超过平台未兑换现金 1340 // 判断是否超过平台未兑换现金
1340 if activityUpdated.ExchangedSuMoney > activityFoundExchangedSuMoney { 1341 if activityUpdated.ExchangedSuMoney > activityFoundExchangedSuMoney {
1341 - if (activityUpdated.ExchangedSuMoney - activityFoundExchangedSuMoney) * activityUpdated.Rate > cashPoolFoundUnExchangeCash { 1342 + if (activityUpdated.ExchangedSuMoney-activityFoundExchangedSuMoney)*activityUpdated.Rate > cashPoolFoundUnExchangeCash {
1342 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "已超过投入现金池的未兑换现金") 1343 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "已超过投入现金池的未兑换现金")
1343 } 1344 }
1344 } 1345 }
@@ -1443,7 +1444,7 @@ func (cashPoolService *CashPoolService) ImportCreateExchangeCashPerson(createExc @@ -1443,7 +1444,7 @@ func (cashPoolService *CashPoolService) ImportCreateExchangeCashPerson(createExc
1443 1444
1444 // 现金池仓储初始化 1445 // 现金池仓储初始化
1445 var cashPoolRepository domain.CashPoolRepository 1446 var cashPoolRepository domain.CashPoolRepository
1446 - if value, err := factory.CreateCashPoolRepository(map[string] interface{} { 1447 + if value, err := factory.CreateCashPoolRepository(map[string]interface{}{
1447 "transactionContext": transactionContext, 1448 "transactionContext": transactionContext,
1448 }); err != nil { 1449 }); err != nil {
1449 return []interface{}{}, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 1450 return []interface{}{}, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
@@ -1535,8 +1536,9 @@ func (cashPoolService *CashPoolService) ImportCreateExchangeCashPerson(createExc @@ -1535,8 +1536,9 @@ func (cashPoolService *CashPoolService) ImportCreateExchangeCashPerson(createExc
1535 cashPoolFoundUnExchangeCash := cashPoolFound.UnExchangeCash // 当前公司现金池未兑换现金 1536 cashPoolFoundUnExchangeCash := cashPoolFound.UnExchangeCash // 当前公司现金池未兑换现金
1536 cashPoolFoundExchangedCash := cashPoolFound.ExchangedCash // 当前公司现金池已兑换现金 1537 cashPoolFoundExchangedCash := cashPoolFound.ExchangedCash // 当前公司现金池已兑换现金
1537 1538
1538 - // TODO 更改:根据uid和companyId,判断当前员工是否有效 1539 + // 更改:根据uid、account和companyId,判断当前员工是否有效(身份有效、手机账号有效)
1539 getEmployee := map[string]interface{}{ 1540 getEmployee := map[string]interface{}{
  1541 + "uid": createExchangeCashPersonCommand.Uid,
1540 "account": createExchangeCashPersonCommand.PersonAccount, 1542 "account": createExchangeCashPersonCommand.PersonAccount,
1541 "companyId": activityFound.CompanyId, 1543 "companyId": activityFound.CompanyId,
1542 } 1544 }
@@ -1563,8 +1565,9 @@ func (cashPoolService *CashPoolService) ImportCreateExchangeCashPerson(createExc @@ -1563,8 +1565,9 @@ func (cashPoolService *CashPoolService) ImportCreateExchangeCashPerson(createExc
1563 } 1565 }
1564 employeeFoundSuMoney := employeeFound.SuMoney // 当前导入员工持有的素币值 1566 employeeFoundSuMoney := employeeFound.SuMoney // 当前导入员工持有的素币值
1565 1567
1566 - // TODO 更改:根据uid和activityId判断当前员工是否已经在素币兑换清单中, 1568 + // 更改:根据uid、employeeAccount和activityId判断当前员工是否已经在素币兑换清单中,
1567 personFound, _ := exchangeCashPersonListRepository.FindOne(map[string]interface{}{ 1569 personFound, _ := exchangeCashPersonListRepository.FindOne(map[string]interface{}{
  1570 + "uid": employeeFound.EmployeeInfo.Uid,
1568 "employeeAccount": employeeFound.EmployeeInfo.EmployeeAccount, 1571 "employeeAccount": employeeFound.EmployeeInfo.EmployeeAccount,
1569 "activityId": activityFound.ActivityId, 1572 "activityId": activityFound.ActivityId,
1570 }) 1573 })
@@ -1693,7 +1696,7 @@ func (cashPoolService *CashPoolService) ImportCreateExchangeCashPerson(createExc @@ -1693,7 +1696,7 @@ func (cashPoolService *CashPoolService) ImportCreateExchangeCashPerson(createExc
1693 } 1696 }
1694 1697
1695 // 判断是否超过平台未兑换现金 1698 // 判断是否超过平台未兑换现金
1696 - if createExchangeCashPersonCommand.ExchangedSuMoney * activityFound.Rate > cashPoolFoundUnExchangeCash { 1699 + if createExchangeCashPersonCommand.ExchangedSuMoney*activityFound.Rate > cashPoolFoundUnExchangeCash {
1697 row := []interface{}{ 1700 row := []interface{}{
1698 createExchangeCashPersonCommand.PersonName, 1701 createExchangeCashPersonCommand.PersonName,
1699 createExchangeCashPersonCommand.PersonAccount, 1702 createExchangeCashPersonCommand.PersonAccount,
@@ -2271,7 +2274,7 @@ func (cashPoolService *CashPoolService) CreateExchangeCashPerson(createExchangeC @@ -2271,7 +2274,7 @@ func (cashPoolService *CashPoolService) CreateExchangeCashPerson(createExchangeC
2271 2274
2272 // 现金池仓储初始化 2275 // 现金池仓储初始化
2273 var cashPoolRepository domain.CashPoolRepository 2276 var cashPoolRepository domain.CashPoolRepository
2274 - if value, err := factory.CreateCashPoolRepository(map[string] interface{} { 2277 + if value, err := factory.CreateCashPoolRepository(map[string]interface{}{
2275 "transactionContext": transactionContext, 2278 "transactionContext": transactionContext,
2276 }); err != nil { 2279 }); err != nil {
2277 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 2280 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
@@ -2429,7 +2432,7 @@ func (cashPoolService *CashPoolService) CreateExchangeCashPerson(createExchangeC @@ -2429,7 +2432,7 @@ func (cashPoolService *CashPoolService) CreateExchangeCashPerson(createExchangeC
2429 cashPoolFoundExchangedCash := cashPoolsFound[0].ExchangedCash 2432 cashPoolFoundExchangedCash := cashPoolsFound[0].ExchangedCash
2430 2433
2431 // 判断是否超过平台未兑换现金 2434 // 判断是否超过平台未兑换现金
2432 - if createExchangeCashPersonCommand.ExchangedSuMoney * activityFound.Rate > cashPoolFoundUnExchangeCash { 2435 + if createExchangeCashPersonCommand.ExchangedSuMoney*activityFound.Rate > cashPoolFoundUnExchangeCash {
2433 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "已超过投入现金池的未兑换现金") 2436 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "已超过投入现金池的未兑换现金")
2434 } 2437 }
2435 2438
@@ -2665,7 +2668,7 @@ func (cashPoolService *CashPoolService) RemoveExchangeCashPerson(removeExchangeC @@ -2665,7 +2668,7 @@ func (cashPoolService *CashPoolService) RemoveExchangeCashPerson(removeExchangeC
2665 2668
2666 // 现金池仓储初始化 2669 // 现金池仓储初始化
2667 var cashPoolRepository domain.CashPoolRepository 2670 var cashPoolRepository domain.CashPoolRepository
2668 - if value, err := factory.CreateCashPoolRepository(map[string] interface{} { 2671 + if value, err := factory.CreateCashPoolRepository(map[string]interface{}{
2669 "transactionContext": transactionContext, 2672 "transactionContext": transactionContext,
2670 }); err != nil { 2673 }); err != nil {
2671 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 2674 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
@@ -2999,17 +3002,47 @@ func (cashPoolService *CashPoolService) ExchangeListRanking(exchangeListRankingQ @@ -2999,17 +3002,47 @@ func (cashPoolService *CashPoolService) ExchangeListRanking(exchangeListRankingQ
2999 } 3002 }
3000 3003
3001 // 兑换素币清单排行榜 3004 // 兑换素币清单排行榜
3002 - for i, _ := range exchangeCashListRankingStatistics["people"].([]struct{Uid int64; EmployeeName string; SuMoney float64; Cash float64; Ranking int}) {  
3003 - uid := exchangeCashListRankingStatistics["people"].([]struct{Uid int64; EmployeeName string; SuMoney float64; Cash float64; Ranking int})[i].Uid 3005 + for i, _ := range exchangeCashListRankingStatistics["people"].([]struct {
  3006 + Uid int64
  3007 + EmployeeName string
  3008 + SuMoney float64
  3009 + Cash float64
  3010 + Ranking int
  3011 + }) {
  3012 + uid := exchangeCashListRankingStatistics["people"].([]struct {
  3013 + Uid int64
  3014 + EmployeeName string
  3015 + SuMoney float64
  3016 + Cash float64
  3017 + Ranking int
  3018 + })[i].Uid
3004 if uidName[uid] != nil { 3019 if uidName[uid] != nil {
3005 - exchangeCashListRankingStatistics["people"].([]struct{Uid int64; EmployeeName string; SuMoney float64; Cash float64; Ranking int})[i].EmployeeName = uidName[uid].(string) 3020 + exchangeCashListRankingStatistics["people"].([]struct {
  3021 + Uid int64
  3022 + EmployeeName string
  3023 + SuMoney float64
  3024 + Cash float64
  3025 + Ranking int
  3026 + })[i].EmployeeName = uidName[uid].(string)
3006 } 3027 }
3007 } 3028 }
3008 3029
3009 // 个人素币兑换清单 3030 // 个人素币兑换清单
3010 if exchangeCashListRankingStatistics["currentEmployee"] != nil { 3031 if exchangeCashListRankingStatistics["currentEmployee"] != nil {
3011 - currentEmployeeExchangeCashList := exchangeCashListRankingStatistics["currentEmployee"].(struct{Uid int64;EmployeeName string;SuMoney float64; Cash float64;Ranking int})  
3012 - uidExchangeCashList := exchangeCashListRankingStatistics["currentEmployee"].(struct{Uid int64;EmployeeName string;SuMoney float64; Cash float64;Ranking int}).Uid 3032 + currentEmployeeExchangeCashList := exchangeCashListRankingStatistics["currentEmployee"].(struct {
  3033 + Uid int64
  3034 + EmployeeName string
  3035 + SuMoney float64
  3036 + Cash float64
  3037 + Ranking int
  3038 + })
  3039 + uidExchangeCashList := exchangeCashListRankingStatistics["currentEmployee"].(struct {
  3040 + Uid int64
  3041 + EmployeeName string
  3042 + SuMoney float64
  3043 + Cash float64
  3044 + Ranking int
  3045 + }).Uid
3013 if uidName[uidExchangeCashList] != nil { 3046 if uidName[uidExchangeCashList] != nil {
3014 currentEmployeeExchangeCashList.EmployeeName = uidName[uidExchangeCashList].(string) 3047 currentEmployeeExchangeCashList.EmployeeName = uidName[uidExchangeCashList].(string)
3015 } 3048 }
@@ -17,11 +17,11 @@ import ( @@ -17,11 +17,11 @@ import (
17 "gitlab.fjmaimaimai.com/linmadan/mmm-worth/pkg/infrastructure/dao" 17 "gitlab.fjmaimaimai.com/linmadan/mmm-worth/pkg/infrastructure/dao"
18 ) 18 )
19 19
20 -// 任务服务 20 +// TaskService 任务服务
21 type TaskService struct { 21 type TaskService struct {
22 } 22 }
23 23
24 -// 对抢单任务进行确认 24 +// ConfirmRobTask 对抢单任务进行确认
25 func (taskService *TaskService) ConfirmRobTask(confirmRobTaskCommand *command.ConfirmRobTaskCommand) (interface{}, error) { 25 func (taskService *TaskService) ConfirmRobTask(confirmRobTaskCommand *command.ConfirmRobTaskCommand) (interface{}, error) {
26 if err := confirmRobTaskCommand.ValidateCommand(); err != nil { 26 if err := confirmRobTaskCommand.ValidateCommand(); err != nil {
27 return nil, application.ThrowError(application.ARG_ERROR, err.Error()) 27 return nil, application.ThrowError(application.ARG_ERROR, err.Error())
@@ -935,7 +935,7 @@ func (taskService *TaskService) CreateTask(createTaskCommand *command.CreateTask @@ -935,7 +935,7 @@ func (taskService *TaskService) CreateTask(createTaskCommand *command.CreateTask
935 if sponsorInvalid == nil { 935 if sponsorInvalid == nil {
936 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "无效的发布者") 936 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "无效的发布者")
937 } 937 }
938 - return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "无效的发布者:"+ sponsorInvalid.EmployeeInfo.EmployeeName) 938 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "无效的发布者:"+sponsorInvalid.EmployeeInfo.EmployeeName)
939 } 939 }
940 940
941 // 获取任务指派人 941 // 获取任务指派人
@@ -959,7 +959,7 @@ func (taskService *TaskService) CreateTask(createTaskCommand *command.CreateTask @@ -959,7 +959,7 @@ func (taskService *TaskService) CreateTask(createTaskCommand *command.CreateTask
959 if employeeInvalid == nil { 959 if employeeInvalid == nil {
960 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "无效的指派人员") 960 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "无效的指派人员")
961 } 961 }
962 - return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "无效的指派人员:" + employeeInvalid.EmployeeInfo.EmployeeName) 962 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "无效的指派人员:"+employeeInvalid.EmployeeInfo.EmployeeName)
963 } 963 }
964 assignedPerson = employee.EmployeeInfo 964 assignedPerson = employee.EmployeeInfo
965 } 965 }
@@ -1308,7 +1308,7 @@ func (taskService *TaskService) UpdateTask(updateTaskCommand *command.UpdateTask @@ -1308,7 +1308,7 @@ func (taskService *TaskService) UpdateTask(updateTaskCommand *command.UpdateTask
1308 if employeeInvalid == nil { 1308 if employeeInvalid == nil {
1309 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "无效的指派人员") 1309 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "无效的指派人员")
1310 } 1310 }
1311 - return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "无效的指派人员:" + employeeInvalid.EmployeeInfo.EmployeeName) 1311 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "无效的指派人员:"+employeeInvalid.EmployeeInfo.EmployeeName)
1312 } 1312 }
1313 updateData["assignedPerson"] = employee.EmployeeInfo 1313 updateData["assignedPerson"] = employee.EmployeeInfo
1314 } else { 1314 } else {
@@ -3,9 +3,11 @@ package service @@ -3,9 +3,11 @@ package service
3 import ( 3 import (
4 "encoding/json" 4 "encoding/json"
5 "github.com/linmadan/egglib-go/core/application" 5 "github.com/linmadan/egglib-go/core/application"
  6 + "gitlab.fjmaimaimai.com/linmadan/mmm-worth/pkg/application/event/subscriber"
6 "gitlab.fjmaimaimai.com/linmadan/mmm-worth/pkg/application/factory" 7 "gitlab.fjmaimaimai.com/linmadan/mmm-worth/pkg/application/factory"
7 "gitlab.fjmaimaimai.com/linmadan/mmm-worth/pkg/application/unifiedUserCenter/command" 8 "gitlab.fjmaimaimai.com/linmadan/mmm-worth/pkg/application/unifiedUserCenter/command"
8 "gitlab.fjmaimaimai.com/linmadan/mmm-worth/pkg/domain" 9 "gitlab.fjmaimaimai.com/linmadan/mmm-worth/pkg/domain"
  10 + "gitlab.fjmaimaimai.com/linmadan/mmm-worth/pkg/domain/service"
9 "gitlab.fjmaimaimai.com/linmadan/mmm-worth/pkg/infrastructure/dao" 11 "gitlab.fjmaimaimai.com/linmadan/mmm-worth/pkg/infrastructure/dao"
10 "time" 12 "time"
11 ) 13 )
@@ -27,8 +29,9 @@ func (unifiedUserCenterService *UnifiedUserCenterService) SyncEmployeeCallback(s @@ -27,8 +29,9 @@ func (unifiedUserCenterService *UnifiedUserCenterService) SyncEmployeeCallback(s
27 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) 29 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
28 } 30 }
29 defer func() { 31 defer func() {
30 - transactionContext.RollbackTransaction() 32 + _ = transactionContext.RollbackTransaction()
31 }() 33 }()
  34 +
32 var employeeRepository domain.EmployeeRepository 35 var employeeRepository domain.EmployeeRepository
33 if value, err := factory.CreateEmployeeRepository(map[string]interface{}{ 36 if value, err := factory.CreateEmployeeRepository(map[string]interface{}{
34 "transactionContext": transactionContext, 37 "transactionContext": transactionContext,
@@ -37,6 +40,7 @@ func (unifiedUserCenterService *UnifiedUserCenterService) SyncEmployeeCallback(s @@ -37,6 +40,7 @@ func (unifiedUserCenterService *UnifiedUserCenterService) SyncEmployeeCallback(s
37 } else { 40 } else {
38 employeeRepository = value 41 employeeRepository = value
39 } 42 }
  43 +
40 var employeeDao *dao.EmployeeDao 44 var employeeDao *dao.EmployeeDao
41 if value, err := factory.CreateEmployeeDao(map[string]interface{}{ 45 if value, err := factory.CreateEmployeeDao(map[string]interface{}{
42 "transactionContext": transactionContext, 46 "transactionContext": transactionContext,
@@ -45,10 +49,36 @@ func (unifiedUserCenterService *UnifiedUserCenterService) SyncEmployeeCallback(s @@ -45,10 +49,36 @@ func (unifiedUserCenterService *UnifiedUserCenterService) SyncEmployeeCallback(s
45 } else { 49 } else {
46 employeeDao = value 50 employeeDao = value
47 } 51 }
  52 +
  53 + var cashPoolDao *dao.CashPoolDao
  54 + if value, err := factory.CreateCashPoolDao(map[string]interface{}{
  55 + "transactionContext": transactionContext,
  56 + }); err != nil {
  57 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  58 + } else {
  59 + cashPoolDao = value
  60 + }
  61 +
  62 + // 修改手机号事件订阅初始化
  63 + var changePhoneService service.ChangePhoneService
  64 + if value, err := factory.CreateChangePhoneService(map[string]interface{}{
  65 + "transactionContext": transactionContext,
  66 + }); err != nil {
  67 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  68 + } else {
  69 + changePhoneService = value
  70 + err := changePhoneService.Subscribe(&subscriber.WorthServiceSubscriber{})
  71 + if err != nil {
  72 + return nil, err
  73 + }
  74 + }
  75 +
48 var companyId int64 76 var companyId int64
49 var uid int64 77 var uid int64
50 var employeeName string 78 var employeeName string
51 var employeeAccount string 79 var employeeAccount string
  80 + var oldPhone string
  81 + var newPhone string
52 var employeeAvatarUrl string 82 var employeeAvatarUrl string
53 var isPrincipal bool 83 var isPrincipal bool
54 var status int 84 var status int
@@ -74,6 +104,12 @@ func (unifiedUserCenterService *UnifiedUserCenterService) SyncEmployeeCallback(s @@ -74,6 +104,12 @@ func (unifiedUserCenterService *UnifiedUserCenterService) SyncEmployeeCallback(s
74 if value, ok := data["avatar"]; ok { 104 if value, ok := data["avatar"]; ok {
75 employeeAvatarUrl = value.(string) 105 employeeAvatarUrl = value.(string)
76 } 106 }
  107 + if value, ok := data["old_phone"]; ok {
  108 + oldPhone = value.(string)
  109 + }
  110 + if value, ok := data["new_phone"]; ok {
  111 + newPhone = value.(string)
  112 + }
77 if value, ok := data["admin_type"]; ok { 113 if value, ok := data["admin_type"]; ok {
78 if int(value.(float64)) == 2 { 114 if int(value.(float64)) == 2 {
79 isPrincipal = true 115 isPrincipal = true
@@ -99,6 +135,7 @@ func (unifiedUserCenterService *UnifiedUserCenterService) SyncEmployeeCallback(s @@ -99,6 +135,7 @@ func (unifiedUserCenterService *UnifiedUserCenterService) SyncEmployeeCallback(s
99 editEmployees = append(editEmployees, editEmployee.(map[string]interface{})) 135 editEmployees = append(editEmployees, editEmployee.(map[string]interface{}))
100 } 136 }
101 } 137 }
  138 +
102 if syncEmployeeCallbackCommand.Module == "employee" { 139 if syncEmployeeCallbackCommand.Module == "employee" {
103 switch syncEmployeeCallbackCommand.Action { 140 switch syncEmployeeCallbackCommand.Action {
104 case "import": 141 case "import":
@@ -247,6 +284,36 @@ func (unifiedUserCenterService *UnifiedUserCenterService) SyncEmployeeCallback(s @@ -247,6 +284,36 @@ func (unifiedUserCenterService *UnifiedUserCenterService) SyncEmployeeCallback(s
247 return false, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) 284 return false, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
248 } 285 }
249 break 286 break
  287 + case "changePhoneAllCompany": // 修改手机号
  288 + // 修改用户数据
  289 + if ok, err := employeeDao.EmployeeExist(oldPhone); err != nil {
  290 + return false, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  291 + } else {
  292 + if ok {
  293 + err := employeeDao.ChangePhone(oldPhone, newPhone)
  294 + if err != nil {
  295 + return false, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  296 + }
  297 + }
  298 + }
  299 +
  300 + // 修改业务数据-素币兑换清单
  301 + if ok, err := cashPoolDao.ExchangeCashPersonListExist(oldPhone); err != nil {
  302 + return false, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  303 + } else {
  304 + if ok {
  305 + errUpdateExchangeCashPersonList := cashPoolDao.UpdateExchangeCashPersonListUserInfo(oldPhone, newPhone)
  306 + if errUpdateExchangeCashPersonList != nil {
  307 + return false, application.ThrowError(application.TRANSACTION_ERROR, errUpdateExchangeCashPersonList.Error())
  308 + }
  309 + }
  310 + }
  311 +
  312 + // 发布修改手机号事件
  313 + if err := changePhoneService.ChangePhone(oldPhone, newPhone); err != nil {
  314 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  315 + }
  316 + break
250 default: 317 default:
251 return false, nil 318 return false, nil
252 } 319 }
@@ -6,6 +6,7 @@ const SERVICE_NAME = "mmm-worth" @@ -6,6 +6,7 @@ const SERVICE_NAME = "mmm-worth"
6 6
7 var ABILITY_SERVICE_HOST = "https://suplus-worth-app-gateway-dev.fjmaimaimai.com" 7 var ABILITY_SERVICE_HOST = "https://suplus-worth-app-gateway-dev.fjmaimaimai.com"
8 var MMM_OPEN_API_SERVICE_HOST = "https://mmm-open-api-dev.fjmaimaimai.com" 8 var MMM_OPEN_API_SERVICE_HOST = "https://mmm-open-api-dev.fjmaimaimai.com"
  9 +var WORTH_SERVICE_GATEWAY_HOST = "https://suplus-worth-app-gateway-dev.fjmaimaimai.com"
9 10
10 var LOG_LEVEL = "debug" 11 var LOG_LEVEL = "debug"
11 var LOG_File = "logs/app.log" 12 var LOG_File = "logs/app.log"
@@ -2,7 +2,7 @@ package constant @@ -2,7 +2,7 @@ package constant
2 2
3 import "os" 3 import "os"
4 4
5 -var POSTGRESQL_DB_NAME = "mmm_worth" 5 +var POSTGRESQL_DB_NAME = "mmmworth_dev"
6 var POSTGRESQL_USER = "postgres" 6 var POSTGRESQL_USER = "postgres"
7 var POSTGRESQL_PASSWORD = "1993618jack" 7 var POSTGRESQL_PASSWORD = "1993618jack"
8 var POSTGRESQL_HOST = "127.0.0.1" 8 var POSTGRESQL_HOST = "127.0.0.1"
  1 +package event
  2 +
  3 +import coreDomain "github.com/linmadan/egglib-go/core/domain"
  4 +
  5 +const USER_CHANGE_PHONE = "user-change-phone"
  6 +
  7 +type PhoneChanged struct {
  8 + coreDomain.BaseEvent
  9 + OldPhone string `json:"oldPhone"` // 旧手机号
  10 + NewPhone string `json:"newPhone"` // 新手机号
  11 +}
  12 +
  13 +func (event *PhoneChanged) EventType() string {
  14 + return USER_CHANGE_PHONE
  15 +}
@@ -54,7 +54,6 @@ func (exchangeCashActivity *ExchangeCashActivity) Update(data map[string]interfa @@ -54,7 +54,6 @@ func (exchangeCashActivity *ExchangeCashActivity) Update(data map[string]interfa
54 if createTime, ok := data["createTime"]; ok && createTime.(time.Time).IsZero() { 54 if createTime, ok := data["createTime"]; ok && createTime.(time.Time).IsZero() {
55 exchangeCashActivity.CreateTime = createTime.(time.Time) 55 exchangeCashActivity.CreateTime = createTime.(time.Time)
56 } 56 }
57 - exchangeCashActivity.CreateTime = time.Now()  
58 return nil 57 return nil
59 } 58 }
60 59
  1 +package service
  2 +
  3 +import coreDomain "github.com/linmadan/egglib-go/core/domain"
  4 +
  5 +type ChangePhoneService interface {
  6 + coreDomain.DomainEventPublisher
  7 + ChangePhone(oldPhone string, newPhone string) error
  8 +}
@@ -6,3 +6,12 @@ @@ -6,3 +6,12 @@
6 6
7 package service 7 package service
8 8
  9 +import (
  10 + coreDomain "github.com/linmadan/egglib-go/core/domain"
  11 + "gitlab.fjmaimaimai.com/linmadan/mmm-worth/pkg/domain"
  12 +)
  13 +
  14 +type ExchangeCashService interface {
  15 + coreDomain.DomainEventPublisher
  16 + ExchangeCash(uid int64, operatorUid int64, suMoney float64, activityId int64, recordDescription string) (*domain.SuMoneyTransactionRecord, error)
  17 +}
  1 +package dao
  2 +
  3 +import (
  4 + "fmt"
  5 + pgTransaction "github.com/linmadan/egglib-go/transaction/pg"
  6 +)
  7 +
  8 +type BidInfosDao struct {
  9 + transactionContext *pgTransaction.TransactionContext
  10 +}
  11 +
  12 +//TODO ChangeBidInfosSuccessfulBidderAccount
  13 +func (dao *BidInfosDao) ChangeBidInfosSuccessfulBidderAccount(uid int64, newAccount string) {
  14 +
  15 +}
  16 +
  17 +func NewBidInfosDao(transactionContext *pgTransaction.TransactionContext) (*BidInfosDao, error) {
  18 + if transactionContext == nil {
  19 + return nil, fmt.Errorf("transactionContext参数不能为nil")
  20 + } else {
  21 + return &BidInfosDao{
  22 + transactionContext: transactionContext,
  23 + }, nil
  24 + }
  25 +}
  1 +package dao
  2 +
  3 +import (
  4 + "fmt"
  5 + pgTransaction "github.com/linmadan/egglib-go/transaction/pg"
  6 +)
  7 +
  8 +type BidderInfosDao struct {
  9 + transactionContext *pgTransaction.TransactionContext
  10 +}
  11 +
  12 +//TODO ChangeBidderInfosBidderAccount
  13 +func (dao *BidderInfosDao) ChangeBidderInfosBidderAccount() {
  14 +
  15 +}
  16 +
  17 +func NewBidderInfosDao(transactionContext *pgTransaction.TransactionContext) (*BidderInfosDao, error) {
  18 + if transactionContext == nil {
  19 + return nil, fmt.Errorf("transactionContext参数不能为nil")
  20 + } else {
  21 + return &BidderInfosDao{
  22 + transactionContext: transactionContext,
  23 + }, nil
  24 + }
  25 +}
@@ -2,6 +2,7 @@ package dao @@ -2,6 +2,7 @@ package dao
2 2
3 import ( 3 import (
4 "fmt" 4 "fmt"
  5 + "github.com/go-pg/pg"
5 pgTransaction "github.com/linmadan/egglib-go/transaction/pg" 6 pgTransaction "github.com/linmadan/egglib-go/transaction/pg"
6 "gitlab.fjmaimaimai.com/linmadan/mmm-worth/pkg/infrastructure/pg/models" 7 "gitlab.fjmaimaimai.com/linmadan/mmm-worth/pkg/infrastructure/pg/models"
7 ) 8 )
@@ -19,13 +20,13 @@ func (dao *CashPoolDao) CalculateActivityExchangedSuMoney(activityId int64) (map @@ -19,13 +20,13 @@ func (dao *CashPoolDao) CalculateActivityExchangedSuMoney(activityId int64) (map
19 if err := tx.Model(exchangeCashPersonListModels). 20 if err := tx.Model(exchangeCashPersonListModels).
20 ColumnExpr("sum(exchange_cash_person_list.exchanged_su_money) AS activity_exchanged_su_money"). 21 ColumnExpr("sum(exchange_cash_person_list.exchanged_su_money) AS activity_exchanged_su_money").
21 Where("exchange_cash_person_list.activity_id = ?", activityId). 22 Where("exchange_cash_person_list.activity_id = ?", activityId).
22 - Select(&activityExchangedSuMoney); err !=nil { 23 + Select(&activityExchangedSuMoney); err != nil {
23 return nil, err 24 return nil, err
24 } 25 }
25 if err := tx.Model(exchangeCashPersonListModels). 26 if err := tx.Model(exchangeCashPersonListModels).
26 ColumnExpr("sum(exchange_cash_person_list.exchanged_cash) AS activity_exchanged_cash"). 27 ColumnExpr("sum(exchange_cash_person_list.exchanged_cash) AS activity_exchanged_cash").
27 Where("exchange_cash_person_list.activity_id = ?", activityId). 28 Where("exchange_cash_person_list.activity_id = ?", activityId).
28 - Select(&activityExchangedCash); err !=nil { 29 + Select(&activityExchangedCash); err != nil {
29 return nil, err 30 return nil, err
30 } 31 }
31 return map[string]interface{}{ 32 return map[string]interface{}{
@@ -34,6 +35,27 @@ func (dao *CashPoolDao) CalculateActivityExchangedSuMoney(activityId int64) (map @@ -34,6 +35,27 @@ func (dao *CashPoolDao) CalculateActivityExchangedSuMoney(activityId int64) (map
34 }, nil 35 }, nil
35 } 36 }
36 37
  38 +// ExchangeCashPersonListExist 判断素币兑换清单是否存在
  39 +func (dao *CashPoolDao) ExchangeCashPersonListExist(oldPhone string) (bool, error) {
  40 + tx := dao.transactionContext.PgTx
  41 + m := models.ExchangeCashPersonList{}
  42 + query := tx.Model(&m).Where("employee_account=?", oldPhone)
  43 + ok, err := query.Exists()
  44 + return ok, err
  45 +}
  46 +
  47 +// UpdateExchangeCashPersonListUserInfo 更新素币兑换清单用户信息
  48 +func (dao *CashPoolDao) UpdateExchangeCashPersonListUserInfo(oldPhone string, newPhone string) error {
  49 + tx := dao.transactionContext.PgTx
  50 + if _, err := tx.Query(
  51 + pg.Scan(),
  52 + "UPDATE exchange_cash_person_lists SET employee_account = ? WHERE employee_account = ?",
  53 + newPhone, oldPhone); err != nil {
  54 + return err
  55 + }
  56 + return nil
  57 +}
  58 +
37 // 返回兑换活动清单榜单 59 // 返回兑换活动清单榜单
38 func (dao *CashPoolDao) ExchangeCashListRanking(queryOptions map[string]interface{}) (map[string]interface{}, error) { 60 func (dao *CashPoolDao) ExchangeCashListRanking(queryOptions map[string]interface{}) (map[string]interface{}, error) {
39 var retPeople []struct { 61 var retPeople []struct {
@@ -67,7 +89,7 @@ func (dao *CashPoolDao) ExchangeCashListRanking(queryOptions map[string]interfac @@ -67,7 +89,7 @@ func (dao *CashPoolDao) ExchangeCashListRanking(queryOptions map[string]interfac
67 if companyId, ok := queryOptions["companyId"]; ok && (companyId.(int64) != 0) { 89 if companyId, ok := queryOptions["companyId"]; ok && (companyId.(int64) != 0) {
68 queryPeople = queryPeople.Where("e.company_id = ?", companyId) 90 queryPeople = queryPeople.Where("e.company_id = ?", companyId)
69 } 91 }
70 - if activityId, ok := queryOptions["activityId"]; ok && (activityId.(int64) != 0){ 92 + if activityId, ok := queryOptions["activityId"]; ok && (activityId.(int64) != 0) {
71 queryPeople = queryPeople.Where("exchange_cash_person_list.activity_id = ?", activityId) 93 queryPeople = queryPeople.Where("exchange_cash_person_list.activity_id = ?", activityId)
72 } 94 }
73 queryPeople = queryPeople.Group("exchange_cash_person_list.uid") 95 queryPeople = queryPeople.Group("exchange_cash_person_list.uid")
@@ -104,7 +126,7 @@ func (dao *CashPoolDao) ExchangeCashListRanking(queryOptions map[string]interfac @@ -104,7 +126,7 @@ func (dao *CashPoolDao) ExchangeCashListRanking(queryOptions map[string]interfac
104 if companyId, ok := queryOptions["companyId"]; ok && (companyId.(int64) != 0) { 126 if companyId, ok := queryOptions["companyId"]; ok && (companyId.(int64) != 0) {
105 queryPeopleAll = queryPeopleAll.Where("e.company_id = ?", companyId) 127 queryPeopleAll = queryPeopleAll.Where("e.company_id = ?", companyId)
106 } 128 }
107 - if activityId, ok := queryOptions["activityId"]; ok && (activityId.(int64) != 0){ 129 + if activityId, ok := queryOptions["activityId"]; ok && (activityId.(int64) != 0) {
108 queryPeopleAll = queryPeopleAll.Where("exchange_cash_person_list.activity_id = ?", activityId) 130 queryPeopleAll = queryPeopleAll.Where("exchange_cash_person_list.activity_id = ?", activityId)
109 } 131 }
110 queryPeopleAll = queryPeopleAll.Group("exchange_cash_person_list.uid") 132 queryPeopleAll = queryPeopleAll.Group("exchange_cash_person_list.uid")
@@ -172,7 +194,7 @@ func (dao *CashPoolDao) ExchangeCashListRanking(queryOptions map[string]interfac @@ -172,7 +194,7 @@ func (dao *CashPoolDao) ExchangeCashListRanking(queryOptions map[string]interfac
172 return nil, err 194 return nil, err
173 } 195 }
174 196
175 - return map[string]interface{} { 197 + return map[string]interface{}{
176 "people": retPeople, // 员工排行榜 198 "people": retPeople, // 员工排行榜
177 "count": count, // 计数 199 "count": count, // 计数
178 "currentEmployee": currentEmployee, // 当前员工排名 200 "currentEmployee": currentEmployee, // 当前员工排名
@@ -57,6 +57,27 @@ func (dao *EmployeeDao) ChangePrincipal(companyId int64, employeeAccount string) @@ -57,6 +57,27 @@ func (dao *EmployeeDao) ChangePrincipal(companyId int64, employeeAccount string)
57 return nil 57 return nil
58 } 58 }
59 59
  60 +// EmployeeExist 判断员工是否存在
  61 +func (dao *EmployeeDao) EmployeeExist(oldPhone string) (bool, error) {
  62 + tx := dao.transactionContext.PgTx
  63 + m := models.Employee{}
  64 + query := tx.Model(&m).Where("employee_account=?", oldPhone)
  65 + ok, err := query.Exists()
  66 + return ok, err
  67 +}
  68 +
  69 +// ChangePhone 修改用户手机号
  70 +func (dao *EmployeeDao) ChangePhone(oldPhone string, newPhone string) error {
  71 + tx := dao.transactionContext.PgTx
  72 + if _, err := tx.Query(
  73 + pg.Scan(),
  74 + "UPDATE employees SET employee_account=? WHERE employee_account=?",
  75 + newPhone, oldPhone); err != nil {
  76 + return err
  77 + }
  78 + return nil
  79 +}
  80 +
60 // 更新用户素币 81 // 更新用户素币
61 func (dao *EmployeeDao) TransferSuMoney(uid int64, suMoney float64) error { 82 func (dao *EmployeeDao) TransferSuMoney(uid int64, suMoney float64) error {
62 tx := dao.transactionContext.PgTx 83 tx := dao.transactionContext.PgTx
@@ -139,7 +160,7 @@ func (dao *EmployeeDao) CalculatePersonSuMoney(uid int64) (map[string]interface{ @@ -139,7 +160,7 @@ func (dao *EmployeeDao) CalculatePersonSuMoney(uid int64) (map[string]interface{
139 } 160 }
140 161
141 // 计算系统已兑换现金素币、未兑换素币 162 // 计算系统已兑换现金素币、未兑换素币
142 -func (dao *EmployeeDao) CalculateSystemSuMoney(companyId int64) (map[string] interface{}, error) { 163 +func (dao *EmployeeDao) CalculateSystemSuMoney(companyId int64) (map[string]interface{}, error) {
143 var systemUnExchangeSuMoney float64 164 var systemUnExchangeSuMoney float64
144 var systemExchangedSuMoney float64 165 var systemExchangedSuMoney float64
145 var systemExchangedSuMoneyRestore float64 166 var systemExchangedSuMoneyRestore float64
@@ -172,14 +193,14 @@ func (dao *EmployeeDao) CalculateSystemSuMoney(companyId int64) (map[string] int @@ -172,14 +193,14 @@ func (dao *EmployeeDao) CalculateSystemSuMoney(companyId int64) (map[string] int
172 Select(&systemExchangedSuMoneyRestore); err != nil { 193 Select(&systemExchangedSuMoneyRestore); err != nil {
173 return nil, err 194 return nil, err
174 } 195 }
175 - return map[string] interface{} { 196 + return map[string]interface{}{
176 "systemUnExchangeSuMoney": systemUnExchangeSuMoney, 197 "systemUnExchangeSuMoney": systemUnExchangeSuMoney,
177 "systemExchangedSuMoney": systemExchangedSuMoney - systemExchangedSuMoneyRestore, 198 "systemExchangedSuMoney": systemExchangedSuMoney - systemExchangedSuMoneyRestore,
178 - },nil 199 + }, nil
179 } 200 }
180 201
181 // 计算现金池已兑换现金、未兑换现金 202 // 计算现金池已兑换现金、未兑换现金
182 -func (dao *EmployeeDao) CalculateSystemCash(companyId int64) (map[string] interface{}, error) { 203 +func (dao *EmployeeDao) CalculateSystemCash(companyId int64) (map[string]interface{}, error) {
183 tx := dao.transactionContext.PgTx 204 tx := dao.transactionContext.PgTx
184 var ( 205 var (
185 systemUnExchangeCash float64 206 systemUnExchangeCash float64
@@ -192,7 +213,7 @@ func (dao *EmployeeDao) CalculateSystemCash(companyId int64) (map[string] interf @@ -192,7 +213,7 @@ func (dao *EmployeeDao) CalculateSystemCash(companyId int64) (map[string] interf
192 Where("cash_pool.company_id = ?", companyId). 213 Where("cash_pool.company_id = ?", companyId).
193 Order("id DESC"). 214 Order("id DESC").
194 Limit(1). 215 Limit(1).
195 - Select(&systemExchangedCash) ; err != nil { 216 + Select(&systemExchangedCash); err != nil {
196 return nil, err 217 return nil, err
197 } 218 }
198 // 系统未兑换现金 219 // 系统未兑换现金
@@ -201,10 +222,10 @@ func (dao *EmployeeDao) CalculateSystemCash(companyId int64) (map[string] interf @@ -201,10 +222,10 @@ func (dao *EmployeeDao) CalculateSystemCash(companyId int64) (map[string] interf
201 Where("cash_pool.company_id = ?", companyId). 222 Where("cash_pool.company_id = ?", companyId).
202 Order("id DESC"). 223 Order("id DESC").
203 Limit(1). 224 Limit(1).
204 - Select(&systemUnExchangeCash) ; err != nil { 225 + Select(&systemUnExchangeCash); err != nil {
205 return nil, err 226 return nil, err
206 } 227 }
207 - return map[string] interface{} { 228 + return map[string]interface{}{
208 "systemUnExchangeCash": systemUnExchangeCash, 229 "systemUnExchangeCash": systemUnExchangeCash,
209 "systemExchangedCash": systemExchangedCash, 230 "systemExchangedCash": systemExchangedCash,
210 }, nil 231 }, nil
  1 +package dao
  2 +
  3 +import (
  4 + "fmt"
  5 + pgTransaction "github.com/linmadan/egglib-go/transaction/pg"
  6 +)
  7 +
  8 +type OffTaskRecordsDao struct {
  9 + transactionContext *pgTransaction.TransactionContext
  10 +}
  11 +
  12 +//TODO ChangeOffTaskRecordsOperatorAccount
  13 +func (dao *OffTaskRecordsDao) ChangeOffTaskRecordsOperatorAccount() {
  14 +
  15 +}
  16 +
  17 +func NewOffTaskRecordsDao(transactionContext *pgTransaction.TransactionContext) (*OffTaskRecordsDao, error) {
  18 + if transactionContext == nil {
  19 + return nil, fmt.Errorf("transactionContext参数不能为nil")
  20 + } else {
  21 + return &OffTaskRecordsDao{
  22 + transactionContext: transactionContext,
  23 + }, nil
  24 + }
  25 +}
  1 +package dao
  2 +
  3 +import (
  4 + "fmt"
  5 + pgTransaction "github.com/linmadan/egglib-go/transaction/pg"
  6 +)
  7 +
  8 +type RejectTaskRecordsDao struct {
  9 + transactionContext *pgTransaction.TransactionContext
  10 +}
  11 +
  12 +//TODO ChangeRejectTaskRecordsOperatorAccount
  13 +func (dao *RejectTaskRecordsDao) ChangeRejectTaskRecordsOperatorAccount() {
  14 +
  15 +}
  16 +
  17 +func NewRejectTaskRecordsDao(transactionContext *pgTransaction.TransactionContext) (*RejectTaskRecordsDao, error) {
  18 + if transactionContext == nil {
  19 + return nil, fmt.Errorf("transactionContext参数不能为nil")
  20 + } else {
  21 + return &RejectTaskRecordsDao{
  22 + transactionContext: transactionContext,
  23 + }, nil
  24 + }
  25 +}
  1 +package dao
  2 +
  3 +import (
  4 + "fmt"
  5 + pgTransaction "github.com/linmadan/egglib-go/transaction/pg"
  6 +)
  7 +
  8 +type RobInfosDao struct {
  9 + transactionContext *pgTransaction.TransactionContext
  10 +}
  11 +
  12 +//TODO ChangeRobInfosReceiverAccount
  13 +func (dao *RobInfosDao) ChangeRobInfosReceiverAccount() {
  14 +
  15 +}
  16 +
  17 +func NewRobInfosDao(transactionContext *pgTransaction.TransactionContext) (*RobInfosDao, error) {
  18 + if transactionContext == nil {
  19 + return nil, fmt.Errorf("transactionContext参数不能为nil")
  20 + } else {
  21 + return &RobInfosDao{
  22 + transactionContext: transactionContext,
  23 + }, nil
  24 + }
  25 +}
  1 +package dao
  2 +
  3 +import (
  4 + "fmt"
  5 + pgTransaction "github.com/linmadan/egglib-go/transaction/pg"
  6 +)
  7 +
  8 +type SentNotificationDao struct {
  9 + transactionContext *pgTransaction.TransactionContext
  10 +}
  11 +
  12 +// ChangeSentNotificationReceiverAccount TODO 修改已发送通知用户信息
  13 +func (dao *SentNotificationDao) ChangeSentNotificationReceiverAccount() {
  14 +
  15 +}
  16 +
  17 +func NewSentNotificationDao(transactionContext *pgTransaction.TransactionContext) (*SentNotificationDao, error) {
  18 + if transactionContext == nil {
  19 + return nil, fmt.Errorf("transactionContext参数不能为nil")
  20 + } else {
  21 + return &SentNotificationDao{
  22 + transactionContext: transactionContext,
  23 + }, nil
  24 + }
  25 +}
  1 +package dao
  2 +
  3 +import (
  4 + "fmt"
  5 + pgTransaction "github.com/linmadan/egglib-go/transaction/pg"
  6 +)
  7 +
  8 +type SuMoneyTransactionRecordsDao struct {
  9 + transactionContext *pgTransaction.TransactionContext
  10 +}
  11 +
  12 +// ChangeSuMoneyTransactionRecordsEmployeeAccount TODO 修改素币流水记录用户信息
  13 +func (dao *SuMoneyTransactionRecordsDao) ChangeSuMoneyTransactionRecordsEmployeeAccount() {
  14 +
  15 +}
  16 +
  17 +// ChangeSuMoneyTransactionRecordsOperatorAccount TODO 素币流水记操作人信息
  18 +func (dao *SuMoneyTransactionRecordsDao) ChangeSuMoneyTransactionRecordsOperatorAccount() {
  19 +
  20 +}
  21 +
  22 +func NewSuMoneyTransactionRecordsDao(transactionContext *pgTransaction.TransactionContext) (*SuMoneyTransactionRecordsDao, error) {
  23 + if transactionContext == nil {
  24 + return nil, fmt.Errorf("transactionContext参数不能为nil")
  25 + } else {
  26 + return &SuMoneyTransactionRecordsDao{
  27 + transactionContext: transactionContext,
  28 + }, nil
  29 + }
  30 +}
@@ -362,6 +362,26 @@ func (dao *TaskDao) CalculatePersonTask(uid int64, companyId int) (map[string]in @@ -362,6 +362,26 @@ func (dao *TaskDao) CalculatePersonTask(uid int64, companyId int) (map[string]in
362 }, nil 362 }, nil
363 } 363 }
364 364
  365 +//TODO ChangeSponsorAccount 修改sponsor手机号 jsonb
  366 +func (dao *TaskDao) ChangeSponsorAccount() {
  367 +
  368 +}
  369 +
  370 +//TODO ChangeParticipatorAccount 修改participator手机号 jsonb_array
  371 +func (dao *TaskDao) ChangeParticipatorAccount() {
  372 +
  373 +}
  374 +
  375 +//TODO ChangeTaskPercentageContributorAccount 修改task_percentage contributor手机号 jsonb_array
  376 +func (dao *TaskDao) ChangeTaskPercentageContributorAccount() {
  377 +
  378 +}
  379 +
  380 +//TODO ChangeAssignedPersonAccount 修改assigned_person手机号 jsonb
  381 +func (dao *TaskDao) ChangeAssignedPersonAccount() {
  382 +
  383 +}
  384 +
365 func NewTaskDao(transactionContext *pgTransaction.TransactionContext) (*TaskDao, error) { 385 func NewTaskDao(transactionContext *pgTransaction.TransactionContext) (*TaskDao, error) {
366 if transactionContext == nil { 386 if transactionContext == nil {
367 return nil, fmt.Errorf("transactionContext参数不能为nil") 387 return nil, fmt.Errorf("transactionContext参数不能为nil")
  1 +package domain_service
  2 +
  3 +import (
  4 + "fmt"
  5 + coreDomain "github.com/linmadan/egglib-go/core/domain"
  6 + pgTransaction "github.com/linmadan/egglib-go/transaction/pg"
  7 + "gitlab.fjmaimaimai.com/linmadan/mmm-worth/pkg/domain/event"
  8 +)
  9 +
  10 +type ChangePhoneService struct {
  11 + coreDomain.BaseEventPublisher
  12 + transactionContext *pgTransaction.TransactionContext
  13 +}
  14 +
  15 +func (service *ChangePhoneService) ChangePhone(oldPhone string, newPhone string) error {
  16 + changePhoneEvent := new(event.PhoneChanged)
  17 + changePhoneEvent.OldPhone = oldPhone
  18 + changePhoneEvent.NewPhone = newPhone
  19 + if err := service.Publish(changePhoneEvent); err != nil {
  20 + return err
  21 + }
  22 + return nil
  23 +}
  24 +
  25 +func NewChangePhoneService(transactionContext *pgTransaction.TransactionContext) (*ChangePhoneService, error) {
  26 + if transactionContext == nil {
  27 + return nil, fmt.Errorf("transactionContext参数不能为nil")
  28 + } else {
  29 + return &ChangePhoneService{
  30 + transactionContext: transactionContext,
  31 + }, nil
  32 + }
  33 +}
  1 +package service_gateway
  2 +
  3 +import (
  4 + "gitlab.fjmaimaimai.com/linmadan/mmm-worth/pkg/constant"
  5 + "strings"
  6 + "time"
  7 +)
  8 +
  9 +type HttplibWorthServiceGateway struct {
  10 + httplibBaseServiceGateway
  11 +}
  12 +
  13 +// ChangePhoneCallback 修改手机号码回调,通知价值APP端中台
  14 +func (serviceGateway *HttplibWorthServiceGateway) ChangePhoneCallback(oldPhone string, newPhone string) (map[string]interface{}, error) {
  15 + url := strings.Join([]string{serviceGateway.baseURL, "/v1/auth/forceRevoke"}, "/")
  16 + request := serviceGateway.createRequest(url, "post")
  17 + options := make(map[string]interface{})
  18 + options["phone"] = oldPhone
  19 + request.JSONBody(options)
  20 + response := make(map[string]interface{})
  21 + request.ToJSON(&response)
  22 + data, err := serviceGateway.responseHandle(response)
  23 + return data, err
  24 +}
  25 +
  26 +func NewHttplibWorthServiceGateway() *HttplibWorthServiceGateway {
  27 + return &HttplibWorthServiceGateway{
  28 + httplibBaseServiceGateway: httplibBaseServiceGateway{
  29 + baseURL: constant.ABILITY_SERVICE_HOST,
  30 + connectTimeout: 100 * time.Second,
  31 + readWriteTimeout: 30 * time.Second,
  32 + },
  33 + }
  34 +}
@@ -14,3 +14,7 @@ type AbilityServiceGateway interface { @@ -14,3 +14,7 @@ type AbilityServiceGateway interface {
14 type MmmOpenApiServiceGateway interface { 14 type MmmOpenApiServiceGateway interface {
15 PushInfo(msgType int, uids []int64, title string, content string, ext map[string]interface{}) (map[string]interface{}, error) 15 PushInfo(msgType int, uids []int64, title string, content string, ext map[string]interface{}) (map[string]interface{}, error)
16 } 16 }
  17 +
  18 +type WorthServiceGateway interface {
  19 + ChangePhoneCallback(oldPhone string, newPhone string) (map[string]interface{}, error)
  20 +}
@@ -8,7 +8,7 @@ import ( @@ -8,7 +8,7 @@ import (
8 8
9 /** 9 /**
10 * @Author SteveChan 10 * @Author SteveChan
11 - * @Description //TODO 11 + * @Description
12 * @Date 16:50 2020/12/10 12 * @Date 16:50 2020/12/10
13 * @Param 13 * @Param
14 * @return 14 * @return
@@ -34,7 +34,7 @@ func StringSliceEqualBCE(a, b []int) bool { @@ -34,7 +34,7 @@ func StringSliceEqualBCE(a, b []int) bool {
34 34
35 /** 35 /**
36 * @Author SteveChan 36 * @Author SteveChan
37 - * @Description //TODO 37 + * @Description
38 * @Date 16:50 2020/12/10 38 * @Date 16:50 2020/12/10
39 * @Param 39 * @Param
40 * @return 40 * @return
@@ -50,7 +50,7 @@ func IsContain(items []interface{}, item string) bool { @@ -50,7 +50,7 @@ func IsContain(items []interface{}, item string) bool {
50 50
51 /** 51 /**
52 * @Author SteveChan 52 * @Author SteveChan
53 - * @Description //TODO 53 + * @Description
54 * @Date 16:50 2020/12/10 54 * @Date 16:50 2020/12/10
55 * @Param 55 * @Param
56 * @return 56 * @return
@@ -80,7 +80,7 @@ func (l LocalDate) MarshalJSON() ([]byte, error) { @@ -80,7 +80,7 @@ func (l LocalDate) MarshalJSON() ([]byte, error) {
80 80
81 /** 81 /**
82 * @Author SteveChan 82 * @Author SteveChan
83 - * @Description //TODO 83 + * @Description
84 * @Date 16:49 2020/12/10 84 * @Date 16:49 2020/12/10
85 * @Param 85 * @Param
86 * @return 86 * @return