All Downloads are FREE. Search and download functionalities are using the official Maven repository.

kotlin-spring.apiDelegate.mustache Maven / Gradle / Ivy

package {{package}}

{{#imports}}import {{import}}
{{/imports}}
import org.springframework.http.HttpStatus
import org.springframework.http.MediaType
import org.springframework.http.ResponseEntity
import org.springframework.web.context.request.NativeWebRequest
import org.springframework.core.io.Resource
{{#reactive}}
import org.springframework.web.server.ServerWebExchange
import reactor.core.publisher.Flux
import reactor.core.publisher.Mono
{{/reactive}}

import java.util.Optional
{{#async}}
import java.util.concurrent.CompletableFuture
{{/async}}

{{#operations}}
/**
 * A delegate to be called by the {@link {{classname}}Controller}}.
 * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class.
 */
{{>generatedAnnotation}}
interface {{classname}}Delegate {

    fun getRequest(): Optional = Optional.empty()
{{#operation}}

    /**
     * @see {{classname}}#{{operationId}}
     */
    fun {{operationId}}({{#allParams}}{{paramName}}: {{^isFile}}{{^isBodyParam}}{{>optionalDataType}}{{/isBodyParam}}{{#isBodyParam}}{{{dataType}}}{{/isBodyParam}}{{/isFile}}{{#isFile}}Resource?{{/isFile}}{{#hasMore}},
        {{/hasMore}}{{/allParams}}): {{#responseWrapper}}{{.}}<{{/responseWrapper}}ResponseEntity<{{>returnTypes}}>{{#responseWrapper}}>{{/responseWrapper}} {
        {{>methodBody}}
    }

{{/operation}}
}
{{/operations}}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy