京东商城商品修改

This commit is contained in:
苏尹岚
2020-05-26 10:48:37 +08:00
parent 2cf9d698fd
commit 697fda029e
4 changed files with 47 additions and 20 deletions

View File

@@ -0,0 +1,11 @@
package jdshopapi
//查询单个订单
//https://open.jd.com/home/home#/doc/api?apiCateId=55&apiId=2389&apiName=jingdong.pop.order.enGet
func (a *API) EnGet(orderID int64) (err error) {
_, err = a.AccessAPI("jingdong.pop.order.enGet", prodURL, map[string]interface{}{
"order_id": orderID,
"optional_fields": "ALL",
})
return err
}

View File

@@ -0,0 +1,13 @@
package jdshopapi
import (
"testing"
)
func TestEnGet(t *testing.T) {
err := api.EnGet(116889545275)
if err != nil {
t.Fatal(err)
}
// t.Log(utils.Format4Output(result, false))
}

View File

@@ -115,6 +115,7 @@ type CreateSkuParamSkus struct {
// Capacity string `json:"capacity"` // 否 20L 20T 容量在有特殊要求的类目下必填最多支持6位小数。 // Capacity string `json:"capacity"` // 否 20L 20T 容量在有特殊要求的类目下必填最多支持6位小数。
Type string `json:"type"` //"com.jd.pop.ware.ic.api.domain.sku" Type string `json:"type"` //"com.jd.pop.ware.ic.api.domain.sku"
Type2 string `json:"@type"` Type2 string `json:"@type"`
MultiCateProps []*CreateSkuParamAttrs `json:"multiCateProps"` // 否 无 类目属性列表,类目属性中有必填项时,此字段必填;若未设置或设置错误,会有“通用属性必填”等错误提示!
} }
type CreateSkuParamAttrs struct { type CreateSkuParamAttrs struct {
@@ -148,6 +149,7 @@ type UpdateWareParam struct {
PromiseID int `json:"promiseId"` // 否 无 配送时效 PromiseID int `json:"promiseId"` // 否 无 配送时效
MobileDesc string `json:"mobileDesc"` // 是 无 移动版的商品介绍 长度限制10W个字符 MobileDesc string `json:"mobileDesc"` // 是 无 移动版的商品介绍 长度限制10W个字符
Introduction string `json:"introduction"` // 是 无 PC版的商品介绍 长度限制10W个字符 Introduction string `json:"introduction"` // 是 无 PC版的商品介绍 长度限制10W个字符
Features []*CreateSkuParamFeatures `json:"features"` // 否 无 商品维度的特殊属性 目前两个特殊属性 IBS、FBP、FCS、SCF 4种商家类型【规格型号】 model和【销售单位】 unit 字段且为必填(如 个、盒、袋等)请勿填写公司名称。
} }
type QueryPictureReuslt struct { type QueryPictureReuslt struct {
@@ -178,6 +180,7 @@ type UpdateSkusParamSkus struct {
Capacity string `json:"capacity,omitempty"` //否 20L 容量在有特殊要求的类目下必填最多支持6位小数。 Capacity string `json:"capacity,omitempty"` //否 20L 容量在有特殊要求的类目下必填最多支持6位小数。
Type string `json:"type"` //"com.jd.pop.ware.ic.api.domain.sku" Type string `json:"type"` //"com.jd.pop.ware.ic.api.domain.sku"
Type2 string `json:"@type"` Type2 string `json:"@type"`
MultiCateProps []*CreateSkuParamAttrs `json:"multiCateProps"` // 否 无 类目属性列表,类目属性中有必填项时,此字段必填;若未设置或设置错误,会有“通用属性必填”等错误提示!
} }
//查询商家所有的店内分类 //查询商家所有的店内分类

View File

@@ -231,7 +231,7 @@ func TestCreateSku(t *testing.T) {
} }
func TestFindAttrs(t *testing.T) { func TestFindAttrs(t *testing.T) {
result, err := api.FindAttrs(13573) result, err := api.FindAttrs(13571)
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
@@ -239,7 +239,7 @@ func TestFindAttrs(t *testing.T) {
} }
func TestFindValuesByAttrId(t *testing.T) { func TestFindValuesByAttrId(t *testing.T) {
result, no, err := api.FindValuesByAttrId(1001027602) result, no, err := api.FindValuesByAttrId(102241)
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }