Browse Source

Merge remote-tracking branch 'origin/master' into ywx

tags/正式版本
雍文秀 2 years ago
parent
commit
44c2eb9eb9

+ 16
- 0
sexam/src/main/java/com/xhkjedu/sexam/config/ConfigKey.java View File

@@ -38,4 +38,20 @@ public class ConfigKey {
38 38
         //Spring Boot注解读取application.properties或者application-{profile}.properties文件时默认的是ISO_8859_1编码,中文会乱码
39 39
         ConfigKey.signName = new String(signName.getBytes("ISO_8859_1"),"UTF-8");
40 40
     }
41
+
42
+    //socket地址
43
+    public static String examscoket;
44
+    //图像失败识别地址
45
+    public static String examface;
46
+
47
+    @Value("${exam.socket}")
48
+    public void setExamsocket(String examscoket) {
49
+        ConfigKey.examscoket = examscoket;
50
+    }
51
+
52
+    @Value("${exam.face}")
53
+    public void setExamface(String examface) {
54
+        ConfigKey.examface = examface;
55
+    }
56
+
41 57
 }

+ 29
- 0
sexam/src/main/java/com/xhkjedu/sexam/controller/system/ToolConfigController.java View File

@@ -0,0 +1,29 @@
1
+package com.xhkjedu.sexam.controller.system;
2
+
3
+import com.xhkjedu.sexam.config.ConfigKey;
4
+import com.xhkjedu.vo.ResultVo;
5
+import org.springframework.web.bind.annotation.PostMapping;
6
+import org.springframework.web.bind.annotation.RequestMapping;
7
+import org.springframework.web.bind.annotation.RestController;
8
+
9
+import java.util.HashMap;
10
+import java.util.Map;
11
+
12
+/**
13
+ * @Description 读取配置文件
14
+ * @Author WN
15
+ * Date 2022/10/29 22:20
16
+ **/
17
+@RestController
18
+@RequestMapping("/tc")
19
+public class ToolConfigController {
20
+    //socket和图片识别地址
21
+    @PostMapping("/wsf")
22
+    public ResultVo info() {
23
+        Map map = new HashMap<>();
24
+        map.put("examsocket", ConfigKey.examscoket);
25
+        map.put("examface",ConfigKey.examface);
26
+
27
+        return new ResultVo(0, "获取成功",map);
28
+    }
29
+}

+ 4
- 0
sexam/src/main/resources/application.properties View File

@@ -86,6 +86,10 @@ enable.scheduled=false
86 86
 #每隔1分钟修改试卷状态
87 87
 cron.updatePaperState=0 0/1 * * * ?
88 88
 
89
+#配置socket地址和face地址
90
+exam.socket=wss://wsexam.xhkjedu.com/ws
91
+exam.face=https://face.xhkjedu.com/
92
+
89 93
 #版本号
90 94
 versionname=Test_v3.5.0
91 95
 

Loading…
Cancel
Save