@Test public void testUnavailableCardCode() throws Exception { String cardId = "p2iQk1luzj50RHue6yeTPQpAx_Z4"; String code = "134905347310"; String reason = "换成新卡了"; String result = this.wxService.getCardService().unavailableCardCode(cardId, code, reason); assertNotNull(result); System.out.println(result); }
@Override public String unavailableCardCode(String cardId, String code, String reason) throws WxErrorException { if (StringUtils.isAnyBlank(cardId, code, reason)) { throw new WxErrorException(WxError.builder().errorCode(41012).errorMsg("参数不完整").build()); } JsonObject jsonRequest = new JsonObject(); jsonRequest.addProperty("card_id", cardId); jsonRequest.addProperty("code", code); jsonRequest.addProperty("reason", reason); return this.wxMpService.post(CARD_CODE_UNAVAILABLE, GSON.toJson(jsonRequest)); }
WxMpCardServiceImpl implements WxMpCardService { @Override public String unavailableCardCode(String cardId, String code, String reason) throws WxErrorException { if (StringUtils.isAnyBlank(cardId, code, reason)) { throw new WxErrorException(WxError.builder().errorCode(41012).errorMsg("参数不完整").build()); } JsonObject jsonRequest = new JsonObject(); jsonRequest.addProperty("card_id", cardId); jsonRequest.addProperty("code", code); jsonRequest.addProperty("reason", reason); return this.wxMpService.post(CARD_CODE_UNAVAILABLE, GSON.toJson(jsonRequest)); } }
WxMpCardServiceImpl implements WxMpCardService { @Override public String unavailableCardCode(String cardId, String code, String reason) throws WxErrorException { if (StringUtils.isAnyBlank(cardId, code, reason)) { throw new WxErrorException(WxError.builder().errorCode(41012).errorMsg("参数不完整").build()); } JsonObject jsonRequest = new JsonObject(); jsonRequest.addProperty("card_id", cardId); jsonRequest.addProperty("code", code); jsonRequest.addProperty("reason", reason); return this.wxMpService.post(CARD_CODE_UNAVAILABLE, GSON.toJson(jsonRequest)); } WxMpCardServiceImpl(WxMpService wxMpService); }
WxMpCardServiceImpl implements WxMpCardService { @Override public String unavailableCardCode(String cardId, String code, String reason) throws WxErrorException { if (StringUtils.isAnyBlank(cardId, code, reason)) { throw new WxErrorException(WxError.builder().errorCode(41012).errorMsg("参数不完整").build()); } JsonObject jsonRequest = new JsonObject(); jsonRequest.addProperty("card_id", cardId); jsonRequest.addProperty("code", code); jsonRequest.addProperty("reason", reason); return this.wxMpService.post(CARD_CODE_UNAVAILABLE, GSON.toJson(jsonRequest)); } WxMpCardServiceImpl(WxMpService wxMpService); @Override WxMpService getWxMpService(); @Override String getCardApiTicket(); @Override String getCardApiTicket(boolean forceRefresh); @Override WxCardApiSignature createCardApiSignature(String... optionalSignParam); @Override String decryptCardCode(String encryptCode); @Override WxMpCardResult queryCardCode(String cardId, String code, boolean checkConsume); @Override String consumeCardCode(String code); @Override String consumeCardCode(String code, String cardId); @Override void markCardCode(String code, String cardId, String openId, boolean isMark); @Override String getCardDetail(String cardId); @Override String addTestWhiteList(String openid); @Override WxMpCardCreateResult createCard(WxMpCardCreateMessage cardCreateMessage); @Override WxMpCardQrcodeCreateResult createQrcodeCard(String cardId, String outerStr); @Override WxMpCardQrcodeCreateResult createQrcodeCard(String cardId, String outerStr, int expiresIn); @Override WxMpCardLandingPageCreateResult createLandingPage(WxMpCardLandingPageCreateRequest request); @Override String unavailableCardCode(String cardId, String code, String reason); @Override WxMpCardDeleteResult deleteCard(String cardId); }
WxMpCardServiceImpl implements WxMpCardService { @Override public String unavailableCardCode(String cardId, String code, String reason) throws WxErrorException { if (StringUtils.isAnyBlank(cardId, code, reason)) { throw new WxErrorException(WxError.builder().errorCode(41012).errorMsg("参数不完整").build()); } JsonObject jsonRequest = new JsonObject(); jsonRequest.addProperty("card_id", cardId); jsonRequest.addProperty("code", code); jsonRequest.addProperty("reason", reason); return this.wxMpService.post(CARD_CODE_UNAVAILABLE, GSON.toJson(jsonRequest)); } WxMpCardServiceImpl(WxMpService wxMpService); @Override WxMpService getWxMpService(); @Override String getCardApiTicket(); @Override String getCardApiTicket(boolean forceRefresh); @Override WxCardApiSignature createCardApiSignature(String... optionalSignParam); @Override String decryptCardCode(String encryptCode); @Override WxMpCardResult queryCardCode(String cardId, String code, boolean checkConsume); @Override String consumeCardCode(String code); @Override String consumeCardCode(String code, String cardId); @Override void markCardCode(String code, String cardId, String openId, boolean isMark); @Override String getCardDetail(String cardId); @Override String addTestWhiteList(String openid); @Override WxMpCardCreateResult createCard(WxMpCardCreateMessage cardCreateMessage); @Override WxMpCardQrcodeCreateResult createQrcodeCard(String cardId, String outerStr); @Override WxMpCardQrcodeCreateResult createQrcodeCard(String cardId, String outerStr, int expiresIn); @Override WxMpCardLandingPageCreateResult createLandingPage(WxMpCardLandingPageCreateRequest request); @Override String unavailableCardCode(String cardId, String code, String reason); @Override WxMpCardDeleteResult deleteCard(String cardId);  }