| | |
| | | package com.lf.server.config; |
| | | |
| | | import com.lf.server.helper.PathHelper; |
| | | import com.lf.server.helper.*; |
| | | import com.lf.server.service.all.UploadAttachService; |
| | | import com.lf.server.service.sys.ArgsService; |
| | | 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; |
| | | |
| | | /** |
| | |
| | | private final static Log log = LogFactory.getLog(InitConfig.class); |
| | | |
| | | @Autowired |
| | | private PathHelper pathHelper; |
| | | PathHelper pathHelper; |
| | | |
| | | @Autowired |
| | | ArgsService argsService; |
| | | |
| | | @Autowired |
| | | Environment env; |
| | | |
| | | @Override |
| | | public void run(ApplicationArguments args) { |
| | | // noinspection AlibabaRemoveCommentedCode |
| | | try { |
| | | pathHelper.init(); |
| | | GdalHelper.init(env.getProperty("sys.gdal_path")); |
| | | UploadAttachService.init(env.getProperty("sys.attachTabs")); |
| | | |
| | | log.info("*****************系统启动完毕*****************" + "\n"); |
| | | pathHelper.init(); |
| | | argsService.initSettingData(); |
| | | |
| | | log.info("***************** 系统启动完毕 *****************" + "\n"); |
| | | } catch (Exception ex) { |
| | | log.error(ex.getMessage() + ex.getStackTrace() + "\n"); |
| | | log.error(ex.getMessage(), ex); |
| | | } |
| | | } |
| | | } |