mirror of
https://github.com/zongzibinbin/MallChat.git
synced 2026-03-15 15:13:43 +08:00
openAI
This commit is contained in:
@@ -38,6 +38,7 @@ import com.abin.mallchat.custom.chat.service.strategy.mark.MsgMarkFactory;
|
||||
import com.abin.mallchat.custom.chat.service.strategy.msg.AbstractMsgHandler;
|
||||
import com.abin.mallchat.custom.chat.service.strategy.msg.MsgHandlerFactory;
|
||||
import com.abin.mallchat.custom.chat.service.strategy.msg.RecallMsgHandler;
|
||||
import com.abin.mallchat.custom.openai.event.OpenAIEvent;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -95,6 +96,7 @@ public class ChatServiceImpl implements ChatService {
|
||||
msgHandler.saveMsg(insert, request);
|
||||
//发布消息发送事件
|
||||
applicationEventPublisher.publishEvent(new MessageSendEvent(this, insert.getId()));
|
||||
applicationEventPublisher.publishEvent(new OpenAIEvent(this, insert.getId()));
|
||||
return insert.getId();
|
||||
}
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ public class TextMsgHandler extends AbstractMsgHandler {
|
||||
AssertUtil.equal(replyMsg.getRoomId(), request.getRoomId(), "只能回复相同会话内的消息");
|
||||
}
|
||||
if (CollectionUtil.isNotEmpty(body.getAtUidList())) {
|
||||
AssertUtil.isTrue(body.getAtUidList().size() > 10, "一次别艾特这么多人");
|
||||
AssertUtil.isFalse(body.getAtUidList().size() > 10, "一次别艾特这么多人");
|
||||
List<Long> atUidList = body.getAtUidList();
|
||||
Map<Long, User> batch = userInfoCache.getBatch(atUidList);
|
||||
AssertUtil.equal(atUidList.size(), batch.values().size(), "@用户不存在");
|
||||
|
||||
Reference in New Issue
Block a user