Skip to content

Commit 004621b

Browse files
committed
doc(update readme)
1 parent 5578621 commit 004621b

2 files changed

Lines changed: 161 additions & 21 deletions

File tree

‎README.md‎

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,7 @@ $curl -s -H "Accept:application/json" http://localhost:9001/eureka/apps | jq '.a
147147
"prot": 9006
148148
}
149149
```
150-
#### 3. Turbine-dashbord : [http://localhost:9010/hystrix](http://localhost:9010/hystrix)
151-
152-
Hystrix : http://10.69.42.86:9005/ext/user?id=1
150+
#### 3. Turbine-dashboard : [http://localhost:9010/hystrix](http://localhost:9010/hystrix)
153151

154152
![](/doc/images/Hystrix-Dashboard.png)
155153

@@ -168,7 +166,7 @@ Paste url [http://localhost:9010/turbine.stream](http://localhost:9010/turbine.s
168166

169167
gateway-->user
170168
```
171-
$ curl -s http://localhost:9006/user/persionalInfo?id=2 | jq .
169+
$ curl -s http://localhost:9006/user/personalInfo?id=2 | jq .
172170
{
173171
"message": "",
174172
"data": {
@@ -185,7 +183,7 @@ $ curl -s http://localhost:9006/user/persionalInfo?id=2 | jq .
185183
```
186184

187185
```
188-
$ curl -s http://localhost:9006/user/persionalInfo?id=3 | jq .
186+
$ curl -s http://localhost:9006/user/personalInfo?id=3 | jq .
189187
{
190188
"message": "user not found",
191189
"data": {}
@@ -212,6 +210,34 @@ $ curl -s 127.0.0.1:9006/trade/order?id=1 | jq .
212210
}
213211
}
214212
```
213+
feign -> user
214+
```bash
215+
curl -s 'http://192.168.99.100:9005/client/feign?id=1' |jq .
216+
{
217+
"id": 1,
218+
"loginName": "erdaoya",
219+
"nickName": "erdaoya",
220+
"password": "1234",
221+
"mobile": "12345678909",
222+
"email": "xx@gmail.com",
223+
"gender": 0,
224+
"registerTime": 2017
225+
}
226+
```
227+
ribbon -> trade
228+
```bash
229+
$ curl -s 'http://192.168.99.100:9005/client/trade/order?id=1' |jq .
230+
{
231+
"id": 1,
232+
"price": 12.123,
233+
"customerId": 1,
234+
"itemId": null,
235+
"sellerId": 2
236+
}
237+
```
238+
239+
240+
215241
If you want the api include seller details(assume that sellerId is associated with userId), But do not want call user from trade。
216242

217243
`cloud-service-comx` will help you.
@@ -245,7 +271,7 @@ json config: `api/ext/trade/order/get.json`
245271
"field": "seller",
246272
"source": {
247273
"base":"springcloud",
248-
"uri": "http://cloud-service-user/user/persionalInfo?id={ref.sellerId}",
274+
"uri": "http://cloud-service-user/user/personalInfo?id={ref.sellerId}",
249275
"onError": {
250276
"type": "ignore"
251277
}
@@ -256,7 +282,7 @@ json config: `api/ext/trade/order/get.json`
256282
]
257283
}
258284
```
259-
gatewat --> cloud-service-comx :
285+
gateway --> cloud-service-comx :
260286
```
261287
$ curl -s 127.0.0.1:9006/ext/trade/order?id=1 | jq .
262288
{

‎doc/1.Verify.md‎

Lines changed: 128 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
10099
Paste 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
139141
Connection: 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

Comments
 (0)