Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hotfix - release 1.1.6 #563

Merged
merged 2 commits into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,24 @@
import lombok.Getter;
import lombok.NoArgsConstructor;

import java.util.Objects;

@Embeddable
@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@AllArgsConstructor(access = AccessLevel.PRIVATE)
public class MoimCuriousPost {
private Long postId;
private String title;
private String idUrl;
private String contents;
private String imgUrl;
private String topic;
private boolean isContainPhoto;

public static MoimCuriousPost of(final Post post) {
return new MoimCuriousPost(
post.getId(),
post.getTitle(),
post.getIdUrl(),
post.getContent(),
Expand All @@ -28,4 +33,16 @@ public static MoimCuriousPost of(final Post post) {
post.isContainPhoto()
);
}

@Override
public int hashCode() {
return postId.intValue();
}

@Override
public boolean equals(Object target) {
MoimCuriousPost targetPost = (MoimCuriousPost) target;

return Objects.equals(this.postId, targetPost.postId);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,34 @@
import lombok.Getter;
import lombok.NoArgsConstructor;

import java.util.Objects;

@Embeddable
@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
public class MoimCuriousWriter {
Long writerNameId;
String name;

private MoimCuriousWriter(final String name) {

private MoimCuriousWriter(final Long writerNameId, final String name) {
this.writerNameId = writerNameId;
this.name = name;
}

public static MoimCuriousWriter of(final WriterName writerName) {
return new MoimCuriousWriter(writerName.getName());
return new MoimCuriousWriter(writerName.getId(), writerName.getName());
}

@Override
public int hashCode() {
return writerNameId.intValue();
}

@Override
public boolean equals(Object target) {
MoimCuriousWriter targetWriter = (MoimCuriousWriter) target;

return Objects.equals(this.name, targetWriter.name) && Objects.equals(this.writerNameId, targetWriter.writerNameId);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ public class MoimPopularInfoService {


@Cacheable(value = "moimPopularInfo", key = "#moim.id")
@AtomicValidateMoimPopulerInfo
public MoimPopularInfo getMoimPopularInfo(final Moim moim) {
return moimPopularInfoRepository.findByMoimId(moim.getId()).orElseGet(
() -> moimPopularInfoRegister.setMostPopularInfoOfMoim(moim)
Expand Down
Loading