Skip to content

feat:新增分层成就系统与达成通知 - #40

Merged
yydounai1234 merged 102 commits into
mainfrom
feat/profile-account-checkin
Aug 4, 2026
Merged

feat:新增分层成就系统与达成通知#40
yydounai1234 merged 102 commits into
mainfrom
feat/profile-account-checkin

Conversation

@suerzzh

@suerzzh suerzzh commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

背景

完善用户成长体系,将原有静态成就展示升级为基于真实学习数据计算、持久化和解锁的分层成就系统,并优化成就页面及达成通知体验。

主要改动

后端成就系统

  • 新增 10 个成就系列、48 个分级里程碑
  • 根据有效对话、学习时长、连续学习等真实数据计算成就进度
  • 新增成就总览、同步、通知查询和已读确认接口
  • 支持成就解锁持久化、幂等处理、并发保护和失败重试
  • 成就同步失败采用非阻断处理,不影响原有对话和报告流程

数据库

  • 新增 Flyway V4 数据库迁移
  • 新增用户成就状态表 user_achievement_state
  • 新增用户成就解锁记录表 user_achievement_unlock
  • 支持已有数据库和平滑初始化的新数据库

成就达成通知

  • 用户达成新成就后展示全局居中弹窗
  • 对话过程中只进行静默同步,不立即弹出
  • 仅在以下节点依次展示待通知成就:
    • 会话结束后
    • 学习报告生成完成后
  • 支持多个成就按顺序展示和已读确认

成就页面

  • 每个成就系列默认只展示用户当前最高等级
  • 点击成就卡片后横向展开该系列全部等级
  • 对已解锁、当前等级和未解锁等级进行差异化展示
  • 保留当前进度、下一阶段目标及等级晋升信息
  • 优化成就卡片布局和移动端展示效果

文档

  • 新增成就系统分级设计文档
  • 更新前后端接口契约与部署说明

数据库迁移说明

启动后端时 Flyway 会自动执行:

V4__achievement_unlock.sql

suerzzh added 30 commits July 31, 2026 15:32

@fennoai fennoai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One issue found in the avatar replacement flow.

Findings without inline locations

  • backend/unispeaking-server/src/main/java/com/unispeaking/service/profile/impl/ProfileAccountServiceImpl.java:69: If signAvatar() returns null here, the method has already updated the DB row and will delete the previous object. The frontend then stores a null avatar URL, so a transient signing failure blanks the user's avatar even though the new object was uploaded successfully. Consider keeping the old object/URL until signing succeeds, or failing the update instead of returning null.

@yydounai1234 yydounai1234 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yydounai1234
yydounai1234 merged commit 5ad9ae6 into main Aug 4, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants