From 9d0dec973632210dc8a59bc26a4880c6ccac6568 Mon Sep 17 00:00:00 2001 From: Kim Daehyeon Date: Wed, 28 Feb 2024 21:04:09 +0900 Subject: [PATCH 1/3] =?UTF-8?q?feat:=20=EC=9E=90=EA=B8=B0=EC=86=8C?= =?UTF-8?q?=EA=B0=9C=20=EC=A1=B0=ED=9A=8C=20=EC=9D=91=EB=8B=B5=EC=97=90=20?= =?UTF-8?q?=ED=95=99=EB=B2=88,=20=EC=9D=B4=EB=A6=84=20=EC=B6=94=EA=B0=80?= =?UTF-8?q?=20-=20#41?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/response/introduce/IntroduceGetResponseData.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/org/mjulikelion/baker/dto/response/introduce/IntroduceGetResponseData.java b/src/main/java/org/mjulikelion/baker/dto/response/introduce/IntroduceGetResponseData.java index 6598ff7..03ef18a 100644 --- a/src/main/java/org/mjulikelion/baker/dto/response/introduce/IntroduceGetResponseData.java +++ b/src/main/java/org/mjulikelion/baker/dto/response/introduce/IntroduceGetResponseData.java @@ -8,6 +8,10 @@ @Builder public class IntroduceGetResponseData { + @JsonProperty + private final String studentId; + @JsonProperty + private final String name; @JsonProperty private final Part part; @JsonProperty From 817c9feb7f4ad1b6becb110cc3944ecc77e3b349 Mon Sep 17 00:00:00 2001 From: Kim Daehyeon Date: Wed, 28 Feb 2024 21:04:37 +0900 Subject: [PATCH 2/3] =?UTF-8?q?feat:=20=EC=9E=90=EA=B8=B0=EC=86=8C?= =?UTF-8?q?=EA=B0=9C=20=EC=A1=B0=ED=9A=8C=20=EC=8B=9C=20=EC=A7=80=EC=9B=90?= =?UTF-8?q?=EC=84=9C=20id=EB=A1=9C=20=EC=A1=B0=ED=9A=8C=ED=95=98=EB=8F=84?= =?UTF-8?q?=EB=A1=9D=20=EB=B3=80=EA=B2=BD,=20=EB=A6=AC=ED=8C=A9=ED=84=B0?= =?UTF-8?q?=EB=A7=81=20-=20#41?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 학번, 이름 세팅 추가 --- .../baker/service/introduce/IntroduceQueryService.java | 3 ++- .../service/introduce/IntroduceQueryServiceImpl.java | 10 ++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/mjulikelion/baker/service/introduce/IntroduceQueryService.java b/src/main/java/org/mjulikelion/baker/service/introduce/IntroduceQueryService.java index 3e83144..0222448 100644 --- a/src/main/java/org/mjulikelion/baker/service/introduce/IntroduceQueryService.java +++ b/src/main/java/org/mjulikelion/baker/service/introduce/IntroduceQueryService.java @@ -1,9 +1,10 @@ package org.mjulikelion.baker.service.introduce; +import java.util.UUID; import org.mjulikelion.baker.dto.response.ResponseDto; import org.mjulikelion.baker.dto.response.introduce.IntroduceGetResponseData; import org.springframework.http.ResponseEntity; public interface IntroduceQueryService { - ResponseEntity> getStudentIntroduce(String studentId); + ResponseEntity> getStudentIntroduce(UUID applicationId); } diff --git a/src/main/java/org/mjulikelion/baker/service/introduce/IntroduceQueryServiceImpl.java b/src/main/java/org/mjulikelion/baker/service/introduce/IntroduceQueryServiceImpl.java index ec0825b..511b66d 100644 --- a/src/main/java/org/mjulikelion/baker/service/introduce/IntroduceQueryServiceImpl.java +++ b/src/main/java/org/mjulikelion/baker/service/introduce/IntroduceQueryServiceImpl.java @@ -33,21 +33,23 @@ public class IntroduceQueryServiceImpl implements IntroduceQueryService { @Override @Transactional(readOnly = true) - public ResponseEntity> getStudentIntroduce(String studentId) { - Application application = this.findApplicationByStudentId(studentId); + public ResponseEntity> getStudentIntroduce(UUID applicationId) { + Application application = this.findApplicationById(applicationId); List applicationIntroduceList = this.findApplicationIntroduces(application.getId()); List introduceDetailVOList = this.buildIntroduceDetailVOList(applicationIntroduceList); IntroduceGetResponseData introduceGetResponseData = IntroduceGetResponseData.builder() .introduceDetailVOList(introduceDetailVOList) + .studentId(application.getStudentId()) + .name(application.getName()) .part(application.getPart()) .build(); return ResponseEntity.ok(ResponseDto.res(HttpStatus.OK, "OK", introduceGetResponseData)); } - private Application findApplicationByStudentId(String studentId) { - return this.applicationRepository.findByStudentId(studentId) + private Application findApplicationById(UUID applicationId) { + return this.applicationRepository.findById(applicationId) .orElseThrow(() -> new ApplicationNotFoundException(APPLICATION_NOT_FOUND_ERROR)); } From d311e7ec495a59ad3de77b19e99ae3963bdc4c09 Mon Sep 17 00:00:00 2001 From: Kim Daehyeon Date: Wed, 28 Feb 2024 21:04:56 +0900 Subject: [PATCH 3/3] =?UTF-8?q?feat:=20=EC=9E=90=EA=B8=B0=EC=86=8C?= =?UTF-8?q?=EA=B0=9C=20=EC=A1=B0=ED=9A=8C=20api=20=EC=A7=80=EC=9B=90?= =?UTF-8?q?=EC=84=9C=20id=EB=A1=9C=20=ED=95=98=EB=8F=84=EB=A1=9D=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD=20-=20#41?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../baker/controller/IntroduceController.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/main/java/org/mjulikelion/baker/controller/IntroduceController.java b/src/main/java/org/mjulikelion/baker/controller/IntroduceController.java index 1b062e4..1428662 100644 --- a/src/main/java/org/mjulikelion/baker/controller/IntroduceController.java +++ b/src/main/java/org/mjulikelion/baker/controller/IntroduceController.java @@ -1,8 +1,6 @@ package org.mjulikelion.baker.controller; -import static org.mjulikelion.baker.constant.RegexPatterns.APPLICATION_STUDENT_ID_PATTERN; - -import jakarta.validation.constraints.Pattern; +import java.util.UUID; import lombok.AllArgsConstructor; import org.mjulikelion.baker.dto.response.ResponseDto; import org.mjulikelion.baker.dto.response.introduce.IntroduceGetResponseData; @@ -19,11 +17,10 @@ public class IntroduceController { private final IntroduceQueryService introduceQueryService; @GetMapping("/introduces") - @Cacheable(value = "applicationByStudentId", key = "#studentId") + @Cacheable(value = "applicationByApplicationId", key = "#applicationId") public ResponseEntity> getStudentIntroduce( - @RequestParam(value = "studentId") - @Pattern(regexp = APPLICATION_STUDENT_ID_PATTERN, message = "학번이 형식에 맞지 않습니다.") String studentId + @RequestParam(value = "applicationId") UUID applicationId ) { - return this.introduceQueryService.getStudentIntroduce(studentId); + return this.introduceQueryService.getStudentIntroduce(applicationId); } }