Skip to content

Commit

Permalink
refactor #56 Ceo 프로필 기본정보 조회 record 형태로 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
huncozyboy committed Nov 10, 2024
1 parent 733ec24 commit f6f02ee
Showing 1 changed file with 16 additions and 10 deletions.
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()
);
}
}

0 comments on commit f6f02ee

Please sign in to comment.