Commit b108356c authored by shiyu's avatar shiyu

判断是否存在

parent 9f84ab0b
...@@ -127,7 +127,7 @@ public class ImServiceImpl implements IMService { ...@@ -127,7 +127,7 @@ public class ImServiceImpl implements IMService {
return askResult; return askResult;
} }
//创建会话,先判断是否存在对话 //创建会话,先判断是否存在对话
boolean isExisted = conversationDao.isExisted(dto.getFromAccount(), dto.getToAccount()); boolean isExisted = conversationDao.isExisted(imUtil.revertAppletUserId(dto.getFromAccount()), imUtil.revertAppletUserId(dto.getToAccount()));
if (!isExisted) { if (!isExisted) {
Conversation conversation = new Conversation(); Conversation conversation = new Conversation();
conversation.setFromAccount(imUtil.revertAppletUserId(dto.getFromAccount())); conversation.setFromAccount(imUtil.revertAppletUserId(dto.getFromAccount()));
......
...@@ -128,12 +128,12 @@ public class ChatApiTest { ...@@ -128,12 +128,12 @@ public class ChatApiTest {
@Test @Test
public void sendAiChatMsg() { public void sendAiChatMsg() {
SendChatMsgRequestDto sendChatMsgRequestDto = new SendChatMsgRequestDto(); SendChatMsgRequestDto sendChatMsgRequestDto = new SendChatMsgRequestDto();
sendChatMsgRequestDto.setToAccount("ai10000"); sendChatMsgRequestDto.setToAccount("ai10001");
sendChatMsgRequestDto.setFromAccount("251"); sendChatMsgRequestDto.setFromAccount("269");
sendChatMsgRequestDto.setMsgType(IMEnum.MsgTypeEnum.TIMTextElem.getCode()); sendChatMsgRequestDto.setMsgType(IMEnum.MsgTypeEnum.TIMTextElem.getCode());
sendChatMsgRequestDto.setReqId("12123123123"); sendChatMsgRequestDto.setReqId("12123123122223");
long timestamp = System.currentTimeMillis(); long timestamp = System.currentTimeMillis();
String msgContent = "什么是站洋"; String msgContent = "什么是袁大头";
// String msgContent = "Hi,欢迎来到老猫的世界"; // String msgContent = "Hi,欢迎来到老猫的世界";
sendChatMsgRequestDto.setMsgContent(msgContent); sendChatMsgRequestDto.setMsgContent(msgContent);
Result<String> result = imService.sendAiChatMsg(sendChatMsgRequestDto); 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