chore(contracts): 同步 0.5.0/0.7.0/0.4.0(场景管理路由与 Scene 模型)

This commit is contained in:
opendance
2026-09-17 00:27:08 +08:00
parent b96a8b0998
commit 392f4544f4
4 changed files with 136 additions and 6 deletions
+65 -1
View File
@@ -1,7 +1,7 @@
openapi: 3.0.3
info:
title: OpenDance Studio Web 管理服务端 API
version: 0.4.0
version: 0.5.0
description: |
OpenDance Studio 的唯一数据源与契约权威。
契约版本见 contracts/VERSION。字段语义见 contracts/data-models.md。
@@ -594,6 +594,70 @@ paths:
contractVersion: { type: object, additionalProperties: { type: string } }
revision: { type: string, description: 目录内容 sha256,变化即需重新拉取 }
/api/scenes:
get:
tags: [scenes]
summary: 场景列表(v0.5.0)
parameters:
- $ref: '#/components/parameters/Page'
- $ref: '#/components/parameters/PageSize'
- name: q
in: query
schema: { type: string }
description: 按 name/author 模糊匹配
- name: status
in: query
schema: { type: string, enum: [draft, pending, published, rejected] }
responses:
'200':
description: 分页结果 { items, total, page, pageSize }
post:
tags: [scenes]
summary: 上传场景(multipart:file + name + 来源五元组 + 可选 config)
description: |
`file` 以 **.glb 为主**(直接导入,不重编码);`.gltf` 直接导入;
`.zip` / `.pmx` / `.fbx` 由服务端转换为 GLB(场景不做 humanoid 重绑定、不转 VRM)。
`config` 为 JSON 字符串(或平铺字段 gravity / wind / environment / spawnPoints / camera),
含物理参数:重力向量、风向动态(基础风 + 阵风)、地面摩擦/弹性/坡度、碰撞体来源。
服务端**只存参数、不跑物理**(仿真在客户端)。上传一律 status=pending。
requestBody:
content:
multipart/form-data:
schema:
type: object
required: [file, name, sourceType, sourceName, sourceUrl, license, author]
properties:
file: { type: string, format: binary }
name: { type: string }
config: { type: string, description: SceneConfig 的 JSON 字符串 }
sourceType: { type: string }
sourceName: { type: string }
sourceUrl: { type: string }
license: { type: string }
author: { type: string }
responses:
'201':
description: 已入库(pending)
/api/scenes/{id}:
parameters: [{ $ref: '#/components/parameters/Id' }]
get:
tags: [scenes]
summary: 场景详情
responses:
'200': { description: Scene }
'404': { description: 不存在 }
patch:
tags: [scenes]
summary: 更新场景名称 / 物理参数(状态变更走 /api/reviews)
responses:
'200': { description: Scene }
'400': { description: 参数非法或试图直接改状态 }
delete:
tags: [scenes]
summary: 删除场景(软删除)
responses:
'204': { description: 已删除 }
components:
parameters:
Id: