@Test public void testDelPrivateTemplate() throws Exception { String templateId = "RPcTe7-4BkU5A2J3imC6W0b4JbjEERcJg0whOMKJKIc"; boolean result = this.wxService.getTemplateMsgService().delPrivateTemplate(templateId); Assert.assertTrue(result); }
@Override public boolean delPrivateTemplate(String templateId) throws WxErrorException { String url = API_URL_PREFIX + "/del_private_template"; JsonObject jsonObject = new JsonObject(); jsonObject.addProperty("template_id", templateId); String responseContent = this.wxMpService.post(url, jsonObject.toString()); WxError error = WxError.fromJson(responseContent, WxType.MP); if (error.getErrorCode() == 0) { return true; } throw new WxErrorException(error); }
WxMpTemplateMsgServiceImpl implements WxMpTemplateMsgService { @Override public boolean delPrivateTemplate(String templateId) throws WxErrorException { String url = API_URL_PREFIX + "/del_private_template"; JsonObject jsonObject = new JsonObject(); jsonObject.addProperty("template_id", templateId); String responseContent = this.wxMpService.post(url, jsonObject.toString()); WxError error = WxError.fromJson(responseContent, WxType.MP); if (error.getErrorCode() == 0) { return true; } throw new WxErrorException(error); } }
WxMpTemplateMsgServiceImpl implements WxMpTemplateMsgService { @Override public boolean delPrivateTemplate(String templateId) throws WxErrorException { String url = API_URL_PREFIX + "/del_private_template"; JsonObject jsonObject = new JsonObject(); jsonObject.addProperty("template_id", templateId); String responseContent = this.wxMpService.post(url, jsonObject.toString()); WxError error = WxError.fromJson(responseContent, WxType.MP); if (error.getErrorCode() == 0) { return true; } throw new WxErrorException(error); } WxMpTemplateMsgServiceImpl(WxMpService wxMpService); }
WxMpTemplateMsgServiceImpl implements WxMpTemplateMsgService { @Override public boolean delPrivateTemplate(String templateId) throws WxErrorException { String url = API_URL_PREFIX + "/del_private_template"; JsonObject jsonObject = new JsonObject(); jsonObject.addProperty("template_id", templateId); String responseContent = this.wxMpService.post(url, jsonObject.toString()); WxError error = WxError.fromJson(responseContent, WxType.MP); if (error.getErrorCode() == 0) { return true; } throw new WxErrorException(error); } WxMpTemplateMsgServiceImpl(WxMpService wxMpService); @Override String sendTemplateMsg(WxMpTemplateMessage templateMessage); @Override boolean setIndustry(WxMpTemplateIndustry wxMpIndustry); @Override WxMpTemplateIndustry getIndustry(); @Override String addTemplate(String shortTemplateId); @Override List<WxMpTemplate> getAllPrivateTemplate(); @Override boolean delPrivateTemplate(String templateId); }
WxMpTemplateMsgServiceImpl implements WxMpTemplateMsgService { @Override public boolean delPrivateTemplate(String templateId) throws WxErrorException { String url = API_URL_PREFIX + "/del_private_template"; JsonObject jsonObject = new JsonObject(); jsonObject.addProperty("template_id", templateId); String responseContent = this.wxMpService.post(url, jsonObject.toString()); WxError error = WxError.fromJson(responseContent, WxType.MP); if (error.getErrorCode() == 0) { return true; } throw new WxErrorException(error); } WxMpTemplateMsgServiceImpl(WxMpService wxMpService); @Override String sendTemplateMsg(WxMpTemplateMessage templateMessage); @Override boolean setIndustry(WxMpTemplateIndustry wxMpIndustry); @Override WxMpTemplateIndustry getIndustry(); @Override String addTemplate(String shortTemplateId); @Override List<WxMpTemplate> getAllPrivateTemplate(); @Override boolean delPrivateTemplate(String templateId); static final String API_URL_PREFIX; }