Sfoglia il codice sorgente

fix:edit chat_session/list

jimmyyem 5 mesi fa
parent
commit
a4d91d9a2e
1 ha cambiato i file con 14 aggiunte e 6 eliminazioni
  1. 14 6
      internal/logic/chatsession/get_chat_session_list_logic.go

+ 14 - 6
internal/logic/chatsession/get_chat_session_list_logic.go

@@ -31,15 +31,23 @@ func (l *GetChatSessionListLogic) GetChatSessionList(req *types.ChatSessionListR
 	resp := &types.ChatSessionListResp{}
 	resp.Msg = errormsg.Success
 
-	organizationId := l.ctx.Value("organizationId").(uint64)
-	isAdmin := l.ctx.Value("isAdmin").(bool)
+	//organizationId := l.ctx.Value("organizationId").(uint64)
+	//isAdmin := l.ctx.Value("isAdmin").(bool)
 
 	var predicates []predicate.ChatSession
-	if isAdmin {
+	//if isAdmin {
+	//
+	//} else {
+	//	predicates = append(predicates, chatsession.BotType(uint8(2)))
+	//	predicates = append(predicates, chatsession.BotID(organizationId))
+	//}
+
+	if req.BotType != nil && *req.BotType > 0 {
+		predicates = append(predicates, chatsession.BotType(*req.BotType))
+	}
 
-	} else {
-		predicates = append(predicates, chatsession.BotType(uint8(2)))
-		predicates = append(predicates, chatsession.BotID(organizationId))
+	if req.BotId != nil && *req.BotId > 0 {
+		predicates = append(predicates, chatsession.BotID(*req.BotId))
 	}
 
 	//if req.BotType != nil && *req.BotType > 0 {