-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* [FIx] 주석 제거 * [Fix] GiftSimpleDto 필드 추가, 정적 팩토리 메서드 적용 * [Fix] 서비스단 정적 팩토리 메서드 적용 * [Fix] 메서드 레퍼런스 수정
- Loading branch information
Showing
4 changed files
with
30 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 21 additions & 8 deletions
29
favor/src/main/java/com/favor/favor/gift/GiftSimpleDto.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,40 @@ | ||
package com.favor.favor.gift; | ||
|
||
import com.favor.favor.photo.GiftPhoto; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
|
||
import java.time.LocalDate; | ||
import java.util.List; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
@Builder | ||
public class GiftSimpleDto { | ||
private Long giftNo; | ||
private String giftName; | ||
private LocalDate giftDate; | ||
private List<GiftPhoto> photoList; | ||
private Boolean isPinned; | ||
private Boolean isGiven; | ||
|
||
@Builder | ||
public GiftSimpleDto(Gift gift){ | ||
this.giftNo = gift.getGiftNo(); | ||
this.giftName = gift.getGiftName(); | ||
this.giftDate = gift.getGiftDate(); | ||
this.photoList = gift.getGiftPhotoList(); | ||
private GiftSimpleDto(Long giftNo, String giftName, LocalDate giftDate, List<GiftPhoto> photoList, Boolean isPinned, Boolean isGiven){ | ||
this.giftNo = giftNo; | ||
this.giftName = giftName; | ||
this.giftDate = giftDate; | ||
this.photoList = photoList; | ||
this.isPinned = isPinned; | ||
this.isGiven = isGiven; | ||
} | ||
|
||
public static GiftSimpleDto from(Gift gift){ | ||
return GiftSimpleDto.builder() | ||
.giftNo(gift.getGiftNo()) | ||
.giftName(gift.getGiftName()) | ||
.giftDate(gift.getGiftDate()) | ||
.photoList(gift.getGiftPhotoList()) | ||
.isPinned(gift.getIsPinned()) | ||
.isGiven(gift.getIsGiven()) | ||
.build(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters