feat: 按原型更新商务明细与游戏分析并清理临时资料

This commit is contained in:
Yvan
2026-11-04 18:13:03 +08:00
parent 19926d275c
commit f866cac768
41 changed files with 392 additions and 2955 deletions
+8 -1
View File
@@ -28,7 +28,8 @@ func (r *ledgerRepoFake) Spends(_ context.Context, s LedgerScope, f LedgerFilter
r.options = o
return &SpendPage{Rows: []*Spend{}, Total: r.total, Available: r.available, TotalPayAmount: stringPointer("0")}, nil
}
func (r *ledgerRepoFake) Games(_ context.Context, _ []string, _ string, limit int) ([]*GameOption, error) {
func (r *ledgerRepoFake) Games(_ context.Context, viewer UserScope, _ []string, _ string, limit int) ([]*GameOption, error) {
r.scope.Viewer = viewer
r.gameLimit = limit
return []*GameOption{}, nil
}
@@ -89,4 +90,10 @@ func TestLedgerExportLimitAndDisplayFallback(t *testing.T) {
if r.gameLimit != 10000 {
t.Fatal("原游戏选项的特殊批量上限丢失")
}
if !r.scope.Viewer.All {
t.Fatal("超管游戏选项范围未传递")
}
if _, err := uc.Games(accountContext(9, 903), nil, "", 20); err != nil || !r.scope.Viewer.OnlySelf || r.scope.Viewer.All {
t.Fatal("普通商务游戏选项必须限定本人范围")
}
}