Skip to content

Commit

Permalink
[#200] feat: 포트폴리오 이름 입력 기능 로직 추가 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
jinnxyoung committed Sep 15, 2024
1 parent ff0f5d9 commit 176dfa5
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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<PortfolioData.Education> educationList = portfolioReq.educationList() != null
? portfolioReq.educationList().stream()
.map(education -> new PortfolioData.Education(
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 176dfa5

Please sign in to comment.