topfans/backend/gateway/controller
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
..
activity_controller.go feat: 修改铸造消耗确认框和新增批量购买道具的功能,修改回退按钮的颜色 2026-05-22 00:14:28 +08:00
ai_chat_controller.go feat:增加的ai搭子对话功能 2026-05-28 12:00:19 +08:00
asset_controller.go feat: 修改合并bug 2026-06-04 00:52:32 +08:00
auth_controller.go feat:新增sms短信注册 2026-05-26 13:23:04 +08:00
gallery_controller.go feat: 新增每小时的收益字段 2026-05-19 12:17:57 +08:00
laser_generate_controller.go feat: 修改头像显示不全,修改docker的配置 2026-06-04 16:41:20 +08:00
ranking_controller.go feat: 给榜单增加字段 2026-05-29 19:47:09 +08:00
segment_controller.go feat:实现AI生成镭射卡功能 2026-06-03 22:19:22 +08:00
social_controller.go feat: 新增点赞列表标签增加 2026-05-28 17:45:07 +08:00
starbook_controller.go
statistic_controller.go feat(statistic): T13-T16 Gateway routes + 5-service business integration (7/7 event types) 2026-06-08 17:20:53 +08:00
task_controller.go feat: 经济系统重构 - 任务服务与画廊服务解耦 2026-05-15 23:12:02 +08:00
user_controller.go feat:修改头像bug 2026-06-02 21:10:35 +08:00