京东商城
This commit is contained in:
@@ -165,7 +165,7 @@ type WaybillReceiveParam struct {
|
||||
// ThrOrderID string `json:"thrOrderId"` //否 无 销售平台订单号(例如京东订单号或天猫订单号等等。总长度不要超过100。如果有多个单号,用英文,间隔。例如:7898675,7898676)
|
||||
SenderName string `json:"senderName"` //是 无 寄件人姓名,说明:不能为生僻字
|
||||
SenderAddress string `json:"senderAddress"` //是 无 寄件人地址,说明:不能为生僻字
|
||||
// SenderTel string `json:"senderTel"` //否 无 寄件人电话
|
||||
SenderTel string `json:"senderTel"` //否 无 寄件人电话
|
||||
// SenderMobile string `json:"senderMobile"` //否 无 寄件人手机(寄件人电话、手机至少有一个不为空)
|
||||
// SenderPostcode string `json:"senderPostcode"` //否 100000 寄件人邮编,长度:6位
|
||||
ReceiveName string `json:"receiveName"` //是 无 收件人名称,说明:不能为生僻字
|
||||
@@ -181,8 +181,8 @@ type WaybillReceiveParam struct {
|
||||
// SiteType int `json:"siteType"` //否 无 站点类型
|
||||
// SiteID int `json:"siteId"` //否 无 站点编码
|
||||
// SiteName string `json:"siteName"` //否 无 站点名称
|
||||
ReceiveTel string `json:"receiveTel"` //否 无 收件人电话
|
||||
ReceiveMobile string `json:"receiveMobile"` //否 无 收件人手机号(收件人电话、手机至少有一个不为空)
|
||||
ReceiveTel string `json:"receiveTel"` //否 无 收件人电话
|
||||
// ReceiveMobile string `json:"receiveMobile"` //否 无 收件人手机号(收件人电话、手机至少有一个不为空)
|
||||
// Postcode string `json:"postcode"` //否 100000 收件人邮编,长度:6
|
||||
PackageCount int `json:"packageCount"` //是 无 包裹数(大于0,小于1000)
|
||||
Weight int `json:"weight"` //是 2.5 重量(单位:kg,保留小数点后两位)
|
||||
|
||||
@@ -78,7 +78,7 @@ func TestGetTrackMessagePlusByOrder(t *testing.T) {
|
||||
t.Log(utils.Format4Output(result, false))
|
||||
}
|
||||
func TestSearchShopStock(t *testing.T) {
|
||||
result, err := api.SearchShopStock("")
|
||||
result, err := api.SearchShopStock("EMG4418113943423")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -86,7 +86,7 @@ func TestSearchShopStock(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestQueryStock(t *testing.T) {
|
||||
result, err := api.QueryStock("")
|
||||
result, err := api.QueryStock("EMG4418113943423")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
@@ -32,11 +32,13 @@ const (
|
||||
CreateCatType = "3"
|
||||
UpdateCatType = "1"
|
||||
|
||||
VenderID = 10374877
|
||||
TransportID = 2158480
|
||||
JxBrandId = 559853
|
||||
JdShopMaxStock = 9999
|
||||
JdsPromiseID = 13725637
|
||||
VenderID = 10374877
|
||||
TransportID = 2158480
|
||||
JxBrandId = 559853
|
||||
JdShopMaxStock = 9999
|
||||
JdsPromiseID = 13725637
|
||||
JdsDeliveryCompany3rd = "1274"
|
||||
JdsDeliveryCompanyJD = "773574"
|
||||
|
||||
JdsSkuStatus1 = 1 //从未上架
|
||||
JdsSkuStatus2 = 2 //自主下架
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
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
|
||||
@@ -17,3 +20,19 @@ func (a *API) OrderShipment(orderID int64, logiCoprId, logiNo string) (err error
|
||||
}
|
||||
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 (
|
||||
"testing"
|
||||
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
)
|
||||
|
||||
func TestEnGet(t *testing.T) {
|
||||
@@ -11,3 +13,11 @@ func TestEnGet(t *testing.T) {
|
||||
}
|
||||
// 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) {
|
||||
// err := api.TransparentImageAdd(wareId, imageUrl)
|
||||
// if err != nil {
|
||||
// t.Fatal(err)
|
||||
// }
|
||||
// t.Log(utils.Format4Output(result, false))
|
||||
str := "12300548611401"
|
||||
// suffix := str[12:len(str)]
|
||||
fmt.Println(str[:12])
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ func TestGetProvince(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestGetCity(t *testing.T) {
|
||||
result, err := api.GetCity(2)
|
||||
result, err := api.GetCity(12)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -55,7 +55,7 @@ func TestGetCity(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestGetCounty(t *testing.T) {
|
||||
result, err := api.GetCounty(2815)
|
||||
result, err := api.GetCounty(988)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user