Commit Graph

73 Commits

Author SHA1 Message Date
8c90de5b08 docs(change-password): 追加 §12 顺带修复 Login 账号状态码 BUG
问题: auth_service.go Login 流程被冻结/封禁时用 fmt.Errorf/errors.New
返回 generic error,落到 ToStatusCode default 分支 -> 500 而非 403

修复:
- errors.go: 新增 NewAccountBannedError / NewAccountFrozenError 2 helper,
  保留 typed error 身份但允许附加 reason / frozenUntil 信息
- errors.go: ToStatusCode 改用 errors.Is 全面识别 wrapped error
  (一处 switch 大改造,使其他 service 中已有的 fmt.Errorf("%w") 自动受益)
- auth_service.go: Login 流程 2 处 return 改用 helper
- auth_service_login_test.go (新建或追加): 2 个新单测验证 403 行为
2026-06-12 13:04:11 +08:00
e5d5808a84 docs(change-password): 架构级修正 - 状态码语义替代白名单方案
按用户反馈,BUG #1 修复应从状态码语义入手,而非前端 URL 白名单:

后端修订 (§4.5):
- ErrInvalidVerifyToken: 401 -> 400 (业务校验,非鉴权)
- 新增 ErrInvalidOldPassword: 400 (改密场景下旧密码错)
- 保留 ErrInvalidPassword (Login 用) = 401 不变
- 关键原则:已登录态下的业务校验都走 400

前端简化 (§5.1):
- 拦截器去掉 NO_AUTO_LOGOUT_PATHS 白名单
- 只对 401 (token 失效) / 403 (账号被封) 自动登出
- 400 类业务错误统一 toast,让用户重试

同步:
- §4.3 service 代码:用 ErrInvalidOldPassword 替代 ErrInvalidPassword
- §4.6 测试用例 #5:用 ErrInvalidOldPassword
- §6.2 手动测试 #2:旧密码错返回 400
- §7 错误码表:增加是否触发自动登出列,统一规则
- §10 文件列表:errors.go 新增 3 错误码,api.js 改为非白名单改造
- §1.1 BUG #1 描述同步更新
2026-06-12 12:51:47 +08:00
0a3d8e0afc docs(change-password): 合并 7 个 second-pass issues
- 3.1 序列图:补 GetByID 调用,与 §4.3 一致
- 4.2: 加 call-site 审计 grep 命令 + 已确认 9 文件列表
- 4.6: 补 mocking 模式代码示例 + Test #9 错误类型规约
- 5.3.3: 解释手动 removeStorageSync 的原因(store 不清 temp_register_*)
- 5.3.4: 补 updatePasswordApi 调用点审计(2 文件已确认)
- 9: 补 AuthMiddleware 已挂载,前端凭 token 即可访问
2026-06-12 12:41:56 +08:00
c875151daa docs(change-password): 修复合并 5 个 spec review issues
- 4.2: 明确 VerifyToken 函数改造为 (ctx, scene, mobile, token)
- 4.3: 补 scene="password" 传入,加 scene 一致性注释
- 5.3.4: 确认 sendCodeApi/verifyCodeApi 已支持 scene,updatePasswordApi 需扩展为 3 参数
- 7: 增加 401 业务码多义性说明,提示 res.message 必须稳定
- 10: auth_service.go 改动明确为 Register 中 VerifyToken 调用加 scene 参数
2026-06-12 12:36:29 +08:00
e8061c7d05 docs(change-password): 设计文档 - 旧密码+短信双保险+修复3 BUG
- 后端:proto 加 verify_token,SMS Redis key 场景化,Service 加 verify_token 校验+新旧密码一致性
- 前端:BUG#1 拦截器白名单修复、BUG#2 补 APP介绍 handler、BUG#3 加前端校验
- 新增 2 个错误码:ErrInvalidVerifyToken、ErrSameAsOldPassword
- 后端单测覆盖矩阵 10 条
- 前端手动验证 checklist 10 条
2026-06-12 11:51:09 +08:00
claude
a595440915 docs(moderation): 自审修复 - target_type 命名/跨schema/Lua lock/补流程 2026-06-11 21:50:58 +08:00
claude
16e8eb55dd docs(moderation): 完善设计 - 序列起始值/状态机迁移/限流/孤儿清理 2026-06-11 21:50:58 +08:00
claude
5320eceb32 docs(moderation): 举报与反馈系统设计 2026-06-11 21:50:58 +08:00
e5061e9449 docs:分析功能设计文档 2026-06-11 17:52:40 +08:00
c90dcf3d36 feat:去掉无用的图片 2026-06-11 12:53:44 +08:00
90803234ba style(stargalaxy): remove shared podium size — each .podium-N controls its own width/height 2026-06-10 19:16:03 +08:00
b14cc119b4 docs:修改文档 2026-06-09 17:08:23 +08:00
1b9d301521 docs: clarify ai-chat is a new service, not extracted from aichatservice 2026-06-09 17:07:54 +08:00
3ee35601e2 docs: clarify new service relationships with current backend
Per user feedback, the relationships of the 4 new services to the existing backend are different than previously described:

