diff --git a/platformapi/mtwmapi/mtwmapi_test.go b/platformapi/mtwmapi/mtwmapi_test.go index 2729fb81..fe2e63f1 100644 --- a/platformapi/mtwmapi/mtwmapi_test.go +++ b/platformapi/mtwmapi/mtwmapi_test.go @@ -19,13 +19,13 @@ func init() { baseapi.Init(sugarLogger) // 菜市 - //api = New("589", "a81eb3df418d83d6a1a4b7c572156d2f", "", "") + api = New("589", "a81eb3df418d83d6a1a4b7c572156d2f", "", "") // 果园 //api = New("4123", "df2c88338b85f830cebce2a9eab56628", "", "") //商超 - api = New("5873", "41c479790a76f86326f89e8048964739", "", "token_kWP3yV8ei6reTseKnsxDJA") //token_nH_IlcWQKAkZBqklwItNRw + //api = New("5873", "41c479790a76f86326f89e8048964739", "", "token_kWP3yV8ei6reTseKnsxDJA") //token_nH_IlcWQKAkZBqklwItNRw cookieStr := ` acctId=57396785; token=0bWbK5VbK50E2BmIhIH2zHB-am_y7mB37yXHm6RLZWx4*; wmPoiId=-1; ` diff --git a/platformapi/mtwmapi/order.go b/platformapi/mtwmapi/order.go index cabeb3a9..9f83ac82 100644 --- a/platformapi/mtwmapi/order.go +++ b/platformapi/mtwmapi/order.go @@ -556,10 +556,13 @@ func (a *API) OrderLogisticsStatus(orderID int64) (status int64, err error) { result, err := a.AccessAPI("order/logistics/status", true, map[string]interface{}{ KeyOrderID: orderID, }) - if err == nil { - return result.(map[string]interface{})["logistics_status"].(int64), nil + if err != nil { + return 0, err } - return 0, err + + data := result.(map[string]interface{}) + + return data["logistics_status"].(int64), err } // 拉取用户真实手机号(必接) diff --git a/platformapi/mtwmapi/order_page_test.go b/platformapi/mtwmapi/order_page_test.go index ff70d7b6..8756bd92 100644 --- a/platformapi/mtwmapi/order_page_test.go +++ b/platformapi/mtwmapi/order_page_test.go @@ -23,7 +23,7 @@ func TestGetDistributeOrderDetail(t *testing.T) { } func TestCancelReason(t *testing.T) { - result, err := api.GetCancelDeliveryReason(140382470727339348, "14038247 ") + result, err := api.GetCancelDeliveryReason(128752442052682640, "12875244") if err != nil { t.Fatal(err) } diff --git a/platformapi/mtwmapi/order_test.go b/platformapi/mtwmapi/order_test.go index 11afad52..6a46bf34 100644 --- a/platformapi/mtwmapi/order_test.go +++ b/platformapi/mtwmapi/order_test.go @@ -71,7 +71,7 @@ func TestOrderApplyPartRefund(t *testing.T) { } func TestOrderLogisticsStatus(t *testing.T) { - result, err := api.OrderLogisticsStatus(140382470727339348) + result, err := api.OrderLogisticsStatus(128752442052682640) if err != nil { t.Fatal(err) } diff --git a/platformapi/mtwmapi/poi.go b/platformapi/mtwmapi/poi.go index d0083e8e..1a70d596 100644 --- a/platformapi/mtwmapi/poi.go +++ b/platformapi/mtwmapi/poi.go @@ -336,13 +336,31 @@ func (a *API) CommentScore(appPoiCode string) (commentScoreResult *CommentScoreR return commentScoreResult, err } +type AuthorizationStatus struct { + AppID int `json:"app_id"` + AppPoiCode string `json:"app_poi_code"` + IsOnline int `json:"is_online"` + PoiName string `json:"poi_name"` + WmPoiID int `json:"wm_poi_id"` +} + // 获取授权门店列表 -func (a *API) GetBoundList(otherStoreId string) (interface{}, error) { +func (a *API) GetBoundList(otherStoreId string) ([]*AuthorizationStatus, error) { param := make(map[string]interface{}, 0) param["page_num"] = 1 param["page_size"] = 20 if otherStoreId != "" { param["app_poi_code"] = otherStoreId } - return a.AccessAPI("ecommerce/poi/bound/list", true, param) + result, err := a.AccessAPI("ecommerce/poi/bound/list", true, param) + if err != nil { + return nil, err + } + + var data []*AuthorizationStatus + if err := utils.Map2StructByJson(result, &data, false); err != nil { + return nil, err + } + + return data, nil } diff --git a/platformapi/mtwmapi/poi_test.go b/platformapi/mtwmapi/poi_test.go index f9999397..90c201ac 100644 --- a/platformapi/mtwmapi/poi_test.go +++ b/platformapi/mtwmapi/poi_test.go @@ -157,7 +157,7 @@ func TestCommentScore(t *testing.T) { } func TestGetBoundList(t *testing.T) { - result, err := api.GetBoundList("") + result, err := api.GetBoundList("15478260") if err != nil { t.Fatal(err) }