docs: 为 category-api 和 apikey-article-api 添加项目笔记文件

- 添加 category-api 的 problems、decisions、learnings、issues 文档
- 添加 apikey-article-api 的 issues、decisions、learnings 文档
- 包含架构决策、问题记录和学习总结
This commit is contained in:
augushong
2026-04-28 21:03:15 +08:00
parent bb08dee91d
commit 0e8944bc7f
13 changed files with 1830 additions and 1 deletions

View File

@@ -0,0 +1,2 @@
## Decisions

View File

@@ -0,0 +1,2 @@
## Issues

View File

@@ -0,0 +1,2 @@
## Learnings

View File

@@ -0,0 +1,7 @@
# Decisions
## 2026-04-28 Architecture
- 树形模式:不使用 `getListLevel()`,改用自建查询 + `array2level()` 构建树
- 扁平模式:标准 where 查询 + 分页
- 认证ApiKeyAuth 中间件
- 默认 status=1 过滤(可覆盖)

View File

@@ -0,0 +1,12 @@
# Issues
## 2026-04-28 F1/F4 REJECT: 预存脏文件
- `app/admin/controller/ApiKey.php``view/admin/common/left_admin.html``view/admin/common/left_admin_manage.html` 在本次任务开始前就已经被修改
- 最后一次提交这些文件的是 dc116a1之前的 feat(api) 提交)
- 本次 subagent 只创建了 Categories.php 和修改了 AGENTS.md
- 提交时必须只暂存 Categories.php 和 AGENTS.md隔离脏文件
## 2026-04-28 F3 QA: 等待用户测试
- API Key: 15fdd6892660f0eadec9b1c2ead33965
- 开发服务器已在后台启动(端口 8010
- 用户自行测试中

View File

@@ -0,0 +1,8 @@
# Learnings
## 2026-04-28 Plan Analysis
- Category 模型没有 SoftDelete trait必须手动过滤 `where('delete_time', 0)`
- `getListLevel()` 不过滤 status有静态缓存问题 → 树形模式不直接使用
- `array2level()` 使用 `static $list` 累积机制,需注意调用方式
- `type` 字段在数据库中是 string 类型,不是 int
- API 控制器多数模式:`$this->request` 取参,无 `declare(strict_types=1)`

View File

@@ -0,0 +1 @@
# Problems