- admin: SHARES database with current system (direct DB connection, not API). Access control via DB account/RBAC.
- review: CALLED BY current backend (gateway/assetservice invokes its API for submission; result returns via callback/message/shared table)
- ai-image-gen: CALLED BY current backend (gateway originally called MiniMax directly, now calls ai-image-gen's API)
- ai-chat: CALLED BY current backend/frontend (extracted from aichatservice)

Section 1.3 rewritten to make this distinction explicit.
Section 11.4.3 expanded to describe the different cross-namespace patterns:
  - admin: no API calls, connects to same RDS via ExternalName
  - review: needs cross-ns Dubbo to read content from each group
  - ai-image-gen / ai-chat: receive calls, may indirectly call userservice via short DNS

This also has implications for the data-layer multi-tenancy in §11.4.4 — admin still needs group_id to filter across groups when reading the shared DB.
2026-06-09 17:07:54 +08:00
zerosaturation
d859650136 feat:修改数据看板 2026-06-09 00:37:42 +08:00
12d484e215 docs: self-audit fixes for K8s migration spec
Fixed 7 issues found during self-audit:

1. §4.2.4: stale reference to '$4.2.5 旧内容' (that section is now Secrets, not healthcheck). Pointed to §10.4 instead.

2. §6 Step 3: wrong cross-reference §10.2 (which is Secret strategy). Should be §10.1 (image registry).

3. §5 directory tree: hpa was duplicated in both gateway/ and hpa/. Unified to single hpa/ directory.

4. §5 directory tree: .gitignore was placed under k8s/. Moved indication to repo root with clearer comment.

5. §5 principles: added '关注点分离' (separation of concerns) for HPA/Ingress/Secret dirs.

6. §6 Step 4: title was '灰度切换' (gradual cutover) but content said 'single namespace, all traffic switched at once'. Renamed to '流量切换'.

7. §6 Step 4 + Step 5: sequence sync step was duplicated with unclear timing. Consolidated into Step 4 as a hard blocker. Step 5 now just stops VM.

8. §4.4 (data layer multi-tenancy): duplicated §11.4.4. Deleted §4.4; kept pointer in §4.3.

9. §3 comparison table: '后续按组隔离成本' for B was undersold as 'low (helm values)'. Corrected to '中' with reference to §11.5 (~2-3 months).

Advisory items left as-is (not blocking): §1.1 '腰部明星' line, §11.4.3 '方式 2' detail.
2026-06-08 17:25:17 +08:00
4db796f407 docs: restructure K8s migration spec into two phases
Per user feedback, split into two phases:

Phase 1 (this task): Merged deployment to reduce cost. All services in single topfans namespace, single gateway, external DB (RDS/ElastiCache), HPA for high-load services. Focus on getting off single VM and using K8s elasticity.

Phase 2 (future, not in this task): Per-group namespace isolation. Triggered by scale/isolation needs. Sketch included as future reference.

Removed from this spec (moved to Phase 2 or out of scope):
- per-group namespace architecture (was the original main design)
- ResourceQuota / LimitRange
- per-group gateway with cross-ns Dubbo
- application-layer group_id changes
- new services (admin/review/ai-*) implementation

Updated:
- Section 0: New 'Phased Strategy' section at top
- Section 2: Three candidates reframed for Phase 1 (don't migrate / single-namespace / per-group from day 1)
- Section 4: Detailed design is now single-namespace with all services merged
- Section 5: Single chart (topfans/) instead of two (topfans-shared + topfans-group)
- Section 6: Migration plan is Phase 1 only
- Section 10: Refinements trimmed to Phase 1-relevant items
- Section 11 (NEW): Phase 2 future design sketch for reference
2026-06-08 17:25:17 +08:00
ebe4a622d8 docs: clarify 4 new services are independent new systems, not reuse
Per user feedback: admin/review/ai-image-gen/ai-chat are completely new independent systems with their own codebases and DBs, not reusing existing services. They only have API-level calls between each other and to existing services. Section 1.3 table and 'key clarification' paragraph updated. Other 'shared' references in the document refer to the platform-architecture sense (shared services for all groups), not code reuse, so no other changes needed.
2026-06-08 17:25:17 +08:00
dfe251c52b docs: add Spec Review Refinements section (10.1-10.7) 2026-06-08 17:25:17 +08:00
82ba768880 docs: add design spec for Docker to Kubernetes migration
Three approaches analyzed (single-tenant, hybrid, full-isolation), with detailed pros/cons comparison. Recommended: shared platform services + per-group data services isolation via namespaces and Helm chart.
2026-06-08 17:25:16 +08:00
zerosaturation
182cc812ce docs(statistic): add 本期实施范围 chapter to design doc + implementation plan
- design doc §0.1 scope matrix (16 items: 8  in, 8  out)
- 4-phase breakdown (P1-P4) with cycle estimates
- P1 末 precheck list (10 items) with real method names
- plan doc 3014 lines, 16 tasks, 126 checkboxes

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-08 17:20:53 +08:00
zerosaturation
9d7e360845 docs: 文档修改 2026-06-08 17:06:53 +08:00
zerosaturation
aba8ec6ba7 feat:增加env配置 2026-06-05 12:26:05 +08:00
7c94e9209d image: 更换图片 2026-06-04 17:58:02 +08:00
e3f28a82c9 docs: 数据看板 spec 补充 effectScope 与 6/7 映射说明
应用 spec reviewer 的两条建议:澄清 composable 用 effectScope 释放
资源(非依赖 onUnmounted),并显式说明 6 组件消费 7 接口的映射
(CollectionMatrix 内部消费 3 个)。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-03 01:20:47 +08:00
1b1f9b22fe docs: 数据看板前端设计 spec
锁定 composables 方案、文件结构、组件契约、loading/error 策略,
并附实施顺序与风险记录。后端 dashboardService 尚未实现,前端先用 mock。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-03 01:20:47 +08:00
zerosaturation
8178799de7 docs: add VerticalProgressBar component design spec 2026-06-02 21:35:48 +08:00
59fdac5bc2 style:修改主页样式和个人页样式 2026-05-28 17:46:09 +08:00
d1b52e324f docs: 添加热门推荐模块前端设计
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-28 17:46:08 +08:00
zerosaturation
9b0c3ee3a9 docs:ai搭子修改,热门模块新增,字段判断基础文档 2026-05-27 16:49:58 +08:00
zerosaturation
2855cd512d feat: 修改自动领取收益关闭,修复下架时间的bug,修改的光栅卡陀螺仪 2026-05-25 11:08:35 +08:00
e29a718b2f feat: 修改为4/3比例的图 2026-05-22 18:43:45 +08:00
c8501c9895 docs: 完善Go SDK集成说明
- SDK包名修正为 dysmsapi-20170525/v4/client
- 补充三种操作系统环境变量配置(Linux/macOS/Windows CMD/PowerShell)
- 完善SDK使用代码(初始化、发送短信、异常处理)
- 补充更多返回码和常见错误处理
- 推荐单例模式创建客户端

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-22 18:43:44 +08:00
3370f0507d docs: 补充阿里云Go SDK详细信息
- 修正SDK包名为 github.com/alibabacloud-go/dysmsapi-20180501/v2
- 补充环境要求、安装方式、API Endpoint
- 新增12.5节:Go SDK使用说明(依赖安装、客户端初始化、发送短信代码示例)
- 新增返回码说明(OK、频率限制、内容违规等)
- 更新12.6相关文档链接,补充快速入门和SDK示例地址

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-22 18:43:44 +08:00
7588498452 docs: 更新阿里云短信价格信息
补充实际套餐包价格(200条¥10、1500条¥73.5、5000条¥170、15000条¥507.6),
修正原错误价格,删除"待确认"标注。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-22 18:43:44 +08:00
aff114afdd docs: 补充阿里云短信服务详情
新增第12章:价格计费、模板类型、签名、开通流程、相关文档链接。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-22 18:43:44 +08:00
7222598961 docs: 修正流程图中的verify_token存储位置
verify_token通过temp_register_verify_token存储,非直接verify_token,
并补充说明setNickname.vue需透传verify_token到registerApi。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-22 18:43:44 +08:00
c05953b84b docs: 修正技术选型说明
明确短信服务使用直接AccessKey认证,与OSS的STS方式区分。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-22 18:43:44 +08:00
091a3eb5c9 docs: 修正部署说明和防暴力破解策略
- 部署说明移除错误的OSS_STS_ROLE_ARN,短信使用直接AccessKey
- 防暴力破解策略补充独立Key的TTL说明

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-22 18:43:43 +08:00
ef46ec832e docs: 补充前端完整注册流程图
明确 register.vue → setNickname.vue 的页面跳转和数据传递逻辑,
verify_token 需要跟随 temp_* 一起存储和传递。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-22 18:43:43 +08:00
cc5565ffaf docs: 简化验证后处理流程
删除验证码 -> 创建 verify:register:{mobile} 记录 -> 注册时比对

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-22 18:43:43 +08:00
95d8c75500 docs: 修正 verify_token 为简单随机字符串非JWT
verify_token 使用 32 位随机字符串(vtf_xxx)而非 JWT,
避免签名验证的复杂性,直接 Redis 比对即可。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-22 18:43:43 +08:00
72ea3f4305 docs: 完善注册短信验证码设计文档
根据评审意见修改:
- 配置项移至 userService(方案一)
- Redis 存储增加 scene 维度、防暴力破解策略、发送频率限制
- verify-code 增加 verify_token 供后续注册接口使用
- 补充错误处理场景(Redis失败、阿里云超时、限流等)
- 增加安全注意事项(日志脱敏、token安全等)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-22 18:43:43 +08:00
d5d311c2b2 docs: 添加注册短信验证码功能设计文档
包含三种实现方案(userService集成、独立微服务、gateway)的对比分析,
推荐方案一在userService中直接集成SMS SDK。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-22 18:43:43 +08:00
36a366e7ba docs: 修改查询藏品设计文档 2026-05-22 11:58:15 +08:00
zerosaturation
ff22b29ede feat:修改星册的过滤条件和等级图标 2026-05-21 13:25:06 +08:00
c0c5426780 feat: 新增图片,修改应援消耗道具 2026-05-15 23:12:02 +08:00
15852260e6 docs:修改文档 2026-05-15 23:06:50 +08:00
zerosaturation
ac0eb55bc0 docs: 优化 Redis Token 黑名单设计
- 使用 SHA256 哈希代替原始 token 作为 Key
- 使用 JSON 格式存储 value,避免解析问题
- 添加输入验证

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-15 11:49:00 +08:00
zerosaturation
342beb5f17 docs: 添加 JWT Token 黑名单设计文档
设计 Redis Token 黑名单功能,用于账号封禁和强制下线场景。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-15 11:49:00 +08:00