chore: initial commit of ai site platform
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
39
blueprint/openapi/README.md
Normal file
39
blueprint/openapi/README.md
Normal file
@@ -0,0 +1,39 @@
|
||||
# API 契约(唯一)
|
||||
|
||||
- **运行时契约**:`GET /api/v1/meta/openapi.yaml`(与代码同嵌入)
|
||||
- **目录清单**:`GET /api/v1/meta/apis`
|
||||
- **源文件**:`platform/internal/handler/openapi.yaml` + `platform/internal/apidef/catalog.go`
|
||||
|
||||
## 动词
|
||||
|
||||
| 方法 | 用途 |
|
||||
|------|------|
|
||||
| GET | 读取 |
|
||||
| POST | 创建,或无幂等动作(login / import / publish / generate) |
|
||||
| PUT | 更新 |
|
||||
| DELETE | 删除 |
|
||||
|
||||
禁止再用 PATCH 作为更新主路径;禁止为行业场景新增平行 CRUD。
|
||||
|
||||
## 动态业务数据
|
||||
|
||||
仅:
|
||||
|
||||
```http
|
||||
GET|POST /api/v1/apps/{slug}/{resource}
|
||||
GET|PUT|DELETE /api/v1/apps/{slug}/{resource}/{id}
|
||||
POST /api/v1/apps/{slug}/{resource}/import
|
||||
GET /api/v1/apps/{slug}/{resource}/export
|
||||
GET /api/v1/apps/{slug}/{resource}/aggregate
|
||||
```
|
||||
|
||||
字段由蓝图定义,平台不做行业写死接口。
|
||||
|
||||
## AI(不重复实现)
|
||||
|
||||
经网关 `/ai` 前缀:
|
||||
|
||||
```http
|
||||
POST /ai/api/v1/apps/generate
|
||||
GET /ai/api/v1/llm/providers
|
||||
```
|
||||
Reference in New Issue
Block a user