diff --git a/platformapi/jdapi/store_test.go b/platformapi/jdapi/store_test.go index e15d614d..54bc760b 100644 --- a/platformapi/jdapi/store_test.go +++ b/platformapi/jdapi/store_test.go @@ -1,6 +1,8 @@ package jdapi import ( + "fmt" + "regexp" "testing" "time" @@ -151,3 +153,14 @@ func TestUpdateStoreFreightConfigNew(t *testing.T) { t.Fatal(err) } } + +func TestAA(t *testing.T) { + str := "您的快件正在派送中,请您准备签收(快递员:赵磊,联系电话:18884041675)" + regexpCnameAndCmobile2 := regexp.MustCompile(`(快递员:(.*),联系电话:(.*))`) + result := regexpCnameAndCmobile2.FindAllStringSubmatch(str, -1) + if len(result) > 0 { + cName := result[0][1] + cMobile := result[0][2] + fmt.Println(cName, cMobile) + } +} diff --git a/platformapi/jdshopapi/store_test.go b/platformapi/jdshopapi/store_test.go index 7cff2501..122356b5 100644 --- a/platformapi/jdshopapi/store_test.go +++ b/platformapi/jdshopapi/store_test.go @@ -47,7 +47,7 @@ func TestGetProvince(t *testing.T) { } func TestGetCity(t *testing.T) { - result, err := api.GetCity(22) + result, err := api.GetCity(2) if err != nil { t.Fatal(err) } @@ -55,7 +55,7 @@ func TestGetCity(t *testing.T) { } func TestGetCounty(t *testing.T) { - result, err := api.GetCounty(1930) + result, err := api.GetCounty(2815) if err != nil { t.Fatal(err) } diff --git a/platformapi/mtpsapi/shop_page.go b/platformapi/mtpsapi/shop_page.go index e9357ac7..9ee8a3f3 100644 --- a/platformapi/mtpsapi/shop_page.go +++ b/platformapi/mtpsapi/shop_page.go @@ -1,22 +1,20 @@ package mtpsapi import ( - "fmt" - "git.rosy.net.cn/baseapi/utils" ) func (a *API) PagePoiUpdate(outerPoiID, contactName, contactPhone, contactEmail string) (err error) { - if outerPoiID == "" || contactName == "" || contactPhone == "" || contactEmail == "" { - return fmt.Errorf("所有参数必须都要有值") - } - params := map[string]interface{}{ - "outerPoiId": outerPoiID, - "contactName": contactName, - "contactPhone": contactPhone, - "contactEmail": contactEmail, - } - _, err = a.AccessAPI2("https://page.peisong.meituan.com/api", "haikuiopen/haikui/open/partner/poi/update", params) + // if outerPoiID == "" || contactName == "" || contactPhone == "" || contactEmail == "" { + // return fmt.Errorf("所有参数必须都要有值") + // } + // params := map[string]interface{}{ + // "outerPoiId": outerPoiID, + // "contactName": contactName, + // "contactPhone": contactPhone, + // "contactEmail": contactEmail, + // } + // _, err = a.AccessAPI2("https://page.peisong.meituan.com/api", "haikuiopen/haikui/open/partner/poi/update", params) return err }