add order func #21
			
				
			
		
		
		
	| 
						 | 
				
			
			@ -82,3 +82,19 @@ func (o Order) UpdateLogisticInfoFailed(p model.OrderUpdateLogisticInfoFailed) e
 | 
			
		|||
	}
 | 
			
		||||
	return nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// ORNotUpdateStatus ...
 | 
			
		||||
func (o Order) ORNotUpdateStatus(p model.OrderORsNotUpdateStatus) error {
 | 
			
		||||
	msg, err := natsio.GetServer().Request(subject.Order.ORNotUpdateStatus, toBytes(p))
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return err
 | 
			
		||||
	}
 | 
			
		||||
	var r model.CommonResponseData
 | 
			
		||||
	if err = json.Unmarshal(msg.Data, &r); err != nil {
 | 
			
		||||
		return err
 | 
			
		||||
	}
 | 
			
		||||
	if r.Error != "" {
 | 
			
		||||
		return errors.New(r.Error)
 | 
			
		||||
	}
 | 
			
		||||
	return nil
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -33,3 +33,8 @@ type OrderUpdateLogisticInfoFailed struct {
 | 
			
		|||
	ORCode  string `json:"orCode"`
 | 
			
		||||
	Reason  string `json:"reason"`
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// OrderORsNotUpdateStatus ...
 | 
			
		||||
type OrderORsNotUpdateStatus struct {
 | 
			
		||||
	ORCodes []string `json:"orCodes"`
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -11,9 +11,11 @@ var Order = struct {
 | 
			
		|||
	CancelDelivery           string
 | 
			
		||||
	ChangeDeliveryStatus     string
 | 
			
		||||
	UpdateLogisticInfoFailed string
 | 
			
		||||
	ORNotUpdateStatus        string
 | 
			
		||||
}{
 | 
			
		||||
	UpdateORStatus:           getOrderValue("update_outbound_request_status"),
 | 
			
		||||
	CancelDelivery:           getOrderValue("cancel_delivery"),
 | 
			
		||||
	ChangeDeliveryStatus:     getOrderValue("change_delivery_status"),
 | 
			
		||||
	UpdateLogisticInfoFailed: getOrderValue("update_logistic_info_failed"),
 | 
			
		||||
	ORNotUpdateStatus:        getOrderValue("outbound_request_not_update_status"),
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue