优化代码注释
This commit is contained in:
@@ -7,7 +7,6 @@ import org.springframework.context.annotation.Bean;
|
|||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 插件集成配置
|
|
||||||
* @Author: jishenghua
|
* @Author: jishenghua
|
||||||
* @Version: 1.0
|
* @Version: 1.0
|
||||||
* @Create Date Time: 2019-05-30 15:53
|
* @Create Date Time: 2019-05-30 15:53
|
||||||
@@ -16,18 +15,10 @@ import org.springframework.context.annotation.Configuration;
|
|||||||
*/
|
*/
|
||||||
@Configuration
|
@Configuration
|
||||||
public class PluginBeanConfig {
|
public class PluginBeanConfig {
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 定义插件应用。使用可以注入它操作插件。
|
|
||||||
* @return PluginApplication
|
|
||||||
*/
|
|
||||||
@Bean
|
@Bean
|
||||||
public PluginApplication pluginApplication(){
|
public PluginApplication pluginApplication(){
|
||||||
// 实例化自动初始化插件的PluginApplication
|
|
||||||
PluginApplication pluginApplication = new AutoPluginApplication();
|
PluginApplication pluginApplication = new AutoPluginApplication();
|
||||||
pluginApplication.addExtension(new SpringBootMybatisExtension());
|
pluginApplication.addExtension(new SpringBootMybatisExtension());
|
||||||
return pluginApplication;
|
return pluginApplication;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,19 +27,12 @@ public class PluginConfiguration extends DefaultIntegrationConfiguration {
|
|||||||
@Value("${runMode:dev}")
|
@Value("${runMode:dev}")
|
||||||
private String runMode;
|
private String runMode;
|
||||||
|
|
||||||
/**
|
|
||||||
* 插件的路径
|
|
||||||
*/
|
|
||||||
@Value("${pluginPath:plugins}")
|
@Value("${pluginPath:plugins}")
|
||||||
private String pluginPath;
|
private String pluginPath;
|
||||||
|
|
||||||
/**
|
|
||||||
* 插件文件的路径
|
|
||||||
*/
|
|
||||||
@Value("${pluginConfigFilePath:pluginConfigs}")
|
@Value("${pluginConfigFilePath:pluginConfigs}")
|
||||||
private String pluginConfigFilePath;
|
private String pluginConfigFilePath;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public RuntimeMode environment() {
|
public RuntimeMode environment() {
|
||||||
return RuntimeMode.byName(runMode);
|
return RuntimeMode.byName(runMode);
|
||||||
@@ -55,38 +48,21 @@ public class PluginConfiguration extends DefaultIntegrationConfiguration {
|
|||||||
return pluginConfigFilePath;
|
return pluginConfigFilePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 重写上传插件包的临时存储路径。只适用于生产环境
|
|
||||||
* @return String
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public String uploadTempPath() {
|
public String uploadTempPath() {
|
||||||
return "temp";
|
return "temp";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 重写插件备份路径。只适用于生产环境
|
|
||||||
* @return String
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public String backupPath() {
|
public String backupPath() {
|
||||||
return "backupPlugin";
|
return "backupPlugin";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 重写插件RestController请求的路径前缀
|
|
||||||
* @return String
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public String pluginRestControllerPathPrefix() {
|
public String pluginRestControllerPathPrefix() {
|
||||||
return "/api/plugin";
|
return "/api/plugin";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 重写是否启用插件id作为RestController请求的路径前缀。
|
|
||||||
* 启动则插件id会作为二级路径前缀。即: /api/plugin/pluginId/**
|
|
||||||
* @return String
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public boolean enablePluginIdRestControllerPathPrefix() {
|
public boolean enablePluginIdRestControllerPathPrefix() {
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -104,7 +104,6 @@ public class TenantConfig {
|
|||||||
return scannerConfigurer;
|
return scannerConfigurer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 性能分析拦截器,不建议生产使用
|
* 性能分析拦截器,不建议生产使用
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -6,10 +6,8 @@ import org.springframework.beans.factory.annotation.Value;
|
|||||||
import org.springframework.boot.web.server.WebServerFactoryCustomizer;
|
import org.springframework.boot.web.server.WebServerFactoryCustomizer;
|
||||||
import org.springframework.boot.web.servlet.server.ConfigurableServletWebServerFactory;
|
import org.springframework.boot.web.servlet.server.ConfigurableServletWebServerFactory;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
//@Configuration
|
|
||||||
public class WebConfig {
|
public class WebConfig {
|
||||||
private static final Logger logger = LoggerFactory.getLogger(WebConfig.class);
|
private static final Logger logger = LoggerFactory.getLogger(WebConfig.class);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user