京东商城

This commit is contained in:
苏尹岚
2020-06-04 09:58:20 +08:00
parent a71f902289
commit 6a4077f441
7 changed files with 47 additions and 18 deletions

View File

@@ -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 //自主下架

View File

@@ -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
}

View File

@@ -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))
}

View File

@@ -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])
}

View File

@@ -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)
}