@@ -41,9 +41,9 @@ curl -s http://localhost:9000/cloud-service-user-dev.properties
4141 ]
4242}
4343```
44- #### 2. Eureka-dashbord : [ http://localhost:9001/ ] ( http://localhost:9001/ )
44+ #### 2. Eureka-dashboard : [ http://localhost:9001/ ] ( http://localhost:9001/ )
4545
46- ![ ] ( ./images/2017-02-18-14-18-44.jpg )
46+ ![ ] ( ./doc/ images/2017-02-18-14-18-44.jpg )
4747
4848
4949``` bash
@@ -92,13 +92,13 @@ $curl -s -H "Accept:application/json" http://localhost:9001/eureka/apps | jq '.a
9292 "prot" : 9006
9393}
9494```
95- #### 3. Turbine-dashbord : [ http://localhost:9010/hystrix ] ( http://localhost:9010/hystrix )
96-
97- Hystrix : http://10.69.42.86:9005/ext/user?id=1
95+ #### 3. Turbine-dashboard : [ http://localhost:9010/hystrix ] ( http://localhost:9010/hystrix )
9896
9997![ ] ( /doc/images/Hystrix-Dashboard.png )
98+
10099Paste url [ http://localhost:9010/turbine.stream ] ( http://localhost:9010/turbine.stream ) in Hystrix Dashboard, and moniter stream.
101- ![ ] (doc/images/Hystrix Stream turbine.png)
100+
101+ ![ ] ( doc/images/Hystrix-Stream-turbine.png )
102102
103103
104104#### 4. Zipkin UI
@@ -108,25 +108,27 @@ Paste url [http://localhost:9010/turbine.stream](http://localhost:9010/turbine.s
108108 ![ ] ( /doc/images/zipkin02.png )
109109
110110#### 5. service api
111+
112+ gateway-->user
111113```
112- $ curl -s http://localhost:9006/user/persionalInfo ?id=1 | jq .
114+ $ curl -s http://localhost:9006/user/personalInfo ?id=2 | jq .
113115{
114116 "message": "",
115117 "data": {
116- "id": 1 ,
117- "loginName": "erdaoya ",
118- "nickName": "erdaoya ",
118+ "id": 2 ,
119+ "loginName": "henry ",
120+ "nickName": "henry ",
119121 "password": "1234",
120- "mobile": "12345678909 ",
121- "email": "xx@gmail.com ",
122- "gender": 0 ,
122+ "mobile": "12345678901 ",
123+ "email": "12345678909 ",
124+ "gender": 1 ,
123125 "registerTime": 2017
124126 }
125127}
126128```
127129
128130```
129- $ curl -s http://localhost:9006/user/persionalInfo ?id=3 | jq .
131+ $ curl -s http://localhost:9006/user/personalInfo ?id=3 | jq .
130132{
131133 "message": "user not found",
132134 "data": {}
@@ -139,6 +141,118 @@ Transfer-Encoding: chunked
139141Connection: close
140142```
141143
144+ gateway --> trade
145+ ```
146+ $ curl -s 127.0.0.1:9006/trade/order?id=1 | jq .
147+ {
148+ "message": "",
149+ "data": {
150+ "id": 1,
151+ "price": 12.123,
152+ "customerId": 1,
153+ "itemId": null,
154+ "sellerId": 2
155+ }
156+ }
157+ ```
158+ feign -> user
159+ ``` bash
160+ curl -s ' http://192.168.99.100:9005/client/feign?id=1' | jq .
161+ {
162+ " id" : 1,
163+ " loginName" : " erdaoya" ,
164+ " nickName" : " erdaoya" ,
165+ " password" : " 1234" ,
166+ " mobile" : " 12345678909" ,
167+ " email" : " xx@gmail.com" ,
168+ " gender" : 0,
169+ " registerTime" : 2017
170+ }
171+ ```
172+ ribbon -> trade
173+ ``` bash
174+ $ curl -s ' http://192.168.99.100:9005/client/trade/order?id=1' | jq .
175+ {
176+ " id" : 1,
177+ " price" : 12.123,
178+ " customerId" : 1,
179+ " itemId" : null,
180+ " sellerId" : 2
181+ }
182+ ```
183+
184+
185+
186+ If you want the api include seller details(assume that sellerId is associated with userId), But do not want call user from trade。
187+
188+ ` cloud-service-comx ` will help you.
189+
190+ json config: ` api/ext/trade/order/get.json `
191+ ``` json
192+ {
193+ "meta" : {
194+ "module" : " order" ,
195+ "name" : " order detail ext" ,
196+ "memo" : " get full orderDetail" ,
197+ "uri" : {
198+ "parameters" : [
199+ {
200+ "field" : " id" ,
201+ "name" : " order id" ,
202+ "type" : " long" ,
203+ "memo" : " must"
204+ }
205+ ]
206+ }
207+ },
208+ "decors" : [
209+ {
210+ "source" : {
211+ "base" :" springcloud" ,
212+ "uri" :" http://cloud-service-trade/trade/order?id={request.url.query.id}"
213+ },
214+ "decors" : [
215+ {
216+ "field" : " seller" ,
217+ "source" : {
218+ "base" :" springcloud" ,
219+ "uri" : " http://cloud-service-user/user/personalInfo?id={ref.sellerId}" ,
220+ "onError" : {
221+ "type" : " ignore"
222+ }
223+ }
224+ }
225+ ]
226+ }
227+ ]
228+ }
229+ ```
230+ gateway --> cloud-service-comx :
231+ ```
232+ $ curl -s 127.0.0.1:9006/ext/trade/order?id=1 | jq .
233+ {
234+ "message": "",
235+ "data": {
236+ "seller": {
237+ "id": 2,
238+ "loginName": "henry",
239+ "nickName": "henry",
240+ "password": "1234",
241+ "mobile": "12345678901",
242+ "email": "12345678909",
243+ "gender": 1,
244+ "registerTime": 2017
245+ },
246+ "sellerId": 2,
247+ "price": 12.123,
248+ "customerId": 1,
249+ "id": 1
250+ }
251+ }
252+ ```
253+
254+
255+
142256#### 6. Admin
143257
144258 [ http://localhost:9003/ ] ( http://localhost:9003/ )
0 commit comments