Back to .md Directory
globs: ["src/app/api//*", "src/api//*"]
API 开发规则
接口规范
- 所有接口返回统一格式:{ code: number, data: T, message: string }
- 错误码:400 参数错误 / 401 未认证 / 403 无权限 / 500 服务器错误
- 参数校验用 Zod,在 Controller 层完成
安全
- 敏感接口必须校验权限
- 用户输入必须做 sanitize
- 不要在响应里返回敏感字段(密码、token 等)
命名
- GET /api/资源名(复数)— 列表
- GET /api/资源名/:id — 详情
- POST /api/资源名 — 创建
- PATCH /api/资源名/:id — 更新
- DELETE /api/资源名/:id — 删除
Related Documents
cursor-rules.md
Journey from Concept to Code: Transforming Cursor into a Devin-like AI Assistant
square: https://daily.borninsea.com/assets/image_1739763605490_yobtaj.png
aiagentllm
0
4
wanghaishengcursor-rules.md
grapeot/devin.cursorrules
date: 2025-07-03T22:11:02.060257
cursor
0
3
tom-doerrcursor-rules.md
dbt Core
A powerful open-source data transformation tool that enables analytics engineers to transform data in their warehouses by writing modular SQL enhanced with Jinja templating.
ai
0
3
agbackhoffcursor-rules.md
Cursor Development Environment
docker build -f Dockerfile.dev -t clawdrive-dev .
aiagentrag
0
2
CyberImmortal