chore: initial commit of ai site platform

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
whm
2026-07-31 10:31:17 +08:00
commit 4ca82fb58a
203 changed files with 45745 additions and 0 deletions

View 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
```