|
@@ -50,11 +50,11 @@ class PathInfoHandler {
|
|
*/
|
|
*/
|
|
private final PackageConfig packageConfig;
|
|
private final PackageConfig packageConfig;
|
|
|
|
|
|
- PathInfoHandler(GlobalConfig globalConfig, StrategyConfig strategyConfig, PackageConfig packageConfig) {
|
|
|
|
|
|
+ PathInfoHandler(InjectionConfig injectionConfig, GlobalConfig globalConfig, StrategyConfig strategyConfig, PackageConfig packageConfig) {
|
|
this.outputDir = globalConfig.getOutputDir();
|
|
this.outputDir = globalConfig.getOutputDir();
|
|
this.packageConfig = packageConfig;
|
|
this.packageConfig = packageConfig;
|
|
// 设置默认输出路径
|
|
// 设置默认输出路径
|
|
- this.setDefaultPathInfo(globalConfig, strategyConfig);
|
|
|
|
|
|
+ this.setDefaultPathInfo(injectionConfig, globalConfig, strategyConfig);
|
|
// 覆盖自定义路径
|
|
// 覆盖自定义路径
|
|
Map<OutputFile, String> pathInfo = packageConfig.getPathInfo();
|
|
Map<OutputFile, String> pathInfo = packageConfig.getPathInfo();
|
|
if (CollectionUtils.isNotEmpty(pathInfo)) {
|
|
if (CollectionUtils.isNotEmpty(pathInfo)) {
|
|
@@ -68,40 +68,40 @@ class PathInfoHandler {
|
|
* @param globalConfig 全局配置
|
|
* @param globalConfig 全局配置
|
|
* @param strategyConfig 模板配置
|
|
* @param strategyConfig 模板配置
|
|
*/
|
|
*/
|
|
- private void setDefaultPathInfo(GlobalConfig globalConfig, StrategyConfig strategyConfig) {
|
|
|
|
|
|
+ private void setDefaultPathInfo(InjectionConfig injectionConfig, GlobalConfig globalConfig, StrategyConfig strategyConfig) {
|
|
Entity entity = strategyConfig.entity();
|
|
Entity entity = strategyConfig.entity();
|
|
if (entity.isGenerate()) {
|
|
if (entity.isGenerate()) {
|
|
- putPathInfo(globalConfig.isKotlin() ? entity.getKotlinTemplate() : entity.getJavaTemplate(), OutputFile.entity, ConstVal.ENTITY);
|
|
|
|
|
|
+ putPathInfo(injectionConfig, globalConfig.isKotlin() ? entity.getKotlinTemplate() : entity.getJavaTemplate(), OutputFile.entity, ConstVal.ENTITY);
|
|
}
|
|
}
|
|
Mapper mapper = strategyConfig.mapper();
|
|
Mapper mapper = strategyConfig.mapper();
|
|
if (mapper.isGenerateMapper()) {
|
|
if (mapper.isGenerateMapper()) {
|
|
- putPathInfo(mapper.getMapperTemplatePath(), OutputFile.mapper, ConstVal.MAPPER);
|
|
|
|
|
|
+ putPathInfo(injectionConfig, mapper.getMapperTemplatePath(), OutputFile.mapper, ConstVal.MAPPER);
|
|
}
|
|
}
|
|
if (mapper.isGenerateMapperXml()) {
|
|
if (mapper.isGenerateMapperXml()) {
|
|
- putPathInfo(mapper.getMapperXmlTemplatePath(), OutputFile.xml, ConstVal.XML);
|
|
|
|
|
|
+ putPathInfo(injectionConfig, mapper.getMapperXmlTemplatePath(), OutputFile.xml, ConstVal.XML);
|
|
}
|
|
}
|
|
Service service = strategyConfig.service();
|
|
Service service = strategyConfig.service();
|
|
if (service.isGenerateService()) {
|
|
if (service.isGenerateService()) {
|
|
- putPathInfo(service.getServiceTemplate(), OutputFile.service, ConstVal.SERVICE);
|
|
|
|
|
|
+ putPathInfo(injectionConfig, service.getServiceTemplate(), OutputFile.service, ConstVal.SERVICE);
|
|
}
|
|
}
|
|
if (service.isGenerateServiceImpl()) {
|
|
if (service.isGenerateServiceImpl()) {
|
|
- putPathInfo(service.getServiceImplTemplate(), OutputFile.serviceImpl, ConstVal.SERVICE_IMPL);
|
|
|
|
|
|
+ putPathInfo(injectionConfig, service.getServiceImplTemplate(), OutputFile.serviceImpl, ConstVal.SERVICE_IMPL);
|
|
}
|
|
}
|
|
Controller controller = strategyConfig.controller();
|
|
Controller controller = strategyConfig.controller();
|
|
if (controller.isGenerate()) {
|
|
if (controller.isGenerate()) {
|
|
- putPathInfo(controller.getTemplatePath(), OutputFile.controller, ConstVal.CONTROLLER);
|
|
|
|
|
|
+ putPathInfo(injectionConfig, controller.getTemplatePath(), OutputFile.controller, ConstVal.CONTROLLER);
|
|
}
|
|
}
|
|
- putPathInfo(OutputFile.parent, ConstVal.PARENT);
|
|
|
|
|
|
+ putPathInfo(injectionConfig, OutputFile.parent, ConstVal.PARENT);
|
|
}
|
|
}
|
|
|
|
|
|
- private void putPathInfo(String template, OutputFile outputFile, String module) {
|
|
|
|
|
|
+ private void putPathInfo(InjectionConfig injectionConfig, String template, OutputFile outputFile, String module) {
|
|
if (StringUtils.isNotBlank(template)) {
|
|
if (StringUtils.isNotBlank(template)) {
|
|
- putPathInfo(outputFile, module);
|
|
|
|
|
|
+ putPathInfo(injectionConfig, outputFile, module);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- private void putPathInfo(OutputFile outputFile, String module) {
|
|
|
|
- pathInfo.putIfAbsent(outputFile, joinPath(outputDir, packageConfig.getPackageInfo(module)));
|
|
|
|
|
|
+ private void putPathInfo(InjectionConfig injectionConfig, OutputFile outputFile, String module) {
|
|
|
|
+ pathInfo.putIfAbsent(outputFile, joinPath(outputDir, packageConfig.getPackageInfo(injectionConfig, module)));
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|