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
+22 -1
View File
@@ -155,16 +155,37 @@ export default function CombinedForm() {
},
setCompletion,
);
saveHistoryEntry({
await saveHistoryEntry({
mode: "combined",
title: "综合测算解读",
question,
summary: activeChart.lunarDate,
completion: text,
baziInput: {
date: birthDate,
time: unknownHour ? "12:00" : birthTime,
gender,
longitude: birthLocation!.longitude,
unknownHour,
birthPlaceName: birthLocation!.name,
},
baziChart: activeChart,
hexagram:
withHexagram && guaData
? {
guaMark: guaData.result.guaMark,
guaTitle: guaData.result.guaTitle,
guaResult: guaData.result.guaResult,
guaChange: guaData.result.guaChange,
}
: undefined,
meta: {
出生地域: birthLocation!.name,
当前地域: currentLocation!.name,
: `${calcDate} ${calcTime}`,
农历: activeChart.lunarDate,
性别: gender === "male" ? "男" : "女",
: `${activeChart.pillars.year.ganZhi} ${activeChart.pillars.month.ganZhi} ${activeChart.pillars.day.ganZhi} ${activeChart.pillars.time.ganZhi}`,
六爻: withHexagram && guaData ? guaData.result.guaTitle : "无",
},
});