mirror of
https://github.com/PowerJob/PowerJob.git
synced 2025-07-17 00:00:04 +08:00
feat: support disable swagger-ui by config #203
This commit is contained in:
parent
75d922d4a9
commit
b24e0d2682
@ -20,6 +20,10 @@ public class PowerJobServerConfigKey {
|
|||||||
* 是否使用 mongoDB
|
* 是否使用 mongoDB
|
||||||
*/
|
*/
|
||||||
public static final String MONGODB_ENABLE = "oms.mongodb.enable";
|
public static final String MONGODB_ENABLE = "oms.mongodb.enable";
|
||||||
|
/**
|
||||||
|
* 是否启用 Swagger-UI,默认关闭
|
||||||
|
*/
|
||||||
|
public static final String SWAGGER_UI_ENABLE = "oms.swagger.enable";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 钉钉报警相关
|
* 钉钉报警相关
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package com.github.kfcfans.powerjob.server.common.config;
|
package com.github.kfcfans.powerjob.server.common.config;
|
||||||
|
|
||||||
|
import com.github.kfcfans.powerjob.server.common.PowerJobServerConfigKey;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||||
@ -23,7 +24,7 @@ import static springfox.documentation.builders.PathSelectors.any;
|
|||||||
*/
|
*/
|
||||||
@Configuration
|
@Configuration
|
||||||
@EnableSwagger2
|
@EnableSwagger2
|
||||||
@ConditionalOnProperty(name = "oms.swagger.enable", havingValue = "true")
|
@ConditionalOnProperty(name = PowerJobServerConfigKey.SWAGGER_UI_ENABLE, havingValue = "true")
|
||||||
public class SwaggerConfig {
|
public class SwaggerConfig {
|
||||||
|
|
||||||
private final BuildProperties buildProperties;
|
private final BuildProperties buildProperties;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user