Files
digital-psychology/.ai/product/feature-spec/ops-content.md
T
jackyu66gitandCursor d33c8fdfe9 feat(ECR-012): 星座对齐收口,并 Closed ECR-007/008
对齐 outlook/分享 type=star/报告页运势面板与测试;流程上关闭 Ops-B/C 两张 ECR。真支付仍后置。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-07 15:48:19 +08:00

93 lines
2.7 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.
# Feature Spec: 运营内容配置(Ops-C
> Status: `Active` · Map: `§7 运营后台` · Phase: `Ops-C`
> ESS`docs/ECR/ECR-008-ops-content.md`**Closed** · L2)· BD-2026-008 Approved
> 关联:[ops-admin.md](ops-admin.md) · [ops-analytics.md](ops-analytics.md) · [home.md](home.md) · [explore-test.md](explore-test.md)
---
## ESS 门禁
1. Change Level = **L2** → ECR Approved + Feature Spec Active + BACKEND_DESIGN Approved — **已满足(2026-08-07**
2. 实现顺序以 `docs/ENGINEERING_SPEC/ECR-008-ops-content.md` 为准
3. 完成后:TEST_REPORT · CODE_REVIEW · `ess-validate --phase review`
---
## 1. 目标
让运营在后台配置:
1. **首页宫格工具**:增删改排序、显隐、角标(替代写死 `homeCatalog.ts`
2. **测评上下架**`scales.status` = `published` / `draft`C 端列表只见已发布
---
## 2. In / Out
| In | Out |
|---|---|
| 首页宫格 CRUD(最多约 24 项;默认 12 | 首页 Feeds 信息流 CMS(本 ECR 后置,仍用静态 `homeFeeds` |
| 工具 path / icon 白名单校验 | 任意外链、自定义 SVG 上传 |
| scales 列表 + 上架/下架 + 审计 | 新建量表题目编辑器 · 探索目录全量 CMS |
| Admin「内容」页 | RBAC / 封禁 / 推送(Ops-E |
---
## 3. 数据模型
```text
home_tools
id, row_index (1|2), sort_order, path, icon, label,
badge?, badge_tone? (hot|new|null), enabled, updated_at
scales(已有)
status: published | draft
```
种子:与当前 `homeGridRow1/2` 一致。
---
## 4. API
| Method | Path | 意图 |
|---|---|---|
| GET | `/api/v1/home/tools` | C 端宫格(仅 enabledDeviceAuth |
| GET | `/api/v1/admin/home/tools` | 管理端全量 |
| PUT | `/api/v1/admin/home/tools` | 整表替换保存(排序+字段)+ 审计 |
| GET | `/api/v1/admin/scales` | 全部量表(含 draft |
| PATCH | `/api/v1/admin/scales/:id` | `{ status }` + 审计 |
C 端既有 `GET /scales` 继续只返回 published。
---
## 5. 管理端「内容」页
侧栏:概览 · 数据 · **内容** · 用户 · 订单 · 审计
- Tab「首页宫格」:两行列表、拖拽/上下移、编辑 label/path/icon/badge、启用开关、保存
- Tab「测评」:列表 · 上架/下架
---
## 6. C 端行为
- `useHomePage` 优先拉 `GET /home/tools`;失败回退静态 `homeCatalog`
- 下架 scale:列表不可见;直链 slug 返回 404/不可用(与现 Get 行为对齐)
---
## 7. 验收
**Given** Admin 将某宫格 disabled 并保存
**When** H5 刷新首页
**Then** 该项不出现
**Given** Admin 将 `mbti-lite` 置 draft
**When** GET `/scales`
**Then** 列表不含该 slug
---