Merge branch 'master' of https://e.coding.net/rosydev/baseapi
This commit is contained in:
@@ -34,7 +34,7 @@ func init() {
|
||||
//api = New("0e12f461-2e6b-49ca-bce6-935c6672362d", "f2ed33075faf4773a47e065acd79532b", "aed14cbbecac4456843570e90c5f46ec")
|
||||
|
||||
// 京东超市 381564
|
||||
api = New("f99d25b8-33a6-4251-a97c-5e24b80b0005", "d2d1e2e3213d4320bc2712a684307831", "1750f5b9848d4a6492c1c20b487074da")
|
||||
api = New("fe07cad2-d366-424b-8e85-9b81d7987cba", "8376b3071c5b49fb96a4c82be0dbc104", "a55b47042d5845018834f42d42ffafb7")
|
||||
//prod zs
|
||||
// api = New("6f8d3290-0120-4ad7-8b53-943c67c84f3f", "789279b9ae814ba091ac52815566b54d", "5d668cd227644637bb0fd73ed8118ec8")
|
||||
// const cookieValue = "YYJV3NHVBPHLD36FWP6F3EM5PTXJ2XZQS7U4HWRIDPP4IWGUKUIB4XG5N26CZRDLDF7PKOXBPD6BNTUAJLETLZOIWMCVFI3K6MYZIY4QBIXIMXYDJNUKFGJVQTN5356SAD6WPCIHWNQAG7DDMF7L7S3SHCT3RM3CQG7IJIPUQ3THS5UIUYWMKINM7ETUOQB7OBPOPZVCT3ZJY55243TDVXLO25PP4UYSPTTPMNQ7HPMWOJKJ3BJWGVHD243MXH7NZWW264TKN5UOCJBSSSOKD2QQII"
|
||||
|
||||
@@ -1038,6 +1038,7 @@ func (a *API) GetJdUpcCodeByName(name, upcCode string, pageNo, pageSize int) (pr
|
||||
UpcCode: v.(map[string]interface{})["upcCode"].(string),
|
||||
Weight: float32(utils.Interface2Float64WithDefault(v.(map[string]interface{})["weight"], 0) * 1000),
|
||||
ImgList: ImgList,
|
||||
BrandName: v.(map[string]interface{})["brandName"].(string),
|
||||
}
|
||||
productInfos = append(productInfos, productInfo)
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import (
|
||||
"fmt"
|
||||
"git.rosy.net.cn/baseapi"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
@@ -208,14 +209,15 @@ func TestC(t *testing.T) {
|
||||
// api.GetJdStoreLevel("320406", "11732427", 1)
|
||||
//}
|
||||
//
|
||||
//func TestGetJdUpcCodeByName(t *testing.T) {
|
||||
// result, err := api.GetJdUpcCodeByName("", "6920174736731", 1, 5)
|
||||
// if err != nil {
|
||||
// t.Fatal(err)
|
||||
// }
|
||||
// t.Log(utils.Format4Output(result, false))
|
||||
//}
|
||||
//
|
||||
func TestGetJdUpcCodeByName(t *testing.T) {
|
||||
result, err := api.GetJdUpcCodeByName("", "9556771007300", 1, 5)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
t.Log(strings.Split(result[0].OriginalName, " ")[0])
|
||||
t.Log(utils.Format4Output(result, false))
|
||||
}
|
||||
|
||||
//func TestGetJdSkuDirectPrice(t *testing.T) {
|
||||
// result, err := api.GetJdSkuDirectPrice(31031)
|
||||
// fmt.Println("test1", result, err)
|
||||
|
||||
@@ -32,23 +32,14 @@ import (
|
||||
// t.Log(utils.Format4Output(result, false))
|
||||
//}
|
||||
//
|
||||
//func TestGetStationsByVenderId(t *testing.T) {
|
||||
// result, err := api.GetStationsByVenderId()
|
||||
// if err != nil {
|
||||
// t.Fatal(err)
|
||||
// }
|
||||
// findStore := false
|
||||
// for _, v := range result {
|
||||
// if v == mustExistStoreID {
|
||||
// findStore = true
|
||||
// break
|
||||
// }
|
||||
// }
|
||||
// if !findStore {
|
||||
// baseapi.SugarLogger.Fatalf("result have no store:%s", mustExistStoreID)
|
||||
// }
|
||||
//}
|
||||
//
|
||||
func TestGetStationsByVenderId(t *testing.T) {
|
||||
result, err := api.GetStationsByVenderId()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
t.Log(utils.Format4Output(result, false))
|
||||
}
|
||||
|
||||
func TestGetStoreInfoByStationNo(t *testing.T) {
|
||||
result, err := api.GetStoreInfoByStationNo2("12535376")
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user