mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-08 01:28:24 +08:00
test: 测试代码生成器。
This commit is contained in:
parent
2439e93220
commit
474bacdea2
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user