修复 Context 改造后的编译问题

This commit is contained in:
yml2213
2026-06-10 09:43:49 +08:00
parent b377f8350b
commit 334436f381
13 changed files with 193 additions and 189 deletions
+3 -2
View File
@@ -1,6 +1,7 @@
package router
import (
"context"
"os"
"strings"
@@ -164,7 +165,7 @@ func New(cfg config.Config, deps Dependencies, logger *zap.Logger) *gin.Engine {
// Inject refund function into order repo to avoid circular dependency
if orderRepo != nil && paymentRepo != nil {
orderRepo.SetRefundFunc(func(orderID uint64, refundAmountCent int64, bizType string, remark string) (string, error) {
dto, err := paymentRepo.StartRefund(orderID, refundAmountCent, bizType, remark)
dto, err := paymentRepo.StartRefund(context.Background(), orderID, refundAmountCent, bizType, remark)
if err != nil {
return "", err
}
@@ -200,7 +201,7 @@ func New(cfg config.Config, deps Dependencies, logger *zap.Logger) *gin.Engine {
}
if disputeRepo != nil && paymentRepo != nil {
disputeRepo.SetRefundFunc(func(orderID uint64, refundAmountCent int64, bizType string, remark string) (string, error) {
dto, err := paymentRepo.StartRefund(orderID, refundAmountCent, bizType, remark)
dto, err := paymentRepo.StartRefund(context.Background(), orderID, refundAmountCent, bizType, remark)
if err != nil {
return "", err
}