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/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; 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 +) { +} 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( + "지게차운전기능사", + "농기계운전기능사", + "건설기계설비기사", + "산업안전산업기사" + ); + } }