fix(groups): 微信群排序复刻云客+群详情去掉重复的「成员列表」字段
用户报:①群详情有成员墙后「成员列表」原始串字段重复;②排序与云客不一致。 - 排序:云客「微信群统计」真机判别=员工分组(云客员工列表序)+ 组内 chatRoomId 字符串升序——/api/groups 微信路径改 JOIN wechat_account 按 list_order(NULL 垫底按 owner asc)+room_id asc; WA 保持最近活跃优先 - 群详情:memberIds 从「其他字段」兜底区排除(成员墙已替代,不再 以原始 wxid 串重复出现) 726 测试绿(默认排序断言更新为员工分组序)。 Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
@@ -64,17 +64,20 @@ async def _seed(session: AsyncSession) -> None:
|
||||
|
||||
|
||||
async def test_default_list_returns_all_ordered_desc(make_client):
|
||||
"""No filters -> 3 groups, ordered by ``last_chat_time desc`` (nulls last)."""
|
||||
"""No filters -> 3 groups;微信排序=员工分组(list_order NULL 按 owner asc)
|
||||
+组内 room_id 字符串升序(云客群统计同款,2026-09-10)。
|
||||
seed 无 wechat_account 行 → list_order 全 NULL → owner 字符串序:
|
||||
wa_owner_1 < wx_owner_1 < wx_owner_2 → [wa_room_x, room_a, room_b]。
|
||||
"""
|
||||
client = await make_client(_seed)
|
||||
r = await client.get("/api/groups")
|
||||
assert r.status_code == 200
|
||||
body = r.json()
|
||||
assert body["total"] == 3
|
||||
# 2000, 1000, null -> [room_a, room_b, wa_room_x]
|
||||
assert [it["room_id"] for it in body["items"]] == [
|
||||
"wa_room_x@s.whatsapp.net",
|
||||
"room_a@chatroom",
|
||||
"room_b@chatroom",
|
||||
"wa_room_x@s.whatsapp.net",
|
||||
]
|
||||
for key in (
|
||||
"room_id",
|
||||
|
||||
Reference in New Issue
Block a user