提交 f5d902b4 作者: 方治民

fix: 修复权限 meta JSON 数据构建空值错误、equals 代码简化

上级 fc1405db
......@@ -122,7 +122,9 @@ public class Permission extends BasicEntity implements Serializable {
meta.put("icon", this.icon);
meta.put("orderNo", this.serial);
meta.put("hideMenu", this.hidden);
meta.putAll(this.meta);
if (this.meta != null) {
meta.putAll(this.meta);
}
return meta;
}
......@@ -131,7 +133,7 @@ public class Permission extends BasicEntity implements Serializable {
if (this == o) return true;
if (o == null || Hibernate.getClass(this) != Hibernate.getClass(o)) return false;
Permission that = (Permission) o;
return this.getId() != null && Objects.equals(this.getId(), that.getId());
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
......
......@@ -73,7 +73,7 @@ public class Role extends BasicEntity implements Serializable {
if (this == o) return true;
if (o == null || Hibernate.getClass(this) != Hibernate.getClass(o)) return false;
Role role = (Role) o;
return this.getId() != null && Objects.equals(this.getId(), role.getId());
return getId() != null && Objects.equals(getId(), role.getId());
}
@Override
......
......@@ -89,7 +89,7 @@ public class User extends BasicEntity implements Serializable {
joinColumns = { @JoinColumn(name = "user_id") },
inverseJoinColumns = { @JoinColumn(name = "role_id") }
)
private Set<Role> roles = new HashSet<>();
Set<Role> roles = new HashSet<>();
@Comment("最后登录IP地址")
String lastLoginIp;
......@@ -102,7 +102,7 @@ public class User extends BasicEntity implements Serializable {
if (this == o) return true;
if (o == null || Hibernate.getClass(this) != Hibernate.getClass(o)) return false;
User user = (User) o;
return this.getId() != null && Objects.equals(this.getId(), user.getId());
return getId() != null && Objects.equals(getId(), user.getId());
}
@Override
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论