swagger是否生成文档改成配置文件
This commit is contained in:
parent
11eed02309
commit
23a78f0756
@ -9,6 +9,7 @@
|
|||||||
package com.lz.config;
|
package com.lz.config;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||||
@ -29,10 +30,13 @@ import static com.google.common.collect.Lists.newArrayList;
|
|||||||
@EnableSwagger2
|
@EnableSwagger2
|
||||||
public class SwaggerConfig implements WebMvcConfigurer {
|
public class SwaggerConfig implements WebMvcConfigurer {
|
||||||
|
|
||||||
|
@Value(value = "${swagger.enable}")
|
||||||
|
boolean enableSwagger;
|
||||||
@Bean
|
@Bean
|
||||||
public Docket createRestApi() {
|
public Docket createRestApi() {
|
||||||
return new Docket(DocumentationType.SWAGGER_2)
|
return new Docket(DocumentationType.SWAGGER_2)
|
||||||
.apiInfo(apiInfo())
|
.apiInfo(apiInfo())
|
||||||
|
.enable(enableSwagger)
|
||||||
.select()
|
.select()
|
||||||
//加了ApiOperation注解的类,才生成接口文档
|
//加了ApiOperation注解的类,才生成接口文档
|
||||||
.apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class))
|
.apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class))
|
||||||
|
|||||||
@ -267,8 +267,6 @@ public class DingtalkBusiness {
|
|||||||
integer.setMemberCount(integer.getMemberCount() + staffs.size());
|
integer.setMemberCount(integer.getMemberCount() + staffs.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(staffs.size() > 0){
|
if(staffs.size() > 0){
|
||||||
for (DepartmentStaffBo departmentStaffBo:staffs
|
for (DepartmentStaffBo departmentStaffBo:staffs
|
||||||
) {
|
) {
|
||||||
|
|||||||
@ -37,6 +37,8 @@ domain:
|
|||||||
main: "http://192.168.43.94:8001"
|
main: "http://192.168.43.94:8001"
|
||||||
sms:
|
sms:
|
||||||
code: false
|
code: false
|
||||||
|
swagger:
|
||||||
|
enable: true
|
||||||
|
|
||||||
##多数据源的配置
|
##多数据源的配置
|
||||||
#dynamic:
|
#dynamic:
|
||||||
|
|||||||
@ -36,6 +36,8 @@ domain:
|
|||||||
main: "https://lzmanagement.ldxinyong.com"
|
main: "https://lzmanagement.ldxinyong.com"
|
||||||
sms:
|
sms:
|
||||||
code: true
|
code: true
|
||||||
|
swagger:
|
||||||
|
enable: true
|
||||||
##多数据源的配置
|
##多数据源的配置
|
||||||
#dynamic:
|
#dynamic:
|
||||||
# datasource:
|
# datasource:
|
||||||
|
|||||||
@ -36,7 +36,8 @@ domain:
|
|||||||
main: "http:/localhost"
|
main: "http:/localhost"
|
||||||
sms:
|
sms:
|
||||||
code: false
|
code: false
|
||||||
|
swagger:
|
||||||
|
enable: true
|
||||||
|
|
||||||
##多数据源的配置
|
##多数据源的配置
|
||||||
#dynamic:
|
#dynamic:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user