mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2024-11-25 16:51:52 +08:00
【功能优化】INFRA:代码生成时,默认禁用单元测试的生成,更符合大家的习惯
This commit is contained in:
parent
af5520db46
commit
805f80c36a
@ -34,4 +34,10 @@ public class CodegenProperties {
|
||||
@NotNull(message = "代码生成的前端类型不能为空")
|
||||
private Integer frontType;
|
||||
|
||||
/**
|
||||
* 是否生成单元测试
|
||||
*/
|
||||
@NotNull(message = "是否生成单元测试不能为空")
|
||||
private Boolean unitTestEnable;
|
||||
|
||||
}
|
||||
|
@ -398,6 +398,11 @@ public class CodegenEngine {
|
||||
Map<String, String> templates = new LinkedHashMap<>();
|
||||
templates.putAll(SERVER_TEMPLATES);
|
||||
templates.putAll(FRONT_TEMPLATES.row(frontType));
|
||||
// 如果禁用单元测试,则移除对应的模版
|
||||
if (Boolean.FALSE.equals(codegenProperties.getUnitTestEnable())) {
|
||||
templates.remove(javaTemplatePath("test/serviceTest"));
|
||||
templates.remove("codegen/sql/h2.vm");
|
||||
}
|
||||
return templates;
|
||||
}
|
||||
|
||||
|
@ -246,6 +246,7 @@ yudao:
|
||||
base-package: ${yudao.info.base-package}
|
||||
db-schemas: ${spring.datasource.dynamic.datasource.master.name}
|
||||
front-type: 20 # 前端模版的类型,参见 CodegenFrontTypeEnum 枚举类
|
||||
unit-test-enable: false # 是否生成单元测试
|
||||
tenant: # 多租户相关配置项
|
||||
enable: true
|
||||
ignore-urls:
|
||||
|
Loading…
Reference in New Issue
Block a user