Commit Graph

126 Commits

Author SHA1 Message Date
zerosaturation
7074546959 feat:新增通知系统 2026-06-16 21:30:58 +08:00
zerosaturation
d9473fda7a docs:修改文档 2026-06-16 02:45:19 +08:00
zerosaturation
271e0350c7 feat:重构code状态码 2026-06-15 16:28:35 +08:00
f30655ec64 feat:添加压测工具脚本 2026-06-15 15:28:25 +08:00
zerosaturation
ddb3620eb1 feat: 修改星河,星榜的样式 2026-06-15 12:07:56 +08:00
zerosaturation
942dee0fa8 docs:增加文档 2026-06-12 17:00:46 +08:00
3b14922e48 docs(plan): 修复 4 个真实编译风险 + 1 个范围声明
- Task 3.3: 补 rate-limit 函数(IncrMobileCount/IncrIPCount 等)
  场景化,11 个函数完整列出
- Task 4: 加 4.4-4.6 修复 auth_provider.go / unified_provider.go /
  auth_controller.go 调用点(否则编译失败);修订'明确不动'列表
- Task 4.3: 引入 VerifyTokenFn package-level var DI 模式(让
  Task 6.2 的 setupVerifyTokenMock 可工作)
- Task 6.3: 改用 VerifyTokenFn 注入调用,匹配 DI 模式
- Task 7: 5 PASS + 5 SKIP 明确分工(避免验收标准误导)
- Task 10.2: 完整 import 块 + 用 errors.Is 标准库 + pbCommon 别名
- 依赖图:刷新编号,前端 Task 9/11 可独立推进说明
- 验收标准:5 PASS + 5 SKIP 标注
2026-06-12 15:18:40 +08:00
ae6dabba69 docs(plan): 修改密码功能实现计划 - 12 个 Task
- Task 1: proto 加 verify_token + regen
- Task 2: errors.go 新增错误码 + ToStatusCode errors.Is 改造
- Task 3: SMS Redis key scene-aware 重构
- Task 4: SMS service SendCode/VerifyCode/VerifyToken 加 scene
- Task 5: auth_service.Register 调用点更新
- Task 6: user_service.UpdatePassword 完整实现(TDD)
- Task 7: password_test 10 个测试骨架
- Task 8: user_provider 透传 ctx
- Task 9: api.js 拦截器去 400 自动登出
- Task 10: auth_service.Login BUG 修复 + 2 测试
- Task 11: profile.vue 改密弹窗 5 UI 区 + handler + CSS
- Task 12: 回归 + 灰度发布

总览:
- 12 个 task,每 task 含文件路径+步骤+命令
- TDD 优先,frequent commits
- 任务依赖图清晰,可识别可并行项
- 验收标准 12 条
2026-06-12 15:13:53 +08:00
b15788d1fc docs(change-password): 全面检查 - 5 issues
- §3.1 序列图弹窗描述过长 -> 简化为'5个UI区'
- §4.3 GetByID 错误处理用 '...' 省略 -> 补完整(NotFound/wrap)
- §4.5 错误映射表 - 删除重复的 ErrPasswordTooShort 行
- §10 文件变更总览 - 补 auth_service_login_test.go (§12.4 新增)
- §11 部署清单 - 增 'API 接口回归' 和 '登录态回归' 重点
  (401 不变,403 上升,500 下降)
2026-06-12 15:03:38 +08:00
397ebed805 docs(change-password): 自审修复 - 7 issues
🔴 高 (4):
1. §3.1 序列图'6 UI 区' -> '5 UI 区'(实际是 1+1+3=5)
2. §4.3 'service.VerifyToken' 错误引用 -> 'VerifyToken' (同包)
3. §5.3.3 confirmChangePassword else 分支是死代码
   (api.js 业务码 400 时 reject 跳到 catch),删除 else 分支
4. §5.3.3 setInterval 倒计时无 cleanup
   - 新增 codeCountdownTimer ref
   - handleSendCode 存 timer,清旧 timer
   - closePasswordModal 清 timer

🟡 中 (2):
5. §4.3 事务内代码 // 原逻辑保持 占位 -> 补完整
   (password_hash + updated_at + access_token=nil 分两步)
6. §4.5 ErrUserInactive 描述'不变'不准 -> 改为'修复'
   (此前 default 500,本次 403),并补完整 ToStatusCode 函数代码

🟢 低 (1):
7. §12.5 状态码重构 spec 描述'草稿' -> '已 Approved'
2026-06-12 13:43:34 +08:00
e52f46e50f docs(status-code): 合并 5 个 review advisory 修复
- §7.1 测试表 #9/#10 重复行清理
- §6.1 增加 Phase 0a Dubbo 探针(验证 dubbo-go-pixiu/triples
  对 gRPC code->HTTP status 的实际行为,影响 gateway 拦截器策略)
- §6.3 Day 4 与 §5.1 冲突修复(老前端拦截器保持不变,只新业务代码引入 getGrpcCode)
- §5.4 / §8 文件数 '10+/15+/12+' 统一为 'TBD pending audit'
- §10 E2E 测试细化(3 类断言);增加'第三方客户端风险通知'清单项
2026-06-12 13:37:39 +08:00
7c897ec4e0 docs(status-code): 自审修复 - 12 个问题
🔴 严重 (2):
1. "双协议期"实际无法双协议: 原设计 code=gRPC 会破坏老前端(它们读 code 期望 HTTP 码)
   - 修订: code 字段保持 HTTP 镜像码不变,新增 grpc_code 字段;老前端零改动
