From d962fafe7f388107f58ff4a0bdccd00487a4f1bf Mon Sep 17 00:00:00 2001 From: shanshanzhong Date: Wed, 4 Mar 2026 23:28:37 -0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=AE=A2=E5=8D=95=E6=94=AF?= =?UTF-8?q?=E4=BB=98=E6=98=BE=E7=A4=BA=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apis/types.api | 1 - .../logic/admin/order/createOrderLogic.go | 2 +- .../logic/admin/order/getOrderListLogic.go | 9 ------ internal/logic/admin/order/method.go | 30 ------------------- internal/types/types.go | 1 - 5 files changed, 1 insertion(+), 42 deletions(-) delete mode 100644 internal/logic/admin/order/method.go diff --git a/apis/types.api b/apis/types.api index f2fd38f..8f60427 100644 --- a/apis/types.api +++ b/apis/types.api @@ -405,7 +405,6 @@ type ( CouponDiscount int64 `json:"coupon_discount"` Commission int64 `json:"commission,omitempty"` Payment PaymentMethod `json:"payment"` - Method string `json:"method"` FeeAmount int64 `json:"fee_amount"` TradeNo string `json:"trade_no"` Status uint8 `json:"status"` diff --git a/internal/logic/admin/order/createOrderLogic.go b/internal/logic/admin/order/createOrderLogic.go index cb1c82f..32abeaf 100644 --- a/internal/logic/admin/order/createOrderLogic.go +++ b/internal/logic/admin/order/createOrderLogic.go @@ -45,7 +45,7 @@ func (l *CreateOrderLogic) CreateOrder(req *types.CreateOrderRequest) error { Coupon: req.Coupon, CouponDiscount: req.CouponDiscount, PaymentId: req.PaymentId, - Method: normalizeOrderMethod("", paymentMethod.Platform), + Method: paymentMethod.Token, FeeAmount: req.FeeAmount, TradeNo: req.TradeNo, Status: req.Status, diff --git a/internal/logic/admin/order/getOrderListLogic.go b/internal/logic/admin/order/getOrderListLogic.go index 22c04b2..cdf9da6 100644 --- a/internal/logic/admin/order/getOrderListLogic.go +++ b/internal/logic/admin/order/getOrderListLogic.go @@ -35,15 +35,6 @@ func (l *GetOrderListLogic) GetOrderList(req *types.GetOrderListRequest) (resp * resp = &types.GetOrderListResponse{} resp.List = make([]types.Order, 0) tool.DeepCopy(&resp.List, list) - for index := range resp.List { - resp.List[index].Method = normalizeOrderMethod(resp.List[index].Method, resp.List[index].Payment.Platform) - if resp.List[index].Payment.Platform == "" { - resp.List[index].Payment.Platform = resp.List[index].Method - } - if resp.List[index].Payment.Name == "" { - resp.List[index].Payment.Name = resp.List[index].Method - } - } resp.Total = total return } diff --git a/internal/logic/admin/order/method.go b/internal/logic/admin/order/method.go deleted file mode 100644 index 5f281e9..0000000 --- a/internal/logic/admin/order/method.go +++ /dev/null @@ -1,30 +0,0 @@ -package order - -import ( - "strings" - - paymentPlatform "github.com/perfect-panel/server/pkg/payment" -) - -func canonicalOrderMethod(method string) string { - method = strings.TrimSpace(method) - if method == "" { - return "" - } - - platform := paymentPlatform.ParsePlatform(method) - if platform == paymentPlatform.UNSUPPORTED { - return "" - } - return platform.String() -} - -func normalizeOrderMethod(orderMethod string, paymentMethod string) string { - if method := canonicalOrderMethod(paymentMethod); method != "" { - return method - } - if method := canonicalOrderMethod(orderMethod); method != "" { - return method - } - return "unknown" -} diff --git a/internal/types/types.go b/internal/types/types.go index 2dd1684..7eeca2c 100644 --- a/internal/types/types.go +++ b/internal/types/types.go @@ -1433,7 +1433,6 @@ type Order struct { CouponDiscount int64 `json:"coupon_discount"` Commission int64 `json:"commission,omitempty"` Payment PaymentMethod `json:"payment"` - Method string `json:"method"` FeeAmount int64 `json:"fee_amount"` TradeNo string `json:"trade_no"` Status uint8 `json:"status"`