package com.moon.server.config;
|
|
import com.moon.server.entity.all.StaticData;
|
import com.moon.server.service.all.UploadAttachService;
|
import com.moon.server.service.sys.ArgsService;
|
import com.moon.server.helper.GdalHelper;
|
import com.moon.server.helper.PathHelper;
|
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.LogFactory;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.boot.ApplicationArguments;
|
import org.springframework.boot.ApplicationRunner;
|
import org.springframework.core.env.Environment;
|
import org.springframework.stereotype.Component;
|
|
/**
|
* 初始化完成配置类
|
* @author WWW
|
*/
|
@Component
|
public class InitConfig implements ApplicationRunner {
|
private final static Log log = LogFactory.getLog(InitConfig.class);
|
|
@Autowired
|
PathHelper pathHelper;
|
|
@Autowired
|
ArgsService argsService;
|
|
@Autowired
|
Environment env;
|
|
//@Autowired
|
//TestService testService;
|
|
@Override
|
public void run(ApplicationArguments args) {
|
// noinspection AlibabaRemoveCommentedCode
|
try {
|
GdalHelper.init(env.getProperty("sys.gdal_path"));
|
UploadAttachService.init(env.getProperty("sys.attachTabs"));
|
|
//testService.testRegister();
|
pathHelper.init();
|
StaticData.ADMIN = env.getProperty("sys.admin");
|
argsService.initSettingData();
|
|
log.info("***************** 系统启动完毕 *****************" + "\n");
|
} catch (Exception ex) {
|
log.error(ex.getMessage(), ex);
|
}
|
}
|
}
|