This commit is contained in:
ray zhou
2026-05-29 11:21:40 +08:00
parent 5d6d482efe
commit f71a5c59af
447 changed files with 32245 additions and 116 deletions

View File

@@ -20,3 +20,10 @@ alwaysApply: true
- 只有当某段能力具备跨场景复用价值、公共计算价值、公共配置访问、外部系统封装等公共属性时,才应抽到 Service。
- 不应创建只做中转的 Service 方法,例如 Logic 调用 ServiceService 再原样调用 Model 或另一个 Logic且没有封装公共能力。
- 如果确实需要中转层,必须在代码或 PR 说明中解释原因,例如兼容历史接口、统一事务边界、隔离第三方 SDK、收敛跨模块依赖等。
## Agent 完成前 MUST
1. **重命名/删除类**:对本次 diff 中删除的 `*.php`,类名不得出现在**其它已改动**的 PHP 文件中。
2. **新建/大改 `app/api/controller/*`**:必须 `extends \slotLib\basic\BaseController`,构造注入对应 `*Logic` + `*Validator`;参照 `slot_console/app/api/controller/FreeCreditsController.php`。
3. **禁止 Logic 型 Service**:不得新建以单业务用例编排为主、仅转发 Model/Logic 的 `app/service/*Service``*CalcService` 等公共计算除外)。
4. **声称完成前**:必须执行 `~/.cursor/hooks/verify-slot-backend.sh`,在最终回复粘贴脚本输出(`PASS` 或 `FAIL` 明细)。