|
@@ -3,9 +3,12 @@ package com.qmth.themis.admin.start;
|
|
|
import com.qmth.themis.business.constant.SystemConstant;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.boot.CommandLineRunner;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
+import java.io.File;
|
|
|
+
|
|
|
/**
|
|
|
* @Description: 服务启动时初始化运行,哪个微服务模块需要则拿此模版去用
|
|
|
* @Param:
|
|
@@ -17,11 +20,14 @@ import org.springframework.stereotype.Component;
|
|
|
public class StartRunning implements CommandLineRunner {
|
|
|
private final static Logger log = LoggerFactory.getLogger(StartRunning.class);
|
|
|
|
|
|
+ @Value("${spring.application.name}")
|
|
|
+ String applicationName;
|
|
|
+
|
|
|
@Override
|
|
|
public void run(String... args) throws Exception {
|
|
|
log.info("服务器启动时执行 start");
|
|
|
SystemConstant.initTempFiles();
|
|
|
- SystemConstant.getSearcher(SystemConstant.TEMP_FILES_DIR);
|
|
|
+ SystemConstant.getSearcher(SystemConstant.TEMP_FILES_DIR + File.separator + applicationName);
|
|
|
log.info("服务器启动时执行 end");
|
|
|
}
|
|
|
}
|