双人年度报告后端实现

This commit is contained in:
xuncha
2026-02-01 01:13:17 +08:00
parent 53f0e299e0
commit 5413d7e2c8
14 changed files with 1572 additions and 19 deletions

View File

@@ -337,6 +337,55 @@ export interface ElectronAPI {
}>
onProgress: (callback: (payload: { status: string; progress: number }) => void) => () => void
}
dualReport: {
generateReport: (payload: { friendUsername: string; year: number }) => Promise<{
success: boolean
data?: {
year: number
myName: string
friendUsername: string
friendName: string
firstChat: {
createTime: number
createTimeStr: string
content: string
isSentByMe: boolean
senderUsername?: string
} | null
thisYearFirstChat?: {
createTime: number
createTimeStr: string
content: string
isSentByMe: boolean
friendName: string
firstThreeMessages: Array<{
content: string
isSentByMe: boolean
createTime: number
createTimeStr: string
}>
} | null
yearlyStats: {
totalMessages: number
totalWords: number
imageCount: number
voiceCount: number
emojiCount: number
myTopEmojiMd5?: string
friendTopEmojiMd5?: string
myTopEmojiUrl?: string
friendTopEmojiUrl?: string
}
wordCloud: {
words: Array<{ phrase: string; count: number }>
totalWords: number
totalMessages: number
}
}
error?: string
}>
onProgress: (callback: (payload: { status: string; progress: number }) => void) => () => void
}
export: {
exportSessions: (sessionIds: string[], outputDir: string, options: ExportOptions) => Promise<{
success: boolean