diff --git a/platformapi/ebaiapi/ebaiapi_test.go b/platformapi/ebaiapi/ebaiapi_test.go index ce86377b..467decd2 100644 --- a/platformapi/ebaiapi/ebaiapi_test.go +++ b/platformapi/ebaiapi/ebaiapi_test.go @@ -29,13 +29,13 @@ func init() { // api = New("62289", "d3ec2358d6a819ea") // 京西菜市 - //api = New("34665", "c3db75b754ea2d89") + api = New("34665", "c3db75b754ea2d89") //菜市测试 // api = New("62923", "aa4cdc6c1108486b") // 京西果园 - api = New("35957", "10013fbb7c2ddad7") + //api = New("35957", "10013fbb7c2ddad7") // api.SetCookie("PASSPORT_DELIMONT_TOKEN", "PBE_2.0_5cd1c6141c127d4188f026ac01fc93656266683e8dfb3127c2fdf894259e9034125ff3bdd2a997a385802ee3ef1802ba93a04acea34fde2d2b6e802c5dcd4ec6e3f4ad909a1d806e3ceeb349ed726b03d60ed1fe7010d4140aa338d9c5f05e3fec172c78d3d7f0ca579d61b7015af1bf99aa46b04d2b8a64aa50646dc09afe94b6b60e0ba9a933635db5e8b2a035e9b6d693b289acf1b256d5b9a3f8478c87b0b009115bfd1394f20bb5a0dc2c07b8d013a25f286ec6bf7f2d86010d65507e31358834b7a6b58fbd88cb3f1a12cf71c997b91c1527f6f3c10693f7c2bd6073da8633a98cd2dc1114dfa5be5ee0e60b02cf7e4a94d0fb563a8c01717e7c050f02249117219c07a2eb211577c208ba77f4d536fa25139bc249be93b38d6fc495ef67a32aa206835d177db402bc534de1d29caf4f6b4fbcd912c13f167d00d1732222744c336a5189728f72fb5e153c4b1164171cfb0c811f34f4c2fedd43f721b8706b43f8d631251c") //api.SetCookie("WMUSS", "NTE2NDMTAwMDAyNzYxNzAwOTEyTmUzNWJNcDlQ ") //api.SetCookie("WMSTOKEN", "NTE2NDMTAwMDAyNzYxNzAwOTEyTmUzNWJNcDlQ ") diff --git a/platformapi/ebaiapi/order_test.go b/platformapi/ebaiapi/order_test.go index 600ee066..fd5eb52e 100644 --- a/platformapi/ebaiapi/order_test.go +++ b/platformapi/ebaiapi/order_test.go @@ -214,7 +214,7 @@ func TestOrderPrivateInfo(t *testing.T) { } func TestOrderDeliveryGet(t *testing.T) { - result, err := api.OrderDeliveryGet("4053750050397193755") + result, err := api.OrderDeliveryGet("4040090353958939256") if err != nil { t.Fatal(err) } diff --git a/platformapi/ebaiapi/shop_sku_test.go b/platformapi/ebaiapi/shop_sku_test.go index a81f1dbe..885fc596 100644 --- a/platformapi/ebaiapi/shop_sku_test.go +++ b/platformapi/ebaiapi/shop_sku_test.go @@ -17,15 +17,6 @@ func TestShopCategoryCreate(t *testing.T) { } } -func TestShopCategoryGet(t *testing.T) { - result, err := api.ShopCategoryGet("800493") - if err != nil { - t.Fatal(err) - } else { - t.Log(utils.Format4Output(result, false)) - } -} - func TestShopGet222(t *testing.T) { data, err := api.ShopGet("", 32267258880) fmt.Println(data) @@ -56,6 +47,7 @@ func TestSkuGetItemsByCategoryId(t *testing.T) { } func TestSkuList(t *testing.T) { + foodListData := make([]*SkuInfo, 0, 0) skuIdOffset := 0 param := &SkuListParams{ @@ -65,7 +57,6 @@ func TestSkuList(t *testing.T) { } for { - foodList, err := api.SkuList(utils.Int2Str(300394), param) if err != nil { break @@ -88,14 +79,14 @@ func TestSkuListDelete(t *testing.T) { Page: page, PageSize: 100, } - foodList, err := api.SkuList(utils.Int2Str(5000100), param) + foodList, err := api.SkuList(utils.Int2Str(5000112), param) if err != nil { break } for k, v := range foodList.List { api.AccessAPI2("sku.delete", map[string]interface{}{ - "shop_id": "5000100", + "shop_id": "5000112", "sku_id": v.SkuId, }, utils.GetUUID()) globals.SugarLogger.Debugf("---k := %d,delete_name:= %s", k, v.Name) @@ -105,6 +96,17 @@ func TestSkuListDelete(t *testing.T) { } } +func TestSkuDeleteCategory(t *testing.T) { + fromCategoryList, _ := api.ShopCategoryGet(utils.Int2Str(5000112)) + for _, v := range fromCategoryList { + api.ShopCategoryDelete("5000112", v.CategoryID) + if len(v.Children) != 0 { + for _, c := range v.Children { + api.ShopCategoryDelete("5000112", c.CategoryID) + } + } + } +} func TestSkuUploadRTF(t *testing.T) { rtfDetail := BuildRFTFromImgs("https://image.jxc4.com/sijidou.jpg") t.Log(rtfDetail) diff --git a/platformapi/jdapi/im.go b/platformapi/jdapi/im.go index 631a5f42..afe6a91c 100644 --- a/platformapi/jdapi/im.go +++ b/platformapi/jdapi/im.go @@ -3,6 +3,7 @@ package jdapi import ( "fmt" "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/globals" "io/ioutil" "net/http" "time" @@ -71,6 +72,7 @@ func (a *API) MessagePushService(msg *ContextMsg) error { func ImChatRiskMsg(request *http.Request) (back []byte, url string, err error) { msgURL := getMsgURLFromRequest(request) data, err := ioutil.ReadAll(request.Body) + globals.SugarLogger.Debugf("------ImChatRiskMsg:= %s", string(data)) if err != nil { return nil, "", err } diff --git a/platformapi/mtwmapi/mtwmapi_test.go b/platformapi/mtwmapi/mtwmapi_test.go index 7cd886f7..44828986 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_oFtkFnZqmR7QtKUeqIpJ8Q") + //api = New("5873", "41c479790a76f86326f89e8048964739", "", "token_oFtkFnZqmR7QtKUeqIpJ8Q") //cookieStr := ` // acctId=57396785; token=0bWbK5VbK50E2BmIhIH2zHB-am_y7mB37yXHm6RLZWx4*; wmPoiId=-1; //` diff --git a/platformapi/mtwmapi/retail_test.go b/platformapi/mtwmapi/retail_test.go index c65a2050..af60d205 100644 --- a/platformapi/mtwmapi/retail_test.go +++ b/platformapi/mtwmapi/retail_test.go @@ -406,7 +406,7 @@ func TestRetailRecommendTag(t *testing.T) { // 删除商品 func TestRetailDelete(t *testing.T) { - poiCode := "31690278" + poiCode := "33889953" i := 0 count := 0 @@ -439,18 +439,18 @@ func TestRetailDelete(t *testing.T) { // 测试删除门店分类列表 func TestDeleteCat(t *testing.T) { - result, err := api.RetailCatList("31690278") + result, err := api.RetailCatList("33889953") fmt.Println(result, err) for _, v := range result { if v.Children != nil { for _, v2 := range v.Children { - err = api.RetailCatDelete("31690278", "", v2.Name, 1) + err = api.RetailCatDelete("33889953", "", v2.Name, 1) if err != nil { t.Fatal(err) } } } else { - err = api.RetailCatDelete("31690278", "", v.Name, 1) + err = api.RetailCatDelete("33889953", "", v.Name, 1) if err != nil { continue t.Fatal(err)