From f1728bb5a3ad5481bc8c94474cfb9a3c7d43f475 Mon Sep 17 00:00:00 2001 From: lwl0608 Date: Thu, 21 Mar 2024 19:25:54 +0800 Subject: [PATCH] fix err return --- app/mix/service/logic/vas.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/mix/service/logic/vas.go b/app/mix/service/logic/vas.go index eba6c233..104a8dca 100644 --- a/app/mix/service/logic/vas.go +++ b/app/mix/service/logic/vas.go @@ -2452,13 +2452,13 @@ func (v *Vas) RefundOrder(ctx *gin.Context, req *vasproto.RefundOrderReq) error // 获取订单 order, err := v.store.GetOrderById(ctx, nil, req.OrderId) if err == sql.ErrNoRows { - return errs.ErrVasOrderNotExists + return errors.New("订单不存在") } if err != nil { return err } if order == nil { - return errs.ErrVasOrderNotExists + return errors.New("订单不存在") } // 获取商品 @@ -2478,7 +2478,7 @@ func (v *Vas) RefundOrder(ctx *gin.Context, req *vasproto.RefundOrderReq) error case dbstruct.ProductTypeMoneyContact: return v.refundMoneyContactWechat(ctx, order, req) default: - return errors.New("invalid product") + return errors.New("不支持该商品退款") } } @@ -2966,7 +2966,7 @@ func (v *Vas) RefundCoinOrder(ctx *gin.Context, req *vasproto.RefundCoinOrderReq // 获取订单 order, err := v.store.GetCoinOrderById(ctx, nil, req.OrderId) if err == sql.ErrNoRows { - return errs.ErrVasOrderNotExists + return errors.New("订单不存在") } if err != nil { return err @@ -2979,7 +2979,7 @@ func (v *Vas) RefundCoinOrder(ctx *gin.Context, req *vasproto.RefundCoinOrderReq case dbstruct.ProductIdContactWechat: return v.refundCoinContactWechat(ctx, order, req) default: - return errors.New("invalid product") + return errors.New("不支持该商品退款") } }