增加查询当前登陆管理员的基本信息的接口

This commit is contained in:
YunaiV
2020-07-09 23:22:06 +08:00
parent 3a23ca72e6
commit 40fe027753
14 changed files with 73 additions and 50 deletions

View File

@@ -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);
}
}

View File

@@ -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));
}
}

View File

@@ -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) {