@Test public void testDelTemplate() throws Exception { List<Integer> list = Lists.newArrayList(); list.add(1); list.add(20); list.add(84); WxMaTemplateAddResult result = this.wxService.getTemplateService().addTemplate("AT0004", list); this.wxService.getTemplateService().delTemplate(result.getTemplateId()); }
@Override public boolean delTemplate(String templateId) throws WxErrorException { Map<String, String> params = new HashMap<>(); params.put("template_id", templateId); String responseText = this.wxMaService.post(TEMPLATE_DEL_URL, WxGsonBuilder.create().toJson(params)); WxError wxError = WxError.fromJson(responseText); if(wxError.getErrorCode() == 0){ return true; }else { throw new WxErrorException(wxError); } }
WxMaTemplateServiceImpl implements WxMaTemplateService { @Override public boolean delTemplate(String templateId) throws WxErrorException { Map<String, String> params = new HashMap<>(); params.put("template_id", templateId); String responseText = this.wxMaService.post(TEMPLATE_DEL_URL, WxGsonBuilder.create().toJson(params)); WxError wxError = WxError.fromJson(responseText); if(wxError.getErrorCode() == 0){ return true; }else { throw new WxErrorException(wxError); } } }
WxMaTemplateServiceImpl implements WxMaTemplateService { @Override public boolean delTemplate(String templateId) throws WxErrorException { Map<String, String> params = new HashMap<>(); params.put("template_id", templateId); String responseText = this.wxMaService.post(TEMPLATE_DEL_URL, WxGsonBuilder.create().toJson(params)); WxError wxError = WxError.fromJson(responseText); if(wxError.getErrorCode() == 0){ return true; }else { throw new WxErrorException(wxError); } } WxMaTemplateServiceImpl(WxMaService wxMaService); }
WxMaTemplateServiceImpl implements WxMaTemplateService { @Override public boolean delTemplate(String templateId) throws WxErrorException { Map<String, String> params = new HashMap<>(); params.put("template_id", templateId); String responseText = this.wxMaService.post(TEMPLATE_DEL_URL, WxGsonBuilder.create().toJson(params)); WxError wxError = WxError.fromJson(responseText); if(wxError.getErrorCode() == 0){ return true; }else { throw new WxErrorException(wxError); } } WxMaTemplateServiceImpl(WxMaService wxMaService); @Override WxMaTemplateLibraryListResult findTemplateLibraryList(int offset, int count); @Override WxMaTemplateLibraryGetResult findTemplateLibraryKeywordList(String id); @Override WxMaTemplateAddResult addTemplate(String id, List<Integer> keywordIdList); @Override WxMaTemplateListResult findTemplateList(int offset, int count); @Override boolean delTemplate(String templateId); }
WxMaTemplateServiceImpl implements WxMaTemplateService { @Override public boolean delTemplate(String templateId) throws WxErrorException { Map<String, String> params = new HashMap<>(); params.put("template_id", templateId); String responseText = this.wxMaService.post(TEMPLATE_DEL_URL, WxGsonBuilder.create().toJson(params)); WxError wxError = WxError.fromJson(responseText); if(wxError.getErrorCode() == 0){ return true; }else { throw new WxErrorException(wxError); } } WxMaTemplateServiceImpl(WxMaService wxMaService); @Override WxMaTemplateLibraryListResult findTemplateLibraryList(int offset, int count); @Override WxMaTemplateLibraryGetResult findTemplateLibraryKeywordList(String id); @Override WxMaTemplateAddResult addTemplate(String id, List<Integer> keywordIdList); @Override WxMaTemplateListResult findTemplateList(int offset, int count); @Override boolean delTemplate(String templateId);  }