|
5 | 5 | import boombimapi.domain.place.application.MemberPlaceService; |
6 | 6 | import boombimapi.domain.place.dto.request.ResolveMemberPlaceRequest; |
7 | 7 | import boombimapi.domain.place.dto.request.ViewportRequest; |
8 | | -import boombimapi.domain.place.dto.response.ResolveMemberPlaceResponse; |
| 8 | +import boombimapi.domain.place.dto.response.member.GetMemberPlaceDetailResponse; |
| 9 | +import boombimapi.domain.place.dto.response.member.ResolveMemberPlaceResponse; |
9 | 10 | import boombimapi.domain.place.dto.response.node.ViewportNodeResponse; |
10 | 11 | import boombimapi.global.response.BaseResponse; |
11 | 12 | import io.swagger.v3.oas.annotations.Operation; |
12 | 13 | import io.swagger.v3.oas.annotations.responses.ApiResponse; |
13 | 14 | import io.swagger.v3.oas.annotations.responses.ApiResponses; |
14 | 15 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 16 | +import jakarta.validation.constraints.Max; |
| 17 | +import jakarta.validation.constraints.Min; |
15 | 18 | import java.util.List; |
16 | 19 | import lombok.RequiredArgsConstructor; |
17 | 20 | import org.springframework.http.HttpStatus; |
18 | 21 | import org.springframework.http.ResponseEntity; |
| 22 | +import org.springframework.security.core.annotation.AuthenticationPrincipal; |
| 23 | +import org.springframework.web.bind.annotation.GetMapping; |
| 24 | +import org.springframework.web.bind.annotation.PathVariable; |
19 | 25 | import org.springframework.web.bind.annotation.PostMapping; |
20 | 26 | import org.springframework.web.bind.annotation.RequestBody; |
21 | 27 | import org.springframework.web.bind.annotation.RequestMapping; |
| 28 | +import org.springframework.web.bind.annotation.RequestParam; |
22 | 29 | import org.springframework.web.bind.annotation.RestController; |
23 | 30 |
|
24 | 31 | @RestController |
@@ -52,15 +59,45 @@ public ResponseEntity<BaseResponse<ResolveMemberPlaceResponse>> resolveMemberPla |
52 | 59 | }) |
53 | 60 | @PostMapping |
54 | 61 | public ResponseEntity<BaseResponse<List<ViewportNodeResponse>>> getMemberPlacesInViewport( |
| 62 | + @AuthenticationPrincipal String memberId, |
55 | 63 | @RequestBody ViewportRequest request |
56 | 64 | ) { |
57 | 65 | return ResponseEntity.ok( |
58 | 66 | BaseResponse.of( |
59 | 67 | HttpStatus.OK, |
60 | 68 | GET_MEMBER_PLACES_IN_VIEWPORT_SUCCESS, |
61 | | - memberPlaceService.getViewportNodes(request) |
| 69 | + memberPlaceService.getViewportNodes(memberId, request) |
62 | 70 | ) |
63 | 71 | ); |
64 | 72 | } |
65 | 73 |
|
| 74 | + @Operation(summary = "특정 사용자 장소 상세 조회", description = "특정 사용자 장소를 상세 조회하여 해당 장소에 작성된 혼잡도들을 확인합니다.") |
| 75 | + @ApiResponses(value = { |
| 76 | + @ApiResponse(responseCode = "200", description = "특정 사용자 장소 상세 조회 성공") |
| 77 | + }) |
| 78 | + @GetMapping("/{memberPlaceId}") |
| 79 | + public ResponseEntity<BaseResponse<GetMemberPlaceDetailResponse>> getMemberPlaceDetail( |
| 80 | + @PathVariable Long memberPlaceId, |
| 81 | + @RequestParam(required = false) @Min(1) @Max(100) Integer size, |
| 82 | + @RequestParam(required = false) Long cursor, |
| 83 | + @AuthenticationPrincipal String memberId |
| 84 | + ) { |
| 85 | + |
| 86 | + GetMemberPlaceDetailResponse memberPlaceDetailResponse = memberPlaceService.getMemberPlaceDetail( |
| 87 | + memberId, |
| 88 | + memberPlaceId, |
| 89 | + size, |
| 90 | + cursor |
| 91 | + ); |
| 92 | + |
| 93 | + return ResponseEntity.ok( |
| 94 | + BaseResponse.of( |
| 95 | + HttpStatus.OK, |
| 96 | + GET_MEMBER_PLACE_DETAIL_SUCCESS, |
| 97 | + memberPlaceDetailResponse |
| 98 | + ) |
| 99 | + ); |
| 100 | + |
| 101 | + } |
| 102 | + |
66 | 103 | } |
0 commit comments