完成剩余模块 Context 超时控制改造
This commit is contained in:
@@ -380,7 +380,7 @@ func seedMockPaymentConfig(t *testing.T, service *paymentconfig.Service, adminID
|
||||
|
||||
func createOwnerPaymentAccount(t *testing.T, service *paymentaccount.Service, ownerID uint64) *paymentaccount.PaymentAccountDTO {
|
||||
t.Helper()
|
||||
account, err := service.Create(ownerID, paymentaccount.CreatePaymentAccountRequest{
|
||||
account, err := service.Create(t.Context(), ownerID, paymentaccount.CreatePaymentAccountRequest{
|
||||
AccountType: "alipay",
|
||||
AccountName: "张三",
|
||||
AccountNo: "owner@example.com",
|
||||
@@ -458,7 +458,7 @@ func assertFinanceDashboard(t *testing.T, service *adminfinance.Service, orderNo
|
||||
StartDate: now.Add(-time.Hour),
|
||||
EndDate: now.Add(time.Hour),
|
||||
}
|
||||
dashboard, err := service.Dashboard(query)
|
||||
dashboard, err := service.Dashboard(t.Context(), query)
|
||||
if err != nil {
|
||||
t.Fatalf("读取财务看板失败: %v", err)
|
||||
}
|
||||
@@ -469,7 +469,7 @@ func assertFinanceDashboard(t *testing.T, service *adminfinance.Service, orderNo
|
||||
assertEqual(t, "财务号主钱包入账", dashboard.Summary.OwnerWalletIncomeAmountCent, int64(27500))
|
||||
assertEqual(t, "财务结算订单数", dashboard.Summary.SettledOrderCount, int64(1))
|
||||
|
||||
details, err := service.Details(adminfinance.DetailQuery{
|
||||
details, err := service.Details(t.Context(), adminfinance.DetailQuery{
|
||||
OrderNo: orderNo,
|
||||
DateType: "settled",
|
||||
StartDate: query.StartDate,
|
||||
@@ -497,7 +497,7 @@ func assertWalletAndWithdrawal(t *testing.T, walletService *wallet.Service, with
|
||||
}
|
||||
assertEqual(t, "提现前可用余额", accountBefore.AvailableBalanceCent, int64(27500))
|
||||
|
||||
req, err := withdrawalService.Create(ownerID, withdrawal.CreateWithdrawalRequest{
|
||||
req, err := withdrawalService.Create(t.Context(), ownerID, withdrawal.CreateWithdrawalRequest{
|
||||
PaymentAccountID: paymentAccountID,
|
||||
AmountCent: 10000,
|
||||
})
|
||||
@@ -507,7 +507,7 @@ func assertWalletAndWithdrawal(t *testing.T, walletService *wallet.Service, with
|
||||
assertEqual(t, "提现申请金额", req.AmountCent, int64(10000))
|
||||
assertEqual(t, "提现申请状态", req.Status, "pending")
|
||||
|
||||
reviewed, err := withdrawalService.Review(adminID, req.ID, withdrawal.ReviewWithdrawalRequest{
|
||||
reviewed, err := withdrawalService.Review(t.Context(), adminID, req.ID, withdrawal.ReviewWithdrawalRequest{
|
||||
Approved: true,
|
||||
Remark: "E2E 审核通过",
|
||||
})
|
||||
@@ -516,7 +516,7 @@ func assertWalletAndWithdrawal(t *testing.T, walletService *wallet.Service, with
|
||||
}
|
||||
assertEqual(t, "提现审核后状态", reviewed.Status, "processing")
|
||||
|
||||
paid, err := withdrawalService.ConfirmPayment(adminID, req.ID, withdrawal.ConfirmPaymentRequest{
|
||||
paid, err := withdrawalService.ConfirmPayment(t.Context(), adminID, req.ID, withdrawal.ConfirmPaymentRequest{
|
||||
PaymentProofURL: "https://example.com/proof.png",
|
||||
Remark: "E2E 已打款",
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user