Modifier and Type | Field and Description |
---|---|
protected KdtApiClient |
client |
protected static com.fasterxml.jackson.core.type.TypeReference<Response<CouponConsume>> |
COUPON_CONSUME_RESPONSE_TYPE_REF |
protected static com.fasterxml.jackson.core.type.TypeReference<Response<Coupon>> |
COUPON_RESPONSE_TYPE_REF |
protected static com.fasterxml.jackson.core.type.TypeReference<Response<Coupons>> |
COUPONS_RESPONSE_TYPE_REF |
protected static com.fasterxml.jackson.core.type.TypeReference<Response<Item>> |
ITEM_RESPONSE_TYPE_REF |
protected static com.fasterxml.jackson.core.type.TypeReference<Response<Items>> |
ITEMS_RESPONSE_TYPE_REF |
protected com.fasterxml.jackson.databind.ObjectMapper |
mapper |
protected static com.fasterxml.jackson.core.type.TypeReference<Response<SelfFetchTrade>> |
SELF_FETCH_TRADE_RESPONSE_TYPE_REF |
protected static com.fasterxml.jackson.core.type.TypeReference<Response<Shop>> |
SHOP_RESPONSE_TYPE_REF |
protected static com.fasterxml.jackson.core.type.TypeReference<Response<Sku>> |
SKU_RESPONSE_TYPE_REF |
protected static com.fasterxml.jackson.core.type.TypeReference<Response<Skus>> |
SKUS_RESPONSE_TYPE_REF |
protected static com.fasterxml.jackson.core.type.TypeReference<Response<Success>> |
SUCCESS_RESPONSE_TYPE_REF |
protected static com.fasterxml.jackson.core.type.TypeReference<Response<TimelimitedDiscounts>> |
TIMELIMITED_DISCOUNTS_RESPONSE_TYPE_REF |
protected static com.fasterxml.jackson.core.type.TypeReference<Response<Trade>> |
TRADE_RESPONSE_TYPE_REF |
protected static com.fasterxml.jackson.core.type.TypeReference<Response<Trades>> |
TRADES_RESPONSE_TYPE_REF |
protected static com.fasterxml.jackson.core.type.TypeReference<Response<Verifylogs>> |
VERIFYLOGS_RESPONSE_TYPE_REF |
Constructor and Description |
---|
ItemService(KdtApiClient client) |
Modifier and Type | Method and Description |
---|---|
GoodsDetail |
addItem(GoodsDetail item,
String fields)
|
boolean |
deleteItem(Long numIid)
|
GoodsDetail |
delistingItem(Long numIid,
String fields)
商品下架.
|
boolean |
delistingItems(Long[] numIids)
|
GoodsDetail[] |
getInventoryItems(Long tagId,
String q,
Integer pageSize,
Long pageNo,
String orderBy,
String fields,
String banner)
|
GoodsDetail |
getItem(Long numIid,
String fields,
String alias)
|
GoodsDetail[] |
getItems(String outerId,
String fields)
|
GoodsDetail[] |
getOnsaleItems(Long tagId,
String q,
Integer pageSize,
Long pageNo,
String orderBy,
String fields)
|
GoodsSku[] |
getSkus(String outerId,
Long numIid,
String fields)
|
GoodsDetail |
listingItem(Long numIid,
String fields)
商品上架.
|
boolean |
listingItems(Long[] numIids)
|
protected <T> T |
readValue(String method,
Map<String,String> params,
com.fasterxml.jackson.core.type.TypeReference valueTypeRef) |
GoodsDetail |
updateItem(GoodsDetail item,
String fields)
|
GoodsSku |
updateSku(Long skuId,
Long quantity,
BigDecimal price,
String outerId,
Long numIid)
|
protected static final com.fasterxml.jackson.core.type.TypeReference<Response<Success>> SUCCESS_RESPONSE_TYPE_REF
protected static final com.fasterxml.jackson.core.type.TypeReference<Response<Item>> ITEM_RESPONSE_TYPE_REF
protected static final com.fasterxml.jackson.core.type.TypeReference<Response<Items>> ITEMS_RESPONSE_TYPE_REF
protected static final com.fasterxml.jackson.core.type.TypeReference<Response<Sku>> SKU_RESPONSE_TYPE_REF
protected static final com.fasterxml.jackson.core.type.TypeReference<Response<Skus>> SKUS_RESPONSE_TYPE_REF
protected static final com.fasterxml.jackson.core.type.TypeReference<Response<Shop>> SHOP_RESPONSE_TYPE_REF
protected static final com.fasterxml.jackson.core.type.TypeReference<Response<Trade>> TRADE_RESPONSE_TYPE_REF
protected static final com.fasterxml.jackson.core.type.TypeReference<Response<Trades>> TRADES_RESPONSE_TYPE_REF
protected static final com.fasterxml.jackson.core.type.TypeReference<Response<SelfFetchTrade>> SELF_FETCH_TRADE_RESPONSE_TYPE_REF
protected static final com.fasterxml.jackson.core.type.TypeReference<Response<Coupons>> COUPONS_RESPONSE_TYPE_REF
protected static final com.fasterxml.jackson.core.type.TypeReference<Response<CouponConsume>> COUPON_CONSUME_RESPONSE_TYPE_REF
protected static final com.fasterxml.jackson.core.type.TypeReference<Response<Verifylogs>> VERIFYLOGS_RESPONSE_TYPE_REF
protected static final com.fasterxml.jackson.core.type.TypeReference<Response<Coupon>> COUPON_RESPONSE_TYPE_REF
protected static final com.fasterxml.jackson.core.type.TypeReference<Response<TimelimitedDiscounts>> TIMELIMITED_DISCOUNTS_RESPONSE_TYPE_REF
protected final KdtApiClient client
protected final com.fasterxml.jackson.databind.ObjectMapper mapper
public ItemService(KdtApiClient client)
public boolean deleteItem(@Nonnull Long numIid) throws IOException, YouzanException
numIid
- 商品数字编号IOException
- indicates I/O exception.YouzanException
- indicates Youzan business exception.public GoodsDetail updateItem(GoodsDetail item, String fields) throws IOException, YouzanException
item
- the item to be updated.fields
- 需要返回的商品对象字段IOException
- indicates i/O exception.YouzanException
- indicates Youzan business exception.public GoodsDetail getItem(@Nullable Long numIid, @Nullable String fields, @Nullable String alias) throws IOException, YouzanException
numIid
- 商品数字编号fields
- 需要返回的商品对象字段,如title,price,desc等alias
- 商品别名 调用时,参数 num_iid 和 alias 必须选其一IOException
- indicates I/O exception.YouzanException
- indicates Youzan business exception.public GoodsDetail listingItem(@Nonnull Long numIid, @Nullable String fields) throws IOException, YouzanException
numIid
- 商品数字编号fields
- 需要返回的商品对象字段IOException
- indicates I/O exception.YouzanException
- indicates Youzan business exception.public GoodsDetail delistingItem(@Nonnull Long numIid, @Nullable String fields) throws IOException, YouzanException
numIid
- 商品数字编号fields
- 需要返回的商品对象字段IOException
- indicates I/O exception.YouzanException
- indicates Youzan business exception.public boolean listingItems(@Nonnull Long[] numIids) throws IOException, YouzanException
numIids
- 商品数字编号IOException
- indicates I/O exception.YouzanException
- indicates Youzan business exception.public boolean delistingItems(@Nonnull Long[] numIids) throws IOException, YouzanException
numIids
- 商品数字编号IOException
- indicates I/O exception.YouzanException
- indicates Youzan business exception.public GoodsSku[] getSkus(@Nonnull String outerId, @Nonnull Long numIid, @Nullable String fields) throws IOException, YouzanException
跟据商家编码(商家为Sku设置的外部编号)获取商品Sku,如果一个outer_id对应多个Sku会返回所有符合条件的Sku。
outerId
- 商家编码(商家为Sku设置的外部编号)numIid
- 商品数字编号fields
- 需要返回的Sku对象字段,如sku_id,num_iid,quantity等。可选值:Sku结构体中所有字段均可返回;多个字段用“,”分隔。如果为空则返回所有IOException
- indicates I/O exception.YouzanException
- indicates Youzan business exception.public GoodsDetail[] getOnsaleItems(@Nullable Long tagId, @Nullable String q, @Nullable Integer pageSize, @Nullable Long pageNo, @Nullable String orderBy, @Nullable String fields) throws IOException, YouzanException
tagId
- 商品标签的IDq
- 搜索字段。搜索商品的titlepageSize
- 每页条数pageNo
- 页码orderBy
- 排序方式。格式为column:asc/desc,column可选值:created 创建时间fields
- 需要返回的商品对象字段,如title,price,desc等。可选值:Item商品结构体中所有字段均可返回;多个字段用“,”分隔。如果为空则返回所有IOException
- indicates I/O exception.YouzanException
- indicates Youzan business exception.public GoodsDetail[] getInventoryItems(@Nullable Long tagId, @Nullable String q, @Nullable Integer pageSize, @Nullable Long pageNo, @Nullable String orderBy, @Nullable String fields, @Nullable String banner) throws IOException, YouzanException
tagId
- 商品标签的IDq
- 搜索字段。搜索商品的titlepageSize
- 每页条数pageNo
- 页码orderBy
- 排序方式。格式为column:asc/desc,column可选值:created 创建时间 / modified 修改时间fields
- 需要返回的商品对象字段,如title,price,desc等。可选值:Item商品结构体中所有字段均可返回;多个字段用“,”分隔。如果为空则返回所有banner
- 分类字段。可选值:for_shelved(已下架的)/ sold_out(已售罄的)IOException
- indicates I/O exception.YouzanException
- indicates Youzan business exception.public GoodsDetail[] getItems(@Nonnull String outerId, @Nullable String fields) throws IOException, YouzanException
outerId
- 商品货号(商家为商品设置的外部编号)fields
- 需要返回的商品对象字段,如title,price,desc等。可选值:Item商品结构体中所有字段均可返回;多个字段用“,”分隔。如果为空则返回所有IOException
- indicates I/O exception.YouzanException
- indicates Youzan business exception.public GoodsSku updateSku(@Nonnull Long skuId, @Nullable Long quantity, @Nullable BigDecimal price, @Nullable String outerId, @Nonnull Long numIid) throws IOException, YouzanException
skuId
- Sku数字IDquantity
- Sku的库存数量price
- Sku的销售价格。精确到2位小数;单位:元outerId
- 商家编码(商家为Sku设置的外部编号)numIid
- 商品数字编号IOException
- indicates I/O exception.YouzanException
- indicates Youzan business exception.public GoodsDetail addItem(GoodsDetail item, String fields) throws IOException, YouzanException
item
- 商品信息。fields
- 需要返回的商品对象字段,如title,price,desc等。可选值:Item商品结构体中所有字段均可返回;多个字段用“,”分隔。如果为空则返回所有'IOException
- indicates I/O exception.YouzanException
- indicates Youzan business exception.protected <T> T readValue(@Nonnull String method, @Nullable Map<String,String> params, @Nonnull com.fasterxml.jackson.core.type.TypeReference valueTypeRef) throws IOException, YouzanException
IOException
YouzanException
Copyright © 2016–2017. All rights reserved.