master v1.1.2
大虾 3 years ago
parent 5ed98fa532
commit 7ae0451908

@ -3,6 +3,7 @@ package rest
import (
"encoding/json"
"fmt"
"git.oa00.com/go/jcook-sdk/util/http"
"git.oa00.com/go/jcook-sdk/util/security"
"github.com/mitchellh/mapstructure"
@ -120,13 +121,14 @@ func (c *Client) Exec(r Requester) (interface{}, error) {
if !strings.Contains(string(resp), r.GetRespName()) {
return nil, fmt.Errorf("system err: %s", string(resp))
}
fmt.Println(string(resp))
var temp map[string]interface{}
err = json.Unmarshal(resp, &temp)
if err != nil {
return nil, err
}
if c.Debug{
if c.Debug {
fmt.Println(temp)
}
result := temp[r.GetRespName()]

@ -0,0 +1,49 @@
package sku
import "git.oa00.com/go/jcook-sdk/api/rest"
type ApiSkuPoolListParam struct {
ScrollID string `json:"scrollId"`
SkuPoolType uint `json:"skuPoolType"`
PageSize uint `json:"pageSize"`
}
type GetSkuPoolRequest struct {
CtpProtocol rest.CtpProtocol `json:"ctpProtocol"`
ApiSkuPoolListParam ApiSkuPoolListParam `json:"apiSkuPoolListParam"`
}
func (o GetSkuPoolRequest) GetApiName() string {
return "jingdong.ctp.ware.skupool.getSkuPoolList"
}
func (o GetSkuPoolRequest) GetRespName() string {
return "jingdong_ctp_ware_skupool_getSkuPoolList_responce"
}
func (o GetSkuPoolRequest) GetRespObj() interface{} {
return PoolResponse{}
}
type PoolSku struct {
SkuPoolID uint `json:"skuPoolId"`
SkuID uint `json:"skuId"`
SkuName string `json:"skuName"`
SkuPoolType uint `json:"skuPoolType"`
SkuPoolTypeName string `json:"skuPoolTypeName"`
}
type PoolParams struct {
ScrollID string `json:"scrollId"`
Total uint `json:"total"`
Entries []PoolSku `json:"entries"`
}
type PoolResponse struct {
Code string `json:"code"`
Result struct {
Data PoolParams `json:"data"`
ErrCode uint `json:"errCode"`
ErrMsg string `json:"errMsg"`
Success bool `json:"success"`
} `json:"result"`
}

@ -0,0 +1,45 @@
package sku
import "git.oa00.com/go/jcook-sdk/api/rest"
type PoolAddParam struct {
SkuPoolID uint `json:"skuPoolId"`
SkuID uint `json:"skuId"`
}
type PoolAddList struct {
SkuPoolAddList []PoolAddParam `json:"skuPoolAddList"`
}
type PoolAddRequest struct {
CtpProtocol rest.CtpProtocol `json:"ctpProtocol"`
ApiSkuPoolAddParam PoolAddList `json:"apiSkuPoolAddParam"`
}
func (o PoolAddRequest) GetApiName() string {
return "jingdong.ctp.ware.skupool.addSkuIntoChannel"
}
func (o PoolAddRequest) GetRespName() string {
return "jingdong_ctp_ware_skupool_addSkuIntoChannel_responce"
}
func (o PoolAddRequest) GetRespObj() interface{} {
return PoolAddResponse{}
}
type PoolAddParams struct {
ErrorMessage string `json:"errorMessage"`
SkuPoolId uint `json:"skuPoolId"`
SkuId uint `json:"skuId"`
IsSuccess bool `json:"isSuccess"`
}
type PoolAddResponse struct {
Code string `json:"code"`
Result struct {
Data []PoolAddParams `json:"data"`
ErrCode uint `json:"errCode"`
ErrMsg string `json:"errMsg"`
Success bool `json:"success"`
} `json:"result"`
}
Loading…
Cancel
Save