-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor #56 Ceo 프로필 기본정보 조회 record 형태로 변경
- Loading branch information
1 parent
733ec24
commit f6f02ee
Showing
1 changed file
with
16 additions
and
10 deletions.
There are no files selected for viewing
26 changes: 16 additions & 10 deletions
26
src/main/java/land/leets/Carrot/domain/user/dto/response/CeoProfileResponse.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,16 +1,22 @@ | ||
package land.leets.Carrot.domain.user.dto.response; | ||
|
||
import land.leets.Carrot.domain.user.entity.Ceo; | ||
import lombok.Getter; | ||
import land.leets.Carrot.domain.user.entity.Gender; | ||
|
||
@Getter | ||
public class CeoProfileResponse extends ProfileResponse { | ||
private final String ceoName; | ||
private final String ceoPhoneNumber; | ||
|
||
public CeoProfileResponse(Ceo ceo) { | ||
super(ceo.getGender(), ceo.getBirthYear()); | ||
this.ceoName = ceo.getCeoName(); | ||
this.ceoPhoneNumber = ceo.getCeoPhoneNumber(); | ||
public record CeoProfileResponse( | ||
String ceoName, | ||
String ceoPhoneNumber, | ||
String ceoAddress, | ||
Gender gender, | ||
Integer birthYear | ||
) implements ProfileResponse { | ||
public static CeoProfileResponse from(Ceo ceo) { | ||
return new CeoProfileResponse( | ||
ceo.getCeoName(), | ||
ceo.getCeoPhoneNumber(), | ||
ceo.getCeoAddress(), | ||
ceo.getGender(), | ||
ceo.getBirthYear() | ||
); | ||
} | ||
} |