搜索商品修改
This commit is contained in:
@@ -451,13 +451,18 @@ type SearchWare4ValidResult struct {
|
||||
|
||||
//搜索有效商品
|
||||
//https://open.jd.com/home/home#/doc/api?apiCateId=48&apiId=1587&apiName=jingdong.ware.read.searchWare4Valid
|
||||
func (a *API) SearchWare4Valid(searchKey string) (searchWare4ValidResult *SearchWare4ValidResult, err error) {
|
||||
func (a *API) SearchWare4Valid(searchKey string, pageNo, pageSize int) (searchWare4ValidResult *SearchWare4ValidResult, err error) {
|
||||
param := make(map[string]interface{})
|
||||
if searchKey != "" {
|
||||
param["searchKey"] = searchKey
|
||||
param["searchField"] = "title"
|
||||
}
|
||||
param["pageSize"] = 100
|
||||
if pageNo != 0 {
|
||||
param["pageNo"] = pageNo
|
||||
}
|
||||
if pageSize != 0 {
|
||||
param["pageSize"] = pageSize
|
||||
}
|
||||
result, err := a.AccessAPI("jingdong.ware.read.searchWare4Valid", prodURL, param)
|
||||
if err == nil {
|
||||
utils.Map2StructByJson(result["jingdong_ware_read_searchWare4Valid_responce"].(map[string]interface{})["page"], &searchWare4ValidResult, false)
|
||||
@@ -538,3 +543,12 @@ func (a *API) UpdateWareMarketPrice(wareId int64, marketPrice float64) (err erro
|
||||
})
|
||||
return err
|
||||
}
|
||||
|
||||
//获取商品下架原因
|
||||
//https://open.jd.com/home/home#/doc/api?apiCateId=48&apiId=1225&apiName=jingdong.ware.read.findOpReason
|
||||
func (a *API) FindOpReason(wareId int64) (err error) {
|
||||
_, err = a.AccessAPI2("jingdong.ware.read.findOpReason", prodURL, map[string]interface{}{
|
||||
"wareId": wareId,
|
||||
})
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user