12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- package {{package}};
- {{#imports}}import {{import}};
- {{/imports}}
- import org.springframework.http.HttpStatus;
- import org.springframework.http.MediaType;
- {{#useResponseEntity}}
- import org.springframework.http.ResponseEntity;
- {{/useResponseEntity}}
- import org.springframework.web.context.request.NativeWebRequest;
- import org.springframework.web.multipart.MultipartFile;
- {{#reactive}}
- import org.springframework.web.server.ServerWebExchange;
- import reactor.core.publisher.Flux;
- import reactor.core.publisher.Mono;
- import org.springframework.http.codec.multipart.Part;
- {{/reactive}}
- {{#useBeanValidation}}
- import {{javaxPackage}}.validation.constraints.*;
- import {{javaxPackage}}.validation.Valid;
- {{/useBeanValidation}}
- import java.util.List;
- import java.util.Map;
- import java.util.Optional;
- {{#async}}
- import java.util.concurrent.CompletableFuture;
- {{/async}}
- import {{javaxPackage}}.annotation.Generated;
- import com.crunii.micro.common.dto.Result;
- import com.crunii.micro.common.dto.PageReq;
- import com.crunii.micro.common.dto.PageRsp;
- {{#operations}}
- /**
- * A delegate to be called by the {@link {{classname}}Controller}}.
- * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class.
- */
- {{>generatedAnnotation}}
- public interface {{classname}}Delegate {
- {{#jdk8-default-interface}}
- default Optional<NativeWebRequest> getRequest() {
- return Optional.empty();
- }
- {{/jdk8-default-interface}}
- {{#operation}}
- /**
- * {{httpMethod}} {{{path}}}{{#summary}} : {{.}}{{/summary}}
- {{#notes}}
- * {{.}}
- {{/notes}}
- *
- {{#allParams}}
- * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}
- {{/allParams}}
- * @return {{#responses}}{{message}} (status code {{code}}){{^-last}}
- * or {{/-last}}{{/responses}}
- {{#isDeprecated}}
- * @deprecated
- {{/isDeprecated}}
- {{#externalDocs}}
- * {{description}}
- * @see <a href="{{url}}">{{summary}} Documentation</a>
- {{/externalDocs}}
- * @see {{classname}}#{{operationId}}
- */
- {{#isDeprecated}}
- @Deprecated
- {{/isDeprecated}}
- {{#jdk8-default-interface}}default {{/jdk8-default-interface}}{{#responseWrapper}}{{.}}<{{/responseWrapper}}{{#useResponseEntity}}Result<{{/useResponseEntity}}{{^vendorExtensions.x-spring-paginated}}{{>returnTypes}}{{/vendorExtensions.x-spring-paginated}}{{#vendorExtensions.x-spring-paginated}}PageRsp<{{>returnTypes}}>{{/vendorExtensions.x-spring-paginated}}{{#useResponseEntity}}>{{/useResponseEntity}}{{#responseWrapper}}>{{/responseWrapper}} {{operationId}}({{^vendorExtensions.x-spring-paginated}}{{#allParams}}{{^isFile}}{{^isBodyParam}}{{>optionalDataType}}{{/isBodyParam}}{{#isBodyParam}}{{^reactive}}{{{dataType}}}{{/reactive}}{{#reactive}}{{^isArray}}Mono<{{{dataType}}}>{{/isArray}}{{#isArray}}Flux<{{{baseType}}}>{{/isArray}}{{/reactive}}{{/isBodyParam}}{{/isFile}}{{#isFile}}{{#isArray}}List<{{/isArray}}{{#reactive}}Flux<Part>{{/reactive}}{{^reactive}}MultipartFile{{/reactive}}{{#isArray}}>{{/isArray}}{{/isFile}} {{paramName}}{{^-last}},
- {{/-last}}{{/allParams}}{{/vendorExtensions.x-spring-paginated}}{{#vendorExtensions.x-spring-paginated}}{{#allParams}}{{^isFile}}{{^isBodyParam}}{{>optionalDataType}}{{/isBodyParam}}{{#isBodyParam}}{{^reactive}}PageReq<{{{dataType}}}>{{/reactive}}{{#reactive}}{{^isArray}}Mono<{{{dataType}}}>{{/isArray}}{{#isArray}}Flux<{{{baseType}}}>{{/isArray}}{{/reactive}}{{/isBodyParam}}{{/isFile}}{{#isFile}}{{#isArray}}List<{{/isArray}}{{#reactive}}Flux<Part>{{/reactive}}{{^reactive}}MultipartFile{{/reactive}}{{#isArray}}>{{/isArray}}{{/isFile}} {{paramName}}{{^-last}},
- {{/-last}}{{/allParams}}{{/vendorExtensions.x-spring-paginated}}{{#reactive}}{{#hasParams}},
- {{/hasParams}}ServerWebExchange exchange{{/reactive}}){{#unhandledException}} throws Exception{{/unhandledException}}{{^jdk8-default-interface}};{{/jdk8-default-interface}}{{#jdk8-default-interface}} {
- {{>methodBody}}
- }{{/jdk8-default-interface}}
- {{/operation}}
- }
- {{/operations}}
|