From 11dd5545617b941cbb36fa44c7a82ca458a4e85e Mon Sep 17 00:00:00 2001 From: gazebo Date: Tue, 7 Jan 2020 10:29:51 +0800 Subject: [PATCH] BuyerCancelOrder --- business/partner/purchase/jx/localjx/order.go | 2 +- controllers/jx_order2.go | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/business/partner/purchase/jx/localjx/order.go b/business/partner/purchase/jx/localjx/order.go index 7d254f68d..1f3d219a7 100644 --- a/business/partner/purchase/jx/localjx/order.go +++ b/business/partner/purchase/jx/localjx/order.go @@ -160,7 +160,7 @@ func CreateOrder(ctx *jxcontext.Context, jxOrder *JxOrderInfo, addressID int64, } // 买家取消(或申请取消)订单 -func BuyerCancelOrder(ctx *jxcontext.Context, orderID int64) (canceled bool, err error) { +func BuyerCancelOrder(ctx *jxcontext.Context, orderID int64, reason string) (canceled bool, err error) { order, err := partner.CurOrderManager.LoadOrder(utils.Int64ToStr(orderID), model.VendorIDJX) if err == nil { if order.Status < model.OrderStatusNew { diff --git a/controllers/jx_order2.go b/controllers/jx_order2.go index f42fd25e4..e76f72c98 100644 --- a/controllers/jx_order2.go +++ b/controllers/jx_order2.go @@ -46,6 +46,21 @@ func (c *JxOrderController) Pay4Order() { }) } +// @Title 买家取消(或申请取消)订单 +// @Description 买家取消(或申请取消)订单 +// @Param token header string true "认证token" +// @Param vendorOrderID formData string true "订单ID" +// @Param reason formData string true "原因" +// @Success 200 {object} controllers.CallResult +// @Failure 200 {object} controllers.CallResult +// @router /BuyerCancelOrder [post] +func (c *JxOrderController) BuyerCancelOrder() { + c.callBuyerCancelOrder(func(params *tJxorderBuyerCancelOrderParams) (retVal interface{}, errCode string, err error) { + retVal, err = localjx.BuyerCancelOrder(params.Ctx, utils.Str2Int64(params.VendorOrderID), params.Reason) + return retVal, "", err + }) +} + // @Title 查询网络打印机状态 // @Description 查询网络打印机状态 // @Param token header string true "认证token"