Store calculation history on server with bazi input and chart snapshots.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-13 09:57:16 +08:00
parent fcf071cfaa
commit 123a5cce6d
17 changed files with 419 additions and 54 deletions
+13 -2
View File
@@ -92,16 +92,27 @@ export default function BaziForm() {
},
setCompletion,
);
saveHistoryEntry({
await saveHistoryEntry({
mode: "bazi",
title: "生辰八字解读",
question,
summary: activeChart.lunarDate,
completion: text,
baziInput: {
date: input.date,
time: input.time,
gender: input.gender,
longitude: input.longitude,
unknownHour: !!input.unknownHour,
birthPlaceName: location!.name,
},
baziChart: activeChart,
meta: {
出生地域: location!.name,
: `${input.date} ${input.time}`,
: `${input.date} ${unknownHour ? "时辰不详" : input.time}`,
农历: activeChart.lunarDate,
性别: gender === "male" ? "男" : "女",
: `${activeChart.pillars.year.ganZhi} ${activeChart.pillars.month.ganZhi} ${activeChart.pillars.day.ganZhi} ${activeChart.pillars.time.ganZhi}`,
},
});
} catch (err) {