From 482adbe4a7fb1f9ac3ddee282af07ece55d47d03 Mon Sep 17 00:00:00 2001 From: jinnxyoung Date: Sun, 15 Sep 2024 22:25:13 +0900 Subject: [PATCH 1/4] =?UTF-8?q?[#200]=20feat:=20=ED=8F=AC=ED=8A=B8?= =?UTF-8?q?=ED=8F=B4=EB=A6=AC=EC=98=A4=20=EC=9D=B4=EB=A6=84=20=ED=95=84?= =?UTF-8?q?=EB=93=9C=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../server/domain/portfolio/dto/request/PortfolioReq.java | 6 ++++++ .../server/domain/portfolio/dto/response/PortfolioRes.java | 2 ++ .../gongjakso/server/domain/portfolio/vo/PortfolioData.java | 6 ++++++ 3 files changed, 14 insertions(+) diff --git a/src/main/java/com/gongjakso/server/domain/portfolio/dto/request/PortfolioReq.java b/src/main/java/com/gongjakso/server/domain/portfolio/dto/request/PortfolioReq.java index 0248b7e4..328a4e86 100644 --- a/src/main/java/com/gongjakso/server/domain/portfolio/dto/request/PortfolioReq.java +++ b/src/main/java/com/gongjakso/server/domain/portfolio/dto/request/PortfolioReq.java @@ -1,11 +1,14 @@ package com.gongjakso.server.domain.portfolio.dto.request; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.Size; import java.time.LocalDate; import java.util.List; import lombok.Builder; @Builder public record PortfolioReq ( + String portfolioName, List educationList, List workList, List activityList, @@ -35,18 +38,21 @@ public record Activty ( Boolean isActive ) { } + public record Award ( String contestName, String awardName, LocalDate awardDate ) { } + public record Certificate ( String name, String rating, LocalDate certificationDate ) { } + public record Sns ( String snsLink ) { diff --git a/src/main/java/com/gongjakso/server/domain/portfolio/dto/response/PortfolioRes.java b/src/main/java/com/gongjakso/server/domain/portfolio/dto/response/PortfolioRes.java index 8771a902..a28ea0fb 100644 --- a/src/main/java/com/gongjakso/server/domain/portfolio/dto/response/PortfolioRes.java +++ b/src/main/java/com/gongjakso/server/domain/portfolio/dto/response/PortfolioRes.java @@ -10,6 +10,7 @@ @JsonInclude(JsonInclude.Include.NON_NULL) public record PortfolioRes ( Long id, + String portfolioName, List educationList, List workList, List activityList, @@ -21,6 +22,7 @@ public static PortfolioRes from(Portfolio portfolio) { PortfolioData portfolioData = portfolio.getPortfolioData(); return new PortfolioRes( portfolio.getId(), + portfolioData.portfolioName(), portfolioData.educationList(), portfolioData.workList(), portfolioData.activityList(), diff --git a/src/main/java/com/gongjakso/server/domain/portfolio/vo/PortfolioData.java b/src/main/java/com/gongjakso/server/domain/portfolio/vo/PortfolioData.java index 28f80f00..a67c8420 100644 --- a/src/main/java/com/gongjakso/server/domain/portfolio/vo/PortfolioData.java +++ b/src/main/java/com/gongjakso/server/domain/portfolio/vo/PortfolioData.java @@ -4,6 +4,7 @@ import java.util.List; public record PortfolioData ( + String portfolioName, List educationList, List workList, List activityList, @@ -17,6 +18,7 @@ public record Education ( Boolean isActive ) { } + public record Work ( String company, String partition, @@ -26,23 +28,27 @@ public record Work ( String detail ) { } + public record Activity ( String name, Boolean isActive ) { } + public record Award ( String contestName, String awardName, LocalDate awardDate ) { } + public record Certificate ( String name, String rating, LocalDate certificationDate ) { } + public record Sns ( String snsLink ) { From ff0f5d9646b52a37b216200e973df033d2176fbf Mon Sep 17 00:00:00 2001 From: jinnxyoung Date: Sun, 15 Sep 2024 22:27:01 +0900 Subject: [PATCH 2/4] =?UTF-8?q?[#200]=20feat:=20=EC=82=AD=EC=A0=9C?= =?UTF-8?q?=EB=90=9C=20=ED=8F=AC=ED=8A=B8=ED=8F=B4=EB=A6=AC=EC=98=A4?= =?UTF-8?q?=EB=A5=BC=20=EC=A0=9C=EC=99=B8=ED=95=9C=20=EA=B0=9C=EC=88=98=20?= =?UTF-8?q?Count=20=EB=A9=94=EC=86=8C=EB=93=9C=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../server/domain/portfolio/repository/PortfolioRepository.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/com/gongjakso/server/domain/portfolio/repository/PortfolioRepository.java b/src/main/java/com/gongjakso/server/domain/portfolio/repository/PortfolioRepository.java index d61eea7f..d4bc90fc 100644 --- a/src/main/java/com/gongjakso/server/domain/portfolio/repository/PortfolioRepository.java +++ b/src/main/java/com/gongjakso/server/domain/portfolio/repository/PortfolioRepository.java @@ -6,4 +6,6 @@ public interface PortfolioRepository extends JpaRepository { Optional findByIdAndDeletedAtIsNull(Long portfolioId); + + long countByDeletedAtIsNull(); } From 176dfa555d7fb6d6374fd7e0c19e71fa9cfc09ca Mon Sep 17 00:00:00 2001 From: jinnxyoung Date: Sun, 15 Sep 2024 22:28:36 +0900 Subject: [PATCH 3/4] =?UTF-8?q?[#200]=20feat:=20=ED=8F=AC=ED=8A=B8?= =?UTF-8?q?=ED=8F=B4=EB=A6=AC=EC=98=A4=20=EC=9D=B4=EB=A6=84=20=EC=9E=85?= =?UTF-8?q?=EB=A0=A5=20=EA=B8=B0=EB=8A=A5=20=EB=A1=9C=EC=A7=81=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80=20=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 From c0fa3ea98b60d34badcbe7cb827ec76df236944e Mon Sep 17 00:00:00 2001 From: jinnxyoung Date: Sun, 15 Sep 2024 23:21:53 +0900 Subject: [PATCH 4/4] =?UTF-8?q?[#200]=20feat:=20portfolioName=20=ED=95=84?= =?UTF-8?q?=EB=93=9C=EC=97=90=20Annotation=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../server/domain/portfolio/dto/request/PortfolioReq.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/com/gongjakso/server/domain/portfolio/dto/request/PortfolioReq.java b/src/main/java/com/gongjakso/server/domain/portfolio/dto/request/PortfolioReq.java index 328a4e86..3043f9bb 100644 --- a/src/main/java/com/gongjakso/server/domain/portfolio/dto/request/PortfolioReq.java +++ b/src/main/java/com/gongjakso/server/domain/portfolio/dto/request/PortfolioReq.java @@ -1,6 +1,7 @@ package com.gongjakso.server.domain.portfolio.dto.request; import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.annotation.Nullable; import jakarta.validation.constraints.Size; import java.time.LocalDate; import java.util.List; @@ -8,6 +9,7 @@ @Builder public record PortfolioReq ( + @Nullable String portfolioName, List educationList, List workList,