重构增加模型枚举值定义
This commit is contained in:
@@ -3,6 +3,7 @@ package handlers
|
||||
import (
|
||||
"platform/web/auth"
|
||||
"platform/web/core"
|
||||
trade2 "platform/web/domains/trade"
|
||||
m "platform/web/models"
|
||||
q "platform/web/queries"
|
||||
s "platform/web/services"
|
||||
@@ -180,8 +181,8 @@ func RechargePrepareAlipay(c *fiber.Ctx) error {
|
||||
Subject: "账户充值 - " + strconv.FormatFloat(req.Amount, 'f', 2, 64) + "元",
|
||||
Amount: req.Amount,
|
||||
ExpireAt: time.Now().Add(30 * time.Minute),
|
||||
Type: s.TransactionTypeRecharge,
|
||||
Method: s.TransactionMethodAlipay,
|
||||
Type: trade2.TypeRecharge,
|
||||
Method: trade2.MethodAlipay,
|
||||
})
|
||||
return err
|
||||
})
|
||||
@@ -212,7 +213,7 @@ func RechargeConfirmAlipay(c *fiber.Ctx) error {
|
||||
// 验证支付结果
|
||||
result, err := s.Transaction.VerifyTransaction(c.Context(), &s.TransactionVerifyData{
|
||||
TradeNo: req.TradeNo,
|
||||
Method: s.TransactionMethodAlipay,
|
||||
Method: trade2.MethodAlipay,
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -247,8 +248,8 @@ func RechargePrepareWechat(c *fiber.Ctx) error {
|
||||
Subject: "账户充值 - " + strconv.FormatFloat(req.Amount, 'f', 2, 64) + "元",
|
||||
Amount: req.Amount,
|
||||
ExpireAt: time.Now().Add(30 * time.Minute),
|
||||
Type: s.TransactionTypeRecharge,
|
||||
Method: s.TransactionMethodWeChat,
|
||||
Type: trade2.TypeRecharge,
|
||||
Method: trade2.MethodWeChat,
|
||||
})
|
||||
return err
|
||||
})
|
||||
@@ -281,7 +282,7 @@ func RechargeConfirmWechat(c *fiber.Ctx) error {
|
||||
// 验证支付结果
|
||||
result, err := s.Transaction.VerifyTransaction(c.Context(), &s.TransactionVerifyData{
|
||||
TradeNo: req.TradeNo,
|
||||
Method: s.TransactionMethodWeChat,
|
||||
Method: trade2.MethodWeChat,
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user