继续补齐核心模块 Context 超时控制
This commit is contained in:
@@ -164,8 +164,8 @@ func New(cfg config.Config, deps Dependencies, logger *zap.Logger) *gin.Engine {
|
||||
paymentHandler := payment.NewHandler(paymentService)
|
||||
// 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(context.Background(), orderID, refundAmountCent, bizType, remark)
|
||||
orderRepo.SetRefundFunc(func(ctx context.Context, orderID uint64, refundAmountCent int64, bizType string, remark string) (string, error) {
|
||||
dto, err := paymentRepo.StartRefund(ctx, orderID, refundAmountCent, bizType, remark)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
@@ -200,8 +200,8 @@ func New(cfg config.Config, deps Dependencies, logger *zap.Logger) *gin.Engine {
|
||||
disputeRepo = dispute.NewRepository(deps.DB)
|
||||
}
|
||||
if disputeRepo != nil && paymentRepo != nil {
|
||||
disputeRepo.SetRefundFunc(func(orderID uint64, refundAmountCent int64, bizType string, remark string) (string, error) {
|
||||
dto, err := paymentRepo.StartRefund(context.Background(), orderID, refundAmountCent, bizType, remark)
|
||||
disputeRepo.SetRefundFunc(func(ctx context.Context, orderID uint64, refundAmountCent int64, bizType string, remark string) (string, error) {
|
||||
dto, err := paymentRepo.StartRefund(ctx, orderID, refundAmountCent, bizType, remark)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user