From ec1105693a5399d74bc063e8e894334dc677db38 Mon Sep 17 00:00:00 2001 From: bo Date: Sun, 11 Feb 2024 21:26:16 +0900 Subject: [PATCH] =?UTF-8?q?refactor(profile):=20introduction=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../presentation/dto/ProfileResponse.java | 12 ++++++++++-- .../presentation/dto/SimpleProfileResponse.java | 16 +++++++++++++--- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/sickgyun/server/profile/presentation/dto/ProfileResponse.java b/src/main/java/com/sickgyun/server/profile/presentation/dto/ProfileResponse.java index ef48914..7862b44 100644 --- a/src/main/java/com/sickgyun/server/profile/presentation/dto/ProfileResponse.java +++ b/src/main/java/com/sickgyun/server/profile/presentation/dto/ProfileResponse.java @@ -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() ); } } diff --git a/src/main/java/com/sickgyun/server/profile/presentation/dto/SimpleProfileResponse.java b/src/main/java/com/sickgyun/server/profile/presentation/dto/SimpleProfileResponse.java index ddcd979..3b20f16 100644 --- a/src/main/java/com/sickgyun/server/profile/presentation/dto/SimpleProfileResponse.java +++ b/src/main/java/com/sickgyun/server/profile/presentation/dto/SimpleProfileResponse.java @@ -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 ); } }