From 1e16cae1e3f4c0ba90326da02a65b723420d89c0 Mon Sep 17 00:00:00 2001 From: Sinh Date: Tue, 22 Aug 2023 13:43:30 +0700 Subject: [PATCH 1/5] change api odn host --- partnerapi/tnc/const.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/partnerapi/tnc/const.go b/partnerapi/tnc/const.go index d12a697..3dbfe0c 100644 --- a/partnerapi/tnc/const.go +++ b/partnerapi/tnc/const.go @@ -34,7 +34,7 @@ const ( baseURLStaging = "https://ext.stg.vnfai.com" baseURLAuthProd = "https://auth.vnfai.com" - baseURLProd = "https://ext.vnfai.com" + baseURLProd = "https://ext-api.vnfai.com/doc" ) const ( From 04c8804c9d0ad688720336f79cc4f1bf7beab36c Mon Sep 17 00:00:00 2001 From: Sinh Date: Tue, 22 Aug 2023 13:51:55 +0700 Subject: [PATCH 2/5] change api odn host --- partnerapi/tnc/const.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/partnerapi/tnc/const.go b/partnerapi/tnc/const.go index 3dbfe0c..d07f2f1 100644 --- a/partnerapi/tnc/const.go +++ b/partnerapi/tnc/const.go @@ -34,7 +34,7 @@ const ( baseURLStaging = "https://ext.stg.vnfai.com" baseURLAuthProd = "https://auth.vnfai.com" - baseURLProd = "https://ext-api.vnfai.com/doc" + baseURLProd = "https://ext-api.vnfai.com" ) const ( From 4b8e6c4178aaef3d19d88eb979755fdfc85eb398 Mon Sep 17 00:00:00 2001 From: Sinh Date: Wed, 23 Aug 2023 11:28:30 +0700 Subject: [PATCH 3/5] update handle err OR --- partnerapi/tnc/tnc.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/partnerapi/tnc/tnc.go b/partnerapi/tnc/tnc.go index 0df0e74..30d1e30 100644 --- a/partnerapi/tnc/tnc.go +++ b/partnerapi/tnc/tnc.go @@ -67,7 +67,6 @@ func (c *Client) CreateOutboundRequest(p OutboundRequestPayload) (*OutboundReque } var ( r model.CommunicationHttpResponse - errRes Error dataRes []OutboundRequestRes ) 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") } if res.StatusCode >= http.StatusBadRequest { + var errRes Error if err = r.ParseResponseData(&errRes); err != nil { 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] e := item.Error if e != nil { - return nil, errRes + return nil, e } return item, err From 5b1b55ee789cae6bafc5c437851db897f5ba1b3e Mon Sep 17 00:00:00 2001 From: Sinh Date: Wed, 23 Aug 2023 13:48:16 +0700 Subject: [PATCH 4/5] update odn logistic info --- partnerapi/tnc/model_request.go | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/partnerapi/tnc/model_request.go b/partnerapi/tnc/model_request.go index 5f0a41d..ac74d4d 100644 --- a/partnerapi/tnc/model_request.go +++ b/partnerapi/tnc/model_request.go @@ -45,8 +45,14 @@ type OutboundRequestPayload struct { // UpdateORLogisticInfoPayload ... type UpdateORLogisticInfoPayload struct { - OrID int `json:"orId"` - TrackingCode string `json:"trackingCode"` - ShippingLabel string `json:"shippingLabel"` - SlaShipDate string `json:"slaShipDate"` + OrID int `json:"orId"` + + TPLCode string `json:"tplCode"` + TrackingCode string `json:"trackingCode"` + LogisticInfoLabels []LogisticInfoLabel `json:"logisticInfoLabels"` +} + +type LogisticInfoLabel struct { + Caption string `json:"caption"` + URI string `json:"uri"` } From 7d1d63039d28cac48d37b8e9fcedf7ce82bb8b58 Mon Sep 17 00:00:00 2001 From: Sinh Date: Wed, 23 Aug 2023 13:49:24 +0700 Subject: [PATCH 5/5] update odn logistic info --- partnerapi/tnc/model_request.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/partnerapi/tnc/model_request.go b/partnerapi/tnc/model_request.go index ac74d4d..3f2352c 100644 --- a/partnerapi/tnc/model_request.go +++ b/partnerapi/tnc/model_request.go @@ -47,9 +47,9 @@ type OutboundRequestPayload struct { type UpdateORLogisticInfoPayload struct { OrID int `json:"orId"` - TPLCode string `json:"tplCode"` - TrackingCode string `json:"trackingCode"` - LogisticInfoLabels []LogisticInfoLabel `json:"logisticInfoLabels"` + TPLCode string `json:"tplCode"` + TrackingCode string `json:"trackingCode"` + ShippingLabels []LogisticInfoLabel `json:"shippingLabels"` } type LogisticInfoLabel struct {