File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
modules/swagger-codegen/src/main/resources/JavaSpring Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ import org.springframework.web.multipart.MultipartFile;
19
19
20
20
import java.util.List;
21
21
{ {#async} }
22
- import java.util.concurrent.Callable;
22
+ import java.util.concurrent.{ {^java8 } } Callable{ {/java8 } } { {#java8 } }CompletableFuture { {/java8 } } ;
23
23
{ {/async} }
24
24
25
25
{ {> generatedAnnotation} }
@@ -43,10 +43,9 @@ public interface {{classname}} {
43
43
produces = { {{#produces} }"{ {{mediaType} }}"{ {#hasMore} }, { {/hasMore} }{ {/produces} } }, { {/hasProduces} }{ {#hasConsumes} }
44
44
consumes = { {{#consumes} }"{ {{mediaType} }}"{ {#hasMore} }, { {/hasMore} }{ {/consumes} } },{ {/hasConsumes} }{ {/singleContentTypes} }
45
45
method = RequestMethod.{ {httpMethod} })
46
- { {#java8} }default { {/java8} }{ {#async} }Callable<{ {/async} }ResponseEntity<{ {> returnTypes} }>{ {#async} }>{ {/async} } { {operationId} }({ {#allParams} }{ {> queryParams} }{ {> pathParams} }{ {> headerParams} }{ {> bodyParams} }{ {> formParams} }{ {#hasMore} },
47
- { {/hasMore} }{ {/allParams} }){ {^java8} };{ {/java8} }{ {#java8} } {
46
+ { {#java8} }default { {/java8} }{ {#async} }{ {^java8} }Callable{ {/java8} }{ {#java8} }CompletableFuture<{ {/java8} }{ {/async} }ResponseEntity<{ {> returnTypes} }>{ {#async} }>{ {/async} } { {operationId} }({ {#allParams} }{ {> queryParams} }{ {> pathParams} }{ {> headerParams} }{ {> bodyParams} }{ {> formParams} }{ {#hasMore} },{ {/hasMore} }{ {/allParams} }){ {^java8} };{ {/java8} }{ {#java8} } {
48
47
// do some magic!
49
- return {{#async} }() -> { {/async} }new ResponseEntity<{ {> returnTypes} }>(HttpStatus.OK);
48
+ return {{#async} }CompletableFuture.completedFuture( { {/async} }new ResponseEntity<{ {> returnTypes} }>(HttpStatus.OK){ {#async } }) { {/async } } ;
50
49
}{ {/java8} }
51
50
52
51
{ {/operation} }
You can’t perform that action at this time.
0 commit comments