From b30f2aa6af14392c776fd68e3126be1a6bd811eb Mon Sep 17 00:00:00 2001 From: mataoxun <2359971480@qq.com> Date: Mon, 13 Dec 2021 09:50:09 +0800 Subject: [PATCH] last --- .../handler/nettyService/HasChannelChatService.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/mobile-app/src/main/java/com/ruoyi/chat/LongConnection/handler/nettyService/HasChannelChatService.java b/mobile-app/src/main/java/com/ruoyi/chat/LongConnection/handler/nettyService/HasChannelChatService.java index afdd8fc..bfede82 100644 --- a/mobile-app/src/main/java/com/ruoyi/chat/LongConnection/handler/nettyService/HasChannelChatService.java +++ b/mobile-app/src/main/java/com/ruoyi/chat/LongConnection/handler/nettyService/HasChannelChatService.java @@ -69,16 +69,12 @@ public class HasChannelChatService { ctx.writeAndFlush(LongConnectionMsgUtil.ObjectToWSTextResult(new ReturnMsgVo(ReturnMsgVo.SEND_SUCCESS, new SendMsgVo(chatDTO.getChatId(), msgVo)))); - - })); map.put(LongConnectionChatDTO.FILE, ((ctx, chatDTO, senderId) -> { ChatRecord chatrecord = ChatRecord.ChatRecordReaded(senderId, chatDTO.getReceiverId(), "", chatDTO.getMsgType()); FileMsg fileMsg = mapper.convertValue(chatDTO.getMessage(), FileMsg.class); String url = mclass.minioService.setFile(fileMsg); - CountDownLatch countDownLatch = new CountDownLatch(1); - countDownLatch.await(); mclass.chatrecordService.save(chatrecord); ChatFileData ChatFileData = new ChatFileData(chatrecord.getMsgId(), url, fileMsg.getFileName()); mclass.ChatFileDataService.save(ChatFileData); @@ -88,7 +84,7 @@ public class HasChannelChatService { fileMsgVo.setFileName(fileMsg.getFileName()).setUrl(url); channel.writeAndFlush(LongConnectionMsgUtil.ObjectToWSTextResult(new ReturnMsgVo(ReturnMsgVo.RECEIVE_MSG, new ReceiveMsgVo(chatDTO.getMsgType(), fileMsgVo)))); ctx.writeAndFlush(LongConnectionMsgUtil.ObjectToWSTextResult(new ReturnMsgVo(ReturnMsgVo.SEND_SUCCESS, new SendMsgVo(chatDTO.getChatId(), fileMsgVo)))); - countDownLatch.countDown(); + })); } -- Gitee