结构修改
This commit is contained in:
parent
f17e10a0b3
commit
ca0fce6911
|
@ -100,9 +100,7 @@ func (r *AiRouterBiz) RouteWithSocket(c *websocket.Conn, req *entitys.ChatSockRe
|
|||
go func() {
|
||||
defer func() {
|
||||
close(done)
|
||||
if len(chat) > 0 {
|
||||
|
||||
}
|
||||
var his = []*model.AiChatHi{
|
||||
{
|
||||
SessionID: session,
|
||||
|
@ -133,7 +131,7 @@ func (r *AiRouterBiz) RouteWithSocket(c *websocket.Conn, req *entitys.ChatSockRe
|
|||
cancel() // 通知主流程退出
|
||||
return
|
||||
}
|
||||
if v.Type == entitys.ResponseText || v.Type == entitys.ResponseStream {
|
||||
if v.Type == entitys.ResponseText || v.Type == entitys.ResponseStream || v.Type == entitys.ResponseJson {
|
||||
chat = append(chat, v.Content)
|
||||
}
|
||||
|
||||
|
@ -408,7 +406,7 @@ func (r *AiRouterBiz) getSessionChatHis(sessionId string) (his []model.AiChatHi,
|
|||
cond := builder.NewCond()
|
||||
cond = cond.And(builder.Eq{"session_id": sessionId})
|
||||
|
||||
_, err = r.hisImpl.GetListToStruct(&cond, &dataTemp.ReqPageBo{Limit: r.conf.Sys.SessionLen}, &his, "his_id asc")
|
||||
_, err = r.hisImpl.GetListToStruct(&cond, &dataTemp.ReqPageBo{Limit: r.conf.Sys.SessionLen}, &his, "his_id desc")
|
||||
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue