feat/asset_material_relations #2
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "feat/asset_material_relations"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
合并代码
- 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>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>问题: 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 行为