You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
jcook-sdk/api/rest/order/Inventory.go

70 lines
1.6 KiB

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"`
}