月球大数据地理空间分析展示平台-【后端】-月球后台服务
1
13693261870
2023-07-10 864a545636b2ca6aeee4afbdb4d6b0acd6238925
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
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.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
 
import javax.annotation.Resource;
 
/**
 * 初始化完成配置类
 * @author WWW
 */
@Component
public class InitConfig implements ApplicationRunner {
    private final static Log log = LogFactory.getLog(InitConfig.class);
 
    @Resource
    PathHelper pathHelper;
 
    @Resource
    ArgsService argsService;
 
    @Resource
    Environment env;
 
    //@Resource
    //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);
        }
    }
}