Files
mce/_Design/TODO.md
Victor_Jay 7f847b9211
Some checks failed
CI / Lint + Build (push) Has been cancelled
docs: 重构 TODO.md 为总待办清单,整合全部审计报告遗留项
分类:Bugs(5) / 代码规范(9) / 性能(7) / 基础设施(3) / 暂缓(6)
Phase 1-5 折叠为摘要,审计修复 20 项归档
2026-06-22 14:01:44 +08:00

119 lines
4.8 KiB
Markdown
Raw 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.

# MetaLab RC 总待办
> 最后更新2026-06-22 | 参考:`_Design/` 下各审计报告
>
> 符号:✅ 已完成 | 🔧 进行中 | ⬜ 未开始 | 🚫 暂缓
---
## Phase 1-5核心功能 ✅ 全部完成
<details>
<summary>Phase 1 (Bug修复+品牌CMS) / Phase 2 (公告) / Phase 3 (文章属性) / Phase 4 (分类+标签) / Phase 5 (定时发布)</summary>
✅ 5/5 Bugs · ✅ 品牌CMS配置化 · ✅ 公告系统 · ✅ 文章属性(7种) · ✅ 分类两级树 · ✅ 标签系统 · ✅ 定时发布
</details>
---
## 🔴 Bugs5 项)
> 来源:`TEMPLATE_AUDIT_REPORT.md`
| # | 严重度 | 问题 | 位置 |
|---|--------|------|------|
| B1 | 高 | `/login``/auth/login` 6 处路径错误 | `posts/show.html` |
| B2 | 高 | `selectMention` 闭包 Bug`var` 无块作用域) | `posts/show.html:937` |
| B3 | 中 | admin `energy.js` escapeHtml 缺单引号转义 | `admin/static/js/energy.js:195` |
| B4 | 中 | messages "系统消息"标题不跟随 Tab | `messages/index.html:41` |
| B5 | 中 | `/space` stat-value 始终为 0 | `space_controller.go` |
---
## 🟡 代码规范9 项)
> 来源:`AUDIT_REPORT.md` + `post-system-audit.md`
| # | 问题 | 位置 |
|---|------|------|
| C1 | 文件行数超标16 个文件 > 上限) | controller/service/repository |
| C2 | Controller 权限检查重复 6 处 | `post_controller.go` |
| C3 | Model 层职责过重DTO/权限逻辑混入) | `model/post.go` |
| C4 | Repository `FindPageable`/`FindAdminPageable` 70% 重复 | `post_repo.go` |
| C5 | Service `List`/`ListAdmin` 重复 | `post_service.go` |
| C6 | Controller 分页重复初始化 | `post_controller.go` |
| C7 | Admin Restore 缺少 `ErrPostNotFound` 错误分类 | `admin_post_controller.go` |
| C8 | Role 缺少类型安全(`string``type Role string` | `model/user.go` |
| C9 | CSRF 中间件重复封装3 处相同 4 行) | `router/` |
---
## 🔵 性能7 项)
> 来源:`AUDIT_REPORT.md`
| # | 影响 | 问题 | 位置 |
|---|------|------|------|
| P1 | 中 | 首页无缓存,每次请求查 DB | `frontend.go` |
| P2 | 中 | `LIKE '%keyword%'` 无法用索引 | `comment_repo.go:204` |
| P3 | 中 | Post 表缺少 `(user_id, status)` 复合索引 | `model/post.go` |
| P4 | 低 | 图片上传 `io.ReadAll` + `image.Decode` 双倍内存 | `post_upload_controller.go` |
| P5 | 低 | 启动时同步计算全部静态资源哈希 | `helper.go` |
| P6 | 低 | Session Cookie 每次请求查签到表 | `auth.go` |
| P7 | 低 | 评论子查询 `IN (SELECT ...)` 可改为 JOIN | `comment_repo.go` |
---
## ⚪ 工程基础设施3 项)
> 来源:`audit-report-2025-05-31.md` 暂缓项
| # | 问题 |
|---|------|
| E1 | 零测试覆盖(`*_test.go`: 0 个文件) |
| E2 | 无结构化日志(全项目 `log.Printf` |
| E3 | Repository 层错误上下文丢失(`return err` 无包装) |
---
## ⬜ Phase 6 / 配置 / 未来迭代
| # | 项目 | 状态 |
|---|------|------|
| F1 | P2: `config.SiteSettings` 持有 `*gorm.DB` | ⬜ |
| F2 | 集成测试 | 🚫 暂缓 |
| F3 | `git tag v0.1.0-rc1` | 🚫 暂缓 |
| F4 | 黑名单系统 | 🚫 暂缓 |
| F5 | 首页推荐算法 | 🚫 暂缓 |
| F6 | 模板审计全量修复30+ 个模板) | 🚫 暂缓 |
---
## ✅ 审计修复记录(已完成 20 项)
> 2026-06-22 执行,来源:`_Design/TODO.md` + `AUDIT_REPORT.md` + `cleanup-todo.md`
| 类别 | 项目 |
|------|------|
| 安全 | CSP nonce替代unsafe-inline · HSTS始终启用 · 密码四级强度 · 注册限流 · CSRF日志仅记长度 |
| 架构 | router/api.go 按域拆为 7 文件 · 管理后台设置拆为 4 子页 · 用户设置拆为 6 模板+JS · DB健康降级 · 时区配置 |
| 规范 | Controller Exp 用 GetGinExp 包装 · UID 用 ParseUIDParam 统一 · BaseModel 统一嵌入 · primaryKey→primarykey · 16 包注释 · error小写 · errors.Is · gofumpt全量 |
| 性能 | trends 用 errgroup 并行 · GetOverview 单次 GROUP BY |
| 合规 | Footer 8 字段 + safeHTML 模板函数 · 注册准则三层控制 |
| CI | `.gitea/workflows/ci.yml` strict模式 · CI 零告警 |
---
## 进度总览
```
Bugs ░░░░░░░░░░░░░░░░░░░░░░░░ 0/5 0%
代码规范 ░░░░░░░░░░░░░░░░░░░░░░░░ 0/9 0%
性能 ░░░░░░░░░░░░░░░░░░░░░░░░ 0/7 0%
工程基础设施 ░░░░░░░░░░░░░░░░░░░░░░░░ 0/3 0%
────────────────────────────────
待办总计 ░░░░░░░░░░░░░░░░░░░░░░░░ 0/24 0%
```
> 已完成项RC Phase 1-5 · 审计修复 20 项 · CI 接入 · 文档更新