feat(api): /api/sessions 账号会话列表(好友+群,今日消息数+最近联系时间,全本地聚合)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import datetime as dt
|
||||
from typing import Any, Generic, TypeVar
|
||||
from typing import Any, Generic, Literal, TypeVar
|
||||
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
@@ -325,3 +325,22 @@ class StaffChatStatsOut(BaseModel):
|
||||
end: int # ms-epoch
|
||||
summary: StaffChatStatsSummary
|
||||
customers: list[StaffChatCustomerOut]
|
||||
|
||||
|
||||
class SessionOut(BaseModel):
|
||||
"""账号会话列表的一行(好友或群)。"""
|
||||
|
||||
type: Literal["friend", "group"]
|
||||
talker_id: str | None = None
|
||||
room_id: str | None = None
|
||||
name: str | None = None
|
||||
avatar: str | None = None
|
||||
today_count: int
|
||||
last_chat_time: int | None = None
|
||||
|
||||
|
||||
class SessionListOut(BaseModel):
|
||||
owner_account_id: str
|
||||
channel: str
|
||||
today_start: int
|
||||
sessions: list[SessionOut]
|
||||
|
||||
Reference in New Issue
Block a user