MCPcopy Create free account
hub / github.com/TurtleTrace2026/TurtleTrace / exportCompleteData

Function exportCompleteData

src/services/exportService.ts:83–101  ·  view source on GitHub ↗
(positions: Position[], summary: ProfitSummary)

Source from the content-addressed store, hash-verified

81
82// 导出完整数据(包含持仓、复盘和事件)
83export async function exportCompleteData(positions: Position[], summary: ProfitSummary): Promise<void> {
84 // 获取所有复盘记录
85 const reviews = await reviewService.getAllReviews()
86 // 获取所有事件
87 const events = await eventService.getAllEvents()
88
89 const data: ExtendedExportData = {
90 version: '3.0.0',
91 exportTime: Date.now(),
92 positions,
93 summary,
94 reviews,
95 events,
96 }
97
98 const jsonContent = JSON.stringify(data, null, 2)
99
100 downloadFile(jsonContent, `完整数据备份_${getDateString()}.json`, 'application/json')
101}
102
103// 导出每日复盘数据(单独)
104export async function exportReviewsData(): Promise<void> {

Callers 1

handleExportCompleteFunction · 0.90

Calls 4

downloadFileFunction · 0.85
getDateStringFunction · 0.85
getAllEventsMethod · 0.80
getAllReviewsMethod · 0.45

Tested by

no test coverage detected