Disable invoke super equal and hashCode method in PostTag and PostCategory

pull/137/head
johnniang 2019-03-22 10:08:47 +08:00
parent 95f23f84ea
commit 20e83c6b2b
4 changed files with 19 additions and 18 deletions

View File

@ -8,6 +8,8 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import java.util.Date;
/**
* Post minimal output dto.
*
@ -42,4 +44,19 @@ public class PostMinimalOutputDTO implements OutputConverter<PostMinimalOutputDT
* Post type
*/
private PostType type;
/**
*
*/
private Date updateTime;
/**
*
*/
private Date createTime;
/**
* Edit time.
*/
private Date editTime;
}

View File

@ -66,18 +66,4 @@ public class PostSimpleOutputDTO extends PostMinimalOutputDTO {
*/
private Long likes;
/**
*
*/
private Date createTime;
/**
*
*/
private Date updateTime;
/**
* Edit time.
*/
private Date editTime;
}

View File

@ -51,7 +51,6 @@ public class PostCategory extends BaseEntity {
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
PostCategory that = (PostCategory) o;
return categoryId.equals(that.categoryId) &&
postId.equals(that.postId);
@ -59,6 +58,6 @@ public class PostCategory extends BaseEntity {
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), categoryId, postId);
return Objects.hash(categoryId, postId);
}
}

View File

@ -49,7 +49,6 @@ public class PostTag extends BaseEntity {
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
PostTag postTag = (PostTag) o;
return Objects.equals(postId, postTag.postId) &&
Objects.equals(tagId, postTag.tagId);
@ -57,6 +56,6 @@ public class PostTag extends BaseEntity {
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), postId, tagId);
return Objects.hash(postId, tagId);
}
}