This commit is contained in:
邹宗楠
2022-08-29 16:17:40 +08:00
parent 9e139e79d7
commit c3d3ed8f16
6 changed files with 28 additions and 9 deletions

View File

@@ -19,13 +19,13 @@ func init() {
baseapi.Init(sugarLogger) baseapi.Init(sugarLogger)
// 菜市 // 菜市
api = New("589", "a81eb3df418d83d6a1a4b7c572156d2f", "", "") //api = New("589", "a81eb3df418d83d6a1a4b7c572156d2f", "", "")
// 果园 // 果园
//api = New("4123", "df2c88338b85f830cebce2a9eab56628", "", "") //api = New("4123", "df2c88338b85f830cebce2a9eab56628", "", "")
//商超 //商超
//api = New("5873", "41c479790a76f86326f89e8048964739", "", "token_vI4fNBaB5J1qvft0WmZG_g") //token_nH_IlcWQKAkZBqklwItNRw api = New("5873", "41c479790a76f86326f89e8048964739", "", "token_kWP3yV8ei6reTseKnsxDJA") //token_nH_IlcWQKAkZBqklwItNRw
cookieStr := ` cookieStr := `
acctId=57396785; token=0bWbK5VbK50E2BmIhIH2zHB-am_y7mB37yXHm6RLZWx4*; wmPoiId=-1; acctId=57396785; token=0bWbK5VbK50E2BmIhIH2zHB-am_y7mB37yXHm6RLZWx4*; wmPoiId=-1;
` `

View File

@@ -552,14 +552,14 @@ func (a *API) OrderLogisticsCancel(orderID int64, reason string) (err error) {
return err return err
} }
func (a *API) OrderLogisticsStatus(orderID int64) (status map[string]interface{}, err error) { func (a *API) OrderLogisticsStatus(orderID int64) (status int64, err error) {
result, err := a.AccessAPI("order/logistics/status", true, map[string]interface{}{ result, err := a.AccessAPI("order/logistics/status", true, map[string]interface{}{
KeyOrderID: orderID, KeyOrderID: orderID,
}) })
if err == nil { if err == nil {
return result.(map[string]interface{}), nil return result.(map[string]interface{})["logistics_status"].(int64), nil
} }
return nil, err return 0, err
} }
// 拉取用户真实手机号(必接) // 拉取用户真实手机号(必接)

View File

@@ -23,7 +23,7 @@ func TestGetDistributeOrderDetail(t *testing.T) {
} }
func TestCancelReason(t *testing.T) { func TestCancelReason(t *testing.T) {
result, err := api.GetCancelDeliveryReason(148815412592716910, "14881541") result, err := api.GetCancelDeliveryReason(140382470727339348, "14038247 ")
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }

View File

@@ -71,14 +71,14 @@ func TestOrderApplyPartRefund(t *testing.T) {
} }
func TestOrderLogisticsStatus(t *testing.T) { func TestOrderLogisticsStatus(t *testing.T) {
result, err := api.OrderLogisticsStatus(33762863658107006) result, err := api.OrderLogisticsStatus(140382470727339348)
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
if len(result) == 0 { if result == 0 {
t.Fatal("result should have value") t.Fatal("result should have value")
} }
// t.Log(utils.Format4Output(result, false)) t.Log(utils.Format4Output(result, false))
} }
func TestOrderBatchPullPhoneNumber(t *testing.T) { func TestOrderBatchPullPhoneNumber(t *testing.T) {

View File

@@ -335,3 +335,14 @@ func (a *API) CommentScore(appPoiCode string) (commentScoreResult *CommentScoreR
} }
return commentScoreResult, err return commentScoreResult, err
} }
// 获取授权门店列表
func (a *API) GetBoundList(otherStoreId string) (interface{}, 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)
}

View File

@@ -155,3 +155,11 @@ func TestCommentScore(t *testing.T) {
} }
t.Log(utils.Format4Output(result, false)) t.Log(utils.Format4Output(result, false))
} }
func TestGetBoundList(t *testing.T) {
result, err := api.GetBoundList("")
if err != nil {
t.Fatal(err)
}
t.Log(utils.Format4Output(result, false))
}