Files
jx-callback/controllers/jx_order2.go
gazebo 7410da75fd +GetOrderPay
GetOrders添加参数isPurchase
2019-11-27 10:05:26 +08:00

75 lines
3.0 KiB
Go

package controllers
import (
"git.rosy.net.cn/baseapi/utils"
"git.rosy.net.cn/jx-callback/business/partner/purchase/jx/localjx"
"github.com/astaxie/beego"
)
type JxOrderController struct {
beego.Controller
}
// @Title 创建京西商城订单
// @Description 创建京西商城订单
// @Param token header string true "认证token"
// @Param jxOrder formData string true "订单信息"
// @Param addressID formData int64 true "配送地址ID"
// @Param createType formData int false "创建类型, 0:预创建, 1:创建"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /CreateOrder [post]
func (c *JxOrderController) CreateOrder() {
c.callCreateOrder(func(params *tJxorderCreateOrderParams) (retVal interface{}, errCode string, err error) {
var jxOrder *localjx.JxOrderInfo
if err = utils.UnmarshalUseNumber([]byte(params.JxOrder), &jxOrder); err == nil {
retVal, err = localjx.CreateOrder(params.Ctx, jxOrder, int64(params.AddressID), params.CreateType)
}
return retVal, "", err
})
}
// @Title 请求支付京西商城订单
// @Description 请求支付京西商城订单
// @Param token header string true "认证token"
// @Param vendorOrderID formData string true "订单ID"
// @Param payType formData int true "支付类型"
// @Param vendorPayType formData string true "平台支付类型"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /Pay4Order [post]
func (c *JxOrderController) Pay4Order() {
c.callPay4Order(func(params *tJxorderPay4OrderParams) (retVal interface{}, errCode string, err error) {
retVal, err = localjx.Pay4Order(params.Ctx, utils.Str2Int64(params.VendorOrderID), params.PayType, params.VendorPayType)
return retVal, "", err
})
}
// @Title 查询网络打印机状态
// @Description 查询网络打印机状态
// @Param token header string true "认证token"
// @Param storeID query int true "门店ID"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /GetAvailableDeliverTime [get]
func (c *JxOrderController) GetAvailableDeliverTime() {
c.callGetAvailableDeliverTime(func(params *tJxorderGetAvailableDeliverTimeParams) (retVal interface{}, errCode string, err error) {
retVal, err = localjx.GetAvailableDeliverTime(params.Ctx, params.StoreID)
return retVal, "", err
})
}
// @Title 得到一个订单的支付信息
// @Description 得到一个订单的支付信息
// @Param token header string true "认证token"
// @Param vendorOrderID query string true "订单号,如果此项不为空,忽略其它所有查询条件"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /GetOrderPay [get]
func (c *JxOrderController) GetOrderPay() {
c.callGetOrderPay(func(params *tJxorderGetOrderPayParams) (retVal interface{}, errCode string, err error) {
retVal, err = localjx.GetOrderPay(params.Ctx, params.VendorOrderID)
return retVal, "", err
})
}