重写数据库初始化程序,全自动检查模块数据库初始化,简化模块安装。
This commit is contained in:
@@ -8,60 +8,20 @@ import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.ActiveProfiles;
|
||||
|
||||
import com.jeesite.common.tests.BaseInitDataTests;
|
||||
import com.jeesite.common.utils.SpringUtils;
|
||||
import com.jeesite.modules.Application;
|
||||
import com.jeesite.modules.filemanager.db.InitFilemanagerData;
|
||||
import com.jeesite.modules.sys.db.InitCoreData;
|
||||
|
||||
/**
|
||||
* 初始化数据表
|
||||
* @author ThinkGem
|
||||
* @version 2019-12-30
|
||||
* @version 2020-5-26
|
||||
*/
|
||||
@ActiveProfiles("test")
|
||||
@SpringBootTest(classes=Application.class)
|
||||
public class InitData extends BaseInitDataTests {
|
||||
|
||||
@Test
|
||||
public void initStep01() throws Exception{
|
||||
initCoreData(); // 核心模块
|
||||
}
|
||||
|
||||
@Test
|
||||
public void initStep02() throws Exception{
|
||||
initFilemanagerData(); // 文件管理模块
|
||||
public void initData01() throws Exception{
|
||||
logger.info("数据库初始化完成。");
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化核心模块表及数据
|
||||
*/
|
||||
public void initCoreData() throws Exception{
|
||||
InitCoreData data = SpringUtils.getBean(InitCoreData.class);
|
||||
data.createTable();
|
||||
data.initLog();
|
||||
data.initArea("3700","3701","3702");
|
||||
data.initConfig();
|
||||
data.initModule();
|
||||
data.initDict();
|
||||
data.initRole();
|
||||
data.initMenu();
|
||||
data.initUser();
|
||||
data.initOffice();
|
||||
data.initCompany();
|
||||
data.initPost();
|
||||
data.initEmpUser();
|
||||
data.initMsgPushJob();
|
||||
data.initGenTestData();
|
||||
data.initGenTreeData();
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化文件管理模块表及数据
|
||||
*/
|
||||
public void initFilemanagerData() throws Exception{
|
||||
InitFilemanagerData data = SpringUtils.getBean(InitFilemanagerData.class);
|
||||
data.createTable();
|
||||
data.initFilemanagerFolder();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user