Skip to content

Commit 708e682

Browse files
committed
release 1.1.7
1 parent 3a32ac9 commit 708e682

3 files changed

Lines changed: 22 additions & 3 deletions

File tree

README-en.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ The only thing we need to do is defining the interface.
2929
<dependency>
3030
<groupId>com.github.dadiyang</groupId>
3131
<artifactId>http-api-invoker</artifactId>
32-
<version>1.1.6</version>
32+
<version>1.1.7</version>
3333
</dependency>
3434
```
3535

@@ -174,6 +174,25 @@ City city = cityServiceWithResponseProcessor.getCity(id);
174174

175175
or in Spring scenario, register a RequestPreprocessor Bean.
176176

177+
Usually, an HTTP api would response a ResultBean formed with code/msg/data fields, like:
178+
179+
```json
180+
{
181+
"code": 0,
182+
"data": {
183+
"name": "Hello"
184+
},
185+
"msg or message": "xx"
186+
}
187+
```
188+
189+
We provided a `ResultBeanResponseProcessor` for this scenario.
190+
191+
It will check the code specify by @ExpectedCode annotation or 0 by default.
192+
193+
If the code in response body is not equals to the expected one, an IllegalStateException will be thrown.
194+
195+
If they are equal, the data field will be parse to return value, unless the method do not need it or its return type is a ResultBean.
177196

178197
# CORE ANNOTATION
179198

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<dependency>
3232
<groupId>com.github.dadiyang</groupId>
3333
<artifactId>http-api-invoker</artifactId>
34-
<version>1.1.6</version>
34+
<version>1.1.7</version>
3535
</dependency>
3636
```
3737

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>com.github.dadiyang</groupId>
88
<artifactId>http-api-invoker</artifactId>
9-
<version>1.1.6</version>
9+
<version>1.1.7</version>
1010
<packaging>jar</packaging>
1111
<parent>
1212
<groupId>org.sonatype.oss</groupId>

0 commit comments

Comments
 (0)