Parcourir la source

1.websocket URL
———— by qlm

qlm il y a 4 ans
Parent
commit
8347a63d53

+ 3 - 3
src/main/java/com/xc/controller/WebSocketTestController.java

@@ -1,6 +1,7 @@
 package com.xc.controller;
 
 import com.jfinal.plugin.activerecord.Db;
+import com.xc.utils.PropertiesUtil;
 import com.xc.utils.websocket.WsClient;
 import org.java_websocket.WebSocket;
 import org.slf4j.Logger;
@@ -23,8 +24,8 @@ public class WebSocketTestController {
     @ResponseBody
     public String star() {
         try {
-
-            WsClient myClient = new WsClient(new URI(wssurl1));
+            String url = PropertiesUtil.getProperty("ws.url")+"zxdata987654+";
+            WsClient myClient = new WsClient(new URI(url));
             myClient.connect();
             while (!myClient.getReadyState().equals(WebSocket.READYSTATE.OPEN)) {
                 System.out.println("连接中···请稍后");
@@ -36,7 +37,6 @@ public class WebSocketTestController {
 
         return "true";
     }
-    //查询企业公告信息
     @RequestMapping({"test.do"})
     @ResponseBody
     public String star2() {

+ 3 - 0
src/main/resources/stock2guo.properties

@@ -153,3 +153,6 @@ jisuapi.appkey=eebe6cf3838a5395
 jisuapi.news.url=https://api.jisuapi.com/news/get
 jisuapi.news.channel=股票
 
+#websocket 订阅地址 (数据解析服务器)
+ws.url=ws://101.32.215.72:8080/data_server_java/websocket/
+