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