@Test public void testGetCardDetail() throws Exception { String result = this.wxService.getCardService().getCardDetail(this.cardId); assertNotNull(result); System.out.println(result); }
@Override public String getCardDetail(String cardId) throws WxErrorException { JsonObject param = new JsonObject(); param.addProperty("card_id", cardId); String responseContent = this.wxMpService.post(CARD_GET, param.toString()); JsonObject json = (new JsonParser()).parse(responseContent).getAsJsonObject(); String errcode = json.get("errcode").getAsString(); if (!"0".equals(errcode)) { String errmsg = json.get("errmsg").getAsString(); throw new WxErrorException(WxError.builder() .errorCode(Integer.valueOf(errcode)).errorMsg(errmsg) .build()); } return responseContent; }
WxMpCardServiceImpl implements WxMpCardService { @Override public String getCardDetail(String cardId) throws WxErrorException { JsonObject param = new JsonObject(); param.addProperty("card_id", cardId); String responseContent = this.wxMpService.post(CARD_GET, param.toString()); JsonObject json = (new JsonParser()).parse(responseContent).getAsJsonObject(); String errcode = json.get("errcode").getAsString(); if (!"0".equals(errcode)) { String errmsg = json.get("errmsg").getAsString(); throw new WxErrorException(WxError.builder() .errorCode(Integer.valueOf(errcode)).errorMsg(errmsg) .build()); } return responseContent; } }
WxMpCardServiceImpl implements WxMpCardService { @Override public String getCardDetail(String cardId) throws WxErrorException { JsonObject param = new JsonObject(); param.addProperty("card_id", cardId); String responseContent = this.wxMpService.post(CARD_GET, param.toString()); JsonObject json = (new JsonParser()).parse(responseContent).getAsJsonObject(); String errcode = json.get("errcode").getAsString(); if (!"0".equals(errcode)) { String errmsg = json.get("errmsg").getAsString(); throw new WxErrorException(WxError.builder() .errorCode(Integer.valueOf(errcode)).errorMsg(errmsg) .build()); } return responseContent; } WxMpCardServiceImpl(WxMpService wxMpService); }
WxMpCardServiceImpl implements WxMpCardService { @Override public String getCardDetail(String cardId) throws WxErrorException { JsonObject param = new JsonObject(); param.addProperty("card_id", cardId); String responseContent = this.wxMpService.post(CARD_GET, param.toString()); JsonObject json = (new JsonParser()).parse(responseContent).getAsJsonObject(); String errcode = json.get("errcode").getAsString(); if (!"0".equals(errcode)) { String errmsg = json.get("errmsg").getAsString(); throw new WxErrorException(WxError.builder() .errorCode(Integer.valueOf(errcode)).errorMsg(errmsg) .build()); } return responseContent; } 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); }
WxMpCardServiceImpl implements WxMpCardService { @Override public String getCardDetail(String cardId) throws WxErrorException { JsonObject param = new JsonObject(); param.addProperty("card_id", cardId); String responseContent = this.wxMpService.post(CARD_GET, param.toString()); JsonObject json = (new JsonParser()).parse(responseContent).getAsJsonObject(); String errcode = json.get("errcode").getAsString(); if (!"0".equals(errcode)) { String errmsg = json.get("errmsg").getAsString(); throw new WxErrorException(WxError.builder() .errorCode(Integer.valueOf(errcode)).errorMsg(errmsg) .build()); } return responseContent; } 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);  }