|
@@ -1,44 +1,44 @@
|
|
|
-package com.txz.project.configurer;
|
|
|
-
|
|
|
-import io.swagger.v3.oas.models.Components;
|
|
|
-import io.swagger.v3.oas.models.OpenAPI;
|
|
|
-import io.swagger.v3.oas.models.info.Contact;
|
|
|
-import io.swagger.v3.oas.models.info.Info;
|
|
|
-import io.swagger.v3.oas.models.info.License;
|
|
|
-import io.swagger.v3.oas.models.parameters.Parameter;
|
|
|
-import org.springframework.context.annotation.Bean;
|
|
|
-import org.springframework.context.annotation.Configuration;
|
|
|
-import org.springframework.context.annotation.Profile;
|
|
|
-
|
|
|
-
|
|
|
-@Configuration
|
|
|
-@Profile({"dev", "test"})
|
|
|
-public class SwaggerConfig {
|
|
|
-
|
|
|
- @Bean
|
|
|
- public OpenAPI customOpenAPI() {
|
|
|
- return new OpenAPI()
|
|
|
- .components(new Components()
|
|
|
- .addParameters("token", new Parameter()
|
|
|
- .name("token")
|
|
|
- .description("user token")
|
|
|
- .required(false)
|
|
|
- .in("header"))
|
|
|
- .addParameters("appCode", new Parameter()
|
|
|
- .name("appCode")
|
|
|
- .description("appCode")
|
|
|
- .required(false)
|
|
|
- .in("header")))
|
|
|
- .info(new Info()
|
|
|
- .title("API接口文档")
|
|
|
- .description("swagger2 demo api")
|
|
|
- .version("1.0")
|
|
|
- .contact(new Contact()
|
|
|
- .name("admin")
|
|
|
- .url("http://localhost/swagger-ui.html")
|
|
|
- .email("xxx@qq.com"))
|
|
|
- .license(new License()
|
|
|
- .name("Apache 2.0")
|
|
|
- .url("http://localhost/swagger-ui.html")));
|
|
|
- }
|
|
|
-}
|
|
|
+//package com.txz.project.configurer;
|
|
|
+//
|
|
|
+//import io.swagger.v3.oas.models.Components;
|
|
|
+//import io.swagger.v3.oas.models.OpenAPI;
|
|
|
+//import io.swagger.v3.oas.models.info.Contact;
|
|
|
+//import io.swagger.v3.oas.models.info.Info;
|
|
|
+//import io.swagger.v3.oas.models.info.License;
|
|
|
+//import io.swagger.v3.oas.models.parameters.Parameter;
|
|
|
+//import org.springframework.context.annotation.Bean;
|
|
|
+//import org.springframework.context.annotation.Configuration;
|
|
|
+//import org.springframework.context.annotation.Profile;
|
|
|
+//
|
|
|
+//
|
|
|
+//@Configuration
|
|
|
+//@Profile({"dev", "test"})
|
|
|
+//public class SwaggerConfig {
|
|
|
+//
|
|
|
+// @Bean
|
|
|
+// public OpenAPI customOpenAPI() {
|
|
|
+// return new OpenAPI()
|
|
|
+// .components(new Components()
|
|
|
+// .addParameters("token", new Parameter()
|
|
|
+// .name("token")
|
|
|
+// .description("user token")
|
|
|
+// .required(false)
|
|
|
+// .in("header"))
|
|
|
+// .addParameters("appCode", new Parameter()
|
|
|
+// .name("appCode")
|
|
|
+// .description("appCode")
|
|
|
+// .required(false)
|
|
|
+// .in("header")))
|
|
|
+// .info(new Info()
|
|
|
+// .title("API接口文档")
|
|
|
+// .description("swagger2 demo api")
|
|
|
+// .version("1.0")
|
|
|
+// .contact(new Contact()
|
|
|
+// .name("admin")
|
|
|
+// .url("http://localhost/swagger-ui.html")
|
|
|
+// .email("xxx@qq.com"))
|
|
|
+// .license(new License()
|
|
|
+// .name("Apache 2.0")
|
|
|
+// .url("http://localhost/swagger-ui.html")));
|
|
|
+// }
|
|
|
+//}
|