Skip to content

Commit

Permalink
refactor(profile): introduction 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobhboy committed Feb 11, 2024
1 parent 55c5c0f commit ec11056
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,29 @@
public record ProfileResponse(
Long userId,
String name,
Integer admissionYear,
String imageUrl,
Major major,
String githubUrl,
String resume,
String portfolio
String portfolio,
Boolean isRecruited,
String company,
String introduction
) {
public static ProfileResponse from(Profile profile) {
return new ProfileResponse(
profile.getWriter().getId(),
profile.getWriter().getName(),
profile.getInformation().getAdmissionYear(),
profile.getInformation().getImageUrl(),
profile.getInformation().getMajor(),
profile.getOnlineProfile().getGithubUrl(),
profile.getOnlineProfile().getResume(),
profile.getOnlineProfile().getPortfolio()
profile.getOnlineProfile().getPortfolio(),
profile.getCompany().getIsRecruited(),
profile.getCompany().getCompany(),
profile.getInformation().getIntroduction()
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,26 @@ public record SimpleProfileResponse(
String name,
Integer admissionYear,
String imageUrl,
Major major

Major major,
Boolean isRecruited,
String company,
String introduction
) {
public static SimpleProfileResponse from(Profile profile) {
String introduction = profile.getInformation().getIntroduction();
if (introduction != null) {
introduction = introduction.substring(0, 20);
}

return new SimpleProfileResponse(
profile.getWriter().getId(),
profile.getWriter().getName(),
profile.getInformation().getAdmissionYear(),
profile.getInformation().getImageUrl(),
profile.getInformation().getMajor()
profile.getInformation().getMajor(),
profile.getCompany().getIsRecruited(),
profile.getCompany().getCompany(),
introduction
);
}
}

0 comments on commit ec11056

Please sign in to comment.