AE86 2 лет назад
Родитель
Сommit
88e9755e03

+ 12 - 1
dbsyncer-common/src/main/java/org/dbsyncer/common/config/AppConfig.java

@@ -1,8 +1,11 @@
 package org.dbsyncer.common.config;
 
+import org.dbsyncer.common.util.StringUtil;
 import org.springframework.boot.context.properties.ConfigurationProperties;
 import org.springframework.context.annotation.Configuration;
 
+import java.time.LocalDate;
+
 /**
  * @author AE86
  * @version 1.0.0
@@ -12,7 +15,7 @@ import org.springframework.context.annotation.Configuration;
 @ConfigurationProperties(prefix = "info.app")
 public class AppConfig {
 
-    private String name;
+    private String name = "DBSyncer";
 
     private String version;
 
@@ -35,6 +38,14 @@ public class AppConfig {
     }
 
     public String getCopyright() {
+        if (StringUtil.isBlank(copyright)) {
+            StringBuilder copy = new StringBuilder();
+            copy.append("©").append(LocalDate.now().getYear()).append(" ");
+            copy.append(name);
+            copy.append("(").append(version).append(")");
+            copy.append("<footer>Designed By <a href='https://gitee.com/ghi/dbsyncer' target='_blank' >AE86</a></footer>");
+            this.copyright = copy.toString();
+        }
         return copyright;
     }
 

+ 1 - 0
dbsyncer-web/src/main/java/org/dbsyncer/web/Application.java

@@ -40,6 +40,7 @@ public class Application {
             properties.put("info.app.build.time", format);
         }
         properties.put("info.app.version", version);
+        properties.put("spring.thymeleaf.prefix", "classpath:/public/");
         application.setDefaultProperties(properties);
     }
 

+ 1 - 9
dbsyncer-web/src/main/resources/application.properties

@@ -40,14 +40,6 @@ management.endpoints.web.base-path=/app
 management.endpoints.web.exposure.include=*
 management.endpoint.health.show-details=always
 management.health.elasticsearch.enabled=false
-info.app.name=DBSyncer
-info.app.copyright=&copy;2023 ${info.app.name}(${info.app.version})<footer>Designed By <a href='https://gitee.com/ghi/dbsyncer' target='_blank' >AE86</a></footer>
 
 #All < Trace < Debug < Info < Warn < Error < Fatal < OFF
-logging.level.root=info
-#thymelea config
-spring.thymeleaf.prefix=classpath:/public/
-spring.thymeleaf.suffix=.html
-spring.thymeleaf.mode=HTML
-spring.thymeleaf.encoding=UTF-8
-spring.thymeleaf.cache=false
+logging.level.root=info