@Test public void createMemberCard() throws Exception { WxMpMemberCardCreateMessage createMessage = new WxMpMemberCardCreateMessage(); MemberCardCreateRequest cardCreateRequest = new MemberCardCreateRequest(); MemberCard memberCard = new MemberCard(); memberCard.setPrerogative("特权说明"); memberCard.setAutoActivate(true); memberCard.setSupplyBonus(true); memberCard.setSupplyBalance(false); memberCard.setBackgroundPicUrl("http: memberCard.setDiscount(0); BaseInfo baseInfo = new BaseInfo(); baseInfo.setLogoUrl("http: baseInfo.setCodeType("CODE_TYPE_QRCODE"); baseInfo.setBrandName("信舟科技"); baseInfo.setTitle("铂金用户贵宾卡"); baseInfo.setColor("Color010"); baseInfo.setNotice("卡券使用提醒"); baseInfo.setDescription("卡券使用说明"); baseInfo.setServicePhone("4008803016"); Sku sku = new Sku(); baseInfo.setSku(sku); DateInfo dateInfo = new DateInfo(); baseInfo.setDateInfo(dateInfo); memberCard.setBaseInfo(baseInfo); cardCreateRequest.setMemberCard(memberCard); createMessage.setCardCreateRequest(cardCreateRequest); WxMpCardCreateResult response = this.wxService.getMemberCardService().createMemberCard(createMessage); assertNotNull(response); System.out.println(response); }
@Override public WxMpCardCreateResult createMemberCard(String createJson) throws WxErrorException { WxMpMemberCardCreateMessage createMessage = WxGsonBuilder.create() .fromJson(createJson, WxMpMemberCardCreateMessage.class); return createMemberCard(createMessage); }
WxMpMemberCardServiceImpl implements WxMpMemberCardService { @Override public WxMpCardCreateResult createMemberCard(String createJson) throws WxErrorException { WxMpMemberCardCreateMessage createMessage = WxGsonBuilder.create() .fromJson(createJson, WxMpMemberCardCreateMessage.class); return createMemberCard(createMessage); } }
WxMpMemberCardServiceImpl implements WxMpMemberCardService { @Override public WxMpCardCreateResult createMemberCard(String createJson) throws WxErrorException { WxMpMemberCardCreateMessage createMessage = WxGsonBuilder.create() .fromJson(createJson, WxMpMemberCardCreateMessage.class); return createMemberCard(createMessage); } WxMpMemberCardServiceImpl(WxMpService wxMpService); }
WxMpMemberCardServiceImpl implements WxMpMemberCardService { @Override public WxMpCardCreateResult createMemberCard(String createJson) throws WxErrorException { WxMpMemberCardCreateMessage createMessage = WxGsonBuilder.create() .fromJson(createJson, WxMpMemberCardCreateMessage.class); return createMemberCard(createMessage); } WxMpMemberCardServiceImpl(WxMpService wxMpService); @Override WxMpService getWxMpService(); @Override WxMpCardCreateResult createMemberCard(String createJson); @Override WxMpCardCreateResult createMemberCard(WxMpMemberCardCreateMessage createMessageMessage); @Override String activateMemberCard(WxMpMemberCardActivatedMessage activatedMessage); @Override WxMpMemberCardUserInfoResult getUserInfo(String cardId, String code); @Override WxMpMemberCardUpdateResult updateUserMemberCard(WxMpMemberCardUpdateMessage updateUserMessage); @Override MemberCardActivateUserFormResult setActivateUserForm(MemberCardActivateUserFormRequest userFormRequest); @Override ActivatePluginParam getActivatePluginParam(String cardId, String outStr); @Override CardUpdateResult updateCardInfo(MemberCardUpdateRequest memberCardUpdateRequest); @Override WxMpMemberCardActivateTempInfoResult getActivateTempInfo(String activateTicket); static Map<String, String> parseRequestUrl(String url); }
WxMpMemberCardServiceImpl implements WxMpMemberCardService { @Override public WxMpCardCreateResult createMemberCard(String createJson) throws WxErrorException { WxMpMemberCardCreateMessage createMessage = WxGsonBuilder.create() .fromJson(createJson, WxMpMemberCardCreateMessage.class); return createMemberCard(createMessage); } WxMpMemberCardServiceImpl(WxMpService wxMpService); @Override WxMpService getWxMpService(); @Override WxMpCardCreateResult createMemberCard(String createJson); @Override WxMpCardCreateResult createMemberCard(WxMpMemberCardCreateMessage createMessageMessage); @Override String activateMemberCard(WxMpMemberCardActivatedMessage activatedMessage); @Override WxMpMemberCardUserInfoResult getUserInfo(String cardId, String code); @Override WxMpMemberCardUpdateResult updateUserMemberCard(WxMpMemberCardUpdateMessage updateUserMessage); @Override MemberCardActivateUserFormResult setActivateUserForm(MemberCardActivateUserFormRequest userFormRequest); @Override ActivatePluginParam getActivatePluginParam(String cardId, String outStr); @Override CardUpdateResult updateCardInfo(MemberCardUpdateRequest memberCardUpdateRequest); @Override WxMpMemberCardActivateTempInfoResult getActivateTempInfo(String activateTicket); static Map<String, String> parseRequestUrl(String url);  }