@Test public void testCreate() throws Exception { WxCpDepart cpDepart = new WxCpDepart(); cpDepart.setName("子部门" + System.currentTimeMillis()); cpDepart.setParentId(1); cpDepart.setOrder(1L); Integer departId = this.wxCpService.getDepartmentService().create(cpDepart); System.out.println(departId); }
@Override public Integer create(WxCpDepart depart) throws WxErrorException { String url = "https: String responseContent = this.mainService.post(url, depart.toJson()); JsonElement tmpJsonElement = new JsonParser().parse(responseContent); return GsonHelper.getAsInteger(tmpJsonElement.getAsJsonObject().get("id")); }
WxCpDepartmentServiceImpl implements WxCpDepartmentService { @Override public Integer create(WxCpDepart depart) throws WxErrorException { String url = "https: String responseContent = this.mainService.post(url, depart.toJson()); JsonElement tmpJsonElement = new JsonParser().parse(responseContent); return GsonHelper.getAsInteger(tmpJsonElement.getAsJsonObject().get("id")); } }
WxCpDepartmentServiceImpl implements WxCpDepartmentService { @Override public Integer create(WxCpDepart depart) throws WxErrorException { String url = "https: String responseContent = this.mainService.post(url, depart.toJson()); JsonElement tmpJsonElement = new JsonParser().parse(responseContent); return GsonHelper.getAsInteger(tmpJsonElement.getAsJsonObject().get("id")); } WxCpDepartmentServiceImpl(WxCpService mainService); }
WxCpDepartmentServiceImpl implements WxCpDepartmentService { @Override public Integer create(WxCpDepart depart) throws WxErrorException { String url = "https: String responseContent = this.mainService.post(url, depart.toJson()); JsonElement tmpJsonElement = new JsonParser().parse(responseContent); return GsonHelper.getAsInteger(tmpJsonElement.getAsJsonObject().get("id")); } WxCpDepartmentServiceImpl(WxCpService mainService); @Override Integer create(WxCpDepart depart); @Override void update(WxCpDepart group); @Override void delete(Integer departId); @Override List<WxCpDepart> list(Integer id); }
WxCpDepartmentServiceImpl implements WxCpDepartmentService { @Override public Integer create(WxCpDepart depart) throws WxErrorException { String url = "https: String responseContent = this.mainService.post(url, depart.toJson()); JsonElement tmpJsonElement = new JsonParser().parse(responseContent); return GsonHelper.getAsInteger(tmpJsonElement.getAsJsonObject().get("id")); } WxCpDepartmentServiceImpl(WxCpService mainService); @Override Integer create(WxCpDepart depart); @Override void update(WxCpDepart group); @Override void delete(Integer departId); @Override List<WxCpDepart> list(Integer id);  }