chore(ECR-001,ECR-003): 关闭结构对齐并清理 outlook JSON 旧键

正式关闭 ECR-001/002;删除 fortune 双写与 lucky 字段,H5 改读 outlook/boost。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
jackyu66git
2026-08-05 20:39:34 +08:00
co-authored by Cursor
parent 69fa1b85d6
commit 67701d1f7b
22 changed files with 286 additions and 133 deletions
+21 -6
View File
@@ -25,8 +25,11 @@ func TestBuildDeterministic(t *testing.T) {
if a.Summary["sun_sign"] == nil || a.Detail["sections"] == nil {
t.Fatal("missing fields")
}
if a.Summary["sign_cards"] == nil || a.Summary["fortune"] == nil || a.Summary["planets"] == nil {
t.Fatal("missing sign_cards, fortune or planets")
if a.Summary["sign_cards"] == nil || a.Summary["outlook"] == nil || a.Summary["planets"] == nil {
t.Fatal("missing sign_cards, outlook or planets")
}
if a.Summary["fortune"] != nil {
t.Fatal("legacy fortune key must be removed (ECR-003)")
}
if a.Summary["aspects_preview"] == nil {
t.Fatal("missing aspects_preview")
@@ -66,18 +69,30 @@ func TestBuildWithBirthTimeChangesRise(t *testing.T) {
_ = b.Summary["rise_sign"]
}
func TestBuildFortuneScores(t *testing.T) {
func TestBuildOutlookScores(t *testing.T) {
birth := time.Date(1990, 5, 12, 0, 0, 0, 0, time.UTC)
out, err := BuildWith(BuildOpts{Birth: birth, Name: "测", AsOf: time.Date(2026, 1, 1, 0, 0, 0, 0, time.UTC)})
if err != nil {
t.Fatal(err)
}
fort, ok := out.Summary["fortune"].(map[string]any)
bundle, ok := out.Summary["outlook"].(map[string]any)
if !ok {
t.Fatal("fortune missing")
t.Fatal("outlook missing")
}
daily, ok := fort["daily"].(map[string]any)
daily, ok := bundle["daily"].(map[string]any)
if !ok || daily["score"] == nil {
t.Fatal("daily score missing")
}
if daily["lucky"] != nil {
t.Fatal("legacy lucky key must be removed")
}
if daily["boost"] == nil {
t.Fatal("boost missing")
}
if out.Detail["fortune_detail"] != nil {
t.Fatal("legacy fortune_detail must be removed")
}
if out.Detail["outlook_detail"] == nil {
t.Fatal("outlook_detail missing")
}
}