2. Gateway 拦截器只改 header 不改 body: Dubbo 已把 gRPC code 写进 body 字段
   - 修订: 用 responseRecorder 完整捕获 body,重写 header 200 后回写

🟡 高 (3):
3. errors.go 代码块缺 import (status, strings)
4. responseRecorder 类型引用但未定义 -> 补充完整类型定义
5. ErrInvalidOldPassword (change-password spec §4.5 新增) 未在 ToStatusCode/ToGRPCCode 映射
   - 修订: 同步加到两个函数的 InvalidArgument 分支
6. ErrUserInactive 此前 fall into default 500 -> 现在映射到 PermissionDenied (修复)

🟢 中 (4):
7. ToStatusCode 函数需要保留作为兼容(原 spec 说删) -> 保留并补 case
8. NewError 函数引用 status 但无 import -> 补 import
9. 缺 AuthMiddleware 与 GRPCStatusInterceptor 中间件链顺序说明
10. Phase 0 描述与实际实现对齐(保留 ToStatusCode)

🔵 低 (3):
11. grep 命令可能漏掉 raw 数字赋值 -> 补 grep -rn 'Code:\s*uint32...'
12. 全文清理 legacy_code / ToLegacyCode 残留
13. §3.4 完整响应流示例更新为新设计(code+grpc_code)
14. §5.1 getBizCode helper 改为新增 getGrpcCode helper,老前端拦截器不动
15. §6.1 Phase 0 描述对齐,Phase 3 清理描述对齐
16. §10 部署清单更新
2026-06-12 13:30:53 +08:00
fd763298c7 docs(status-code): 重构设计 - google.rpc.Code 标准化 + 双协议期迁移
核心:
- proto: BaseResponse.code 改用 google.rpc.Code 数字 (0/3/5/7/8/13/16)
- proto: 新增 legacy_code 字段保留旧 HTTP 镜像码(过渡期用)
- errors.go: 重写 ToStatusCode -> ToGRPCCode + ToLegacyCode,全面用 errors.Is
- service: 所有硬编码 StatusCode_STATUS_X 改为 status.Error(codes.X, msg)
- gateway: 新增拦截器强制 HTTP 200,剥除 Dubbo 自动 gRPC->HTTP 转换
- 前端: api.js 拦截器重写,优先读 code 兼容 legacy_code

迁移: 双协议期 4 阶段(准备/双协议/前端升级/清理),约 4 sprint
执行顺序: 先实现 change-password spec,再启动本重构

与 change-password spec 协同:
- §4.5 错误码映射自动升级为 gRPC code
- §5.1 拦截器修复方案被本设计自然吸收
- §12 Login BUG 修复(ToGRPCCode 用 errors.Is)作为前置依赖
2026-06-12 13:20:29 +08:00
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
zerosaturation
233b527236 docs:星河设计文档 2026-06-10 12:07:27 +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
dfb79af4b1 feat: 铸造菜单改为动态配置 2026-06-09 12:38:12 +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
liulong
b9527bee70 feat:合并新 2026-06-03 22:41:19 +08:00
liulong
10168f8e6b feat:实现AI生成镭射卡功能 2026-06-03 22:19:22 +08:00
8f84b2ad58 fix(plan): 4 条阻塞 + 2 条 advisory 修复(re-review 反馈)
阻塞修复:
1. Task 7: chartData/chartOpts 加入 return,H5 模板可访问
2. Task 13: 补 onUnmounted import
3. Task 13: 删除 4 个重复的 onShow 草稿块,保留唯一规范版本
4. Task 2: 新增 USE_MOCK_API 翻 true 的步骤(api.js 默认 false)

advisory 修复:
- Task 10: margin: 24r 0 → 24rpx 0
- Task 13: 删 enablePullDownRefresh(与 scroll-view refresher 冲突)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-03 01:20:47 +08:00
72c91c1787 fix(plan): 应用 plan reviewer 5 条 issue + 2 条 advisory
修复:
1. Task 14: 删除 scrolltolower 误绑定(每次滚到底会触发全量刷新)
2. Task 14: 补 onShow 生命周期(spec §4.1 要求从其他页返回时强制刷)
3. Task 3: refresh() 改为 cache-aware 默认行为;force 需显式传参
4. Task 7: 删除未被引用的 chart-theme.json(死文件)
5. 删除原 Task 13(SectionSkeleton+EmptyState 死组件)
6. Task 13: pageBg 改用 SCSS class 引用,移除 inline 重复字符串
7. 新增 Task 14 全链路手动验证(spec §8.2 核对清单)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-03 01:20:47 +08:00
702fc1d383 docs: 数据看板前端实现 plan
14 个任务,2-3 天工作量(前端部分),按 M2-M6 阶段分组。
不引入测试框架,验证走手动核对清单。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-03 01:20:47 +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
cb648d2cb0 docs: add VerticalProgressBar implementation plan 2026-06-02 21:40:28 +08:00
zerosaturation
8178799de7 docs: add VerticalProgressBar component design spec 2026-06-02 21:35:48 +08:00
zerosaturation
20e3fcedc4 docs: 添加数据看板文档设计 2026-06-02 17:35:44 +08:00
liulong
889c9232fb feat:镭射新链路,旧链路清理,迁移脚本 2026-05-29 12:35:37 +08:00