京东商城
This commit is contained in:
@@ -165,7 +165,7 @@ type WaybillReceiveParam struct {
|
|||||||
// ThrOrderID string `json:"thrOrderId"` //否 无 销售平台订单号(例如京东订单号或天猫订单号等等。总长度不要超过100。如果有多个单号,用英文,间隔。例如:7898675,7898676)
|
// ThrOrderID string `json:"thrOrderId"` //否 无 销售平台订单号(例如京东订单号或天猫订单号等等。总长度不要超过100。如果有多个单号,用英文,间隔。例如:7898675,7898676)
|
||||||
SenderName string `json:"senderName"` //是 无 寄件人姓名,说明:不能为生僻字
|
SenderName string `json:"senderName"` //是 无 寄件人姓名,说明:不能为生僻字
|
||||||
SenderAddress string `json:"senderAddress"` //是 无 寄件人地址,说明:不能为生僻字
|
SenderAddress string `json:"senderAddress"` //是 无 寄件人地址,说明:不能为生僻字
|
||||||
// SenderTel string `json:"senderTel"` //否 无 寄件人电话
|
SenderTel string `json:"senderTel"` //否 无 寄件人电话
|
||||||
// SenderMobile string `json:"senderMobile"` //否 无 寄件人手机(寄件人电话、手机至少有一个不为空)
|
// SenderMobile string `json:"senderMobile"` //否 无 寄件人手机(寄件人电话、手机至少有一个不为空)
|
||||||
// SenderPostcode string `json:"senderPostcode"` //否 100000 寄件人邮编,长度:6位
|
// SenderPostcode string `json:"senderPostcode"` //否 100000 寄件人邮编,长度:6位
|
||||||
ReceiveName string `json:"receiveName"` //是 无 收件人名称,说明:不能为生僻字
|
ReceiveName string `json:"receiveName"` //是 无 收件人名称,说明:不能为生僻字
|
||||||
@@ -182,7 +182,7 @@ type WaybillReceiveParam struct {
|
|||||||
// SiteID int `json:"siteId"` //否 无 站点编码
|
// SiteID int `json:"siteId"` //否 无 站点编码
|
||||||
// SiteName string `json:"siteName"` //否 无 站点名称
|
// SiteName string `json:"siteName"` //否 无 站点名称
|
||||||
ReceiveTel string `json:"receiveTel"` //否 无 收件人电话
|
ReceiveTel string `json:"receiveTel"` //否 无 收件人电话
|
||||||
ReceiveMobile string `json:"receiveMobile"` //否 无 收件人手机号(收件人电话、手机至少有一个不为空)
|
// ReceiveMobile string `json:"receiveMobile"` //否 无 收件人手机号(收件人电话、手机至少有一个不为空)
|
||||||
// Postcode string `json:"postcode"` //否 100000 收件人邮编,长度:6
|
// Postcode string `json:"postcode"` //否 100000 收件人邮编,长度:6
|
||||||
PackageCount int `json:"packageCount"` //是 无 包裹数(大于0,小于1000)
|
PackageCount int `json:"packageCount"` //是 无 包裹数(大于0,小于1000)
|
||||||
Weight int `json:"weight"` //是 2.5 重量(单位:kg,保留小数点后两位)
|
Weight int `json:"weight"` //是 2.5 重量(单位:kg,保留小数点后两位)
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ func TestGetTrackMessagePlusByOrder(t *testing.T) {
|
|||||||
t.Log(utils.Format4Output(result, false))
|
t.Log(utils.Format4Output(result, false))
|
||||||
}
|
}
|
||||||
func TestSearchShopStock(t *testing.T) {
|
func TestSearchShopStock(t *testing.T) {
|
||||||
result, err := api.SearchShopStock("")
|
result, err := api.SearchShopStock("EMG4418113943423")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
@@ -86,7 +86,7 @@ func TestSearchShopStock(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestQueryStock(t *testing.T) {
|
func TestQueryStock(t *testing.T) {
|
||||||
result, err := api.QueryStock("")
|
result, err := api.QueryStock("EMG4418113943423")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,6 +37,8 @@ const (
|
|||||||
JxBrandId = 559853
|
JxBrandId = 559853
|
||||||
JdShopMaxStock = 9999
|
JdShopMaxStock = 9999
|
||||||
JdsPromiseID = 13725637
|
JdsPromiseID = 13725637
|
||||||
|
JdsDeliveryCompany3rd = "1274"
|
||||||
|
JdsDeliveryCompanyJD = "773574"
|
||||||
|
|
||||||
JdsSkuStatus1 = 1 //从未上架
|
JdsSkuStatus1 = 1 //从未上架
|
||||||
JdsSkuStatus2 = 2 //自主下架
|
JdsSkuStatus2 = 2 //自主下架
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
package jdshopapi
|
package jdshopapi
|
||||||
|
|
||||||
import "fmt"
|
import (
|
||||||
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
|
)
|
||||||
|
|
||||||
//订单出库
|
//订单出库
|
||||||
//https://open.jd.com/home/home#/doc/api?apiCateId=55&apiId=1948&apiName=jingdong.pop.order.shipment
|
//https://open.jd.com/home/home#/doc/api?apiCateId=55&apiId=1948&apiName=jingdong.pop.order.shipment
|
||||||
@@ -17,3 +20,19 @@ func (a *API) OrderShipment(orderID int64, logiCoprId, logiNo string) (err error
|
|||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//获取商家物流公司
|
||||||
|
//https://open.jd.com/home/home#/doc/api?apiCateId=75&apiId=582&apiName=360buy.get.vender.all.delivery.company
|
||||||
|
func (a *API) GetDeliveryCompany() (result interface{}, err error) {
|
||||||
|
var params = map[string]interface{}{
|
||||||
|
"fields": "id,name",
|
||||||
|
}
|
||||||
|
data, _ := json.Marshal(params)
|
||||||
|
result, err = a.AccessAPI("360buy.get.vender.all.delivery.company", prodURL, map[string]interface{}{
|
||||||
|
"360buy_param_json": string(data),
|
||||||
|
})
|
||||||
|
if err == nil {
|
||||||
|
|
||||||
|
}
|
||||||
|
return result, err
|
||||||
|
}
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ package jdshopapi
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
"git.rosy.net.cn/baseapi/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestEnGet(t *testing.T) {
|
func TestEnGet(t *testing.T) {
|
||||||
@@ -11,3 +13,11 @@ func TestEnGet(t *testing.T) {
|
|||||||
}
|
}
|
||||||
// t.Log(utils.Format4Output(result, false))
|
// t.Log(utils.Format4Output(result, false))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestGetDeliveryCompany(t *testing.T) {
|
||||||
|
result, err := api.GetDeliveryCompany()
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
t.Log(utils.Format4Output(result, false))
|
||||||
|
}
|
||||||
|
|||||||
@@ -423,9 +423,7 @@ func TestFindWareById(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestTransparentImageAdd(t *testing.T) {
|
func TestTransparentImageAdd(t *testing.T) {
|
||||||
// err := api.TransparentImageAdd(wareId, imageUrl)
|
str := "12300548611401"
|
||||||
// if err != nil {
|
// suffix := str[12:len(str)]
|
||||||
// t.Fatal(err)
|
fmt.Println(str[:12])
|
||||||
// }
|
|
||||||
// t.Log(utils.Format4Output(result, false))
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ func TestGetProvince(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestGetCity(t *testing.T) {
|
func TestGetCity(t *testing.T) {
|
||||||
result, err := api.GetCity(2)
|
result, err := api.GetCity(12)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
@@ -55,7 +55,7 @@ func TestGetCity(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestGetCounty(t *testing.T) {
|
func TestGetCounty(t *testing.T) {
|
||||||
result, err := api.GetCounty(2815)
|
result, err := api.GetCounty(988)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user