@Test public void testUpdateUserMemberCard() throws Exception { WxMpMemberCardUpdateMessage updateMessage = new WxMpMemberCardUpdateMessage(); updateMessage.setAddBounus(100); updateMessage.setBonus(1000); updateMessage.setCardId(cardId); updateMessage.setCode(code); WxMpMemberCardUpdateResult result = this.wxService.getMemberCardService().updateUserMemberCard(updateMessage); assertNotNull(result); System.out.println(result); }
@Override public WxMpMemberCardUpdateResult updateUserMemberCard(WxMpMemberCardUpdateMessage updateUserMessage) throws WxErrorException { String responseContent = this.getWxMpService().post(MEMBER_CARD_UPDATE_USER, GSON.toJson(updateUserMessage)); JsonElement tmpJsonElement = new JsonParser().parse(responseContent); return WxMpGsonBuilder.INSTANCE.create().fromJson(tmpJsonElement, new TypeToken<WxMpMemberCardUpdateResult>() { }.getType()); }
WxMpMemberCardServiceImpl implements WxMpMemberCardService { @Override public WxMpMemberCardUpdateResult updateUserMemberCard(WxMpMemberCardUpdateMessage updateUserMessage) throws WxErrorException { String responseContent = this.getWxMpService().post(MEMBER_CARD_UPDATE_USER, GSON.toJson(updateUserMessage)); JsonElement tmpJsonElement = new JsonParser().parse(responseContent); return WxMpGsonBuilder.INSTANCE.create().fromJson(tmpJsonElement, new TypeToken<WxMpMemberCardUpdateResult>() { }.getType()); } }
WxMpMemberCardServiceImpl implements WxMpMemberCardService { @Override public WxMpMemberCardUpdateResult updateUserMemberCard(WxMpMemberCardUpdateMessage updateUserMessage) throws WxErrorException { String responseContent = this.getWxMpService().post(MEMBER_CARD_UPDATE_USER, GSON.toJson(updateUserMessage)); JsonElement tmpJsonElement = new JsonParser().parse(responseContent); return WxMpGsonBuilder.INSTANCE.create().fromJson(tmpJsonElement, new TypeToken<WxMpMemberCardUpdateResult>() { }.getType()); } WxMpMemberCardServiceImpl(WxMpService wxMpService); }
WxMpMemberCardServiceImpl implements WxMpMemberCardService { @Override public WxMpMemberCardUpdateResult updateUserMemberCard(WxMpMemberCardUpdateMessage updateUserMessage) throws WxErrorException { String responseContent = this.getWxMpService().post(MEMBER_CARD_UPDATE_USER, GSON.toJson(updateUserMessage)); JsonElement tmpJsonElement = new JsonParser().parse(responseContent); return WxMpGsonBuilder.INSTANCE.create().fromJson(tmpJsonElement, new TypeToken<WxMpMemberCardUpdateResult>() { }.getType()); } WxMpMemberCardServiceImpl(WxMpService wxMpService); @Override WxMpService getWxMpService(); @Override String activateMemberCard(WxMpMemberCardActivatedMessage activatedMessage); @Override WxMpMemberCardUserInfoResult getUserInfo(String cardId, String code); @Override WxMpMemberCardUpdateResult updateUserMemberCard(WxMpMemberCardUpdateMessage updateUserMessage); }
WxMpMemberCardServiceImpl implements WxMpMemberCardService { @Override public WxMpMemberCardUpdateResult updateUserMemberCard(WxMpMemberCardUpdateMessage updateUserMessage) throws WxErrorException { String responseContent = this.getWxMpService().post(MEMBER_CARD_UPDATE_USER, GSON.toJson(updateUserMessage)); JsonElement tmpJsonElement = new JsonParser().parse(responseContent); return WxMpGsonBuilder.INSTANCE.create().fromJson(tmpJsonElement, new TypeToken<WxMpMemberCardUpdateResult>() { }.getType()); } WxMpMemberCardServiceImpl(WxMpService wxMpService); @Override WxMpService getWxMpService(); @Override String activateMemberCard(WxMpMemberCardActivatedMessage activatedMessage); @Override WxMpMemberCardUserInfoResult getUserInfo(String cardId, String code); @Override WxMpMemberCardUpdateResult updateUserMemberCard(WxMpMemberCardUpdateMessage updateUserMessage);  }