mirror of
https://gitee.com/dromara/dax-pay.git
synced 2025-09-03 19:16:21 +00:00
style 统一SDK代码优化
This commit is contained in:
@@ -34,7 +34,7 @@ public class AuthAssistService {
|
||||
public void sendSmsCaptcha(String phone) {
|
||||
// 判断用户是否存在
|
||||
UserInfo userInfo = userInfoManager.findByPhone(phone).orElseThrow(UserInfoNotExistsException::new);
|
||||
if (!Objects.equals(userInfo.getStatus(), UserStatusEnum.NORMAL)) {
|
||||
if (!Objects.equals(userInfo.getStatus(), UserStatusEnum.NORMAL.getCode())) {
|
||||
throw new BizException("用户状态异常");
|
||||
}
|
||||
}
|
||||
|
@@ -45,7 +45,7 @@ public class UserInfoStatusCheckImpl implements UserInfoStatusCheck {
|
||||
return;
|
||||
}
|
||||
// 判断用户是否被禁用
|
||||
if (Objects.equals(userDetail.getStatus(), UserStatusEnum.BAN)){
|
||||
if (Objects.equals(userDetail.getStatus(), UserStatusEnum.BAN.getCode())){
|
||||
throw new LoginFailureException("该用户已被禁用");
|
||||
}
|
||||
}
|
||||
|
@@ -30,6 +30,6 @@ public class PermCodeParam {
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "是否为子节点")
|
||||
private boolean leaf;;
|
||||
private boolean leaf;
|
||||
|
||||
}
|
||||
|
@@ -148,7 +148,7 @@ public class RoleQueryService {
|
||||
// 获取关联的角色和子角色
|
||||
List<RoleResult> unfold = TreeBuildUtil.unfold(tree, RoleResult::getChildren).stream()
|
||||
.filter(role -> roleIds.contains(role.getId()))
|
||||
.collect(Collectors.toList());;
|
||||
.collect(Collectors.toList());
|
||||
var list = new ArrayList<>(unfold);
|
||||
// 将子孙级别的角色移除, 只保留根角色
|
||||
for (var out : unfold) {
|
||||
|
@@ -152,7 +152,7 @@ public class RoleCodeService {
|
||||
// 权限码列表
|
||||
List<PermCode> permCodes = allPermCodes.stream()
|
||||
.filter(PermCode::isLeaf)
|
||||
.toList();;
|
||||
.toList();
|
||||
// 如果有有上级角色, 显示上级角色已分配的权限
|
||||
if (Objects.nonNull(role.getPid())){
|
||||
List<Long> codeIds = roleCodeManager.findAllByRole(role.getPid())
|
||||
|
Reference in New Issue
Block a user