This commit is contained in:
邹宗楠
2022-08-30 09:32:20 +08:00
parent c3d3ed8f16
commit 9ab4c3b6c3
6 changed files with 31 additions and 10 deletions

View File

@@ -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;
`

View File

@@ -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
}
// 拉取用户真实手机号(必接)

View File

@@ -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)
}

View File

@@ -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)
}

View File

@@ -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
}

View File

@@ -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)
}