From 6220260d69c65ca2524689706658c19aba2fa7b0 Mon Sep 17 00:00:00 2001 From: yummygyudon Date: Sun, 26 Nov 2023 03:22:02 +0900 Subject: [PATCH 1/3] =?UTF-8?q?FEAT=20:=20User=20=EC=84=B8=EB=B6=80=20?= =?UTF-8?q?=EB=B7=B0(=EA=B5=90=ED=99=94=ED=99=9C=EB=8F=99=20=EB=82=B4?= =?UTF-8?q?=EC=97=AD)=20=EC=A1=B0=ED=9A=8C=20Success=20Enum=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 --- .../org/sopt/sopkerton/user/domain/exception/UserSuccess.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/sopt/sopkerton/user/domain/exception/UserSuccess.java b/src/main/java/org/sopt/sopkerton/user/domain/exception/UserSuccess.java index 3af93c8..0a72e31 100644 --- a/src/main/java/org/sopt/sopkerton/user/domain/exception/UserSuccess.java +++ b/src/main/java/org/sopt/sopkerton/user/domain/exception/UserSuccess.java @@ -6,7 +6,8 @@ @AllArgsConstructor public enum UserSuccess implements SuccessBase { - USER_MAIN_VIEW_SUCCESS(HttpStatus.OK, "Get User Main View Data Successful.") + USER_MAIN_VIEW_SUCCESS(HttpStatus.OK, "Get User Main View Data Successful."), + USER_DETAIL_VIEW_SUCCESS(HttpStatus.OK, "Get User Detail View Data Successful.") , ; private final HttpStatus status; From 6a2f81fc849ab0b0c0806812d92c889a518b3559 Mon Sep 17 00:00:00 2001 From: yummygyudon Date: Sun, 26 Nov 2023 03:22:35 +0900 Subject: [PATCH 2/3] =?UTF-8?q?FEAT=20:=20=EA=B5=90=ED=99=94=EB=82=B4?= =?UTF-8?q?=EC=97=AD=20=EB=B0=98=ED=99=98=20=EB=A9=94=EC=84=9C=EB=93=9C=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 --- .../sopkerton/user/service/UserService.java | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/src/main/java/org/sopt/sopkerton/user/service/UserService.java b/src/main/java/org/sopt/sopkerton/user/service/UserService.java index 2ada395..a1cc704 100644 --- a/src/main/java/org/sopt/sopkerton/user/service/UserService.java +++ b/src/main/java/org/sopt/sopkerton/user/service/UserService.java @@ -5,10 +5,13 @@ import org.sopt.sopkerton.user.domain.enums.Gender; import org.sopt.sopkerton.user.domain.exception.UserError; import org.sopt.sopkerton.user.domain.exception.UserException; +import org.sopt.sopkerton.user.dto.response.DetailView; import org.sopt.sopkerton.user.dto.response.MainView; import org.sopt.sopkerton.user.infrastructure.UserRepository; import org.springframework.stereotype.Service; +import java.util.List; + @Service @RequiredArgsConstructor public class UserService { @@ -47,4 +50,38 @@ public MainView getMainViewInfo(Long userId) { RING_RATE ); } + + public DetailView getDetailInfo(Long userId) { + return new DetailView( + makeVolunteers(), + makeCompletedPrograms(), + makeCertifications() + ); + } + + + private List makeVolunteers() { + return List.of( + "어르신 생활편의 보조 도움", + "백합요양원 어른신들 이미용봉사", + "둘레길 환경정화 플로깅 활동", + "용진읍 실로암병원 봉사활동" + ); + } + private List makeCompletedPrograms() { + return List.of( + "사회성향상 프로그램", + "직업훈련 프로그램", + "면접지도 프로그램", + "심리치료 프로그램" + ); + } + private List makeCertifications() { + return List.of( + "지게차운전기능사", + "농기계운전기능사", + "건설기계설비기사", + "산업안전산업기사" + ); + } } From 4e16a4ff23ed1a0c38f1aff052483d7595522481 Mon Sep 17 00:00:00 2001 From: yummygyudon Date: Sun, 26 Nov 2023 03:22:52 +0900 Subject: [PATCH 3/3] =?UTF-8?q?FEAT=20:=20=EA=B5=90=ED=99=94=ED=99=9C?= =?UTF-8?q?=EB=8F=99=20=EC=84=B8=EB=B6=80=20=EB=B7=B0=20=EC=A1=B0=ED=9A=8C?= =?UTF-8?q?=20API=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sopkerton/user/controller/UserController.java | 13 +++++++++++++ .../sopkerton/user/dto/response/DetailView.java | 10 ++++++++++ 2 files changed, 23 insertions(+) create mode 100644 src/main/java/org/sopt/sopkerton/user/dto/response/DetailView.java diff --git a/src/main/java/org/sopt/sopkerton/user/controller/UserController.java b/src/main/java/org/sopt/sopkerton/user/controller/UserController.java index 24f7029..799e846 100644 --- a/src/main/java/org/sopt/sopkerton/user/controller/UserController.java +++ b/src/main/java/org/sopt/sopkerton/user/controller/UserController.java @@ -3,6 +3,7 @@ import lombok.RequiredArgsConstructor; import org.sopt.sopkerton.common.response.ApiResponse; import org.sopt.sopkerton.user.domain.exception.UserSuccess; +import org.sopt.sopkerton.user.dto.response.DetailView; import org.sopt.sopkerton.user.dto.response.MainView; import org.sopt.sopkerton.user.service.UserService; import org.springframework.http.ResponseEntity; @@ -29,4 +30,16 @@ public ResponseEntity> orderMainView( ApiResponse.success(UserSuccess.USER_MAIN_VIEW_SUCCESS, mainViewInfo) ); } + + @GetMapping("/info/detail/{userId}") + public ResponseEntity> orderDetailView( + @PathVariable("userId") Long userId + ) { + DetailView detailInfo = userService.getDetailInfo(userId); + return ResponseEntity + .status(UserSuccess.USER_DETAIL_VIEW_SUCCESS.getHttpStatus()) + .body( + ApiResponse.success(UserSuccess.USER_DETAIL_VIEW_SUCCESS, detailInfo) + ); + } } diff --git a/src/main/java/org/sopt/sopkerton/user/dto/response/DetailView.java b/src/main/java/org/sopt/sopkerton/user/dto/response/DetailView.java new file mode 100644 index 0000000..35e9e2b --- /dev/null +++ b/src/main/java/org/sopt/sopkerton/user/dto/response/DetailView.java @@ -0,0 +1,10 @@ +package org.sopt.sopkerton.user.dto.response; + +import java.util.List; + +public record DetailView( + List volunteers, + List programs, + List certifications +) { +}