提交 f5d902b4 作者: 方治民

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

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