|
@@ -193,22 +193,6 @@ public class DDImplClient_Contacts implements DDClient_Contacts {
|
|
|
return (Map) DDR.doPost("https://oapi.dingtalk.com/topapi/v2/user/create", null, param, body).getResult();
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 创建钉钉自建企业账号
|
|
|
- *
|
|
|
- * @apiNote https://open.dingtalk.com/document/orgapp/create-dingtalk-user-created-dedicated-account
|
|
|
- */
|
|
|
- @Override
|
|
|
- public Map createUser_dingTalk(String access_token, String login_id, String init_password, String name, List<Long> dept_id_list, Map body_ext) {
|
|
|
- Map param = UtilMap.map("access_token", access_token);
|
|
|
- String deptIds = String.join(",", dept_id_list.stream().map(dept -> String.valueOf(dept)).collect(Collectors.toList()));
|
|
|
- Map body = UtilMap.map("exclusive_account, exclusive_account_type, login_id, init_password, name, dept_id_list", true, "dingtalk", login_id, init_password, name, deptIds);
|
|
|
- if (ObjectUtil.isNotNull(body_ext)) {
|
|
|
- body.putAll(body_ext);
|
|
|
- }
|
|
|
- return (Map) DDR.doPost("https://oapi.dingtalk.com/topapi/v2/user/create", null, param, body).getResult();
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* 创建部门
|
|
|
*
|
|
@@ -245,4 +229,32 @@ public class DDImplClient_Contacts implements DDClient_Contacts {
|
|
|
Map result = (Map) DDR.doPost("https://oapi.dingtalk.com/topapi/user/count", null, DDConf.initTokenParams(access_token), UtilMap.map("only_active", only_active)).getResult();
|
|
|
return UtilMap.getInt(result, "count");
|
|
|
}
|
|
|
+
|
|
|
+ ////////////////////////////// 企业账号 //////////////////////////////
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 创建钉钉自建企业账号
|
|
|
+ *
|
|
|
+ * @apiNote https://open.dingtalk.com/document/orgapp/create-dingtalk-user-created-dedicated-account
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public Map createUser_dingTalk(String access_token, String login_id, String init_password, String name, List<Long> dept_id_list, Map body_ext) {
|
|
|
+ Map param = UtilMap.map("access_token", access_token);
|
|
|
+ String deptIds = String.join(",", dept_id_list.stream().map(dept -> String.valueOf(dept)).collect(Collectors.toList()));
|
|
|
+ Map body = UtilMap.map("exclusive_account, exclusive_account_type, login_id, init_password, name, dept_id_list", true, "dingtalk", login_id, init_password, name, deptIds);
|
|
|
+ if (ObjectUtil.isNotNull(body_ext)) {
|
|
|
+ body.putAll(body_ext);
|
|
|
+ }
|
|
|
+ return (Map) DDR.doPost("https://oapi.dingtalk.com/topapi/v2/user/create", null, param, body).getResult();
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Map updateUser_dingTalk(String access_token, String userId, List<Long> dept_id_list, Map body_ext) {
|
|
|
+ Map param = UtilMap.map("access_token", access_token);
|
|
|
+ String deptIds = String.join(",", dept_id_list.stream().map(dept -> String.valueOf(dept)).collect(Collectors.toList()));
|
|
|
+ Map body = UtilMap.map("userid, dept_id_list", userId, deptIds);
|
|
|
+ body.putAll(body_ext);
|
|
|
+ return (Map) DDR.doPost("https://oapi.dingtalk.com/topapi/v2/user/update", null, param, body).getResult();
|
|
|
+
|
|
|
+ }
|
|
|
}
|