|
@@ -18,6 +18,7 @@ import org.springframework.stereotype.Service;
|
|
|
import javax.websocket.*;
|
|
import javax.websocket.*;
|
|
|
import javax.websocket.server.PathParam;
|
|
import javax.websocket.server.PathParam;
|
|
|
import javax.websocket.server.ServerEndpoint;
|
|
import javax.websocket.server.ServerEndpoint;
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
import java.util.Objects;
|
|
import java.util.Objects;
|
|
@@ -108,9 +109,7 @@ public class WebSocket {
|
|
|
log.info("查询邮件");
|
|
log.info("查询邮件");
|
|
|
try {
|
|
try {
|
|
|
List<MetaEmail> metaEmails = queryEmail(Long.parseLong(userId));
|
|
List<MetaEmail> metaEmails = queryEmail(Long.parseLong(userId));
|
|
|
- if (CollectionUtils.isNotEmpty(metaEmails)) {
|
|
|
|
|
- websocketCommon.sendMessageTo(clients, JSON.toJSONString(metaEmails), userId);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ websocketCommon.sendMessageTo(clients, CollectionUtils.isNotEmpty(metaEmails) ? JSON.toJSONString(metaEmails) : JSON.toJSONString(new ArrayList<>()), userId);
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
log.error(String.format("查询邮件失败,错误信息[%S]", e.getMessage()));
|
|
log.error(String.format("查询邮件失败,错误信息[%S]", e.getMessage()));
|
|
|
}
|
|
}
|