forked from OpenFeign/feign
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add ResponseInterceptor support OpenFeign#1126
- Loading branch information
Fei,Yanke
committed
Apr 28, 2022
1 parent
e1a7028
commit 40db4ba
Showing
3 changed files
with
72 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package feign; | ||
|
||
/** | ||
* Zero or more {@code ResponseInterceptor} may be configured for purposes | ||
* such as verify or modify headers of response, verify the business status of decoded object. | ||
* No guarantees are given with regards to the order that interceptors are applied. | ||
* Once interceptors are applied, {@link ResponseInterceptor#beforeDecode(Response)} is called | ||
* before decode method called, {@link ResponseInterceptor#afterDecode(Object)} is called | ||
* after decode method called. | ||
*/ | ||
public interface ResponseInterceptor { | ||
|
||
/** | ||
* Called for response before decode, add data on the supplied {@link Response} or doing | ||
* customized logic | ||
* | ||
* @param response | ||
* @return | ||
*/ | ||
void beforeDecode(Response response); | ||
|
||
/** | ||
* Called for response after decode, add data to decoded object or doing customized logic | ||
* | ||
* @param response | ||
* @return | ||
*/ | ||
void afterDecode(Object response); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters