feat: add exploration scale list, questions, and scoring

Seed communication-style scale, expose /api/v1/scales APIs, and wire
Explore/Scale H5 pages for the P1 探索测试 path.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
jackyu66git
2026-08-02 16:29:31 +08:00
co-authored by Cursor
parent 14b836f53b
commit 15a9db374a
10 changed files with 478 additions and 5 deletions
+14
View File
@@ -73,6 +73,20 @@ export function createClient(opts: CreateClientOptions) {
method: 'POST',
body: { profile_a_id, profile_b_id },
}),
listScales: () =>
call<{ items: { slug: string; title: string; description: string }[] }>('/api/v1/scales'),
getScale: (slug: string) =>
call<{
slug: string
title: string
description: string
questions: { id: string; sort: number; body: { prompt: string; options: { key: string; text: string }[] } }[]
}>(`/api/v1/scales/${slug}`),
submitScale: (slug: string, profile_id: string, answers: Record<string, string>) =>
call<{ id: string; result: Record<string, unknown> }>(`/api/v1/scales/${slug}/result`, {
method: 'POST',
body: { profile_id, answers },
}),
}
}