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

Function exportEventsData

src/services/exportService.ts:156–173  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

154
155// 导出事件数据(单独)
156export async function exportEventsData(): Promise<void> {
157 const events = await eventService.getAllEvents()
158
159 if (events.length === 0) {
160 alert('暂无事件数据可导出')
161 return
162 }
163
164 const data = {
165 version: '1.0.0',
166 exportTime: Date.now(),
167 events,
168 }
169
170 const jsonContent = JSON.stringify(data, null, 2)
171
172 downloadFile(jsonContent, `消息日历_${getDateString()}.json`, 'application/json')
173}
174
175// 从 JSON 导入数据
176export function importFromJSON(jsonContent: string): {

Callers

nothing calls this directly

Calls 3

downloadFileFunction · 0.85
getDateStringFunction · 0.85
getAllEventsMethod · 0.80

Tested by

no test coverage detected