Skip to content

Commit

Permalink
Merge pull request #65 from 9oormthon-univ/hyundong
Browse files Browse the repository at this point in the history
feat :: 발급한 복지패스 조회 기능 추가
  • Loading branch information
hyundong-L authored Dec 4, 2024
2 parents 8807a38 + 862e45b commit 176d377
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.danpoong.onchung.domain.policy.controller;

import com.danpoong.onchung.domain.policy.domain.enums.PolicyPath;
import com.danpoong.onchung.domain.policy.dto.PolicyPathRequestDto;
import com.danpoong.onchung.domain.policy.dto.PolicyPathResponseDto;
import com.danpoong.onchung.domain.policy.dto.PolicyResponseDto;
Expand Down Expand Up @@ -37,6 +38,12 @@ public ResponseTemplate<PolicyPathResponseDto> makePolicyPath(
return new ResponseTemplate<>(HttpStatus.CREATED, "복지패스 발급 성공", policyService.makePolicyPath(userId, requestDto));
}

@Operation(summary = "발급 받은 복지패스 조회")
@GetMapping("/path")
public ResponseTemplate<List<PolicyPath>> getPolicyPath(@AuthenticationPrincipal Long userId) {
return new ResponseTemplate<>(HttpStatus.OK, "발급한 복지패스 조회 성공", policyService.getPolicyPaths(userId));
}

@Operation(summary = "정책 추천")
@GetMapping("/recommend")
public ResponseTemplate<List<RecommendResponseDto>> recommend(@RequestParam int cardNum) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ public PolicyPathResponseDto makePolicyPath(Long userId, PolicyPathRequestDto re
.build();
}

public List<PolicyPath> getPolicyPaths(Long userId) {
UserInfo userInfo = userInfoRepository.findById(userId).orElseThrow(() -> new UserNotFoundException("해당 ID의 유저 정보를 찾을 수 없습니다."));
return userInfo.getPolicyPaths();
}

private PolicyPath determinePolicyPath(PolicyPathRequestDto requestDto) {
String interestTopic = requestDto.interestTopic();
String educationStatus = requestDto.educationStatus();
Expand Down

0 comments on commit 176d377

Please sign in to comment.