统一订单单状态模型
This commit is contained in:
@@ -126,7 +126,7 @@ func (h *MerchantHandler) UpdateProduct(c *gin.Context) {
|
||||
|
||||
func (h *MerchantHandler) ListOrders(c *gin.Context) {
|
||||
page, size := pageParams(c)
|
||||
list, total, err := h.fulfillmentSvc.ListOrders(middleware.GetMerchantID(c), page, size, c.Query("fulfillment_status"))
|
||||
list, total, err := h.fulfillmentSvc.ListOrders(middleware.GetMerchantID(c), page, size, c.Query("order_status"))
|
||||
if err != nil {
|
||||
response.ServerError(c, err.Error())
|
||||
return
|
||||
@@ -135,10 +135,10 @@ func (h *MerchantHandler) ListOrders(c *gin.Context) {
|
||||
}
|
||||
|
||||
type merchantTestOrderReq struct {
|
||||
SKU string `json:"sku" binding:"required"`
|
||||
BuyerReference string `json:"buyer_reference"`
|
||||
Note string `json:"note"`
|
||||
FulfillmentStatus string `json:"fulfillment_status"`
|
||||
SKU string `json:"sku" binding:"required"`
|
||||
BuyerReference string `json:"buyer_reference"`
|
||||
Note string `json:"note"`
|
||||
OrderStatus string `json:"order_status"`
|
||||
}
|
||||
|
||||
func (h *MerchantHandler) CreateTestOrder(c *gin.Context) {
|
||||
@@ -148,12 +148,12 @@ func (h *MerchantHandler) CreateTestOrder(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
order, err := h.fulfillmentSvc.CreateTestOrder(service.CreateTestOrderInput{
|
||||
MerchantID: middleware.GetMerchantID(c),
|
||||
ActorUserID: middleware.GetUserID(c),
|
||||
SKU: req.SKU,
|
||||
BuyerReference: req.BuyerReference,
|
||||
Note: req.Note,
|
||||
FulfillmentStatus: req.FulfillmentStatus,
|
||||
MerchantID: middleware.GetMerchantID(c),
|
||||
ActorUserID: middleware.GetUserID(c),
|
||||
SKU: req.SKU,
|
||||
BuyerReference: req.BuyerReference,
|
||||
Note: req.Note,
|
||||
OrderStatus: req.OrderStatus,
|
||||
})
|
||||
if err != nil {
|
||||
response.BadRequest(c, err.Error())
|
||||
|
||||
@@ -110,8 +110,8 @@ func (h *OpenV1Handler) QueryOrder(c *gin.Context) {
|
||||
response.ServerError(c, err.Error())
|
||||
return
|
||||
}
|
||||
openlog.Info(c, "query_order ok order_no=%s status=%s payment=%s",
|
||||
order.OrderNo, order.FulfillmentStatus, order.PaymentStatus)
|
||||
openlog.Info(c, "query_order ok order_no=%s status=%s",
|
||||
order.OrderNo, order.OrderStatus)
|
||||
response.OK(c, buildOpenOrderResponse(order))
|
||||
}
|
||||
|
||||
@@ -259,8 +259,7 @@ func buildOpenOrderResponse(order *model.FulfillmentOrder) gin.H {
|
||||
data := gin.H{
|
||||
"order_no": order.OrderNo,
|
||||
"client_order_no": order.ClientOrderNo,
|
||||
"payment_status": order.PaymentStatus,
|
||||
"fulfillment_status": order.FulfillmentStatus,
|
||||
"order_status": order.OrderStatus,
|
||||
"can_fulfill": canFulfill,
|
||||
"cannot_fulfill_reason": reason,
|
||||
"product": gin.H{
|
||||
|
||||
Reference in New Issue
Block a user