增加查询当前登陆管理员的基本信息的接口
This commit is contained in:
@@ -52,4 +52,8 @@ public class AdminManager {
|
||||
return AdminConvert.INSTANCE.convert(adminPage);
|
||||
}
|
||||
|
||||
public AdminVO getAdmin(Integer adminId) {
|
||||
AdminBO adminBO = adminService.getAdmin(adminId);
|
||||
return AdminConvert.INSTANCE.convert(adminBO);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,4 +41,9 @@ public class AdminRpcImpl implements AdminRpc {
|
||||
return success(adminManager.pageAdmin(pageDTO));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<AdminVO> getAdmin(Integer adminId) {
|
||||
return success(adminManager.getAdmin(adminId));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ public class AdminService {
|
||||
public AdminBO verifyPassword(String username, String password, String ip) {
|
||||
AdminDO adminDO = adminMapper.selectByUsername(username);
|
||||
if (adminDO == null) {
|
||||
throw ServiceExceptionUtil.exception(ADMIN_NOT_FOUND);
|
||||
throw ServiceExceptionUtil.exception(ADMIN_USERNAME_NOT_EXISTS);
|
||||
}
|
||||
// 校验密码是否正确
|
||||
String encodedPassword = DigestUtils.bcrypt(password, adminDO.getPasswordSalt());
|
||||
@@ -114,6 +114,11 @@ public class AdminService {
|
||||
adminMapper.updateById(updateAdmin);
|
||||
}
|
||||
|
||||
public AdminBO getAdmin(Integer adminId) {
|
||||
AdminDO adminDO = adminMapper.selectById(adminId);
|
||||
return AdminConvert.INSTANCE.convert(adminDO);
|
||||
}
|
||||
|
||||
//
|
||||
// @Override
|
||||
// public Map<Integer, Collection<RoleBO>> getAdminRolesMap(Collection<Integer> adminIds) {
|
||||
|
||||
Reference in New Issue
Block a user