Search in sources :

Example 1 with WorkspaceService

use of io.jpom.service.system.WorkspaceService in project Jpom by dromara.

the class InitDb method loadJsonToDb.

private static void loadJsonToDb() {
    /*
		  @author Hotstrip
		  @date 2021-08-03
		  load build.js data to DB
		 */
    LoadBuildJsonToDB.getInstance().doJsonToSql();
    // @author bwcx_jzy @date 2021-12-02
    LoadJsonConfigToDb instance = LoadJsonConfigToDb.getInstance();
    // init workspace
    WorkspaceService workspaceService = SpringUtil.getBean(WorkspaceService.class);
    try {
        BaseServerController.resetInfo(UserModel.EMPTY);
        // 
        instance.loadIpConfig();
        instance.loadMailConfig();
        instance.loadOutGivingWhitelistConfig();
        // 
        instance.loadUserInfo();
        workspaceService.checkInitDefault();
        // 
        instance.loadNodeInfo();
        instance.loadSshInfo();
        instance.loadMonitorInfo();
        instance.loadOutgivinInfo();
    } finally {
        BaseServerController.removeEmpty();
    }
    // 
    workspaceService.convertNullWorkspaceId();
    instance.convertMonitorLogField();
    // 同步项目
    Map<String, BaseNodeService> beansOfType = SpringUtil.getApplicationContext().getBeansOfType(BaseNodeService.class);
    for (BaseNodeService<?> value : beansOfType.values()) {
        value.syncAllNode();
    }
    // 
    Map<String, BaseGroupService> groupServiceMap = SpringUtil.getApplicationContext().getBeansOfType(BaseGroupService.class);
    for (BaseGroupService<?> value : groupServiceMap.values()) {
        value.repairGroupFiled();
    }
}
Also used : BaseNodeService(io.jpom.service.h2db.BaseNodeService) WorkspaceService(io.jpom.service.system.WorkspaceService) BaseGroupService(io.jpom.service.h2db.BaseGroupService)

Aggregations

BaseGroupService (io.jpom.service.h2db.BaseGroupService)1 BaseNodeService (io.jpom.service.h2db.BaseNodeService)1 WorkspaceService (io.jpom.service.system.WorkspaceService)1