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 |
---|
CouponService(KdtApiClient client) |
Modifier and Type | Method and Description |
---|---|
UmpCoupon[] |
getAllUnfinishedCoupons(String fields)
|
CouponConsume |
getCouponConsume(String code)
|
TimelimitedDiscounts |
getTimelimitedDiscounts(Integer pageSize,
Long pageNo)
|
UmpPromotionVerifylog[] |
getVerifylogs(String type,
Integer pageSize,
Long pageNo)
|
protected <T> T |
readValue(String method,
Map<String,String> params,
com.fasterxml.jackson.core.type.TypeReference valueTypeRef) |
Coupon |
takeCoupon(String weixinOpenId,
Long fansId,
Long couponGroupId)
|
boolean |
verifyCouponConsume(String code)
|
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 CouponService(KdtApiClient client)
public UmpCoupon[] getAllUnfinishedCoupons(@Nullable String fields) throws IOException, YouzanException
fields
- 需要返回的优惠对象字段。可选值:优惠结构体中所有字段均可返回;多个字段用“,”分隔。如果为空则返回所有IOException
- indicates I/O exception.YouzanException
- indicates Youzan business exception.public CouponConsume getCouponConsume(@Nonnull String code) throws IOException, YouzanException
code
- 核销码IOException
- indicates I/O exception.YouzanException
- indicates Youzan business exception.public boolean verifyCouponConsume(@Nonnull String code) throws IOException, YouzanException
code
- 核销码IOException
- indicates I/O exception.YouzanException
- indicates Youzan business exception.public UmpPromotionVerifylog[] getVerifylogs(@Nullable String type, @Nullable Integer pageSize, @Nullable Long pageNo) throws IOException, YouzanException
type
- the type.pageSize
- the page size.pageNo
- the page number.IOException
- indicates I/O exception.YouzanException
- indicates Youzan business exception.public Coupon takeCoupon(@Nullable String weixinOpenId, @Nullable Long fansId, @Nonnull Long couponGroupId) throws IOException, YouzanException
weixinOpenId
- 微信用户对应的openidfansId
- 微信粉丝id,fans_id与weixin_openid存在一个即可couponGroupId
- 优惠券码组idIOException
- indicates I/O exception.YouzanException
- indicates Youzan business exception.public TimelimitedDiscounts getTimelimitedDiscounts(@Nonnull Integer pageSize, @Nonnull Long pageNo) throws IOException, YouzanException
pageSize
- 每页多少行数据(默认40行,最大500行)pageNo
- 第几页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.