|
@@ -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 {
|