11
13693261870
2024-11-11 138b959cc11dc9a73b0c766030b99ba1180d8650
src/main/java/com/se/simu/config/InitConfig.java
@@ -1,5 +1,6 @@
package com.se.simu.config;
import com.se.simu.helper.CaffeineHelper;
import com.se.simu.helper.GdalHelper;
import com.se.simu.helper.WebHelper;
import lombok.extern.slf4j.Slf4j;
@@ -11,20 +12,18 @@
import javax.annotation.Resource;
/**
 * 初始化配置类
 *
 * @author WWW
 * @date 2024-09-12
 */
@Slf4j
@Component
@SuppressWarnings("ALL")
public class InitConfig implements ApplicationRunner {
    @Resource
    Environment env;
    @Value("${server.port}")
    String serverPort;
    @Value("${config.cacheTime}")
    Integer cacheTime;
    @Value("${server.servlet.context-path}")
    String contextPath;
@@ -34,7 +33,8 @@
        // noinspection AlibabaRemoveCommentedCode
        try {
            log.info("***************** 初始化 GDAL *****************" + "\n");
            GdalHelper.init(env.getProperty("sys.path.gdalPath"));
            GdalHelper.init(env.getProperty("config.gdalPath"));
            CaffeineHelper.init(cacheTime);
            String path = null != contextPath && contextPath.length() > 1 ? contextPath : "";
            log.info("API文档:http://localhost:" + serverPort + path + "/doc.html");