Initial commit: 1人+2AI协作框架 - 完整目录结构和AI宪法

This commit is contained in:
tupingr
2026-05-22 15:27:36 +08:00
commit 837d067928
30 changed files with 1498 additions and 0 deletions
@@ -0,0 +1,95 @@
# P01_errlens_app - 接口定义
## API 基础路径
`/api/v1`
## 认证方式
JWT Token,放在 Authorization 头:
```
Authorization: Bearer <token>
```
## 接口列表
### 1. 代码分析
#### POST /api/v1/analyze
分析代码中的错误
**请求体:**
```json
{
"code": "string",
"language": "string",
"options": {
"strict": true
}
}
```
**响应:**
```json
{
"success": true,
"errors": [
{
"line": 10,
"column": 5,
"type": "error",
"message": "变量未定义",
"suggestion": "建议在使用前定义变量"
}
]
}
```
### 2. 用户管理
#### POST /api/v1/users/login
用户登录
**请求体:**
```json
{
"email": "string",
"password": "string"
}
```
**响应:**
```json
{
"success": true,
"token": "string",
"user": {
"id": "string",
"email": "string",
"name": "string"
}
}
```
### 3. 修复建议
#### POST /api/v1/fix
获取修复建议
**请求体:**
```json
{
"code": "string",
"error": {
"type": "string",
"message": "string"
}
}
```
**响应:**
```json
{
"success": true,
"fixedCode": "string",
"explanation": "string"
}
```