Commit Graph

534 Commits

Author SHA1 Message Date
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
0029fb8cc8 feat(statistic): T9-T12 dashboard 7 RPCs - additional business-side service modifications
Modifications to 5 existing business services for TrackEvent integration:
- socialService/asset_like_service.go: TrackEvent(asset.like) after LikeAsset
- galleryService/exhibition_service.go: TrackEvent(exhibition.start) + (exhibition.end with duration)
- taskService/revenue_service.go: TrackEvent(exhibition.revenue) after OnExhibitionCompleted
- assetService/mint_service.go: TrackEvent(asset.mint) after CreateMintOrder
- assetService/asset_level_service.go: TrackEvent(asset.level_up) in logLevelChange
- userService/user_service.go: fireCrystalChangeEvent wrapper (call site TBD by service owner)

🤖 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
3d3f2260f3 feat(statistic): T13-T16 Gateway routes + 5-service business integration (7/7 event types)
Gateway:
- 7 routes /api/v1/dashboard/* with JWT auth (middleware.AuthMiddleware)
- statistic_controller.go: 7 methods, response format {code:200, data:resp}
- gateway/main.go: StatisticServiceClient wired
- gateway/config: StatisticServiceURL (DUBBO_STATISTIC_SERVICE_URL, default tri://127.0.0.1:20009)

pkg/statistic SDK:
- fire-and-forget TrackEvent + BatchTrackEvent
- Init(client) + Get() global singleton pattern

Business-side integration (7/7 event types):
- socialService.LikeAsset → asset.like
- galleryService.PlaceAsset → exhibition.start
- galleryService.RemoveFromSlot → exhibition.end (with duration_ms)
- taskService.OnExhibitionCompleted → exhibition.revenue
- assetService.CreateMintOrder → asset.mint
- assetService.logLevelChange → asset.level_up
- userService.UpdateCrystalBalance → crystal.change (wrapper fn added)

Cache warmup:
- main.go: 7 RPCs x 5 sample starIDs at startup (15s delay)
- prevents cold-start DB thundering herd

Existing service modifications:
- galleryService/exhibition_service.go
- taskService/revenue_service.go
- assetService/{mint_service,asset_level_service}.go
- userService/user_service.go
- socialService/asset_like_service.go

🤖 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
dd9952ccc9 feat(statistic): T9-T12 dashboard 7 RPCs (Provider + Materializer + Service + Cache)
- StatisticInternalProvider: TrackEvent/BatchTrackEvent
- StatisticCombinedProvider: all 9 RPCs (7 dashboard + 2 event) on single service
- materializer: 4 MV REFRESH CONCURRENTLY + pg_try_advisory_lock + refresh_log
- dashboard_repo: 7 aggregation SQLs (week_rank / 7d curve / top5 / level dist / upgrade progress)
- dashboard_service: 7 RPCs with Redis 5min TTL + cache miss protection (1min empty)
- Cache wrapper: JSON serialize + format dash:{rpc}:{starID}:{userID}
- main.go: integrated workers + Dubbo triple server :20009
- cross-service userService.GetFanProfile (for crystal_balance)
- client/user_rpc_client.go

🤖 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
bed8f8e578 feat(statistic): T4-T8 event collection framework (Event + Sink + Repo + Service + Workers)
- Event model + ToJSON
- EventSink interface + ChannelEventSink (non-blocking Submit)
- event_repo: batch INSERT ON CONFLICT DO NOTHING dedup
- event_service: 7-type whitelist + 1KB props limit + ReceivedAt auto-fill
- event_flusher: 100/1s batch + sync metric_recent_level_ups on level_up
- metric_weekly + metric_upcoming workers (5min/15min with pg_try_advisory_lock)
- partitioner: 7-day pre-create + 30-day cleanup (00:05 create / 00:30 cleanup)
- 22 unit + integration tests (model/repo/service/sink/worker)

🤖 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
f5ece5e1d2 feat(statistic): T3 service skeleton (config + main + healthz + metrics + 10 SQL)
- 6 config blocks (DB/Redis/Channel/Refresh/Partition/Extension with 4 EnableXxx=false)
- 14 Prometheus metric declarations
- self-impl healthz (/healthz + /metrics) — bypasses pkg/health to keep /metrics
- main.go startup: logger → config → DB → Redis → healthz HTTP :21009
- 10 SQL migrations: events partitioned + 4 MV + 3 pre-agg + refresh_log + 7-day initial

🤖 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
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
4212914057 feat(statistic): add event.proto and statistic.proto with 7 RPCs + 2 event RPCs 2026-06-08 17:20:53 +08:00
zerosaturation
3707125549 feat(statistic): scaffold statisticService with go.mod and directory structure 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
zerosaturation
6e470a2b56 feat: 修改详细页图片闪烁bug 2026-06-04 18:06:09 +08:00
zerosaturation
8127a536af feat: 修改详细页图片闪烁bug 2026-06-04 18:00:38 +08:00
zerosaturation
0e0570fbc8 feat: 修改详细页图片闪烁bug 2026-06-04 17:59:04 +08:00
7c94e9209d image: 更换图片 2026-06-04 17:58:02 +08:00
zerosaturation
23a8051e96 feat: 修改头像显示不全,修改docker的配置 2026-06-04 16:41:20 +08:00
zerosaturation
df11dabd1e feat: 移除不需要的图片 2026-06-04 16:10:57 +08:00
zerosaturation
58e303894e feat: 样式调整 2026-06-04 16:01:31 +08:00
zerosaturation
71b8e454ee feat: 样式调整 2026-06-04 15:57:42 +08:00
6c18bb7564 image: 更换图片 2026-06-04 15:29:20 +08:00
7d16772805 image: 添加图片 2026-06-04 14:23:58 +08:00
408e027f5f feat: 修改页面bug 2026-06-04 01:42:29 +08:00
zerosaturation
456bf10352 feat: 修改合并bug 2026-06-04 00:52:32 +08:00
f768613509 feat: 修改页面bug 2026-06-04 00:51:29 +08:00
f0b650de26 feat: 解决合并冲突 2026-06-04 00:03:40 +08:00
bc3d82e20e fix: 合并冲突 2026-06-03 23:44:33 +08:00
liulong
6ff8743c72 feat:修复合并问题 2026-06-03 23:25:08 +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
0284bd6951 feat: 修改铸造页面的样式 2026-06-03 22:12:51 +08:00
fa83788fd0 image: 压缩图片 2026-06-03 21:44:42 +08:00
5f5ee0d7a1 feat: 修改铸造页面的样式 2026-06-03 21:43:21 +08:00
75e1222c55 feat: 修改数据看板 2026-06-03 20:25:22 +08:00
zerosaturation
76c4e2cdf8 feat: 修改docker配置 2026-06-03 18:19:15 +08:00
zerosaturation
12e08703d4 feat: 修改刷新问题 2026-06-03 18:18:44 +08:00
4aa11903f4 fix: 样式修复、创作者头像修复 2026-06-03 18:13:16 +08:00
zerosaturation
feb98dd865 feat: 新增运营活动的进度条显示 2026-06-03 01:21:28 +08:00
463e6cc008 feat:新增数据看板 2026-06-03 01:20:51 +08:00
20f86ceec0 feat(dashboard): onShow 强制刷新 + Tab 缓存 + 下拉刷新(scroll-view refresher) 2026-06-03 01:20:50 +08:00
b40ca02bd1 feat(dashboard): UpcomingUpgrades + RecentUpgrades 双列布局 2026-06-03 01:20:50 +08:00
1dbdcc5e20 feat(dashboard): LevelDistribution 5个conic-gradient环形图 2026-06-03 01:20:50 +08:00
e2555dc015 feat(dashboard): CollectionMatrix 容器 + TopFiveAssets 2026-06-03 01:20:50 +08:00
537b6fbc24 feat(dashboard): LikeIncomeBoard 左侧统计+右侧等级列表 2026-06-03 01:20:50 +08:00
0bf2d152be feat(dashboard): ExhibitionCenter 3联+5行表格
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-03 01:20:50 +08:00
dd33e87d0f feat(dashboard): IncomeCurve 七日柱状+折线(qiun-data-charts uni_modules)
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-03 01:20:49 +08:00
1328aadee9 feat(dashboard): CrystalOverview 双卡(水晶余额+今日收益) 2026-06-03 01:20:49 +08:00