修复已经废弃的接口产生的问题

This commit is contained in:
wenc000 2020-11-12 14:48:34 +08:00
parent bae4016a7b
commit 9aff50313f

View File

@ -46,49 +46,56 @@ public class UserServiceImpl extends AbstractService implements IUserService {
@Override @Override
public JSONArray listDepartmentUsers(Map<String, Object> params) throws AccessTokenException, SearchException { public JSONArray listDepartmentUsers(Map<String, Object> params) throws AccessTokenException, SearchException {
String result = restTemplateUtil.doPostForm(String.format(IApiConsts.LIST_DEPARTMENT_USER, apiPathProperties.getUserCenter(), params.get("departmentId").toString()), params); params.put(IApiConsts.ACCESS_TOKEN, ClientTokenManager.getInstance().getClientToken().getAccessToken());
String result = restTemplateUtil.doPostFormNormal(String.format(IApiConsts.LIST_DEPARTMENT_USER, apiPathProperties.getUserCenter(), params.get("departmentId").toString()), params);
searchResourceResult(result, "获取人员列表失败"); searchResourceResult(result, "获取人员列表失败");
return JSONArray.parseArray(result); return JSONArray.parseArray(result);
} }
@Override @Override
public JSONArray listRoleUsers(Map<String, Object> params) throws AccessTokenException, SearchException { public JSONArray listRoleUsers(Map<String, Object> params) throws AccessTokenException, SearchException {
String result = restTemplateUtil.doPostForm(String.format(IApiConsts.LIST_ROLE_USER, apiPathProperties.getUserCenter(), params.get("roleId").toString()), params); params.put(IApiConsts.ACCESS_TOKEN, ClientTokenManager.getInstance().getClientToken().getAccessToken());
String result = restTemplateUtil.doPostFormNormal(String.format(IApiConsts.LIST_ROLE_USER, apiPathProperties.getUserCenter(), params.get("roleId").toString()), params);
searchResourceResult(result, "获取人员列表失败"); searchResourceResult(result, "获取人员列表失败");
return JSONArray.parseArray(result); return JSONArray.parseArray(result);
} }
@Override @Override
public JSONArray listGroupUsers(Map<String, Object> params) throws AccessTokenException, SearchException { public JSONArray listGroupUsers(Map<String, Object> params) throws AccessTokenException, SearchException {
String result = restTemplateUtil.doPostForm(String.format(IApiConsts.LIST_GROUP_USER, apiPathProperties.getUserCenter(), params.get("groupId").toString()), params); params.put(IApiConsts.ACCESS_TOKEN, ClientTokenManager.getInstance().getClientToken().getAccessToken());
String result = restTemplateUtil.doPostFormNormal(String.format(IApiConsts.LIST_GROUP_USER, apiPathProperties.getUserCenter(), params.get("groupId").toString()), params);
searchResourceResult(result, "获取人员列表失败"); searchResourceResult(result, "获取人员列表失败");
return JSONArray.parseArray(result); return JSONArray.parseArray(result);
} }
@Override @Override
public JSONArray listPositionUsers(Map<String, Object> params) throws AccessTokenException, SearchException { public JSONArray listPositionUsers(Map<String, Object> params) throws AccessTokenException, SearchException {
String result = restTemplateUtil.doPostForm(String.format(IApiConsts.LIST_POSITION_USER, apiPathProperties.getUserCenter(), params.get("positionId").toString()), params); params.put(IApiConsts.ACCESS_TOKEN, ClientTokenManager.getInstance().getClientToken().getAccessToken());
String result = restTemplateUtil.doPostFormNormal(String.format(IApiConsts.LIST_POSITION_USER, apiPathProperties.getUserCenter(), params.get("positionId").toString()), params);
searchResourceResult(result, "获取人员列表失败"); searchResourceResult(result, "获取人员列表失败");
return JSONArray.parseArray(result); return JSONArray.parseArray(result);
} }
@Override @Override
public JSONArray listAllUsers(Map<String, Object> params) throws AccessTokenException, SearchException { public JSONArray listAllUsers(Map<String, Object> params) throws AccessTokenException, SearchException {
String result = restTemplateUtil.doPostForm(String.format(IApiConsts.LIST_ALL_USER, apiPathProperties.getUserCenter()), params); params.put(IApiConsts.ACCESS_TOKEN, ClientTokenManager.getInstance().getClientToken().getAccessToken());
String result = restTemplateUtil.doPostFormNormal(String.format(IApiConsts.LIST_ALL_USER, apiPathProperties.getUserCenter()), params);
searchResourceResult(result, "获取全部人员列表失败"); searchResourceResult(result, "获取全部人员列表失败");
return JSONArray.parseArray(result); return JSONArray.parseArray(result);
} }
@Override @Override
public JSONArray listUserDepartmentUser(Map<String, Object> params) throws AccessTokenException, SearchException { public JSONArray listUserDepartmentUser(Map<String, Object> params) throws AccessTokenException, SearchException {
String result = restTemplateUtil.doPostForm(String.format(IApiConsts.LIST_USER_DEPARTMENT_USER, apiPathProperties.getUserCenter(), params.get("userId").toString()), params); params.put(IApiConsts.ACCESS_TOKEN, ClientTokenManager.getInstance().getClientToken().getAccessToken());
String result = restTemplateUtil.doPostFormNormal(String.format(IApiConsts.LIST_USER_DEPARTMENT_USER, apiPathProperties.getUserCenter(), params.get("userId").toString()), params);
searchResourceResult(result, "获取人员列表失败"); searchResourceResult(result, "获取人员列表失败");
return JSONArray.parseArray(result); return JSONArray.parseArray(result);
} }
@Override @Override
public JSONArray listUserDepartmentUserByRole(Map<String, Object> params) throws AccessTokenException, SearchException { public JSONArray listUserDepartmentUserByRole(Map<String, Object> params) throws AccessTokenException, SearchException {
String result = restTemplateUtil.doPostForm(String.format(IApiConsts.LIST_USER_DEPARTMENT_USER_BY_ROLE, apiPathProperties.getUserCenter(), params.get("userId").toString(), params.get("roleId").toString()), params); params.put(IApiConsts.ACCESS_TOKEN, ClientTokenManager.getInstance().getClientToken().getAccessToken());
String result = restTemplateUtil.doPostFormNormal(String.format(IApiConsts.LIST_USER_DEPARTMENT_USER_BY_ROLE, apiPathProperties.getUserCenter(), params.get("userId").toString(), params.get("roleId").toString()), params);
searchResourceResult(result, "获取人员列表失败"); searchResourceResult(result, "获取人员列表失败");
return JSONArray.parseArray(result); return JSONArray.parseArray(result);
} }
@ -102,14 +109,16 @@ public class UserServiceImpl extends AbstractService implements IUserService {
@Override @Override
public JSONArray listUserDepartmentUserByPosition(Map<String, Object> params) throws AccessTokenException, SearchException { public JSONArray listUserDepartmentUserByPosition(Map<String, Object> params) throws AccessTokenException, SearchException {
String result = restTemplateUtil.doPostForm(String.format(IApiConsts.LIST_USER_DEPARTMENT_USER_BY_POSITION, apiPathProperties.getUserCenter(), params.get("userId").toString(), params.get("positionId").toString()), params); params.put(IApiConsts.ACCESS_TOKEN, ClientTokenManager.getInstance().getClientToken().getAccessToken());
String result = restTemplateUtil.doPostFormNormal(String.format(IApiConsts.LIST_USER_DEPARTMENT_USER_BY_POSITION, apiPathProperties.getUserCenter(), params.get("userId").toString(), params.get("positionId").toString()), params);
searchResourceResult(result, "获取人员列表失败"); searchResourceResult(result, "获取人员列表失败");
return JSONArray.parseArray(result); return JSONArray.parseArray(result);
} }
@Override @Override
public JSONObject getUserDetail(Map<String, Object> params) throws AccessTokenException, SearchException { public JSONObject getUserDetail(Map<String, Object> params) throws AccessTokenException, SearchException {
String result = restTemplateUtil.doPostForm(String.format(IApiConsts.GET_USER_DETAIL, apiPathProperties.getUserCenter(), params.get("userId").toString()), params); params.put(IApiConsts.ACCESS_TOKEN, ClientTokenManager.getInstance().getClientToken().getAccessToken());
String result = restTemplateUtil.doPostFormNormal(String.format(IApiConsts.GET_USER_DETAIL, apiPathProperties.getUserCenter(), params.get("userId").toString()), params);
searchResourceResult(result, "获取人员列表失败"); searchResourceResult(result, "获取人员列表失败");
return JSONObject.parseObject(result); return JSONObject.parseObject(result);
} }
@ -131,7 +140,8 @@ public class UserServiceImpl extends AbstractService implements IUserService {
@Override @Override
public SuccessResult updateUserPassword(Map<String, Object> params) throws AccessTokenException, SearchException { public SuccessResult updateUserPassword(Map<String, Object> params) throws AccessTokenException, SearchException {
String result = restTemplateUtil.doPostForm(String.format(IApiConsts.UPDATE_USER_PASSWORD, apiPathProperties.getUserCenter()), params); params.put(IApiConsts.ACCESS_TOKEN, ClientTokenManager.getInstance().getClientToken().getAccessToken());
String result = restTemplateUtil.doPostFormNormal(String.format(IApiConsts.UPDATE_USER_PASSWORD, apiPathProperties.getUserCenter()), params);
updateResourceResult(result, "密码修改失败"); updateResourceResult(result, "密码修改失败");
return new SuccessResult(); return new SuccessResult();
} }