Browse Source

修改SimConfig。

tom 5 months ago
parent
commit
9cb8d2f35e

+ 12 - 0
ruoyi-admin/src/main/resources/application-sim.yml

@@ -0,0 +1,12 @@
+# sim自定义相关配置
+sim:
+  #
+  gatewayIp: 192.168.10.10
+  #
+  gatewayPort: 8080
+  #
+  gatewayTimeout: 250
+  #
+  gatewayReachableTimeout: 2000
+  #
+  selfExamDuration: 45

+ 78 - 0
ruoyi-sim/src/main/java/com/ruoyi/sim/config/SimConfig.java

@@ -0,0 +1,78 @@
+package com.ruoyi.sim.config;
+
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ * 本项目自定义配置类。
+ */
+@Configuration
+@ConfigurationProperties(prefix = "sim")
+public class SimConfig {
+
+    /**
+     * 模拟器的 网关ip。
+     */
+    private String gatewayIp;
+
+    /**
+     * 模拟器的 网关port。
+     */
+    private int gatewayPort;
+
+    /**
+     * 模拟器通信的 超时时间 ms。
+     */
+    private long gatewayTimeout;
+
+    /**
+     *
+     */
+    private int gatewayReachableTimeout;
+
+    /**
+     * 自主练习时长 minute。
+     */
+    private int selfExamDuration;
+
+
+    public String getGatewayIp() {
+        return gatewayIp;
+    }
+
+    public void setGatewayIp(String gatewayIp) {
+        this.gatewayIp = gatewayIp;
+    }
+
+    public int getGatewayPort() {
+        return gatewayPort;
+    }
+
+    public void setGatewayPort(int gatewayPort) {
+        this.gatewayPort = gatewayPort;
+    }
+
+    public long getGatewayTimeout() {
+        return gatewayTimeout;
+    }
+
+    public void setGatewayTimeout(long gatewayTimeout) {
+        this.gatewayTimeout = gatewayTimeout;
+    }
+
+    public int getGatewayReachableTimeout() {
+        return gatewayReachableTimeout;
+    }
+
+    public void setGatewayReachableTimeout(int gatewayReachableTimeout) {
+        this.gatewayReachableTimeout = gatewayReachableTimeout;
+    }
+
+    public int getSelfExamDuration() {
+        return selfExamDuration;
+    }
+
+    public void setSelfExamDuration(int selfExamDuration) {
+        this.selfExamDuration = selfExamDuration;
+    }
+}

+ 0 - 7
ruoyi-sim/src/main/java/com/ruoyi/sim/config/SimGlobalConfig.java

@@ -1,7 +0,0 @@
-package com.ruoyi.sim.config;
-
-/**
- *
- */
-public class SimGlobalConfig {
-}