From 7c52b18f9ca518424e1bae4451b553daca882ed5 Mon Sep 17 00:00:00 2001
From: 13693261870 <252740454@qq.com>
Date: 星期一, 04 三月 2024 10:19:10 +0800
Subject: [PATCH] 修改初始化

---
 src/main/java/com/moon/server/config/InitConfig.java |   25 ++++++++++++++++++-------
 1 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/src/main/java/com/moon/server/config/InitConfig.java b/src/main/java/com/moon/server/config/InitConfig.java
index a7d5484..5188ff2 100644
--- a/src/main/java/com/moon/server/config/InitConfig.java
+++ b/src/main/java/com/moon/server/config/InitConfig.java
@@ -1,17 +1,20 @@
 package com.moon.server.config;
 
 import com.moon.server.entity.all.StaticData;
+import com.moon.server.service.all.TestService;
 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.beans.factory.annotation.Autowired;
+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;
 
 /**
  * 鍒濆鍖栧畬鎴愰厤缃被
@@ -21,17 +24,23 @@
 public class InitConfig implements ApplicationRunner {
     private final static Log log = LogFactory.getLog(InitConfig.class);
 
-    @Autowired
+    @Resource
     PathHelper pathHelper;
 
-    @Autowired
+    @Resource
     ArgsService argsService;
 
-    @Autowired
+    @Resource
     Environment env;
 
-    //@Autowired
-    //TestService testService;
+    @Resource
+    TestService testService;
+
+    @Value("${server.port}")
+    String serverPort;
+
+    @Value("${server.servlet.context-path}")
+    String contextPath;
 
     @Override
     public void run(ApplicationArguments args) {
@@ -40,12 +49,14 @@
             GdalHelper.init(env.getProperty("sys.gdal_path"));
             UploadAttachService.init(env.getProperty("sys.attachTabs"));
 
-            //testService.testRegister();
+            //testService.testRaster();
+
             pathHelper.init();
             StaticData.ADMIN = env.getProperty("sys.admin");
             argsService.initSettingData();
 
             log.info("***************** 绯荤粺鍚姩瀹屾瘯 *****************" + "\n");
+            log.info("API鏂囨。锛歨ttp://localhost:" + serverPort + contextPath + "/swagger-ui.html");
         } catch (Exception ex) {
             log.error(ex.getMessage(), ex);
         }

--
Gitblit v1.9.3