mirror of https://github.com/halo-dev/halo
Disable invoke super equal and hashCode method in PostTag and PostCategory
parent
95f23f84ea
commit
20e83c6b2b
|
@ -8,6 +8,8 @@ import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Post minimal output dto.
|
* Post minimal output dto.
|
||||||
*
|
*
|
||||||
|
@ -42,4 +44,19 @@ public class PostMinimalOutputDTO implements OutputConverter<PostMinimalOutputDT
|
||||||
* Post type
|
* Post type
|
||||||
*/
|
*/
|
||||||
private PostType type;
|
private PostType type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新时间戳
|
||||||
|
*/
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间戳
|
||||||
|
*/
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Edit time.
|
||||||
|
*/
|
||||||
|
private Date editTime;
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,18 +66,4 @@ public class PostSimpleOutputDTO extends PostMinimalOutputDTO {
|
||||||
*/
|
*/
|
||||||
private Long likes;
|
private Long likes;
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建时间戳
|
|
||||||
*/
|
|
||||||
private Date createTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新时间戳
|
|
||||||
*/
|
|
||||||
private Date updateTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Edit time.
|
|
||||||
*/
|
|
||||||
private Date editTime;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,7 +51,6 @@ public class PostCategory extends BaseEntity {
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o) return true;
|
if (this == o) return true;
|
||||||
if (o == null || getClass() != o.getClass()) return false;
|
if (o == null || getClass() != o.getClass()) return false;
|
||||||
if (!super.equals(o)) return false;
|
|
||||||
PostCategory that = (PostCategory) o;
|
PostCategory that = (PostCategory) o;
|
||||||
return categoryId.equals(that.categoryId) &&
|
return categoryId.equals(that.categoryId) &&
|
||||||
postId.equals(that.postId);
|
postId.equals(that.postId);
|
||||||
|
@ -59,6 +58,6 @@ public class PostCategory extends BaseEntity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hash(super.hashCode(), categoryId, postId);
|
return Objects.hash(categoryId, postId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,7 +49,6 @@ public class PostTag extends BaseEntity {
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o) return true;
|
if (this == o) return true;
|
||||||
if (o == null || getClass() != o.getClass()) return false;
|
if (o == null || getClass() != o.getClass()) return false;
|
||||||
if (!super.equals(o)) return false;
|
|
||||||
PostTag postTag = (PostTag) o;
|
PostTag postTag = (PostTag) o;
|
||||||
return Objects.equals(postId, postTag.postId) &&
|
return Objects.equals(postId, postTag.postId) &&
|
||||||
Objects.equals(tagId, postTag.tagId);
|
Objects.equals(tagId, postTag.tagId);
|
||||||
|
@ -57,6 +56,6 @@ public class PostTag extends BaseEntity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hash(super.hashCode(), postId, tagId);
|
return Objects.hash(postId, tagId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue