修改im接收消息存入数据库
This commit is contained in:
parent
a97079747e
commit
e0e7f10848
|
|
@ -348,7 +348,7 @@ func subscribeAndHandleKBaseTextMessages(ws *websocket.Conn, userId int, kBaseSe
|
|||
log.Println("Error parsing JSON:", err1)
|
||||
continue
|
||||
}
|
||||
service.CreateAIStreamMsg(userId, data.IMContext.ModelID, data.IMContext.SessionID, message, proto.KnowledgeBaseServerResponseType) //将消息存入数据库
|
||||
service.CreateAIStreamMsg(userId, data.IMContext.ModelID, data.IMContext.SessionID, data, proto.KnowledgeBaseServerResponseType) //将消息存入数据库
|
||||
//这里主要将接收到的消息转到对应协程
|
||||
//目标chanel
|
||||
targetChanel := fmt.Sprintf("kbase_%s", data.KnowledgeBase.UUID)
|
||||
|
|
|
|||
|
|
@ -330,6 +330,8 @@ func SelectKBaseContentByQuery(imCtx *proto.IMParamContext, data *proto.WSMessag
|
|||
if err2 != nil {
|
||||
log.Println("Error parsing JSON:", err2)
|
||||
}
|
||||
//讲消息存入数据库
|
||||
CreateAIStreamMsg()
|
||||
break
|
||||
case <-timer.C:
|
||||
log.Println("kbase query timeout")
|
||||
|
|
|
|||
Loading…
Reference in New Issue