Przeglądaj źródła

修改标签核对的功能。

yangzhijie1488@163.com 3 lat temu
rodzic
commit
ecdc1d5594

+ 7 - 1
src/main/java/com/leanwo/management/ServerManagementApp.java

@@ -15,7 +15,9 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;
 import org.springframework.context.annotation.ImportResource;
 
+import com.leanwo.management.config.AppConfig;
 import com.leanwo.management.util.ProgramStopUtil;
+import com.leanwo.management.util.SpringUtil;
 
 
 @SpringBootApplication
@@ -49,7 +51,10 @@ public class ServerManagementApp {
 		}
 
 		final boolean isAutoRunFinal = isAutoRun;
-
+		
+		AppConfig appConfig = (AppConfig) SpringUtil.getSingleBean(AppConfig.class);
+		String title = appConfig.getTitle();
+		
 		SwingUtilities.invokeLater(new Runnable() {
 			@Override
 			public void run() {
@@ -57,6 +62,7 @@ public class ServerManagementApp {
 					final MainFrame mainFrame = new MainFrame(isAutoRunFinal);
 					mainFrame.pack();
 					mainFrame.setVisible(true);
+					mainFrame.setTitle(title);
 					
 					// 免配置模式的时候,启动以后界面最小化。
 					if(isAutoRunFinal) {

+ 23 - 1
src/main/java/com/leanwo/management/config/AppConfig.java

@@ -18,7 +18,11 @@ public class AppConfig {
     /** 是否免配置. */
     @Value("${server.autoConfig}")
     private Boolean autoConfig;
-
+    
+    /**  程序管理器的标题. */
+    @Value("${application.title}")
+    private String title;
+    
 	/**
 	 * Gets the 是否免配置.
 	 *
@@ -36,4 +40,22 @@ public class AppConfig {
 	public void setAutoConfig(Boolean autoConfig) {
 		this.autoConfig = autoConfig;
 	}
+
+	/**
+	 * Gets the 程序管理器的标题.
+	 *
+	 * @return the 程序管理器的标题
+	 */
+	public String getTitle() {
+		return title;
+	}
+
+	/**
+	 * Sets the 程序管理器的标题.
+	 *
+	 * @param title the new 程序管理器的标题
+	 */
+	public void setTitle(String title) {
+		this.title = title;
+	}
 }

+ 4 - 9
src/main/resources/Application.yml

@@ -2,21 +2,16 @@
 server:
   port: 88
   #是否免配置
-  autoConfig: false
-  #数据源配置集合
-data-source:
-  items:
-    - beanId: dataSource1
-      url: jdbc:sqlserver://127.0.0.1:1433;DatabaseName=ProdogAppAsset2020
-      username: sa
-      password: Sitp123123
+  autoConfig: true
       
 spring:
   application:
     # 应用名称,会在Eureka中作为服务的id标识(serviceId)
     name: server-management
 
-    
+application:
+  title: 程序管理器-测试
+
 eureka:
   instance:
     prefer-ip-address: true