Commit b108356c authored by shiyu's avatar shiyu

判断是否存在

parent 9f84ab0b
......@@ -127,7 +127,7 @@ public class ImServiceImpl implements IMService {
return askResult;
}
//创建会话,先判断是否存在对话
boolean isExisted = conversationDao.isExisted(dto.getFromAccount(), dto.getToAccount());
boolean isExisted = conversationDao.isExisted(imUtil.revertAppletUserId(dto.getFromAccount()), imUtil.revertAppletUserId(dto.getToAccount()));
if (!isExisted) {
Conversation conversation = new Conversation();
conversation.setFromAccount(imUtil.revertAppletUserId(dto.getFromAccount()));
......
......@@ -128,12 +128,12 @@ public class ChatApiTest {
@Test
public void sendAiChatMsg() {
SendChatMsgRequestDto sendChatMsgRequestDto = new SendChatMsgRequestDto();
sendChatMsgRequestDto.setToAccount("ai10000");
sendChatMsgRequestDto.setFromAccount("251");
sendChatMsgRequestDto.setToAccount("ai10001");
sendChatMsgRequestDto.setFromAccount("269");
sendChatMsgRequestDto.setMsgType(IMEnum.MsgTypeEnum.TIMTextElem.getCode());
sendChatMsgRequestDto.setReqId("12123123123");
sendChatMsgRequestDto.setReqId("12123123122223");
long timestamp = System.currentTimeMillis();
String msgContent = "什么是站洋";
String msgContent = "什么是袁大头";
// String msgContent = "Hi,欢迎来到老猫的世界";
sendChatMsgRequestDto.setMsgContent(msgContent);
Result<String> result = imService.sendAiChatMsg(sendChatMsgRequestDto);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment