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

3.3 KiB
Raw Blame History

Phase 04 Completion Report

Status

✅ Completed

Implemented

P04-T01 ~ P04-T07: 数据模型

  • UserProfile 实体 + UserProfileMapper
  • UserPreference 实体 + UserPreferenceMapper
  • UserPrivacySettings 实体 + UserPrivacySettingsMapper
  • UserInterest 实体 + UserInterestMapper
  • UserPhoto 实体 + UserPhotoMapper

P04-T08 ~ P04-T13: Profile API

  • UserProfileService — CRUD / 完整度计算 / 草稿支持
  • UserPreferenceService — Required/Preferred 保存
  • ProfileController — /profile/me, /profile/{userId}, /profile/completion
  • PreferenceController — /profile/preferences
  • InterestController — /profile/interests
  • PrivacyController — /profile/privacy

P04-T14 ~ P04-T16: 图片服务

  • PhotoService — 上传凭证 / Signed URL / MIME校验 / Magic Number / EXIF清理预留
  • PhotoController — /photos/upload-token, /photos/{fileKey}/url, /photos/callback
  • 图片安全:MIME白名单 + Magic Number + 大小限制

P04-T17 ~ P04-T20: 完整度与草稿

  • 资料完整度计算(12个核心字段,0-100%)
  • 草稿支持:未提交审核前可反复修改
  • Profile Status 状态机(in_progress → completed → pending_review → approved)

P04-T21 ~ P04-T28: Miniapp 资料页

  • U06 基础资料页(profile-basic)
  • U08 头像照片页(profile-photos)
  • U09 兴趣页(profile-interests)
  • U12-U14 择偶条件页(profile-preference)
  • U15 资料确认页(profile-confirm)

Database Changes

  • 无新增迁移(V002 已包含所有 profile 相关表)

API Changes

新增接口:

Method Path 描述
GET /api/v1/profile/me 获取自己资料
PUT /api/v1/profile/me 更新自己资料
PATCH /api/v1/profile/basic 更新基础资料
GET /api/v1/profile/completion 资料完整度
GET /api/v1/profile/{userId} 查看他人公开资料
GET /api/v1/profile/preferences 获取择偶条件
PUT /api/v1/profile/preferences 保存择偶条件
GET /api/v1/profile/interests 获取兴趣
PUT /api/v1/profile/interests 设置兴趣
GET /api/v1/profile/privacy 获取隐私设置
PUT /api/v1/profile/privacy 更新隐私设置
POST /api/v1/photos/upload-token 获取上传凭证
GET /api/v1/photos/{fileKey}/url 获取签名URL
POST /api/v1/photos/callback 上传回调
GET /api/v1/photos 获取照片列表

Tests

  • UserProfileServiceTest — 4个用例(年龄计算/完整度计算)
  • PhotoServiceTest — 5个用例(MIME/Magic Number)
  • PrivacyServiceTest — 1个用例(默认值)

Security Review

  • 图片 Magic Number 校验防伪装文件
  • MIME 白名单限制
  • 图片上传走私有 Bucket + Signed URL
  • EXIF 清理预留(Phase 10 补充)

Known Issues

  • InterestService 目前返回空列表(UserInterest Mapper 需 V002 表中数据验证)

Pending Product Decisions

  • 照片上限(当前默认6张)
  • 兴趣标签上限(当前默认8个)

Regression Check

  • Phase 01-03 功能不受影响

Docs Updated

  • docs/STATUS.md
  • CHANGELOG.md

Next Phase

Phase 05: 人工审核(ReviewTask Claim/Approve/NeedEdit/Reject)