UI②:数据对象全用中文名 —— label 随物化落 PG 注释,全链读回

此前 label 在建表那一步就丢了,治理台只剩 project__intake_record 这种键给人看。
用表/列注释而非另建元数据表:名字与表同生共死,不会对不上。
设计台/运营台/对象详情/触发器下拉一律中文名在前、键在后。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KeDBx2PHLavbURXB8LJJ7m
This commit is contained in:
2026-07-28 02:33:09 +08:00
co-authored by Claude Fable 5
parent 188637cf26
commit ec0b78c550
12 changed files with 113 additions and 26 deletions
+6 -2
View File
@@ -361,7 +361,10 @@ export const listToolsRoute = {
export const listLedgerObjectsRoute = {
method: 'GET',
path: '/api/gov/data/objects',
output: z.object({ objects: z.array(z.object({ domain: z.string(), object: z.string() })) }),
/** `label` 是人读名(落在表注释上);缺省即没登记,呈现退回对象键 */
output: z.object({
objects: z.array(z.object({ domain: z.string(), object: z.string(), label: z.string().optional() })),
}),
} as const satisfies RouteContract;
export const browseLedgerRoute = {
@@ -369,7 +372,8 @@ export const browseLedgerRoute = {
path: '/api/gov/data/:domain/:object',
params: z.object({ domain: z.string(), object: z.string() }),
output: z.object({
columns: z.array(z.object({ name: z.string(), type: z.string() })),
label: z.string().optional(),
columns: z.array(z.object({ name: z.string(), type: z.string(), label: z.string().optional() })),
primaryKey: z.array(z.string()),
rows: z.array(z.record(z.string(), z.unknown())),
total: z.number().int(),