|
|
@@ -108,7 +108,9 @@ public class WxMpCardServiceImpl implements WxMpCardService { |
|
|
|
@Override |
|
|
|
public WxMpCardResult queryCardCode(String cardId, String code, boolean checkConsume) throws WxErrorException { |
|
|
|
JsonObject param = new JsonObject(); |
|
|
|
param.addProperty("card_id", cardId); |
|
|
|
if (StringUtils.isNotBlank(cardId)) { |
|
|
|
param.addProperty("card_id", cardId); |
|
|
|
} |
|
|
|
param.addProperty("code", code); |
|
|
|
param.addProperty("check_consume", checkConsume); |
|
|
|
String responseContent = this.wxMpService.post(WxMpApiUrl.Card.CARD_CODE_GET, param.toString()); |
|
|
@@ -117,6 +119,20 @@ public class WxMpCardServiceImpl implements WxMpCardService { |
|
|
|
new TypeToken<WxMpCardResult>() { |
|
|
|
}.getType()); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public WxMpCardUserGetCardListResult getUserCardList(String openId, String cardId) throws WxErrorException { |
|
|
|
JsonObject param = new JsonObject(); |
|
|
|
param.addProperty("openid", openId); |
|
|
|
if(StringUtils.isNotBlank(cardId)) { |
|
|
|
param.addProperty("card_id", cardId); |
|
|
|
} |
|
|
|
String responseContent = this.wxMpService.post(WxMpApiUrl.Card.CARD_USER_GETCARDLIST, param.toString()); |
|
|
|
JsonElement tmpJsonElement = new JsonParser().parse(responseContent); |
|
|
|
return WxMpGsonBuilder.create().fromJson(tmpJsonElement, |
|
|
|
new TypeToken<WxMpCardUserGetCardListResult>() { |
|
|
|
}.getType()); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public String consumeCardCode(String code) throws WxErrorException { |
|
|
@@ -170,6 +186,22 @@ public class WxMpCardServiceImpl implements WxMpCardService { |
|
|
|
|
|
|
|
return responseContent; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public WxMpCardBatchGetResult getCardBatchGet(Integer offset, Integer count, List<String> statusList) throws WxErrorException { |
|
|
|
JsonObject param = new JsonObject(); |
|
|
|
param.addProperty("offset", offset); |
|
|
|
param.addProperty("count", count); |
|
|
|
if(statusList.size() > 0) { |
|
|
|
JsonArray statusArray = new JsonArray(); |
|
|
|
for(String item: statusList) { |
|
|
|
statusArray.add(item); |
|
|
|
} |
|
|
|
param.add("status_list", statusArray); |
|
|
|
} |
|
|
|
String responseContent = this.wxMpService.post(WxMpApiUrl.Card.CARD_BATCHGET, param.toString()); |
|
|
|
return WxMpCardBatchGetResult.fromJson(responseContent); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public String addTestWhiteList(String openid) throws WxErrorException { |
|
|
|