| package {{apiPackage}}; |
| |
| import static org.springframework.http.MediaType.*; |
| import java.util.List; |
| import java.util.Map; |
| {{#imports}}import {{import}}; |
| {{/imports}} |
| import org.springframework.http.HttpStatus; |
| import org.springframework.http.ResponseEntity; |
| import org.springframework.web.bind.annotation.PathVariable; |
| import org.springframework.web.bind.annotation.RequestBody; |
| import org.springframework.web.bind.annotation.RequestHeader; |
| import org.springframework.web.bind.annotation.RequestMapping; |
| import org.springframework.web.bind.annotation.RequestMethod; |
| import org.springframework.web.bind.annotation.RequestParam; |
| import org.springframework.web.bind.annotation.RequestPart; |
| import org.springframework.web.multipart.MultipartFile; |
| import org.springframework.web.bind.annotation.RestController; |
| |
| @RestController |
| @RequestMapping(value = "{{#getRelativeBasePath}}{{basePath}}{{/getRelativeBasePath}}", produces = {APPLICATION_JSON_VALUE}) |
| {{#operations}} |
| public class {{classname}} { |
| {{#operation}} |
| |
| @RequestMapping(value = "{{path}}", {{#hasProduces}}produces = { {{#produces}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }, {{/hasProduces}} {{#hasConsumes}}consumes = { {{#consumes}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} },{{/hasConsumes}}method = RequestMethod.{{httpMethod}}) |
| public {{>provider/servlet/returnTypes}} {{operationId}}({{#allParams}}{{>provider/servlet/queryParams}}{{>provider/servlet/pathParams}}{{>provider/servlet/headerParams}}{{>provider/servlet/bodyParams}}{{>provider/servlet/formParams}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) { |
| // do something |
| return null; |
| } |
| {{/operation}} |
| } |
| {{/operations}} |