|
1 |
| -package {{package}}; |
2 |
| - |
3 |
| -import {{modelPackage}}.*; |
4 |
| -import {{package}}.{{classname}}Service; |
5 |
| -import {{package}}.factories.{{classname}}ServiceFactory; |
6 |
| - |
7 |
| -import io.swagger.annotations.ApiParam; |
8 |
| - |
9 |
| -{{#imports}}import {{import}}; |
10 |
| -{{/imports}} |
11 |
| - |
12 |
| -import java.util.List; |
13 |
| -import {{package}}.NotFoundException; |
14 |
| - |
15 |
| -import java.io.InputStream; |
16 |
| - |
17 |
| -import org.glassfish.jersey.media.multipart.FormDataContentDisposition; |
18 |
| -import org.glassfish.jersey.media.multipart.FormDataParam; |
19 |
| - |
20 |
| -import javax.ws.rs.core.Context; |
21 |
| -import javax.ws.rs.core.Response; |
22 |
| -import javax.ws.rs.core.SecurityContext; |
23 |
| -import javax.ws.rs.*; |
24 |
| - |
25 |
| -@Path("/{{baseName}}") |
26 |
| -{{#hasConsumes}}@Consumes({ {{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} }){{/hasConsumes}} |
27 |
| -{{#hasProduces}}@Produces({ {{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }){{/hasProduces}} |
28 |
| -@io.swagger.annotations.Api(description = "the {{baseName}} API") |
29 |
| -{{>generatedAnnotation}} |
30 |
| -{{#operations}} |
31 |
| -public class {{classname}} { |
32 |
| - private final {{classname}}Service delegate = {{classname}}ServiceFactory.get{{classname}}(); |
33 |
| - |
34 |
| -{{#operation}} |
35 |
| - @{{httpMethod}} |
36 |
| - {{#subresourceOperation}}@Path("{{path}}"){{/subresourceOperation}} |
37 |
| - {{#hasConsumes}}@Consumes({ {{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} }){{/hasConsumes}} |
38 |
| - {{#hasProduces}}@Produces({ {{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }){{/hasProduces}} |
39 |
| - @io.swagger.annotations.ApiOperation(value = "{{{summary}}}", notes = "{{{notes}}}", response = {{{returnType}}}.class{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}{{#hasAuthMethods}}, authorizations = { |
40 |
| - {{#authMethods}}@io.swagger.annotations.Authorization(value = "{{name}}"{{#isOAuth}}, scopes = { |
41 |
| - {{#scopes}}@io.swagger.annotations.AuthorizationScope(scope = "{{scope}}", description = "{{description}}"){{#hasMore}}, |
42 |
| - {{/hasMore}}{{/scopes}} |
43 |
| - }{{/isOAuth}}){{#hasMore}}, |
44 |
| - {{/hasMore}}{{/authMethods}} |
45 |
| - }{{/hasAuthMethods}}, tags={ {{#vendorExtensions.x-tags}}"{{tag}}",{{/vendorExtensions.x-tags}} }) |
46 |
| - @io.swagger.annotations.ApiResponses(value = { {{#responses}} |
47 |
| - @io.swagger.annotations.ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{returnType}}}.class{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}){{#hasMore}}, |
48 |
| - {{/hasMore}}{{/responses}} }) |
49 |
| - public Response {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}},{{/allParams}}@Context SecurityContext securityContext) |
50 |
| - throws NotFoundException { |
51 |
| - return delegate.{{nickname}}({{#allParams}}{{#isFile}}inputStream, fileDetail{{/isFile}}{{^isFile}}{{paramName}}{{/isFile}},{{/allParams}}securityContext); |
52 |
| - } |
53 |
| -{{/operation}} |
54 |
| -} |
55 |
| -{{/operations}} |
| 1 | +package {{package}}; |
| 2 | + |
| 3 | +import {{modelPackage}}.*; |
| 4 | +import {{package}}.{{classname}}Service; |
| 5 | +import {{package}}.factories.{{classname}}ServiceFactory; |
| 6 | + |
| 7 | +import io.swagger.annotations.ApiParam; |
| 8 | + |
| 9 | +{{#imports}}import {{import}}; |
| 10 | +{{/imports}} |
| 11 | + |
| 12 | +import java.util.List; |
| 13 | +import {{package}}.NotFoundException; |
| 14 | + |
| 15 | +import java.io.InputStream; |
| 16 | + |
| 17 | +import org.glassfish.jersey.media.multipart.FormDataContentDisposition; |
| 18 | +import org.glassfish.jersey.media.multipart.FormDataParam; |
| 19 | + |
| 20 | +import javax.ws.rs.core.Context; |
| 21 | +import javax.ws.rs.core.Response; |
| 22 | +import javax.ws.rs.core.SecurityContext; |
| 23 | +import javax.ws.rs.*; |
| 24 | + |
| 25 | +@Path("/{{baseName}}") |
| 26 | +{{#hasConsumes}}@Consumes({ {{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} }){{/hasConsumes}} |
| 27 | +{{#hasProduces}}@Produces({ {{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }){{/hasProduces}} |
| 28 | +@io.swagger.annotations.Api(description = "the {{baseName}} API") |
| 29 | +{{>generatedAnnotation}} |
| 30 | +{{#operations}} |
| 31 | +public class {{classname}} { |
| 32 | + private final {{classname}}Service delegate = {{classname}}ServiceFactory.get{{classname}}(); |
| 33 | + |
| 34 | +{{#operation}} |
| 35 | + @{{httpMethod}} |
| 36 | + {{#subresourceOperation}}@Path("{{path}}"){{/subresourceOperation}} |
| 37 | + {{#hasConsumes}}@Consumes({ {{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} }){{/hasConsumes}} |
| 38 | + {{#hasProduces}}@Produces({ {{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }){{/hasProduces}} |
| 39 | + @io.swagger.annotations.ApiOperation(value = "{{{summary}}}", notes = "{{{notes}}}", response = {{{returnType}}}.class{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}{{#hasAuthMethods}}, authorizations = { |
| 40 | + {{#authMethods}}@io.swagger.annotations.Authorization(value = "{{name}}"{{#isOAuth}}, scopes = { |
| 41 | + {{#scopes}}@io.swagger.annotations.AuthorizationScope(scope = "{{scope}}", description = "{{description}}"){{#hasMore}}, |
| 42 | + {{/hasMore}}{{/scopes}} |
| 43 | + }{{/isOAuth}}){{#hasMore}}, |
| 44 | + {{/hasMore}}{{/authMethods}} |
| 45 | + }{{/hasAuthMethods}}, tags={ {{#vendorExtensions.x-tags}}"{{tag}}",{{/vendorExtensions.x-tags}} }) |
| 46 | + @io.swagger.annotations.ApiResponses(value = { {{#responses}} |
| 47 | + @io.swagger.annotations.ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{returnType}}}.class{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}){{#hasMore}}, |
| 48 | + {{/hasMore}}{{/responses}} }) |
| 49 | + public Response {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}},{{/allParams}}@Context SecurityContext securityContext) |
| 50 | + throws NotFoundException { |
| 51 | + return delegate.{{nickname}}({{#allParams}}{{#isFile}}{{paramName}}InputStream, {{paramName}}Detail{{/isFile}}{{^isFile}}{{paramName}}{{/isFile}},{{/allParams}}securityContext); |
| 52 | + } |
| 53 | +{{/operation}} |
| 54 | +} |
| 55 | +{{/operations}} |
0 commit comments