添加自动获取品牌
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user