Skip to content

Commit 30e45d5

Browse files
committed
[Refactor] Update to use PlaceService, Swagger annotations and BaseResponse in OfficialPlaceController.java
1 parent a7c1de8 commit 30e45d5

1 file changed

Lines changed: 14 additions & 5 deletions

File tree

src/main/java/boombimapi/domain/place/presentation/controller/OfficialPlaceController.java

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,14 @@
22

33
import static boombimapi.global.response.ResponseMessage.*;
44

5-
import boombimapi.domain.place.application.service.impl.OfficialPlaceServiceImpl;
5+
import boombimapi.domain.place.application.service.PlaceService;
66
import boombimapi.domain.place.presentation.dto.request.Viewport;
77
import boombimapi.domain.place.presentation.dto.response.MapMarker;
8-
import boombimapi.global.response.ApiResponse;
8+
import boombimapi.global.response.BaseResponse;
9+
import io.swagger.v3.oas.annotations.Operation;
10+
import io.swagger.v3.oas.annotations.responses.ApiResponse;
11+
import io.swagger.v3.oas.annotations.responses.ApiResponses;
12+
import io.swagger.v3.oas.annotations.tags.Tag;
913
import java.util.List;
1014
import lombok.RequiredArgsConstructor;
1115
import org.springframework.http.HttpStatus;
@@ -18,16 +22,21 @@
1822
@RestController
1923
@RequiredArgsConstructor
2024
@RequestMapping("/official-place")
25+
@Tag(name = "OfficialPlace", description = "공식 장소 API")
2126
public class OfficialPlaceController {
2227

23-
private final OfficialPlaceServiceImpl officialPlaceService;
28+
private final PlaceService officialPlaceService;
2429

30+
@Operation(summary = "뷰포트 내 공식 장소 마커 조회 API", description = "뷰포트 내에 위치한 공식 장소들의 좌표를 리스트로 반환합니다.")
31+
@ApiResponses(value = {
32+
@ApiResponse(responseCode = "200", description = "공식 장소 마커 조회 성공")
33+
})
2534
@PostMapping
26-
public ResponseEntity<ApiResponse<List<MapMarker>>> getMarkersInViewport(
35+
public ResponseEntity<BaseResponse<List<MapMarker>>> getMarkersInViewport(
2736
@RequestBody Viewport viewport
2837
) {
2938
return ResponseEntity.ok(
30-
ApiResponse.of(
39+
BaseResponse.of(
3140
HttpStatus.OK,
3241
GET_OFFICIAL_PLACES_WITHIN_VIEWPORT_SUCCESS,
3342
officialPlaceService.getMarkersInViewport(viewport)

0 commit comments

Comments
 (0)