Files

15 lines
643 B
Plaintext
Raw Permalink 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.
---
description: Spring Boot、数据库与 API 规范
globs: backend/**/*.{java,yml,sql}
alwaysApply: false
---
# 后端
- Java 21,Spring Boot 3.5。公共响应使用 `ApiResponse`。业务错误抛 `BizException`。
- DTO 使用 Jakarta Validation。列表接口必须分页,每页最多 100 条。
- 写操作放在事务里。只读查询不要把大文件读进内存。
- Flyway 是唯一建表方式。`ddl-auto` 保持 `validate`。新表要有外键、唯一约束和查询索引。
- 学校数据默认按 `schoolId` 隔离。超级管理员除外。
- 日志里不写密码、验证码、令牌、密钥和完整手机号。