Selaa lähdekoodia

更新 OssProperties

reghao 1 vuosi sitten
vanhempi
commit
8341fb8d3f

+ 3 - 4
oss-store/bin/oss.yml

@@ -7,8 +7,7 @@ spring:
     username: dev
     password: Dev@123456
 oss:
-  consoleHost: 127.0.0.1
-  consolePort: 8120
-  host: 127.0.0.1
+  storeHost: 127.0.0.1
   diskDirs:
-    - /opt/disk/13f654c8-af87-4710-aac9-7aa086c99aec/
+    - /opt/disk/13f654c8-af87-4710-aac9-7aa086c99aec/
+  consoleHost: 127.0.0.1

+ 1 - 1
oss-store/src/main/java/cn/reghao/oss/store/config/BeansConfig.java

@@ -18,7 +18,7 @@ public class BeansConfig {
     public ConsoleService nodeService(OssProperties ossProperties) {
         RemoteService<ConsoleService> remoteService = new RemoteService<>();
         String host = ossProperties.getConsoleHost();
-        int port = ossProperties.getConsolePort();
+        int port = 14030;
         return remoteService.getService(host, port, ConsoleService.class);
     }
 

+ 2 - 3
oss-store/src/main/java/cn/reghao/oss/store/config/props/OssProperties.java

@@ -16,8 +16,7 @@ import java.util.List;
 @Component
 @ConfigurationProperties(prefix = "oss")
 public class OssProperties {
-    private String consoleHost;
-    private Integer consolePort;
-    private String host;
+    private String storeHost;
     private List<String> diskDirs;
+    private String consoleHost;
 }

+ 1 - 1
oss-store/src/main/java/cn/reghao/oss/store/config/props/SpringProperties.java

@@ -21,7 +21,7 @@ public class SpringProperties {
     }
 
     public String getNodeAddress() {
-        return ossProperties.getHost();
+        return ossProperties.getStoreHost();
     }
 
     public int getHttpPort() {

+ 1 - 1
oss-store/src/main/java/cn/reghao/oss/store/service/PutObjectService.java

@@ -33,7 +33,7 @@ public class PutObjectService {
                             OssProperties ossProperties) {
         this.objectRepository = objectRepository;
         this.objectNameService = objectNameService;
-        this.nodeAddress = ossProperties.getHost();
+        this.nodeAddress = ossProperties.getStoreHost();
     }
 
     public ObjectResult putObject(ObjectProp objectProp, String contentId, File savedFile, String originalFilename, String sha256sum) {

+ 2 - 6
oss-store/src/main/resources/application-dev.yml

@@ -1,14 +1,10 @@
-server:
-  tomcat:
-    basedir: /opt/tmp/tomcat
 spring:
   datasource:
     url: jdbc:mysql://localhost:3306/reghao_oss_rdb?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2b8
     username: dev
     password: Dev@123456
 oss:
-  host: 127.0.0.1
+  storeHost: 127.0.0.1
   diskDirs:
     - /opt/disk/13f654c8-af87-4710-aac9-7aa086c99aec/
-  consoleHost: 127.0.0.1
-  consolePort: 14030
+  consoleHost: 127.0.0.1

+ 2 - 6
oss-store/src/main/resources/application-test.yml

@@ -1,15 +1,11 @@
-server:
-  tomcat:
-    basedir: /opt/tmp/tomcat
 spring:
   datasource:
     url: jdbc:mysql://192.168.0.210:3306/reghao_oss_tdb?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2b8
     username: test
     password: Test@123456
 oss:
-  host: 192.168.0.210
+  storeHost: 192.168.0.210
   diskDirs:
     - /opt/oss/disk/13f654c8-af87-4710-aac9-7aa086c99aec/
     - /opt/oss/disk/40b2cf6e-1501-421a-b7b3-9cbf5b206d39/
-  consoleHost: 192.168.0.210
-  consolePort: 14030
+  consoleHost: 192.168.0.210