1
This commit is contained in:
@@ -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_kWP3yV8ei6reTseKnsxDJA") //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;
|
||||||
`
|
`
|
||||||
|
|||||||
@@ -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{}{
|
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{})["logistics_status"].(int64), nil
|
return 0, err
|
||||||
}
|
}
|
||||||
return 0, err
|
|
||||||
|
data := result.(map[string]interface{})
|
||||||
|
|
||||||
|
return data["logistics_status"].(int64), err
|
||||||
}
|
}
|
||||||
|
|
||||||
// 拉取用户真实手机号(必接)
|
// 拉取用户真实手机号(必接)
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ func TestGetDistributeOrderDetail(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestCancelReason(t *testing.T) {
|
func TestCancelReason(t *testing.T) {
|
||||||
result, err := api.GetCancelDeliveryReason(140382470727339348, "14038247 ")
|
result, err := api.GetCancelDeliveryReason(128752442052682640, "12875244")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ func TestOrderApplyPartRefund(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestOrderLogisticsStatus(t *testing.T) {
|
func TestOrderLogisticsStatus(t *testing.T) {
|
||||||
result, err := api.OrderLogisticsStatus(140382470727339348)
|
result, err := api.OrderLogisticsStatus(128752442052682640)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -336,13 +336,31 @@ func (a *API) CommentScore(appPoiCode string) (commentScoreResult *CommentScoreR
|
|||||||
return commentScoreResult, err
|
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 := make(map[string]interface{}, 0)
|
||||||
param["page_num"] = 1
|
param["page_num"] = 1
|
||||||
param["page_size"] = 20
|
param["page_size"] = 20
|
||||||
if otherStoreId != "" {
|
if otherStoreId != "" {
|
||||||
param["app_poi_code"] = 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
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ func TestCommentScore(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestGetBoundList(t *testing.T) {
|
func TestGetBoundList(t *testing.T) {
|
||||||
result, err := api.GetBoundList("")
|
result, err := api.GetBoundList("15478260")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user