feat: P1 合盘/星座/问答与测测完整设计包及模拟器取证工具

落地 synastry/star/ask API 与 H5 页面,补齐 cece-frontend-re complete-design 证据文档,并加入 Android 模拟器截图抓取脚本。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
jackyu66git
2026-08-03 11:37:53 +08:00
co-authored by Cursor
parent 15a9db374a
commit bd22d9dddd
248 changed files with 26309 additions and 842 deletions
+32 -4
View File
@@ -1,6 +1,7 @@
package relation
import (
"encoding/json"
"strings"
"testing"
"time"
@@ -10,13 +11,40 @@ func TestBuild(t *testing.T) {
a := time.Date(1990, 1, 15, 0, 0, 0, 0, time.UTC)
b := time.Date(1992, 6, 8, 0, 0, 0, 0, time.UTC)
out := Build(a, b, "我", "TA")
if out.Summary["diff_one_liner"] == nil {
t.Fatal("missing diff")
if out.Summary["diff_one_liner"] == nil || out.Summary["overview"] == nil {
t.Fatal("missing summary fields")
}
blob := str(out.Summary["diff_one_liner"]) + str(out.Detail["title"])
for _, bad := range []string{"合盘", "运势", "吉凶", "合婚"} {
dims, ok := out.Summary["dimension_compare"].([]map[string]any)
if !ok || len(dims) < 3 {
t.Fatalf("expected dimension_compare, got %#v", out.Summary["dimension_compare"])
}
secs, ok := out.Detail["sections"].([]map[string]any)
if !ok || len(secs) < 4 {
t.Fatalf("expected detail sections")
}
raw, _ := json.Marshal(out)
blob := string(raw)
for _, bad := range []string{"算命"} {
if strings.Contains(blob, bad) {
t.Fatalf("forbidden %q", bad)
}
}
if out.Summary["harmony_index"] == nil || out.Summary["star_compare"] == nil {
t.Fatal("missing match fields")
}
if out.Summary["love_index"] == nil || out.Summary["friend_index"] == nil || out.Summary["marriage_index"] == nil {
t.Fatal("missing match indices")
}
}
func TestBuildSameStyle(t *testing.T) {
d := time.Date(1990, 1, 15, 0, 0, 0, 0, time.UTC)
out := Build(d, d, "我", "TA")
if !strings.Contains(str(out.Summary["diff_one_liner"]), "接近") &&
!strings.Contains(str(out.Summary["diff_one_liner"]), "说明书") {
// same birth => same style; copy should mention 接近 or still valid
if out.Detail["weekly_practice"] == nil {
t.Fatal("missing weekly_practice")
}
}
}