Skip to content

Commit 1b83018

Browse files
committed
Feat: 추억 응답 DTO에 memoryId, spotId 추가
memoryId, spotId 필드 추가 .of() 메서드에서 각각 memory.getId(), memory.getSpot().getId()로 값 설정
1 parent bcad7d6 commit 1b83018

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

back/photorize/src/main/java/com/shutter/photorize/domain/memory/dto/response/MemoryDetailResponse.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,33 +14,39 @@
1414
@NoArgsConstructor
1515
public class MemoryDetailResponse {
1616

17+
private Long memoryId;
1718
private Long writerId;
1819
private String nickname;
1920
private String writerImg;
2021
private List<FileResponse> files;
2122
private LocalDate date;
23+
private Long spotId;
2224
private String spotName;
2325
private String content;
2426

2527
@Builder
26-
private MemoryDetailResponse(Long writerId, String nickname, String writerImg, List<FileResponse> files, LocalDate date,
27-
String spotName, String content) {
28+
private MemoryDetailResponse(Long memoryId, Long writerId, String nickname, String writerImg,
29+
List<FileResponse> files, LocalDate date, Long spotId, String spotName, String content) {
30+
this.memoryId = memoryId;
2831
this.writerId = writerId;
2932
this.nickname = nickname;
3033
this.writerImg = writerImg;
3134
this.files = files;
3235
this.date = date;
36+
this.spotId = spotId;
3337
this.spotName = spotName;
3438
this.content = content;
3539
}
3640

3741
public static MemoryDetailResponse of(Memory memory, List<FileResponse> files) {
3842
return MemoryDetailResponse.builder()
43+
.memoryId(memory.getId())
3944
.writerId(memory.getMember().getId())
4045
.nickname(memory.getMember().getNickname())
4146
.writerImg(memory.getMember().getImg())
4247
.files(files)
4348
.date(LocalDate.from(memory.getDate()))
49+
.spotId(memory.getSpot().getId())
4450
.spotName(memory.getSpot().getName())
4551
.content(memory.getContent())
4652
.build();

0 commit comments

Comments
 (0)