¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | 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; |
| | | |
| | | @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; |
| | | |
| | | @Override |
| | | public void run(ApplicationArguments args) { |
| | | // noinspection AlibabaRemoveCommentedCode |
| | | try { |
| | | log.info("***************** åå§å GDAL *****************" + "\n"); |
| | | 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"); |
| | | log.info("APIææ¡£:http://{}:{}{}/doc.html", WebHelper.getHostIp(), serverPort, path); |
| | | |
| | | log.info("***************** ç³»ç»å¯å¨å®æ¯ *****************" + "\n"); |
| | | } catch (Exception ex) { |
| | | log.error(ex.getMessage(), ex); |
| | | } |
| | | } |
| | | } |