Files
ai_site/blueprint/openapi/README.md
2026-07-31 10:31:17 +08:00

40 lines
996 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 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
```