fix: 调整 chat WS/WT dev 接入
WT 目前沿用 JToken 的 JWT 校验;撤销一致性留到后续 WT 专用网关设计。
This commit is contained in:
@@ -109,6 +109,22 @@ func (s *Store) GetSession(id int64) (*Session, error) {
|
||||
return session, nil
|
||||
}
|
||||
|
||||
func (s *Store) IsParticipant(sessionId, userId int64) bool {
|
||||
s.mu.RLock()
|
||||
defer s.mu.RUnlock()
|
||||
|
||||
session, ok := s.Sessions[sessionId]
|
||||
if !ok {
|
||||
return false
|
||||
}
|
||||
for _, p := range session.Participants {
|
||||
if p == userId {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (s *Store) ListUserSessions(userId int64, page, limit int) []*Session {
|
||||
s.mu.RLock()
|
||||
defer s.mu.RUnlock()
|
||||
|
||||
Reference in New Issue
Block a user