Files
danyang-match/docs/Phase-18-Completion-Report.md
T

58 lines
2.3 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.
# Phase 18 Completion Report
## Status
✅ Completed
## Implemented
### P18-T01 ~ P18-T08: 申诉核心
- [x] V013 迁移:`appeals` 表(含 status/escalation 约束)
- [x] `Appeal` 实体 + `AppealMapper`(5个查询方法)
- [x] `AppealService` — 账号状态检查 / 提交申诉 / 处理申诉 / 统计
- [x] `AppealController` — 用户端3个端点(含FeatureFlag检查)
- [x] `AppealOperatorController` — 管理端5个端点
- [x] Constants 新增:APPEAL_STATUS_* 5种 / RISK_ACTION_STATUS_* 3种
- [x] FeatureFlagConfig 已有 `appealEnabled = false`
### Miniapp 页面
- [x] U48 账号受限页 — 显示限制状态/原因/是否可申诉
- [x] 申诉提交页 — 原因+证据+联系方式+提交成功态
### Admin Web
- [x] A18 申诉管理页 — 统计卡片 + 待处理列表 + 详情抽屉(3种处置决策)
- [x] 路由注册:/appeals
## Core Invariants 已保护
- ✅ **FeatureFlag 控制开关** — appealEnabled 默认 false,上线前需配置开启
- ✅ **仅 ban/suspend 可申诉** — warning/feature_limit 不支持申诉
- ✅ **申诉幂等** — 同一用户对同一 action 只能有一个 pending/reviewing 申诉
- ✅ **申诉通过 → 解除处置** — approve 后自动将 risk_action 标记为 resolved
- ✅ **申诉被拒 → 维持原处置** — reject 不变更 risk_action
- ✅ **升级人工 → 通知风控员** — escalate 触发 system 通知
- ✅ **处置已失效不可申诉** — 检查 risk_action.status == 'active'
## API 端点(8个)
GET /appeals/account-status(账号状态+是否可申诉)
POST /appeals(提交申诉)
GET /appeals/my(我的申诉)
GET /operator/appeals/pending(待处理列表)
GET /operator/appeals/{id}(详情)
POST /operator/appeals/{id}/process(处理:approve/reject/escalate)
GET /operator/appeals/stats(统计)
GET /operator/appeals/users/{userId}(用户申诉记录)
## Migration
V013__add_appeals_table.sql
## Tests
- `AppealServiceTest`: 9 个不变量用例(含 Mockito 注入)
## Project Stats
- Java files: 184 (+8 from Phase 17)
- Test classes: 30 (+1)
- Migration SQL: 13
- Miniapp pages: 30 (+2)
## Next Phase
Phase 19: 后台完善(用户管理/机构管理/Operator角色管理/敏感访问审计日志查询)