src/main/java/com/moon/server/service/all/WebSocketService.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/moon/server/service/data/RasterAnalysisService.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/resources/application.yml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
src/main/java/com/moon/server/service/all/WebSocketService.java
@@ -68,9 +68,6 @@ /** * 出现错误 * * @param session * @param error */ @OnError public void onError(Session session, Throwable error) { @@ -79,13 +76,13 @@ /** * 发送消息,实践表明,每次浏览器刷新,session会发生变化。 * * @param session * @param message */ public static void sendMessage(Session session, String message) { try { session.getBasicRemote().sendText(String.format("%s", message)); // session.getAsyncRemote().sendText(message) synchronized (session){ session.getBasicRemote().sendText(message); } } catch (Exception ex) { log.error("发送消息出错:{}", ex.getMessage()); } @@ -93,9 +90,6 @@ /** * 群发消息 * * @param message * @throws IOException */ public static void broadCastInfo(String message) throws IOException { for (Session session : SESSION_SET) { @@ -107,10 +101,6 @@ /** * 指定Session发送消息 * * @param sessionId * @param message * @throws IOException */ public static void sendMessage(String message, String sessionId) throws IOException { Session session = null; src/main/java/com/moon/server/service/data/RasterAnalysisService.java
@@ -74,7 +74,7 @@ return; } // for (PublishEntity pub : pubs) { //for (PublishEntity pub : pubs) { pubs.parallelStream().forEach(pub -> { try { AnalysisResultEntity entity = new AnalysisResultEntity(token); @@ -137,6 +137,7 @@ String json = JSONObject.toJSONString(map); // System.out.println(json) WebSocketService.broadCastInfo(json); } src/main/resources/application.yml
@@ -46,12 +46,12 @@ datasource: name: prod # JDBC 基本配置 ¤tSchema=public url: jdbc:postgresql://127.0.0.1:5433/moon?useAffectedRows=true #url: jdbc:postgresql://192.168.20.83:5433/moon?useAffectedRows=true #url: jdbc:postgresql://127.0.0.1:5433/moon?useAffectedRows=true url: jdbc:postgresql://192.168.20.83:5433/moon?useAffectedRows=true #url: jdbc:postgresql://103.85.165.99:25432/moon?useAffectedRows=true username: postgres #password: Postgres!_14_moon password: postgres password: Postgres!_14_moon #password: postgres driver-class-name: org.postgresql.Driver platform: POSTGRESQL type: com.alibaba.druid.pool.DruidDataSource