refactor(ECR-001): Phase F types/sdk 对齐并拆分超标 H5 页

抽出 OpenAPI DTO;将 Ask/Report/Profile/Star 等 8 页拆到 ≤400 行,并修 ScaleSummary、fortuneKey、Scale 选答与单测。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
jackyu66git
2026-08-05 18:19:34 +08:00
co-authored by Cursor
parent 19d3cd5945
commit e735aa43e3
64 changed files with 6198 additions and 4157 deletions
+145 -5
View File
@@ -21,6 +21,26 @@ export interface Profile {
created_at: string
}
export interface CreateProfileBody {
relation: 'self' | 'other'
birth_date: string
display_name?: string
relation_type?: string
birth_time?: string
birth_place?: string
}
export interface UpdateProfileBody {
display_name?: string
birth_date?: string
relation_type?: string
birth_time?: string
birth_place?: string
geo_lat?: number
geo_lng?: number
geo_visible?: boolean
}
/** 成长报告(detail 可能因权益被剥离) */
export interface GrowthReport {
id: string
@@ -33,13 +53,34 @@ export interface GrowthReport {
created_at: string
}
/** 探索测试列表项 */
/** 探索测试列表项 — 对齐 Go ScaleListItem / listScales 响应 */
export interface ScaleSummary {
slug: string
name: string
category: string
questionCount: number
description?: string
title: string
description: string
}
export interface ScaleQuestionOption {
key: string
text: string
}
export interface ScaleQuestion {
id: string
sort: number
body: { prompt: string; options: ScaleQuestionOption[] }
}
export interface ScaleDetail {
slug: string
title: string
description: string
questions: ScaleQuestion[]
}
export interface ScaleSubmitResult {
id: string
result: Record<string, unknown>
}
/** 成长会员当前权益 */
@@ -51,6 +92,12 @@ export interface MembershipMe {
ask_quota_left?: number
}
export interface CreateOrderBody {
kind: 'membership' | 'deep_access'
plan?: string
report_id?: string
}
/** 问答线程 */
export interface AskThread {
id: string
@@ -76,3 +123,96 @@ export interface AskQuota {
free_limit: number
source: 'membership' | 'free' | string
}
export interface SynastryNearbyItem {
profile: Profile
distance_km: number
}
export interface SynastryInviteCreated {
token: string
expires_at: string
path: string
}
export interface SynastryInviteView {
token: string
expires_at: string
host_name: string
already_accepted: boolean
}
export interface AcceptSynastryInviteBody {
display_name?: string
birth_date: string
birth_time?: string
birth_place?: string
}
export interface ImageCardScene {
key: string
label: string
}
export interface ImageCardQuota {
remaining: number
daily_free: number
unlimited: boolean
}
export interface ImageCardDrawn {
report: GrowthReport
scene: string
cards: { id: string; title: string; imagery: string; prompt: string; tip: string }[]
quota_left: number
}
export interface SolarTermToday {
name: string
tip: string
date: string
}
export interface MoodEntry {
id: string
day: string
score?: number
note?: string
}
export interface ExploreItem {
key: string
title: string
description: string
path: string
icon: string
tone: string
badge?: string
}
export interface ExploreCategory {
key: string
title: string
description: string
icon: string
tone: string
items: ExploreItem[]
}
export interface GrowthPlan {
id: string
title: string
focus: string
status?: string
}
export interface GrowthCheckin {
id: string
day: string
note?: string
}
export interface RelationInsightResult {
insight: { id: string; report_id?: string }
report: GrowthReport
}