@Test public void testDeleteCard() throws Exception { String cardId = "pwkrWjtw7W4_l50kCQcZ1in1yS6g"; WxMpCardDeleteResult result = this.wxService.getCardService().deleteCard(cardId); assertEquals(result.isSuccess(), true); System.out.println(result); }
@Override public WxMpCardDeleteResult deleteCard(String cardId) throws WxErrorException { if (StringUtils.isEmpty(cardId)) { throw new WxErrorException(WxError.builder().errorCode(41012).errorMsg("cardId不能为空").build()); } JsonObject param = new JsonObject(); param.addProperty("card_id", cardId); String response = this.wxMpService.post(CARD_DELETE, param.toString()); return WxMpCardDeleteResult.fromJson(response); }
WxMpCardServiceImpl implements WxMpCardService { @Override public WxMpCardDeleteResult deleteCard(String cardId) throws WxErrorException { if (StringUtils.isEmpty(cardId)) { throw new WxErrorException(WxError.builder().errorCode(41012).errorMsg("cardId不能为空").build()); } JsonObject param = new JsonObject(); param.addProperty("card_id", cardId); String response = this.wxMpService.post(CARD_DELETE, param.toString()); return WxMpCardDeleteResult.fromJson(response); } }
WxMpCardServiceImpl implements WxMpCardService { @Override public WxMpCardDeleteResult deleteCard(String cardId) throws WxErrorException { if (StringUtils.isEmpty(cardId)) { throw new WxErrorException(WxError.builder().errorCode(41012).errorMsg("cardId不能为空").build()); } JsonObject param = new JsonObject(); param.addProperty("card_id", cardId); String response = this.wxMpService.post(CARD_DELETE, param.toString()); return WxMpCardDeleteResult.fromJson(response); } WxMpCardServiceImpl(WxMpService wxMpService); }
WxMpCardServiceImpl implements WxMpCardService { @Override public WxMpCardDeleteResult deleteCard(String cardId) throws WxErrorException { if (StringUtils.isEmpty(cardId)) { throw new WxErrorException(WxError.builder().errorCode(41012).errorMsg("cardId不能为空").build()); } JsonObject param = new JsonObject(); param.addProperty("card_id", cardId); String response = this.wxMpService.post(CARD_DELETE, param.toString()); return WxMpCardDeleteResult.fromJson(response); } 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 WxMpCardDeleteResult deleteCard(String cardId) throws WxErrorException { if (StringUtils.isEmpty(cardId)) { throw new WxErrorException(WxError.builder().errorCode(41012).errorMsg("cardId不能为空").build()); } JsonObject param = new JsonObject(); param.addProperty("card_id", cardId); String response = this.wxMpService.post(CARD_DELETE, param.toString()); return WxMpCardDeleteResult.fromJson(response); } 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);  }