fix(api): sessions is_del 越界422校验+省略不过滤显式契约测试
is_del 加 Query(ge=0, le=1)——越界值(如2)422 拒绝而非静默空列表; test_sessions_is_del_filter 追加第三个请求:不带 is_del 时全部 4 个 talker 都返回(f1/f2/filehelper/gh0st),补上省略=完全不过滤的显式契约。 Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -94,13 +94,14 @@ async def list_sessions(
|
||||
session: SessionDep,
|
||||
owner_account_id: Annotated[str, Query(min_length=1)],
|
||||
channel: Annotated[str, Query()] = "wechat",
|
||||
is_del: Annotated[int | None, Query()] = None,
|
||||
is_del: Annotated[int | None, Query(ge=0, le=1)] = None,
|
||||
) -> SessionListOut:
|
||||
"""账号会话列表:好友(talker_id,room_id 空)+ 群(room_id),按 last_chat_time desc。
|
||||
|
||||
``is_del`` 可选过滤(对齐云客员工聊天窗口「删除好友」开关):按 customer.delete_flag
|
||||
在 Python 侧过滤——0=未删(NULL 视为 0),1=已删;无 customer 行的 talker(如
|
||||
filehelper 等系统账号)视作未删保留;群会话不受该过滤影响。不传时行为不变。
|
||||
在 Python 侧过滤——0=未删(NULL 视为 0),1=已删;越界值(非 0/1)422 拒绝而非
|
||||
静默空列表;无 customer 行的 talker(如 filehelper 等系统账号)视作未删保留;
|
||||
群会话不受该过滤影响。不传时行为不变。
|
||||
``pinned``:filehelper 会话置顶标记(对齐云客置顶区),其余好友/群恒 False。
|
||||
"""
|
||||
today_start = _today_start_ms()
|
||||
|
||||
Reference in New Issue
Block a user