用户

## 概述 > 用户 类名 ` UserApi.java ` 成员方法 名称 | 方法 | Method | Path ------------- | ------------- | ------------- | ------------- [新增用户](#addUser) | [**addUser**](#addUser) | POST | /api-organization/user/addUser [删除用户](#deleteUser) | [**deleteUser**](#deleteUser) | POST | /api-organization/user/deleteUser [获取企业下所有用户](#getCompanyAllUser) | [**getCompanyAllUser**](#getCompanyAllUser) | POST | /api-organization/user/getCompanyAllUser [获取当前登录用户详细信息](#getLoginUser) | [**getLoginUser**](#getLoginUser) | POST | /api-organization/user/getLoginUser [获取用户信息集合](#getUserInfoList) | [**getUserInfoList**](#getUserInfoList) | POST | /api-organization/user/getUserInfoList [获取指定部门下的用户列表](#getUserListByDeptId) | [**getUserListByDeptId**](#getUserListByDeptId) | POST | /api-organization/user/getUserListByDeptId [修改邮箱](#updateEmail) | [**updateEmail**](#updateEmail) | POST | /api-organization/user/updateEmail [修改密码](#updatePassword) | [**updatePassword**](#updatePassword) | POST | /api-organization/user/updatePassword [修改当前用户手机号](#updatePhone) | [**updatePhone**](#updatePhone) | POST | /api-organization/user/updatePhone [修改当前用户基本信息](#updateUserBaseInfo) | [**updateUserBaseInfo**](#updateUserBaseInfo) | POST | /api-organization/user/updateUserBaseInfo [修改用户全部信息](#updateUserInfo) | [**updateUserInfo**](#updateUserInfo) | POST | /api-organization/user/updateUserInfo <a id="addUser"></a> ## **新增用户** > ResultObject addUser(userForm) 新增用户 ### 请求参数 名称 | 类型 | 描述 | 备注 ------------- | ------------- | ------------- | ------------- **userForm** | **UserForm**| userForm | #### UserForm 名称 | 类型 | 描述 | 备注 ------------ | ------------- | ------------- | ------------- **address** | **String** | 地址 | - **departmentId** | **String** | 部门ID | - **deviceId** | **String** | 图片验证码设备id | - **email** | **String** | 电子邮箱 | - **lock** | **Boolean** | 账号是否锁定(1:锁定 0未锁定) | - **nickname** | **String** | 昵称 | - **officePhone** | **String** | 办公电话 | - **password** | **String** | 密码 | **phone** | **String** | 手机号 | - **phoneCode** | **String** | 手机验证码 | - **roleId** | **String** | 角色ID | - **sex** | **Integer** | 性别(0:男 1:女 2:未知) | - **source** | **Integer** | 数据来源(0注册审核,1企业管理菜单中手动添加,2超级用户添加企业时生成,3系统自动添加) | - **type** | **Integer** | 类型(1管理员 2普通用户)与实际的type不一样 | - **username** | **String** | 用户名 | ### 返回参数 ResultObject 名称 | 类型 | 描述 | 备注 ------------ | ------------- | ------------- | ------------- **code** | **String** | 响应码 | - **data** | **Object** | 响应数据 | - **msg** | **String** | 响应消息 | - **time** | **OffsetDateTime** | 响应时间 | - ### java-sdk 调用示例 ```java //实例化api类,传入token UserApi apiInstance = new UserApi(token); //实例化请求参数 UserForm userForm = new UserForm(); try { ResultObject result = apiInstance.addUser(userForm); System.out.println(result); } catch (ApiException e) { System.err.println("调用UserApi.addUser异常: " + e.getMessage()); e.printStackTrace(); } ``` ### HTTP 调用示例 | 属性 | 名称 | | --------------- | ------------------------ | | HTTP请求地址 | http://[server]:[port]/api-organization/user/addUser| | 请求方式 | POST | | Content-Type | application/json | | header:key | Authorization| | header:value |Bearer *YOUR_ACCESS_TOKEN*| 请求参数: ```json { "address":"", "roleId":"", "departmentId":"", "sex":0, "source":0, "type":0, "deviceId":"", "password":"", "officePhone":"", "phone":"", "nickname":"", "lock":false, "phoneCode":"", "email":"", "username":"" } ``` <a id="deleteUser"></a> ## **删除用户** > ResultObject deleteUser(userId) 根据id删除用户 ### 请求参数 名称 | 类型 | 描述 | 备注 ------------- | ------------- | ------------- | ------------- **userId** | **String**| 用户ID | - ### 返回参数 ResultObject 名称 | 类型 | 描述 | 备注 ------------ | ------------- | ------------- | ------------- **code** | **String** | 响应码 | - **data** | **Object** | 响应数据 | - **msg** | **String** | 响应消息 | - **time** | **OffsetDateTime** | 响应时间 | - ### java-sdk 调用示例 ```java //实例化api类,传入token UserApi apiInstance = new UserApi(token); //实例化请求参数 String userId = "userId_example"; try { ResultObject result = apiInstance.deleteUser(userId); System.out.println(result); } catch (ApiException e) { System.err.println("调用UserApi.deleteUser异常: " + e.getMessage()); e.printStackTrace(); } ``` ### HTTP 调用示例 | 属性 | 名称 | | --------------- | ------------------------ | | HTTP请求地址 | http://[server]:[port]/api-organization/user/deleteUser| | 请求方式 | POST | | Content-Type | application/json | | header:key | Authorization| | header:value |Bearer *YOUR_ACCESS_TOKEN*| 请求参数: ```json { "userId":"" } ``` <a id="getCompanyAllUser"></a> ## **获取企业下所有用户** > ResultListUserVo getCompanyAllUser() 获取企业下所有用户 ### 请求参数 请求参数为空. ### 返回参数 ResultListUserVo 名称 | 类型 | 描述 | 备注 ------------ | ------------- | ------------- | ------------- **code** | **String** | 响应码 | - **data** | **List&lt;UserVo&gt;** | 响应数据 | - **msg** | **String** | 响应消息 | - **time** | **OffsetDateTime** | 响应时间 | - UserVo 名称 | 类型 | 描述 | 备注 ------------ | ------------- | ------------- | ------------- **address** | **String** | 地址 | - **avatar** | **String** | 头像地址 | - **createdBy** | **String** | 创建人 | - **createdTime** | **OffsetDateTime** | 创建时间 | - **departmentId** | **String** | 部门标识 | - **departmentName** | **String** | 部门名称 | - **email** | **String** | 邮箱 | - **enabled** | **Boolean** | 是否启用:1是0否 | - **id** | **String** | 主键id | - **nickname** | **String** | 昵称 | - **officePhone** | **String** | 办公号码 | - **phone** | **String** | 手机号 | - **remark** | **String** | 备注 | - **roleId** | **String** | 角色id | - **roleName** | **String** | 角色name | - **sex** | **Integer** | 性别 0.男,1女,2未知 | - **sid** | **String** | 二次开发访问密钥 | - **type** | **Integer** | 类型 0超级管理员(super),1超级企业管理员2企业管理员,3企业用户,4部门管理员5部门用户 | - **updatedTime** | **OffsetDateTime** | 修改时间 | - **username** | **String** | 用户名 | - ### java-sdk 调用示例 ```java //实例化api类,传入token UserApi apiInstance = new UserApi(token); try { ResultListUserVo result = apiInstance.getCompanyAllUser(); System.out.println(result); } catch (ApiException e) { System.err.println("调用UserApi.getCompanyAllUser异常: " + e.getMessage()); e.printStackTrace(); } ``` ### HTTP 调用示例 | 属性 | 名称 | | --------------- | ------------------------ | | HTTP请求地址 | http://[server]:[port]/api-organization/user/getCompanyAllUser| | 请求方式 | POST | | Content-Type | application/json | | header:key | Authorization| | header:value |Bearer *YOUR_ACCESS_TOKEN*| 请求参数: ```json {} ``` <a id="getLoginUser"></a> ## **获取当前登录用户详细信息** > ResultLoginUserVo getLoginUser() 获取当前登录用户详细信息 ### 请求参数 请求参数为空. ### 返回参数 ResultLoginUserVo 名称 | 类型 | 描述 | 备注 ------------ | ------------- | ------------- | ------------- **code** | **String** | 响应码 | - **data** | **LoginUserVo** | 响应数据 | - **msg** | **String** | 响应消息 | - **time** | **OffsetDateTime** | 响应时间 | - LoginUserVo 名称 | 类型 | 描述 | 备注 ------------ | ------------- | ------------- | ------------- **avatar** | **String** | 头像地址 | - **companyId** | **String** | 企业id | - **departmentId** | **String** | 部门id | - **id** | **String** | 用户id | - **nickname** | **String** | 昵称 | - **permissionCodes** | **List&lt;String&gt;** | 资源 | - **phone** | **String** | 手机号码 | - **routeMenu** | **List&lt;RouteVo&gt;** | 路由菜单 | - **type** | **Integer** | 类型(0超级管理员(super),1超级企业管理员2企业管理员,3企业用户,4部门管理员5部门用户,6个人开发者) | - **username** | **String** | 用户名 | - RouteVo 名称 | 类型 | 描述 | 备注 ------------ | ------------- | ------------- | ------------- **children** | **List&lt;RouteVo&gt;** | | - **component** | **String** | | - **id** | **String** | | - **meta** | **MetaVo** | | - **name** | **String** | | - **path** | **String** | | - **redirect** | **String** | | - **type** | **Integer** | | - ### java-sdk 调用示例 ```java //实例化api类,传入token UserApi apiInstance = new UserApi(token); try { ResultLoginUserVo result = apiInstance.getLoginUser(); System.out.println(result); } catch (ApiException e) { System.err.println("调用UserApi.getLoginUser异常: " + e.getMessage()); e.printStackTrace(); } ``` ### HTTP 调用示例 | 属性 | 名称 | | --------------- | ------------------------ | | HTTP请求地址 | http://[server]:[port]/api-organization/user/getLoginUser| | 请求方式 | POST | | Content-Type | application/json | | header:key | Authorization| | header:value |Bearer *YOUR_ACCESS_TOKEN*| 请求参数: ```json {} ``` <a id="getUserInfoList"></a> ## **获取用户信息集合** > ResultListUserVo getUserInfoList(userIds) 根据id集合获取用户信息集合 ### 请求参数 名称 | 类型 | 描述 | 备注 ------------- | ------------- | ------------- | ------------- **userIds** | **List&lt;String&gt;**| 用户ID集合 | - ### 返回参数 ResultListUserVo 名称 | 类型 | 描述 | 备注 ------------ | ------------- | ------------- | ------------- **code** | **String** | 响应码 | - **data** | **List&lt;UserVo&gt;** | 响应数据 | - **msg** | **String** | 响应消息 | - **time** | **OffsetDateTime** | 响应时间 | - UserVo 名称 | 类型 | 描述 | 备注 ------------ | ------------- | ------------- | ------------- **address** | **String** | 地址 | - **avatar** | **String** | 头像地址 | - **createdBy** | **String** | 创建人 | - **createdTime** | **OffsetDateTime** | 创建时间 | - **departmentId** | **String** | 部门标识 | - **departmentName** | **String** | 部门名称 | - **email** | **String** | 邮箱 | - **enabled** | **Boolean** | 是否启用:1是0否 | - **id** | **String** | 主键id | - **nickname** | **String** | 昵称 | - **officePhone** | **String** | 办公号码 | - **phone** | **String** | 手机号 | - **remark** | **String** | 备注 | - **roleId** | **String** | 角色id | - **roleName** | **String** | 角色name | - **sex** | **Integer** | 性别 0.男,1女,2未知 | - **sid** | **String** | 二次开发访问密钥 | - **type** | **Integer** | 类型 0超级管理员(super),1超级企业管理员2企业管理员,3企业用户,4部门管理员5部门用户 | - **updatedTime** | **OffsetDateTime** | 修改时间 | - **username** | **String** | 用户名 | - ### java-sdk 调用示例 ```java //实例化api类,传入token UserApi apiInstance = new UserApi(token); //实例化请求参数 List<String> userIds = Arrays.asList(new List<String>()); try { ResultListUserVo result = apiInstance.getUserInfoList(userIds); System.out.println(result); } catch (ApiException e) { System.err.println("调用UserApi.getUserInfoList异常: " + e.getMessage()); e.printStackTrace(); } ``` ### HTTP 调用示例 | 属性 | 名称 | | --------------- | ------------------------ | | HTTP请求地址 | http://[server]:[port]/api-organization/user/getUserInfoList| | 请求方式 | POST | | Content-Type | application/json | | header:key | Authorization| | header:value |Bearer *YOUR_ACCESS_TOKEN*| 请求参数: ```json { "userIds":[] } ``` <a id="getUserListByDeptId"></a> ## **获取指定部门下的用户列表** > ResultListUserVo getUserListByDeptId(deptId) 获取当前登录用户的企业,再查询指定部门下的用户集合 ### 请求参数 名称 | 类型 | 描述 | 备注 ------------- | ------------- | ------------- | ------------- **deptId** | **String**| 部门ID | - ### 返回参数 ResultListUserVo 名称 | 类型 | 描述 | 备注 ------------ | ------------- | ------------- | ------------- **code** | **String** | 响应码 | - **data** | **List&lt;UserVo&gt;** | 响应数据 | - **msg** | **String** | 响应消息 | - **time** | **OffsetDateTime** | 响应时间 | - UserVo 名称 | 类型 | 描述 | 备注 ------------ | ------------- | ------------- | ------------- **address** | **String** | 地址 | - **avatar** | **String** | 头像地址 | - **createdBy** | **String** | 创建人 | - **createdTime** | **OffsetDateTime** | 创建时间 | - **departmentId** | **String** | 部门标识 | - **departmentName** | **String** | 部门名称 | - **email** | **String** | 邮箱 | - **enabled** | **Boolean** | 是否启用:1是0否 | - **id** | **String** | 主键id | - **nickname** | **String** | 昵称 | - **officePhone** | **String** | 办公号码 | - **phone** | **String** | 手机号 | - **remark** | **String** | 备注 | - **roleId** | **String** | 角色id | - **roleName** | **String** | 角色name | - **sex** | **Integer** | 性别 0.男,1女,2未知 | - **sid** | **String** | 二次开发访问密钥 | - **type** | **Integer** | 类型 0超级管理员(super),1超级企业管理员2企业管理员,3企业用户,4部门管理员5部门用户 | - **updatedTime** | **OffsetDateTime** | 修改时间 | - **username** | **String** | 用户名 | - ### java-sdk 调用示例 ```java //实例化api类,传入token UserApi apiInstance = new UserApi(token); //实例化请求参数 String deptId = "deptId_example"; try { ResultListUserVo result = apiInstance.getUserListByDeptId(deptId); System.out.println(result); } catch (ApiException e) { System.err.println("调用UserApi.getUserListByDeptId异常: " + e.getMessage()); e.printStackTrace(); } ``` ### HTTP 调用示例 | 属性 | 名称 | | --------------- | ------------------------ | | HTTP请求地址 | http://[server]:[port]/api-organization/user/getUserListByDeptId| | 请求方式 | POST | | Content-Type | application/json | | header:key | Authorization| | header:value |Bearer *YOUR_ACCESS_TOKEN*| 请求参数: ```json { "deptId":"" } ``` <a id="updateEmail"></a> ## **修改邮箱** > ResultObject updateEmail(email) 修改当前用户的邮箱 ### 请求参数 名称 | 类型 | 描述 | 备注 ------------- | ------------- | ------------- | ------------- **email** | **String**| 邮箱 | - ### 返回参数 ResultObject 名称 | 类型 | 描述 | 备注 ------------ | ------------- | ------------- | ------------- **code** | **String** | 响应码 | - **data** | **Object** | 响应数据 | - **msg** | **String** | 响应消息 | - **time** | **OffsetDateTime** | 响应时间 | - ### java-sdk 调用示例 ```java //实例化api类,传入token UserApi apiInstance = new UserApi(token); //实例化请求参数 String email = "email_example"; try { ResultObject result = apiInstance.updateEmail(email); System.out.println(result); } catch (ApiException e) { System.err.println("调用UserApi.updateEmail异常: " + e.getMessage()); e.printStackTrace(); } ``` ### HTTP 调用示例 | 属性 | 名称 | | --------------- | ------------------------ | | HTTP请求地址 | http://[server]:[port]/api-organization/user/updateEmail| | 请求方式 | POST | | Content-Type | application/json | | header:key | Authorization| | header:value |Bearer *YOUR_ACCESS_TOKEN*| 请求参数: ```json { "email":"" } ``` <a id="updatePassword"></a> ## **修改密码** > ResultObject updatePassword(data) 修改当前用户的密码 ### 请求参数 名称 | 类型 | 描述 | 备注 ------------- | ------------- | ------------- | ------------- **data** | **String**| data | - ### 返回参数 ResultObject 名称 | 类型 | 描述 | 备注 ------------ | ------------- | ------------- | ------------- **code** | **String** | 响应码 | - **data** | **Object** | 响应数据 | - **msg** | **String** | 响应消息 | - **time** | **OffsetDateTime** | 响应时间 | - ### java-sdk 调用示例 ```java //实例化api类,传入token UserApi apiInstance = new UserApi(token); //实例化请求参数 String data = "data_example"; try { ResultObject result = apiInstance.updatePassword(data); System.out.println(result); } catch (ApiException e) { System.err.println("调用UserApi.updatePassword异常: " + e.getMessage()); e.printStackTrace(); } ``` ### HTTP 调用示例 | 属性 | 名称 | | --------------- | ------------------------ | | HTTP请求地址 | http://[server]:[port]/api-organization/user/updatePassword| | 请求方式 | POST | | Content-Type | application/json | | header:key | Authorization| | header:value |Bearer *YOUR_ACCESS_TOKEN*| 请求参数: ```json { "data":"" } ``` <a id="updatePhone"></a> ## **修改当前用户手机号** > ResultObject updatePhone(phoneForm) 根据手机号和验证码修改当前用户的手机号 ### 请求参数 名称 | 类型 | 描述 | 备注 ------------- | ------------- | ------------- | ------------- **phoneForm** | **PersonalPhoneForm**| phoneForm | #### PersonalPhoneForm 名称 | 类型 | 描述 | 备注 ------------ | ------------- | ------------- | ------------- **phone** | **String** | 手机号 | - **phoneCode** | **String** | 手机验证码 | - ### 返回参数 ResultObject 名称 | 类型 | 描述 | 备注 ------------ | ------------- | ------------- | ------------- **code** | **String** | 响应码 | - **data** | **Object** | 响应数据 | - **msg** | **String** | 响应消息 | - **time** | **OffsetDateTime** | 响应时间 | - ### java-sdk 调用示例 ```java //实例化api类,传入token UserApi apiInstance = new UserApi(token); //实例化请求参数 PersonalPhoneForm phoneForm = new PersonalPhoneForm(); try { ResultObject result = apiInstance.updatePhone(phoneForm); System.out.println(result); } catch (ApiException e) { System.err.println("调用UserApi.updatePhone异常: " + e.getMessage()); e.printStackTrace(); } ``` ### HTTP 调用示例 | 属性 | 名称 | | --------------- | ------------------------ | | HTTP请求地址 | http://[server]:[port]/api-organization/user/updatePhone| | 请求方式 | POST | | Content-Type | application/json | | header:key | Authorization| | header:value |Bearer *YOUR_ACCESS_TOKEN*| 请求参数: ```json { "phone":"", "phoneCode":"" } ``` <a id="updateUserBaseInfo"></a> ## **修改当前用户基本信息** > ResultObject updateUserBaseInfo(userForm) 修改当前用户基本信息 ### 请求参数 名称 | 类型 | 描述 | 备注 ------------- | ------------- | ------------- | ------------- **userForm** | **PersonalUserForm**| userForm | #### PersonalUserForm 名称 | 类型 | 描述 | 备注 ------------ | ------------- | ------------- | ------------- **address** | **String** | 地址 | - **nickname** | **String** | 昵称 | - **sex** | **Integer** | 性别(0:男 1:女 2:未知) | - ### 返回参数 ResultObject 名称 | 类型 | 描述 | 备注 ------------ | ------------- | ------------- | ------------- **code** | **String** | 响应码 | - **data** | **Object** | 响应数据 | - **msg** | **String** | 响应消息 | - **time** | **OffsetDateTime** | 响应时间 | - ### java-sdk 调用示例 ```java //实例化api类,传入token UserApi apiInstance = new UserApi(token); //实例化请求参数 PersonalUserForm userForm = new PersonalUserForm(); try { ResultObject result = apiInstance.updateUserBaseInfo(userForm); System.out.println(result); } catch (ApiException e) { System.err.println("调用UserApi.updateUserBaseInfo异常: " + e.getMessage()); e.printStackTrace(); } ``` ### HTTP 调用示例 | 属性 | 名称 | | --------------- | ------------------------ | | HTTP请求地址 | http://[server]:[port]/api-organization/user/updateUserBaseInfo| | 请求方式 | POST | | Content-Type | application/json | | header:key | Authorization| | header:value |Bearer *YOUR_ACCESS_TOKEN*| 请求参数: ```json { "nickname":"", "address":"", "sex":0 } ``` <a id="updateUserInfo"></a> ## **修改用户全部信息** > ResultObject updateUserInfo(updateUserForm) 修改用户信息 ### 请求参数 名称 | 类型 | 描述 | 备注 ------------- | ------------- | ------------- | ------------- **updateUserForm** | **UpdateUserForm**| updateUserForm | #### UpdateUserForm 名称 | 类型 | 描述 | 备注 ------------ | ------------- | ------------- | ------------- **address** | **String** | 地址 | - **departmentId** | **String** | 部门ID | - **email** | **String** | 电子邮箱 | - **id** | **String** | 用户id | - **lock** | **Boolean** | 账号是否锁定(1:锁定 0未锁定) | - **nickname** | **String** | 昵称 | - **officePhone** | **String** | 办公电话 | - **oldPhone** | **String** | 旧手机号 | - **phone** | **String** | 手机号 | - **phoneCode** | **String** | 手机验证码 | - **roleId** | **String** | 角色ID | - **sex** | **Integer** | 性别(0:男 1:女 2:未知) | - **source** | **Integer** | 数据来源(0注册审核,1企业管理菜单中手动添加,2超级用户添加企业时生成,3系统自动添加) | - **type** | **Integer** | 类型(1管理员 2普通用户)与实际的type不一样 | - **username** | **String** | 用户名 | ### 返回参数 ResultObject 名称 | 类型 | 描述 | 备注 ------------ | ------------- | ------------- | ------------- **code** | **String** | 响应码 | - **data** | **Object** | 响应数据 | - **msg** | **String** | 响应消息 | - **time** | **OffsetDateTime** | 响应时间 | - ### java-sdk 调用示例 ```java //实例化api类,传入token UserApi apiInstance = new UserApi(token); //实例化请求参数 UpdateUserForm updateUserForm = new UpdateUserForm(); try { ResultObject result = apiInstance.updateUserInfo(updateUserForm); System.out.println(result); } catch (ApiException e) { System.err.println("调用UserApi.updateUserInfo异常: " + e.getMessage()); e.printStackTrace(); } ``` ### HTTP 调用示例 | 属性 | 名称 | | --------------- | ------------------------ | | HTTP请求地址 | http://[server]:[port]/api-organization/user/updateUserInfo| | 请求方式 | POST | | Content-Type | application/json | | header:key | Authorization| | header:value |Bearer *YOUR_ACCESS_TOKEN*| 请求参数: ```json { "address":"", "roleId":"", "departmentId":"", "oldPhone":"", "sex":0, "source":0, "type":0, "officePhone":"", "phone":"", "nickname":"", "lock":false, "phoneCode":"", "id":"", "email":"", "username":"" } ```