@Test(dependsOnMethods = {"testTagCreate"}) public void testTagDelete() throws Exception { Boolean res = this.wxService.getUserTagService().tagDelete(this.tagId); System.out.println(res); Assert.assertTrue(res); }
@Override public Boolean tagDelete(Long id) throws WxErrorException { String url = API_URL_PREFIX + "/delete"; JsonObject json = new JsonObject(); JsonObject tagJson = new JsonObject(); tagJson.addProperty("id", id); json.add("tag", tagJson); String responseContent = this.wxMpService.post(url, json.toString()); WxError wxError = WxError.fromJson(responseContent, WxType.MP); if (wxError.getErrorCode() == 0) { return true; } throw new WxErrorException(wxError); }
WxMpUserTagServiceImpl implements WxMpUserTagService { @Override public Boolean tagDelete(Long id) throws WxErrorException { String url = API_URL_PREFIX + "/delete"; JsonObject json = new JsonObject(); JsonObject tagJson = new JsonObject(); tagJson.addProperty("id", id); json.add("tag", tagJson); String responseContent = this.wxMpService.post(url, json.toString()); WxError wxError = WxError.fromJson(responseContent, WxType.MP); if (wxError.getErrorCode() == 0) { return true; } throw new WxErrorException(wxError); } }
WxMpUserTagServiceImpl implements WxMpUserTagService { @Override public Boolean tagDelete(Long id) throws WxErrorException { String url = API_URL_PREFIX + "/delete"; JsonObject json = new JsonObject(); JsonObject tagJson = new JsonObject(); tagJson.addProperty("id", id); json.add("tag", tagJson); String responseContent = this.wxMpService.post(url, json.toString()); WxError wxError = WxError.fromJson(responseContent, WxType.MP); if (wxError.getErrorCode() == 0) { return true; } throw new WxErrorException(wxError); } WxMpUserTagServiceImpl(WxMpService wxMpService); }
WxMpUserTagServiceImpl implements WxMpUserTagService { @Override public Boolean tagDelete(Long id) throws WxErrorException { String url = API_URL_PREFIX + "/delete"; JsonObject json = new JsonObject(); JsonObject tagJson = new JsonObject(); tagJson.addProperty("id", id); json.add("tag", tagJson); String responseContent = this.wxMpService.post(url, json.toString()); WxError wxError = WxError.fromJson(responseContent, WxType.MP); if (wxError.getErrorCode() == 0) { return true; } throw new WxErrorException(wxError); } WxMpUserTagServiceImpl(WxMpService wxMpService); @Override WxUserTag tagCreate(String name); @Override List<WxUserTag> tagGet(); @Override Boolean tagUpdate(Long id, String name); @Override Boolean tagDelete(Long id); @Override WxTagListUser tagListUser(Long tagId, String nextOpenid); @Override boolean batchTagging(Long tagId, String[] openids); @Override boolean batchUntagging(Long tagId, String[] openids); @Override List<Long> userTagList(String openid); }
WxMpUserTagServiceImpl implements WxMpUserTagService { @Override public Boolean tagDelete(Long id) throws WxErrorException { String url = API_URL_PREFIX + "/delete"; JsonObject json = new JsonObject(); JsonObject tagJson = new JsonObject(); tagJson.addProperty("id", id); json.add("tag", tagJson); String responseContent = this.wxMpService.post(url, json.toString()); WxError wxError = WxError.fromJson(responseContent, WxType.MP); if (wxError.getErrorCode() == 0) { return true; } throw new WxErrorException(wxError); } WxMpUserTagServiceImpl(WxMpService wxMpService); @Override WxUserTag tagCreate(String name); @Override List<WxUserTag> tagGet(); @Override Boolean tagUpdate(Long id, String name); @Override Boolean tagDelete(Long id); @Override WxTagListUser tagListUser(Long tagId, String nextOpenid); @Override boolean batchTagging(Long tagId, String[] openids); @Override boolean batchUntagging(Long tagId, String[] openids); @Override List<Long> userTagList(String openid);  }