test: 测试代码生成器。

This commit is contained in:
Suomm 2023-06-01 20:19:28 +08:00
parent 2439e93220
commit 474bacdea2

View File

@ -18,7 +18,9 @@ package com.mybatisflex.codegen.test;
import com.mybatisflex.codegen.Generator;
import com.mybatisflex.codegen.config.GlobalConfig;
import com.mybatisflex.spring.service.impl.CacheableServiceImpl;
import com.zaxxer.hikari.HikariDataSource;
import org.junit.Test;
import java.util.function.UnaryOperator;
@ -81,7 +83,7 @@ public class GeneratorTest {
generator.generate();
}
// @Test
@Test
public void testCodeGen2() {
//配置数据源
HikariDataSource dataSource = new HikariDataSource();
@ -112,7 +114,7 @@ public class GeneratorTest {
//设置模板路径
globalConfig.getTemplateConfig()
.setEntity("D:\\Documents\\配置文件\\entity.tpl");
.setEntity("D:\\Documents\\配置文件\\entity.tpl");
//配置生成 entity
globalConfig.enableEntity()
@ -125,7 +127,9 @@ public class GeneratorTest {
//配置生成 service
globalConfig.enableService();
//配置生成 serviceImpl
globalConfig.enableServiceImpl();
globalConfig.enableServiceImpl()
.setSupperClass(CacheableServiceImpl.class)
.setCacheExample(true);
//配置生成 controller
globalConfig.enableController();
//配置生成 tableDef