| 128 | * 读取会话元信息 |
| 129 | */ |
| 130 | export function getSessionMeta(db: DatabaseAdapter): SessionMeta | null { |
| 131 | const row = db.prepare('SELECT * FROM meta LIMIT 1').get() as Record<string, unknown> | undefined |
| 132 | if (!row) return null |
| 133 | |
| 134 | return { |
| 135 | name: row.name as string, |
| 136 | platform: row.platform as string, |
| 137 | type: row.type as string, |
| 138 | importedAt: row.imported_at as number, |
| 139 | groupId: (row.group_id as string) || null, |
| 140 | groupAvatar: (row.group_avatar as string) || null, |
| 141 | ownerId: (row.owner_id as string) || null, |
| 142 | } |
| 143 | } |
| 144 | |
| 145 | /** |
| 146 | * 查询会话基础统计(消息数、成员数、时间范围) |