fix logger and redeem admin review findings
Some checks failed
CI / test (push) Has been cancelled
CI / golangci-lint (push) Has been cancelled
Security Scan / backend-security (push) Has been cancelled
Security Scan / frontend-security (push) Has been cancelled

This commit is contained in:
2026-04-20 11:24:36 +08:00
parent 3a0ca7f57f
commit ed642e8769
22 changed files with 563 additions and 63 deletions

View File

@@ -58,7 +58,8 @@ type stubAdminService struct {
sortOrder string
calls int
}
mu sync.Mutex
batchDeleteRedeemResult *service.RedeemBatchDeleteResult
mu sync.Mutex
}
func newStubAdminService() *stubAdminService {
@@ -449,8 +450,11 @@ func (s *stubAdminService) DeleteRedeemCode(ctx context.Context, id int64) error
return nil
}
func (s *stubAdminService) BatchDeleteRedeemCodes(ctx context.Context, ids []int64) (int64, error) {
return int64(len(ids)), nil
func (s *stubAdminService) BatchDeleteRedeemCodes(ctx context.Context, ids []int64) (*service.RedeemBatchDeleteResult, error) {
if s.batchDeleteRedeemResult != nil {
return s.batchDeleteRedeemResult, nil
}
return &service.RedeemBatchDeleteResult{DeletedIDs: ids, Skipped: []service.RedeemBatchDeleteSkipped{}}, nil
}
func (s *stubAdminService) ExpireRedeemCode(ctx context.Context, id int64) (*service.RedeemCode, error) {