From 4085be83708b631ca96595f345846ec3a7f0e720 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Tue, 17 Dec 2019 10:45:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=A5=BF=E7=99=BE=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E9=97=A8=E5=BA=97=E5=85=AC=E5=91=8A=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- platformapi/ebaiapi/shop.go | 10 ++++++++++ platformapi/ebaiapi/shop_test.go | 11 +++++++++-- platformapi/jdapi/store_page_test.go | 2 +- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/platformapi/ebaiapi/shop.go b/platformapi/ebaiapi/shop.go index 7f2249d2..11ef353d 100644 --- a/platformapi/ebaiapi/shop.go +++ b/platformapi/ebaiapi/shop.go @@ -285,3 +285,13 @@ func (a *API) ShopAptitudeGet(shopID string, baiduShopID int64) (shopInfoList [] } return nil, err } + +func (a *API) ShopAnnouncementSet(shopID string, baiduShopID int64, content string) (err error) { + params := a.genShopIDParams(shopID, baiduShopID, 0) + params["content"] = content + _, err = a.AccessAPI("shop.announcement.set", params) + if err == nil { + return nil + } + return err +} diff --git a/platformapi/ebaiapi/shop_test.go b/platformapi/ebaiapi/shop_test.go index cc1f5ddb..4ffc5f31 100644 --- a/platformapi/ebaiapi/shop_test.go +++ b/platformapi/ebaiapi/shop_test.go @@ -52,9 +52,9 @@ func TestShopAptitudeGet(t *testing.T) { func TestShopUpdate(t *testing.T) { params := map[string]interface{}{ - KeyName: "好菜鲜生-测试店1", + KeyName: "好菜鲜生-测试店", KeyPhone: "13812345678", - KeyBaiduShopID: 2233976901, + KeyBaiduShopID: testShopBaiduID, "longitude": 116.307884, "latitude": 40.036828, "coord_type": "amap", @@ -129,3 +129,10 @@ func TestShopOffline(t *testing.T) { t.Fatal(err) } } + +func TestShopAnnouncementSet(t *testing.T) { + err := api.ShopAnnouncementSet("", testShopBaiduID, "测试公告123") + if err != nil { + t.Fatal(err) + } +} diff --git a/platformapi/jdapi/store_page_test.go b/platformapi/jdapi/store_page_test.go index a17097f4..bfcd08b9 100644 --- a/platformapi/jdapi/store_page_test.go +++ b/platformapi/jdapi/store_page_test.go @@ -228,7 +228,7 @@ func TestIsJdManagerUser(t *testing.T) { } func TestGetJdStoreLevel(t *testing.T) { - api.GetJdStoreLevel("320406", "11732427") + api.GetJdStoreLevel("320406", "11732427", 1) } func TestGetJdUpcCodeByName(t *testing.T) {