mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-07-06 15:40:54 +00:00
add @Generated to all Java class templates
This commit is contained in:
parent
6fbb8ab1e0
commit
38fccbd73d
@ -30,6 +30,7 @@ import static org.springframework.http.MediaType.*;
|
|||||||
@Controller
|
@Controller
|
||||||
@RequestMapping(value = "/{{baseName}}", produces = {APPLICATION_JSON_VALUE})
|
@RequestMapping(value = "/{{baseName}}", produces = {APPLICATION_JSON_VALUE})
|
||||||
@Api(value = "/{{baseName}}", description = "the {{baseName}} API")
|
@Api(value = "/{{baseName}}", description = "the {{baseName}} API")
|
||||||
|
{{>generatedAnnotation}}
|
||||||
{{#operations}}
|
{{#operations}}
|
||||||
public class {{classname}} {
|
public class {{classname}} {
|
||||||
{{#operation}}
|
{{#operation}}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package {{apiPackage}};
|
package {{apiPackage}};
|
||||||
|
|
||||||
|
{{>generatedAnnotation}}
|
||||||
public class ApiException extends Exception{
|
public class ApiException extends Exception{
|
||||||
private int code;
|
private int code;
|
||||||
public ApiException (int code, String msg) {
|
public ApiException (int code, String msg) {
|
||||||
|
@ -5,6 +5,7 @@ import java.io.IOException;
|
|||||||
import javax.servlet.*;
|
import javax.servlet.*;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
{{>generatedAnnotation}}
|
||||||
public class ApiOriginFilter implements javax.servlet.Filter {
|
public class ApiOriginFilter implements javax.servlet.Filter {
|
||||||
@Override
|
@Override
|
||||||
public void doFilter(ServletRequest request, ServletResponse response,
|
public void doFilter(ServletRequest request, ServletResponse response,
|
||||||
|
@ -3,6 +3,7 @@ package {{apiPackage}};
|
|||||||
import javax.xml.bind.annotation.XmlTransient;
|
import javax.xml.bind.annotation.XmlTransient;
|
||||||
|
|
||||||
@javax.xml.bind.annotation.XmlRootElement
|
@javax.xml.bind.annotation.XmlRootElement
|
||||||
|
{{>generatedAnnotation}}
|
||||||
public class ApiResponseMessage {
|
public class ApiResponseMessage {
|
||||||
public static final int ERROR = 1;
|
public static final int ERROR = 1;
|
||||||
public static final int WARNING = 2;
|
public static final int WARNING = 2;
|
||||||
|
@ -12,6 +12,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
|||||||
* {{description}}
|
* {{description}}
|
||||||
**/{{/description}}
|
**/{{/description}}
|
||||||
@ApiModel(description = "{{{description}}}")
|
@ApiModel(description = "{{{description}}}")
|
||||||
|
{{>generatedAnnotation}}
|
||||||
public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {
|
public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {
|
||||||
{{#vars}}{{#isEnum}}
|
{{#vars}}{{#isEnum}}
|
||||||
public enum {{datatypeWithEnum}} {
|
public enum {{datatypeWithEnum}} {
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package {{apiPackage}};
|
package {{apiPackage}};
|
||||||
|
|
||||||
|
{{>generatedAnnotation}}
|
||||||
public class NotFoundException extends ApiException {
|
public class NotFoundException extends ApiException {
|
||||||
private int code;
|
private int code;
|
||||||
public NotFoundException (int code, String msg) {
|
public NotFoundException (int code, String msg) {
|
||||||
|
@ -18,6 +18,7 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
|||||||
@EnableSwagger2 //Loads the spring beans required by the framework
|
@EnableSwagger2 //Loads the spring beans required by the framework
|
||||||
@PropertySource("classpath:swagger.properties")
|
@PropertySource("classpath:swagger.properties")
|
||||||
@Import(SwaggerUiConfiguration.class)
|
@Import(SwaggerUiConfiguration.class)
|
||||||
|
{{>generatedAnnotation}}
|
||||||
public class SwaggerConfig {
|
public class SwaggerConfig {
|
||||||
@Bean
|
@Bean
|
||||||
ApiInfo apiInfo() {
|
ApiInfo apiInfo() {
|
||||||
|
@ -8,6 +8,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
|
|||||||
|
|
||||||
@Configuration
|
@Configuration
|
||||||
@EnableWebMvc
|
@EnableWebMvc
|
||||||
|
{{>generatedAnnotation}}
|
||||||
public class SwaggerUiConfiguration extends WebMvcConfigurerAdapter {
|
public class SwaggerUiConfiguration extends WebMvcConfigurerAdapter {
|
||||||
private static final String[] SERVLET_RESOURCE_LOCATIONS = { "/" };
|
private static final String[] SERVLET_RESOURCE_LOCATIONS = { "/" };
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@ package {{configPackage}};
|
|||||||
|
|
||||||
import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;
|
import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;
|
||||||
|
|
||||||
|
{{>generatedAnnotation}}
|
||||||
public class WebApplication extends AbstractAnnotationConfigDispatcherServletInitializer {
|
public class WebApplication extends AbstractAnnotationConfigDispatcherServletInitializer {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -3,6 +3,7 @@ package {{configPackage}};
|
|||||||
import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer;
|
import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer;
|
||||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
|
||||||
|
|
||||||
|
{{>generatedAnnotation}}
|
||||||
public class WebMvcConfiguration extends WebMvcConfigurationSupport {
|
public class WebMvcConfiguration extends WebMvcConfigurationSupport {
|
||||||
@Override
|
@Override
|
||||||
public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) {
|
public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user