From 9bf57342e8f5353dd035f4118802d03e44221fc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Sat, 9 May 2020 08:58:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=AC=E4=B8=9C=E5=95=86=E5=9F=8E=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E5=88=86=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- platformapi/jdshopapi/jdshopapi.go | 3 +++ platformapi/jdshopapi/sku.go | 2 +- platformapi/jdshopapi/store_page.go | 8 ++++---- platformapi/jdshopapi/store_page_test.go | 8 ++++---- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/platformapi/jdshopapi/jdshopapi.go b/platformapi/jdshopapi/jdshopapi.go index 5933791c..28e574b9 100644 --- a/platformapi/jdshopapi/jdshopapi.go +++ b/platformapi/jdshopapi/jdshopapi.go @@ -16,6 +16,9 @@ import ( const ( prodURL = "https://api.jd.com/routerjson" sigKey = "sign" + + CreateCatType = "3" + UpdateCatType = "1" ) type API struct { diff --git a/platformapi/jdshopapi/sku.go b/platformapi/jdshopapi/sku.go index 43517a20..42ab035a 100644 --- a/platformapi/jdshopapi/sku.go +++ b/platformapi/jdshopapi/sku.go @@ -47,6 +47,6 @@ func (a *API) DeleteShopCategory(cid int64) (uniteResp *UniteResp, err error) { //京东商城发布商品(创建商品?) //https://open.jd.com/home/home#/doc/api?apiCateId=48&apiId=1379&apiName=jingdong.ware.write.add -func (a *API) CreateSkuName() (err error) { +func (a *API) CreateSku() (err error) { return err } diff --git a/platformapi/jdshopapi/store_page.go b/platformapi/jdshopapi/store_page.go index 3b8ac148..07e12884 100644 --- a/platformapi/jdshopapi/store_page.go +++ b/platformapi/jdshopapi/store_page.go @@ -41,13 +41,13 @@ func (a *API) AccessStorePage(fullURL string, bizParams map[string]interface{}) } type CreateShopCategoryParam struct { - HomeShow int `json:"homeShow"` - ID int `json:"id"` + HomeShow string `json:"homeShow"` + ID string `json:"id"` Open string `json:"open"` - OrderNo int `json:"orderNo"` + OrderNo string `json:"orderNo"` ParentID string `json:"parentId"` Title string `json:"title"` - Type int `json:"type"` + Type string `json:"type"` } //京东商城创建或修改店内分类 diff --git a/platformapi/jdshopapi/store_page_test.go b/platformapi/jdshopapi/store_page_test.go index 0e2aae82..0191424a 100644 --- a/platformapi/jdshopapi/store_page_test.go +++ b/platformapi/jdshopapi/store_page_test.go @@ -7,13 +7,13 @@ import ( func TestCreateShopCategory(t *testing.T) { var CreateShopCategoryParams = []*CreateShopCategoryParam{ &CreateShopCategoryParam{ - HomeShow: 0, - ID: 0, + HomeShow: "0", + ID: "0", Open: "", - OrderNo: 0, + OrderNo: "0", ParentID: "", Title: "测试1", - Type: 3, + Type: "3", }, } api.CreateShopCategory(CreateShopCategoryParams)