feat(chat): getSessions + ChatSidebar 会话列表组件

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
浅念
2026-08-08 15:13:30 +08:00
parent a418830a90
commit 394bfa8a7c
3 changed files with 132 additions and 0 deletions
+18
View File
@@ -15,6 +15,7 @@ import type {
Message,
Page,
PhoneCall,
SessionList,
Sms,
Staff,
StaffChatStats,
@@ -238,6 +239,22 @@ export function getStaffChatStats(query: StaffChatStatsQuery): Promise<StaffChat
)
}
// ---------------------------------------------------------------------------
// Chat sessions (账号会话列表:好友+群,今日消息数+最近联系时间)
// ---------------------------------------------------------------------------
export interface SessionQuery {
owner_account_id: string
channel?: Channel
}
export function getSessions(query: SessionQuery): Promise<SessionList> {
return getJson<SessionList>(
'/sessions',
clean({ owner_account_id: query.owner_account_id, channel: query.channel }),
)
}
// ---------------------------------------------------------------------------
// Sync monitor
// ---------------------------------------------------------------------------
@@ -300,6 +317,7 @@ export type {
Message,
Page,
PhoneCall,
SessionList,
Sms,
Staff,
StaffChatStats,