feat: 新增斗图榜

This commit is contained in:
digua
2025-11-30 13:44:21 +08:00
parent bdabded14a
commit deeb7c1e20
10 changed files with 427 additions and 0 deletions

View File

@@ -536,6 +536,26 @@ const mainIpcMain = (win: BrowserWindow) => {
}
}
)
/**
* 获取斗图分析数据
*/
ipcMain.handle(
'chat:getMemeBattleAnalysis',
async (_, sessionId: string, filter?: { startTs?: number; endTs?: number }) => {
try {
return await worker.getMemeBattleAnalysis(sessionId, filter)
} catch (error) {
console.error('获取斗图分析失败:', error)
return {
longestBattle: null,
rankByCount: [],
rankByImageCount: [],
totalBattles: 0,
}
}
}
)
}
export default mainIpcMain