package order import "git.oa00.com/go/jcook-sdk/api/rest" // GetSkuStockRequest 获取库存状态. type GetSkuStockRequest struct { CtpProtocol rest.CtpProtocol `json:"ctpProtocol"` StockStateParam StockStateParam `json:"stockStateParam"` } type SkuQuantity struct { Quantity uint `json:"quantity"` SkuID uint `json:"skuId"` } type StockStateParam struct { Address rest.Address `json:"address"` SkuQuantityList []SkuQuantity `json:"skuQuantityList"` } func (o GetSkuStockRequest) GetApiName() string { return "jingdong.ctp.ware.stock.queryAreaStockState" } func (o GetSkuStockRequest) GetRespName() string { return "jingdong_ctp_ware_stock_queryAreaStockState_responce" } func (o GetSkuStockRequest) GetRespObj() interface{} { return GetSkuStockResponse{} } // GetSkuStockResponse 库存状态返回. type GetSkuStockResponse struct { Result struct { ErrCode uint `json:"errCode"` ErrMsg string `json:"errMsg"` Success bool `json:"success"` StockStateList []StockState `json:"stockStateList"` } `json:"result"` } type areaStockState uint const ( SoldOut areaStockState = iota SoldIn StockIng ) var areaStockStateMap = map[areaStockState]string{ SoldOut: "无库存", SoldIn: "有库存", StockIng: "采购中", } func (o areaStockState) String() string { if value, ok := areaStockStateMap[o]; !ok { return rest.UnKnow } else { return value } } type StockState struct { AreaStockState areaStockState `json:"areaStockState"` LeadTime string `json:"leadTime"` SkuQuantity SkuQuantity `json:"skuQuantity"` }