mirror of
				https://gitee.com/binary/weixin-java-tools.git
				synced 2025-10-31 10:38:42 +08:00 
			
		
		
		
	企业微信部门创建接口create返回值改为long类型
This commit is contained in:
		| @ -26,7 +26,7 @@ public interface WxCpDepartmentService { | |||||||
|    * @return 部门id |    * @return 部门id | ||||||
|    * @throws WxErrorException 异常 |    * @throws WxErrorException 异常 | ||||||
|    */ |    */ | ||||||
|   Integer create(WxCpDepart depart) throws WxErrorException; |   Long create(WxCpDepart depart) throws WxErrorException; | ||||||
|  |  | ||||||
|   /** |   /** | ||||||
|    * <pre> |    * <pre> | ||||||
|  | |||||||
| @ -28,11 +28,11 @@ public class WxCpDepartmentServiceImpl implements WxCpDepartmentService { | |||||||
|   } |   } | ||||||
|  |  | ||||||
|   @Override |   @Override | ||||||
|   public Integer create(WxCpDepart depart) throws WxErrorException { |   public Long create(WxCpDepart depart) throws WxErrorException { | ||||||
|     String url = "https://qyapi.weixin.qq.com/cgi-bin/department/create"; |     String url = "https://qyapi.weixin.qq.com/cgi-bin/department/create"; | ||||||
|     String responseContent = this.mainService.post(url, depart.toJson()); |     String responseContent = this.mainService.post(url, depart.toJson()); | ||||||
|     JsonElement tmpJsonElement = new JsonParser().parse(responseContent); |     JsonElement tmpJsonElement = new JsonParser().parse(responseContent); | ||||||
|     return GsonHelper.getAsInteger(tmpJsonElement.getAsJsonObject().get("id")); |     return GsonHelper.getAsLong(tmpJsonElement.getAsJsonObject().get("id")); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   @Override |   @Override | ||||||
|  | |||||||
| @ -31,7 +31,7 @@ public class WxCpDepartmentServiceImplTest { | |||||||
|     cpDepart.setName("子部门" + System.currentTimeMillis()); |     cpDepart.setName("子部门" + System.currentTimeMillis()); | ||||||
|     cpDepart.setParentId(1L); |     cpDepart.setParentId(1L); | ||||||
|     cpDepart.setOrder(1L); |     cpDepart.setOrder(1L); | ||||||
|     Integer departId = this.wxCpService.getDepartmentService().create(cpDepart); |     Long departId = this.wxCpService.getDepartmentService().create(cpDepart); | ||||||
|     System.out.println(departId); |     System.out.println(departId); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user
	 Binary Wang
					Binary Wang