-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add an option to add spring-response-entity for feign client return p…
…aram (#302)
- Loading branch information
Showing
5 changed files
with
164 additions
and
3 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
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
132 changes: 132 additions & 0 deletions
132
src/test/resources/examples/openFeignClient/client/OpenFeignClientWithResponseEntity.kt
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,132 @@ | ||
package examples.openFeignClient.client | ||
|
||
import examples.openFeignClient.models.Content | ||
import examples.openFeignClient.models.FirstModel | ||
import examples.openFeignClient.models.QueryResult | ||
import feign.HeaderMap | ||
import feign.Headers | ||
import feign.Param | ||
import feign.RequestLine | ||
import org.springframework.http.ResponseEntity | ||
import kotlin.Boolean | ||
import kotlin.Int | ||
import kotlin.String | ||
import kotlin.Suppress | ||
import kotlin.Unit | ||
import kotlin.collections.List | ||
import kotlin.collections.Map | ||
|
||
@Suppress("unused") | ||
public interface ExamplePath1Client { | ||
/** | ||
* GET example path 1 | ||
* | ||
* @param explodeListQueryParam | ||
* @param queryParam2 | ||
* @param headerParam1 | ||
* @param headerParam2 | ||
*/ | ||
@RequestLine("GET /example-path-1?explode_list_query_param={explodeListQueryParam}&query_param2={queryParam2}") | ||
@Headers( | ||
"header_param1: {headerParam1}", | ||
"header_param2: {headerParam2}", | ||
"Accept: application/vnd.custom.media+json", | ||
) | ||
public fun getExamplePath1( | ||
@Param("explodeListQueryParam") explodeListQueryParam: List<String>? = null, | ||
@Param("queryParam2") queryParam2: Int? = null, | ||
@Param("headerParam1") headerParam1: String? = null, | ||
@Param("headerParam2") headerParam2: String? = null, | ||
@HeaderMap additionalHeaders: Map<String, String> = emptyMap(), | ||
): ResponseEntity<QueryResult> | ||
|
||
/** | ||
* POST example path 1 | ||
* | ||
* @param content | ||
* @param explodeListQueryParam | ||
*/ | ||
@RequestLine("POST /example-path-1?explode_list_query_param={explodeListQueryParam}") | ||
public fun postExamplePath1( | ||
content: Content, | ||
@Param("explodeListQueryParam") explodeListQueryParam: List<String>? = null, | ||
@HeaderMap additionalHeaders: Map<String, String> = emptyMap(), | ||
): ResponseEntity<Unit> | ||
} | ||
|
||
@Suppress("unused") | ||
public interface ExamplePath2Client { | ||
/** | ||
* GET example path 2 | ||
* | ||
* @param pathParam The resource id | ||
* @param limit | ||
* @param queryParam2 | ||
* @param ifNoneMatch The RFC7232 If-None-Match header field | ||
*/ | ||
@RequestLine("GET /example-path-2/{pathParam}?limit={limit}&query_param2={queryParam2}") | ||
@Headers( | ||
"If-None-Match: {ifNoneMatch}", | ||
"Accept: application/json", | ||
) | ||
public fun getExamplePath2PathParam( | ||
@Param("pathParam") pathParam: String, | ||
@Param("limit") limit: Int = 500, | ||
@Param("queryParam2") queryParam2: Int? = null, | ||
@Param("ifNoneMatch") ifNoneMatch: String? = null, | ||
@HeaderMap additionalHeaders: Map<String, String> = emptyMap(), | ||
): ResponseEntity<Content> | ||
|
||
/** | ||
* HEAD example path 2 | ||
* | ||
* @param pathParam The resource id | ||
* @param queryParam3 | ||
* @param ifNoneMatch The RFC7232 If-None-Match header field | ||
*/ | ||
@RequestLine("HEAD /example-path-2/{pathParam}?query_param3={queryParam3}") | ||
@Headers("If-None-Match: {ifNoneMatch}") | ||
public fun headOperationIdExample( | ||
@Param("pathParam") pathParam: String, | ||
@Param("queryParam3") queryParam3: Boolean? = null, | ||
@Param("ifNoneMatch") ifNoneMatch: String? = null, | ||
@HeaderMap additionalHeaders: Map<String, String> = emptyMap(), | ||
): ResponseEntity<Unit> | ||
|
||
/** | ||
* PUT example path 2 | ||
* | ||
* @param firstModel | ||
* @param pathParam The resource id | ||
* @param ifMatch The RFC7232 If-Match header field | ||
*/ | ||
@RequestLine("PUT /example-path-2/{pathParam}") | ||
@Headers("If-Match: {ifMatch}") | ||
public fun putExamplePath2PathParam( | ||
firstModel: FirstModel, | ||
@Param("pathParam") pathParam: String, | ||
@Param("ifMatch") ifMatch: String, | ||
@HeaderMap additionalHeaders: Map<String, String> = emptyMap(), | ||
): ResponseEntity<Unit> | ||
} | ||
|
||
@Suppress("unused") | ||
public interface ExamplePath3SubresourceClient { | ||
/** | ||
* PUT example path 3 | ||
* | ||
* @param firstModel | ||
* @param pathParam The resource id | ||
* @param ifMatch The RFC7232 If-Match header field | ||
* @param csvListQueryParam | ||
*/ | ||
@RequestLine("PUT /example-path-3/{pathParam}/subresource?csv_list_query_param={csvListQueryParam}") | ||
@Headers("If-Match: {ifMatch}") | ||
public fun putExamplePath3PathParamSubresource( | ||
firstModel: FirstModel, | ||
@Param("pathParam") pathParam: String, | ||
@Param("ifMatch") ifMatch: String, | ||
@Param("csvListQueryParam") csvListQueryParam: List<String>? = null, | ||
@HeaderMap additionalHeaders: Map<String, String> = emptyMap(), | ||
): ResponseEntity<Unit> | ||
} |