bluebirds il y a 4 ans
Parent
commit
29f5d4018e

+ 33 - 0
src/main/java/com/migao/config/properties/ServerInfo.java

@@ -0,0 +1,33 @@
+package com.migao.config.properties;
+
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.stereotype.Component;
+
+/**
+ * @author mwh
+ * description    项目配置
+ * createDate     2019/4/11 10:26
+ * updateRemark
+ * version        1.0
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class ServerInfo {
+
+    /**
+     * 文件下载前缀
+     */
+    public String serverName;
+
+    /**
+     * 文件文件夹路径
+     */
+    public String serverHost;
+
+
+}

+ 7 - 2
src/main/java/com/migao/config/properties/SystemProperties.java

@@ -7,6 +7,8 @@ import lombok.NoArgsConstructor;
 import org.springframework.boot.context.properties.ConfigurationProperties;
 import org.springframework.stereotype.Component;
 
+import java.util.List;
+
 /**
  * @author mwh
  * description    项目配置
@@ -27,12 +29,12 @@ public class SystemProperties {
     public String downloadPrefix;
 
     /**
-     * 文件文件夹路径
+     * 文件文件夹名称
      */
     public String fileStoreDir;
 
     /**
-     * 文件 注意最后的斜杠
+     * 文件存储路径 注意最后的斜杠
      */
     public String fileStoreDirPath;
 
@@ -46,4 +48,7 @@ public class SystemProperties {
      */
     private String fileTempDir;
 
+
+    private List<ServerInfo> serverInfo;
+
 }

+ 0 - 40
src/main/resources/application-dev.yml

@@ -1,57 +1,17 @@
 server:
-  profiles:
-    active: dev
   port: 31234
 
 # swagger配置
 swagger:
   enabled: true
-  title: "项目管理"
-  base-package: com.migao.controller
-  description: "项目管理"
 
 spring:
-  profiles:
-    active:
-  servlet:
-    multipart:
-      max-file-size: 10240MB
-      max-request-size: 10240MB
-
   datasource:
     url: jdbc:mysql://localhost:3306/project?serverTimezone=Hongkong&useSSL=false&useUnicode=true&characterEncoding=UTF-8&nullCatalogMeansCurrent=true
     hikari:
       username: root
       password: 1qazxsw2
-      maximum-pool-size: 10
-    driver-class-name: com.mysql.cj.jdbc.Driver
-
-  jpa:
-    show-sql: false
-    hibernate:
-      ddl-auto: update
-    properties:
-      hibernate:
-        format_sql: true
-    open-in-view: false
-    generate-ddl: true
-
-
-mybatis-plus:
-  mapper-locations: classpath*:/mapper/*.xml
-  global-config:
-    db-config:
-      table-prefix: t_
-      table-underline: true
 
 logging:
-  file:
-    path: ./project.log
-    max-size: 100MB
   level:
     root: info
-
-com:
-  migao:
-    download-prefix: http://127.0.0.1:${server.port}
-    file-store-dir: download

+ 2 - 42
src/main/resources/application-prod.yml

@@ -1,57 +1,17 @@
 server:
-  profiles:
-    active: dev
   port: 31234
 
 # swagger配置
 swagger:
-  enabled: true
-  title: "项目管理"
-  base-package: com.migao.controller
-  description: "项目管理"
+  enabled: false
 
 spring:
-  profiles:
-    active:
-  servlet:
-    multipart:
-      max-file-size: 10240MB
-      max-request-size: 10240MB
-
   datasource:
-    url: jdbc:mysql://localhost:3306/project?serverTimezone=Hongkong&useSSL=false&useUnicode=true&characterEncoding=UTF-8&nullCatalogMeansCurrent=true
+    url: jdbc:mysql://192.168.23.128:3306/project?serverTimezone=Hongkong&useSSL=false&useUnicode=true&characterEncoding=UTF-8&nullCatalogMeansCurrent=true
     hikari:
       username: root
       password: 1qazxsw2
-      maximum-pool-size: 10
-    driver-class-name: com.mysql.cj.jdbc.Driver
-
-  jpa:
-    show-sql: false
-    hibernate:
-      ddl-auto: update
-    properties:
-      hibernate:
-        format_sql: true
-    open-in-view: false
-    generate-ddl: true
-
-
-mybatis-plus:
-  mapper-locations: classpath*:/mapper/*.xml
-  global-config:
-    db-config:
-      table-prefix: t_
-      table-underline: true
 
 logging:
-  file:
-    path: ./project.log
-    max-size: 100MB
   level:
     root: info
-
-com:
-  migao:
-    download-prefix: http://127.0.0.1:${server.port}
-    file-store-dir: download

+ 45 - 1
src/main/resources/application.yml

@@ -1,3 +1,47 @@
 spring:
   profiles:
-    active: dev
+    active: ma
+
+  servlet:
+    multipart:
+      max-file-size: 10240MB
+      max-request-size: 10240MB
+  datasource:
+    hikari:
+      maximum-pool-size: 300
+    driver-class-name: com.mysql.cj.jdbc.Driver
+  jpa:
+    show-sql: false
+    hibernate:
+      ddl-auto: update
+    properties:
+      hibernate:
+        format_sql: true
+    open-in-view: false
+    generate-ddl: true
+    database-platform: org.hibernate.dialect.MySQLDialect
+
+# swagger配置
+swagger:
+  title: "项目管理"
+  base-package: com.migao.controller
+  description: "项目管理"
+
+mybatis-plus:
+  mapper-locations: classpath*:/mapper/*.xml
+  global-config:
+    db-config:
+      table-prefix: t_
+      table-underline: true
+
+logging:
+  file:
+    path: ./project.log
+    max-size: 100MB
+  level:
+    root: info
+
+com:
+  migao:
+    download-prefix: http://127.0.0.1:${server.port}
+    file-store-dir: download