From 176dfa555d7fb6d6374fd7e0c19e71fa9cfc09ca Mon Sep 17 00:00:00 2001 From: jinnxyoung Date: Sun, 15 Sep 2024 22:28:36 +0900 Subject: [PATCH] =?UTF-8?q?[#200]=20feat:=20=ED=8F=AC=ED=8A=B8=ED=8F=B4?= =?UTF-8?q?=EB=A6=AC=EC=98=A4=20=EC=9D=B4=EB=A6=84=20=EC=9E=85=EB=A0=A5=20?= =?UTF-8?q?=EA=B8=B0=EB=8A=A5=20=EB=A1=9C=EC=A7=81=20=EC=B6=94=EA=B0=80=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../server/domain/portfolio/service/PortfolioService.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/gongjakso/server/domain/portfolio/service/PortfolioService.java b/src/main/java/com/gongjakso/server/domain/portfolio/service/PortfolioService.java index 6c8c2f3f..f2e64faf 100644 --- a/src/main/java/com/gongjakso/server/domain/portfolio/service/PortfolioService.java +++ b/src/main/java/com/gongjakso/server/domain/portfolio/service/PortfolioService.java @@ -22,6 +22,12 @@ public class PortfolioService { // PortfolioReq -> PortfolioData 변환 private PortfolioData convertToPortfolioData(PortfolioReq portfolioReq) { + String portfolioName = portfolioReq.portfolioName(); + if (portfolioName == null || portfolioName.isEmpty()) { + long existingPortfolioCount = portfolioRepository.countByDeletedAtIsNull(); + portfolioName = "포트폴리오 " + (existingPortfolioCount + 1); + } + List educationList = portfolioReq.educationList() != null ? portfolioReq.educationList().stream() .map(education -> new PortfolioData.Education( @@ -82,7 +88,7 @@ private PortfolioData convertToPortfolioData(PortfolioReq portfolioReq) { .toList() : List.of(); - return new PortfolioData(educationList, workList, activityList, awardList, certificateList, snsList); + return new PortfolioData(portfolioName, educationList, workList, activityList, awardList, certificateList, snsList); } @Transactional