123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273 |
- /**
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) ({{{generatorVersion}}}).
- * https://openapi-generator.tech
- * Do not edit the class manually.
- */
- package {{package}};
- {{#imports}}import {{import}};
- {{/imports}}
- {{#swagger2AnnotationLibrary}}
- import io.swagger.v3.oas.annotations.ExternalDocumentation;
- import io.swagger.v3.oas.annotations.Operation;
- import io.swagger.v3.oas.annotations.Parameter;
- import io.swagger.v3.oas.annotations.Parameters;
- import io.swagger.v3.oas.annotations.media.ArraySchema;
- import io.swagger.v3.oas.annotations.media.Content;
- import io.swagger.v3.oas.annotations.media.Schema;
- import io.swagger.v3.oas.annotations.responses.ApiResponse;
- import io.swagger.v3.oas.annotations.security.SecurityRequirement;
- import io.swagger.v3.oas.annotations.tags.Tag;
- import io.swagger.v3.oas.annotations.enums.ParameterIn;
- {{/swagger2AnnotationLibrary}}
- {{#swagger1AnnotationLibrary}}
- import io.swagger.annotations.*;
- {{/swagger1AnnotationLibrary}}
- {{#jdk8-no-delegate}}
- {{#virtualService}}
- import io.virtualan.annotation.ApiVirtual;
- import io.virtualan.annotation.VirtualService;
- {{/virtualService}}
- import org.springframework.http.HttpStatus;
- import org.springframework.http.MediaType;
- {{/jdk8-no-delegate}}
- {{^useResponseEntity}}
- import org.springframework.http.HttpStatus;
- {{/useResponseEntity}}
- {{#useResponseEntity}}
- import org.springframework.http.ResponseEntity;
- {{/useResponseEntity}}
- {{#useBeanValidation}}
- import org.springframework.validation.annotation.Validated;
- {{/useBeanValidation}}
- {{#useSpringController}}
- {{#useResponseEntity}}
- import org.springframework.stereotype.Controller;
- {{/useResponseEntity}}
- {{^useResponseEntity}}
- import org.springframework.web.bind.annotation.RestController;
- {{/useResponseEntity}}
- {{/useSpringController}}
- import org.springframework.web.bind.annotation.*;
- {{#jdk8-no-delegate}}
- {{^reactive}}
- import org.springframework.web.context.request.NativeWebRequest;
- {{/reactive}}
- {{/jdk8-no-delegate}}
- 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.Valid;
- import {{javaxPackage}}.validation.constraints.*;
- {{/useBeanValidation}}
- import java.util.List;
- import java.util.Map;
- {{#jdk8-no-delegate}}
- import java.util.Optional;
- {{/jdk8-no-delegate}}
- {{^jdk8-no-delegate}}
- {{#useOptional}}
- import java.util.Optional;
- {{/useOptional}}
- {{/jdk8-no-delegate}}
- {{#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;
- {{>generatedAnnotation}}
- {{#useBeanValidation}}
- @Validated
- {{/useBeanValidation}}
- {{#useSpringController}}
- {{#useResponseEntity}}
- @Controller
- {{/useResponseEntity}}
- {{^useResponseEntity}}
- @RestController
- {{/useResponseEntity}}
- {{/useSpringController}}
- {{#swagger2AnnotationLibrary}}
- @Tag(name = "{{{tagName}}}", description = {{#tagDescription}}"{{{.}}}"{{/tagDescription}}{{^tagDescription}}"the {{{tagName}}} API"{{/tagDescription}})
- {{/swagger2AnnotationLibrary}}
- {{#swagger1AnnotationLibrary}}
- @Api(value = "{{{tagName}}}", description = {{#tagDescription}}"{{{.}}}"{{/tagDescription}}{{^tagDescription}}"the {{{tagName}}} API"{{/tagDescription}})
- {{/swagger1AnnotationLibrary}}
- {{#operations}}
- {{#virtualService}}
- @VirtualService
- {{/virtualService}}
- {{#useRequestMappingOnInterface}}
- {{=<% %>=}}
- @RequestMapping("${openapi.<%title%>.base-path:<%>defaultBasePath%>}")
- <%={{ }}=%>
- {{/useRequestMappingOnInterface}}
- public interface {{classname}} {
- {{#jdk8-default-interface}}
- {{^isDelegate}}
- {{^reactive}}
- default Optional<NativeWebRequest> getRequest() {
- return Optional.empty();
- }
- {{/reactive}}
- {{/isDelegate}}
- {{#isDelegate}}
- default {{classname}}Delegate getDelegate() {
- return new {{classname}}Delegate() {};
- }
- {{/isDelegate}}
- {{/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}}
- */
- {{#isDeprecated}}
- @Deprecated
- {{/isDeprecated}}
- {{#virtualService}}
- @ApiVirtual
- {{/virtualService}}
- {{#swagger2AnnotationLibrary}}
- @Operation(
- operationId = "{{{operationId}}}",
- {{#summary}}
- summary = "{{{.}}}",
- {{/summary}}
- {{#notes}}
- description = "{{{.}}}",
- {{/notes}}
- {{#vendorExtensions.x-tags.size}}
- tags = { {{#vendorExtensions.x-tags}}"{{tag}}"{{^-last}}, {{/-last}}{{/vendorExtensions.x-tags}} },
- {{/vendorExtensions.x-tags.size}}
- responses = {
- {{#responses}}
- @ApiResponse(responseCode = {{#isDefault}}"default"{{/isDefault}}{{^isDefault}}"{{{code}}}"{{/isDefault}}, description = "{{{message}}}"{{#baseType}}, content = {
- {{#produces}}
- @Content(mediaType = "{{{mediaType}}}", {{#isArray}}array = @ArraySchema({{/isArray}}schema = @Schema(implementation = {{{baseType}}}.class){{#isArray}}){{/isArray}}){{^-last}},{{/-last}}
- {{/produces}}
- }{{/baseType}}){{^-last}},{{/-last}}
- {{/responses}}
- }{{#hasAuthMethods}},
- security = {
- {{#authMethods}}
- @SecurityRequirement(name = "{{name}}"{{#isOAuth}}, scopes={ {{#scopes}}"{{scope}}"{{^-last}}, {{/-last}}{{/scopes}} }{{/isOAuth}}){{^-last}},{{/-last}}
- {{/authMethods}}
- }{{/hasAuthMethods}}{{#externalDocs}},
- externalDocs = @ExternalDocumentation(description = "{{externalDocs.description}}", url = "{{externalDocs.url}}"){{/externalDocs}}
- )
- {{/swagger2AnnotationLibrary}}
- {{#swagger1AnnotationLibrary}}
- @ApiOperation(
- {{#vendorExtensions.x-tags.size}}
- tags = { {{#vendorExtensions.x-tags}}"{{tag}}"{{^-last}}, {{/-last}}{{/vendorExtensions.x-tags}} },
- {{/vendorExtensions.x-tags.size}}
- value = "{{{summary}}}",
- nickname = "{{{operationId}}}",
- notes = "{{{notes}}}"{{#returnBaseType}},
- response = {{{.}}}.class{{/returnBaseType}}{{#returnContainer}},
- responseContainer = "{{{.}}}"{{/returnContainer}}{{#hasAuthMethods}},
- authorizations = {
- {{#authMethods}}
- {{#isOAuth}}
- @Authorization(value = "{{name}}", scopes = {
- {{#scopes}}
- @AuthorizationScope(scope = "{{scope}}", description = "{{description}}"){{^-last}},{{/-last}}
- {{/scopes}}
- }){{^-last}},{{/-last}}
- {{/isOAuth}}
- {{^isOAuth}}
- @Authorization(value = "{{name}}"){{^-last}},{{/-last}}
- {{/isOAuth}}
- {{/authMethods}} }{{/hasAuthMethods}}
- )
- @ApiResponses({
- {{#responses}}
- @ApiResponse(code = {{{code}}}, message = "{{{message}}}"{{#baseType}}, response = {{{.}}}.class{{/baseType}}{{#containerType}}, responseContainer = "{{{.}}}"{{/containerType}}){{^-last}},{{/-last}}
- {{/responses}}
- })
- {{/swagger1AnnotationLibrary}}
- {{#implicitHeadersParams.0}}
- {{#swagger2AnnotationLibrary}}
- @Parameters({
- {{#implicitHeadersParams}}
- {{>paramDoc}}{{^-last}},{{/-last}}
- {{/implicitHeadersParams}}
- })
- {{/swagger2AnnotationLibrary}}
- {{#swagger1AnnotationLibrary}}
- @ApiImplicitParams({
- {{#implicitHeadersParams}}
- {{>implicitHeader}}{{^-last}},{{/-last}}
- {{/implicitHeadersParams}}
- })
- {{/swagger1AnnotationLibrary}}
- {{/implicitHeadersParams.0}}
- @RequestMapping(
- method = RequestMethod.{{httpMethod}},
- value = "{{{path}}}"{{#singleContentTypes}}{{#hasProduces}},
- produces = "{{{vendorExtensions.x-accepts}}}"{{/hasProduces}}{{#hasConsumes}},
- consumes = "{{{vendorExtensions.x-content-type}}}"{{/hasConsumes}}{{/singleContentTypes}}{{^singleContentTypes}}{{#hasProduces}},
- produces = { {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} }{{/hasProduces}}{{#hasConsumes}},
- consumes = { {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}} }{{/hasConsumes}}{{/singleContentTypes}}{{#hasVersionHeaders}},
- headers = { {{#vendorExtensions.versionHeaderParamsList}}"{{baseName}}{{#defaultValue}}={{{.}}}{{/defaultValue}}"{{^-last}}, {{/-last}}{{/vendorExtensions.versionHeaderParamsList}} } {{/hasVersionHeaders}}{{#hasVersionQueryParams}},
- params = { {{#vendorExtensions.versionQueryParamsList}}"{{baseName}}{{#defaultValue}}={{{.}}}{{/defaultValue}}"{{^-last}}, {{/-last}}{{/vendorExtensions.versionQueryParamsList}} } {{/hasVersionQueryParams}}
- )
- {{^useResponseEntity}}
- @ResponseStatus({{#springHttpStatus}}{{#responses.0}}{{{code}}}{{/responses.0}}{{/springHttpStatus}})
- {{/useResponseEntity}}
- {{#vendorExtensions.x-operation-extra-annotation}}
- {{{.}}}
- {{/vendorExtensions.x-operation-extra-annotation}}
- {{#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}} {{#delegate-method}}_{{/delegate-method}}{{operationId}}(
- {{^vendorExtensions.x-spring-paginated}}{{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{>cookieParams}}{{^-last}},
- {{/-last}}{{/allParams}}{{/vendorExtensions.x-spring-paginated}}{{#vendorExtensions.x-spring-paginated}}{{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>pageBodyParams}}{{>formParams}}{{>cookieParams}}{{^-last}},
- {{/-last}}{{/allParams}}{{/vendorExtensions.x-spring-paginated}}{{#reactive}}{{#hasParams}},
- {{/hasParams}}{{#swagger2AnnotationLibrary}}@Parameter(hidden = true){{/swagger2AnnotationLibrary}}{{#springFoxDocumentationProvider}}@ApiIgnore{{/springFoxDocumentationProvider}} final ServerWebExchange exchange{{/reactive}}
- ){{#unhandledException}} throws Exception{{/unhandledException}}{{^jdk8-default-interface}};{{/jdk8-default-interface}}{{#jdk8-default-interface}} {
- {{#delegate-method}}
- {{^isVoid}}return {{/isVoid}}{{#isVoid}}{{#useResponseEntity}}return {{/useResponseEntity}}{{^useResponseEntity}}{{#reactive}}return {{/reactive}}{{/useResponseEntity}}{{/isVoid}}{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#reactive}}{{#hasParams}}, {{/hasParams}}exchange{{/reactive}});
- }
- // Override this method
- {{#jdk8-default-interface}}default {{/jdk8-default-interface}} {{#responseWrapper}}{{.}}<{{/responseWrapper}}{{#useResponseEntity}}Result<{{/useResponseEntity}}{{>returnTypes}}{{#useResponseEntity}}>{{/useResponseEntity}}{{#responseWrapper}}>{{/responseWrapper}} {{operationId}}({{#allParams}}{{^isFile}}{{^isBodyParam}}{{>optionalDataType}}{{/isBodyParam}}{{#isBodyParam}}{{^reactive}}{{{dataType}}}{{/reactive}}{{#reactive}}{{^isArray}}Mono<{{{dataType}}}>{{/isArray}}{{#isArray}}Flux<{{{baseType}}}>{{/isArray}}{{/reactive}}{{/isBodyParam}}{{/isFile}}{{#isFile}}{{#reactive}}Flux<Part>{{/reactive}}{{^reactive}}MultipartFile{{/reactive}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#reactive}}{{#hasParams}}, {{/hasParams}}{{#springFoxDocumentationProvider}}@ApiIgnore{{/springFoxDocumentationProvider}} final ServerWebExchange exchange{{/reactive}}{{#vendorExtensions.x-spring-paginated}}{{#hasParams}}, {{/hasParams}}{{^hasParams}}{{#reactive}}, {{/reactive}}{{/hasParams}}{{#springFoxDocumentationProvider}}@ApiIgnore{{/springFoxDocumentationProvider}}final Pageable pageable{{/vendorExtensions.x-spring-paginated}}){{#unhandledException}} throws Exception{{/unhandledException}} {
- {{/delegate-method}}
- {{^isDelegate}}
- {{>methodBody}}
- {{/isDelegate}}
- {{#isDelegate}}
- {{^isVoid}}return {{/isVoid}}{{#isVoid}}{{#useResponseEntity}}return {{/useResponseEntity}}{{^useResponseEntity}}{{#reactive}}return {{/reactive}}{{/useResponseEntity}}{{/isVoid}}getDelegate().{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#reactive}}{{#hasParams}}, {{/hasParams}}exchange{{/reactive}});
- {{/isDelegate}}
- }{{/jdk8-default-interface}}
- {{/operation}}
- }
- {{/operations}}
|