topfans/backend/pkg
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
..
database feat: 修改藏品展示等级和藏品没有同步问题 2026-05-29 12:18:40 +08:00
errors feat: 新增账号状态 2026-04-27 12:59:19 +08:00
filter feat: 新增昵称增加好友和注册用户昵称时的昵称判断 2026-04-21 16:08:55 +08:00
health feat: 增加health健康检查和替换前端跳转路由api 2026-04-14 00:10:24 +08:00
jwt 提交后端代码 2026-04-07 22:29:48 +08:00
logger 提交后端代码 2026-04-07 22:29:48 +08:00
models feat:实现AI生成镭射卡功能 2026-06-03 22:19:22 +08:00
proto feat(statistic): add event.proto and statistic.proto with 7 RPCs + 2 event RPCs 2026-06-08 17:20:53 +08:00
statistic feat(statistic): T13-T16 Gateway routes + 5-service business integration (7/7 event types) 2026-06-08 17:20:53 +08:00
validator feat: 新增昵称增加好友和注册用户昵称时的昵称判断 2026-04-21 16:08:55 +08:00