fix(groups): /api/groups加room_id精确直查(群聊页群名解析,修page_size=200超限422)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -35,19 +35,23 @@ async def list_groups(
|
||||
channel: Annotated[str | None, Query()] = None,
|
||||
owner_account_id: Annotated[str | None, Query()] = None,
|
||||
user_id: Annotated[str | None, Query()] = None,
|
||||
room_id: Annotated[str | None, Query()] = None,
|
||||
) -> Page[GroupOut]:
|
||||
"""List chat groups with optional ``channel`` / ``owner_account_id`` /
|
||||
``user_id`` filters.
|
||||
``user_id`` / ``room_id`` filters.
|
||||
|
||||
``user_id`` maps to the ``ChatGroup.owner_user_id`` column (the staff
|
||||
``userId`` who owns the chatroom account), mirroring the ``user_id``
|
||||
filter on ``GET /api/customers``.
|
||||
filter on ``GET /api/customers``. ``room_id`` is an exact-match single-
|
||||
row lookup (chat page group-name resolution).
|
||||
"""
|
||||
conditions = []
|
||||
if channel is not None:
|
||||
conditions.append(ChatGroup.channel == channel)
|
||||
if owner_account_id is not None:
|
||||
conditions.append(ChatGroup.owner_account_id == owner_account_id)
|
||||
if room_id is not None:
|
||||
conditions.append(ChatGroup.room_id == room_id)
|
||||
if user_id is not None:
|
||||
conditions.append(ChatGroup.owner_user_id == user_id)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user