aa
This commit is contained in:
@@ -57,10 +57,11 @@ type MaterialOptionalParam struct {
|
|||||||
Q string `json:"q,omitempty"`
|
Q string `json:"q,omitempty"`
|
||||||
PageNo int `json:"page_no,omitempty"`
|
PageNo int `json:"page_no,omitempty"`
|
||||||
PageSize int `json:"page_size,omitempty"`
|
PageSize int `json:"page_size,omitempty"`
|
||||||
Sort int `json:"sort,omitempty"`
|
Sort string `json:"sort,omitempty"`
|
||||||
Cat string `json:"cat,omitempty"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type MaterialOptionalResult struct {
|
type MaterialOptionalResult struct {
|
||||||
|
ResultList []struct {
|
||||||
CategoryID int `json:"category_id"`
|
CategoryID int `json:"category_id"`
|
||||||
CategoryName string `json:"category_name"`
|
CategoryName string `json:"category_name"`
|
||||||
CommissionRate string `json:"commission_rate"`
|
CommissionRate string `json:"commission_rate"`
|
||||||
@@ -108,13 +109,16 @@ type MaterialOptionalResult struct {
|
|||||||
WhiteImage string `json:"white_image"`
|
WhiteImage string `json:"white_image"`
|
||||||
XID string `json:"x_id"`
|
XID string `json:"x_id"`
|
||||||
ZkFinalPrice string `json:"zk_final_price"`
|
ZkFinalPrice string `json:"zk_final_price"`
|
||||||
|
} `json:"result_list"`
|
||||||
|
TotalResults int `json:"total_results"`
|
||||||
|
RequestID string `json:"request_id"`
|
||||||
}
|
}
|
||||||
|
|
||||||
//物料搜索
|
//物料搜索
|
||||||
func (a *API) MaterialOptional(param *MaterialOptionalParam) (activityInfoGetResult []*MaterialOptionalResult, err error) {
|
func (a *API) MaterialOptional(param *MaterialOptionalParam) (activityInfoGetResult *MaterialOptionalResult, err error) {
|
||||||
result, err := a.AccessAPI("taobao.tbk.dg.material.optional", false, utils.Struct2FlatMap(param))
|
result, err := a.AccessAPI("taobao.tbk.dg.material.optional", false, utils.Struct2FlatMap(param))
|
||||||
if err == nil {
|
if err == nil {
|
||||||
utils.Map2StructByJson(result["result_list"], &activityInfoGetResult, false)
|
utils.Map2StructByJson(result, &activityInfoGetResult, false)
|
||||||
}
|
}
|
||||||
return activityInfoGetResult, err
|
return activityInfoGetResult, err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ func TestMaterialOptional(t *testing.T) {
|
|||||||
AdzoneID: 111339100149,
|
AdzoneID: 111339100149,
|
||||||
PageNo: 1,
|
PageNo: 1,
|
||||||
PageSize: 10,
|
PageSize: 10,
|
||||||
Cat: "",
|
Q: "泡椒",
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
|
|||||||
Reference in New Issue
Block a user