Compare commits
No commits in common. "ca4fca9a16dd6e39e224adc60eae5d4b119afa78" and "a1844bc818c2e15a208da9316dfe44501f4ed1be" have entirely different histories.
ca4fca9a16
...
a1844bc818
|
@ -100,7 +100,9 @@ func (r *AiRouterBiz) RouteWithSocket(c *websocket.Conn, req *entitys.ChatSockRe
|
||||||
go func() {
|
go func() {
|
||||||
defer func() {
|
defer func() {
|
||||||
close(done)
|
close(done)
|
||||||
|
if len(chat) > 0 {
|
||||||
|
|
||||||
|
}
|
||||||
var his = []*model.AiChatHi{
|
var his = []*model.AiChatHi{
|
||||||
{
|
{
|
||||||
SessionID: session,
|
SessionID: session,
|
||||||
|
@ -131,7 +133,7 @@ func (r *AiRouterBiz) RouteWithSocket(c *websocket.Conn, req *entitys.ChatSockRe
|
||||||
cancel() // 通知主流程退出
|
cancel() // 通知主流程退出
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if v.Type == entitys.ResponseText || v.Type == entitys.ResponseStream || v.Type == entitys.ResponseJson {
|
if v.Type == entitys.ResponseText || v.Type == entitys.ResponseStream {
|
||||||
chat = append(chat, v.Content)
|
chat = append(chat, v.Content)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -406,7 +408,7 @@ func (r *AiRouterBiz) getSessionChatHis(sessionId string) (his []model.AiChatHi,
|
||||||
cond := builder.NewCond()
|
cond := builder.NewCond()
|
||||||
cond = cond.And(builder.Eq{"session_id": sessionId})
|
cond = cond.And(builder.Eq{"session_id": sessionId})
|
||||||
|
|
||||||
_, err = r.hisImpl.GetListToStruct(&cond, &dataTemp.ReqPageBo{Limit: r.conf.Sys.SessionLen}, &his, "his_id desc")
|
_, err = r.hisImpl.GetListToStruct(&cond, &dataTemp.ReqPageBo{Limit: r.conf.Sys.SessionLen}, &his, "his_id asc")
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue