Merge branch 'change-api-tnc-to-odn' into develop
This commit is contained in:
commit
4de10ff715
|
@ -34,7 +34,7 @@ const (
|
||||||
baseURLStaging = "https://ext.stg.vnfai.com"
|
baseURLStaging = "https://ext.stg.vnfai.com"
|
||||||
|
|
||||||
baseURLAuthProd = "https://auth.vnfai.com"
|
baseURLAuthProd = "https://auth.vnfai.com"
|
||||||
baseURLProd = "https://ext.vnfai.com"
|
baseURLProd = "https://ext-api.vnfai.com"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
|
@ -46,7 +46,13 @@ type OutboundRequestPayload struct {
|
||||||
// UpdateORLogisticInfoPayload ...
|
// UpdateORLogisticInfoPayload ...
|
||||||
type UpdateORLogisticInfoPayload struct {
|
type UpdateORLogisticInfoPayload struct {
|
||||||
OrID int `json:"orId"`
|
OrID int `json:"orId"`
|
||||||
|
|
||||||
|
TPLCode string `json:"tplCode"`
|
||||||
TrackingCode string `json:"trackingCode"`
|
TrackingCode string `json:"trackingCode"`
|
||||||
ShippingLabel string `json:"shippingLabel"`
|
ShippingLabels []LogisticInfoLabel `json:"shippingLabels"`
|
||||||
SlaShipDate string `json:"slaShipDate"`
|
}
|
||||||
|
|
||||||
|
type LogisticInfoLabel struct {
|
||||||
|
Caption string `json:"caption"`
|
||||||
|
URI string `json:"uri"`
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,7 +67,6 @@ func (c *Client) CreateOutboundRequest(p OutboundRequestPayload) (*OutboundReque
|
||||||
}
|
}
|
||||||
var (
|
var (
|
||||||
r model.CommunicationHttpResponse
|
r model.CommunicationHttpResponse
|
||||||
errRes Error
|
|
||||||
dataRes []OutboundRequestRes
|
dataRes []OutboundRequestRes
|
||||||
)
|
)
|
||||||
if err = pjson.Unmarshal(msg.Data, &r); err != nil {
|
if err = pjson.Unmarshal(msg.Data, &r); err != nil {
|
||||||
|
@ -78,6 +77,7 @@ func (c *Client) CreateOutboundRequest(p OutboundRequestPayload) (*OutboundReque
|
||||||
return nil, fmt.Errorf("tnc.Client.CreateOutboundRequest: empty_response")
|
return nil, fmt.Errorf("tnc.Client.CreateOutboundRequest: empty_response")
|
||||||
}
|
}
|
||||||
if res.StatusCode >= http.StatusBadRequest {
|
if res.StatusCode >= http.StatusBadRequest {
|
||||||
|
var errRes Error
|
||||||
if err = r.ParseResponseData(&errRes); err != nil {
|
if err = r.ParseResponseData(&errRes); err != nil {
|
||||||
return nil, fmt.Errorf("tnc.Client.CreateOutboundRequest: parse_response_err: %v", err)
|
return nil, fmt.Errorf("tnc.Client.CreateOutboundRequest: parse_response_err: %v", err)
|
||||||
}
|
}
|
||||||
|
@ -92,7 +92,7 @@ func (c *Client) CreateOutboundRequest(p OutboundRequestPayload) (*OutboundReque
|
||||||
item := &dataRes[0]
|
item := &dataRes[0]
|
||||||
e := item.Error
|
e := item.Error
|
||||||
if e != nil {
|
if e != nil {
|
||||||
return nil, errRes
|
return nil, e
|
||||||
}
|
}
|
||||||
|
|
||||||
return item, err
|
return item, err
|
||||||
|
|
Loading…
Reference in New Issue