Skip to content
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 @@ -89,7 +89,7 @@ private Map<Long, String> mapToNoteIdAndImageId(List<Image> imageList) {
public UserNoteGetResponse findNote(Long noteId) {
Limjang note = noteFinder.getNoteByIdWithAddressAndNotePriceWhereDeletedIsFalse(noteId);
boolean isShared = sharedNoteFinder.existsByDeletedAtIsNullAndLimjang(note);
return UserNoteGetResponse.of(isShared, note);
return UserNoteGetResponse.of(isShared, note, note.getAddressEntity());
}

public ChecklistConditionResponse checkLimjangChecklistSatisfaction(Long limjangId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import java.util.List;

import umc.th.juinjang.domain.image.model.Image;
import umc.th.juinjang.domain.limjang.model.Address;
import umc.th.juinjang.domain.limjang.model.Limjang;
import umc.th.juinjang.domain.limjang.model.LimjangPriceType;
import umc.th.juinjang.domain.limjang.model.LimjangPropertyType;
Expand All @@ -22,22 +23,33 @@ public record UserNoteGetResponse(
String monthlyRent,
String updatedAt,
String floor,
Integer pyong
Integer pyong,
String bcode,
String sido,
String sigungu,
String bname1,
String bname2
) {
public static UserNoteGetResponse of(boolean isShared, Limjang note) {
public static UserNoteGetResponse of(boolean isShared, Limjang note, Address address) {
return new UserNoteGetResponse(
isShared,
note.getPurpose(),
note.getPropertyType(),
note.getPriceType(),
note.getNickname(),
note.getImageList().stream().map(Image::getImageUrl).limit(3).toList(),
note.getAddressEntity().getRoadAddress(),
note.getAddressEntity().getAddressDetail(),
address.getRoadAddress(),
address.getAddressDetail(),
note.getLimjangPrice().getPrice(note.getPriceType(), note.getPurpose()),
note.getPriceType() == LimjangPriceType.MONTHLY_RENT ? note.getLimjangPrice().getMonthlyRent() : null,
note.getUpdatedAt().format(DateTimeFormatter.ofPattern("yy.MM.dd")),
note.getFloor(),
note.getPyong());
note.getPyong(),
address.getBcode(),
address.getSido(),
address.getSigungo(),
address.getBname1(),
address.getBname2()
);
}
}