22
33import io .swagger .v3 .oas .annotations .Operation ;
44import io .swagger .v3 .oas .annotations .Parameter ;
5+ import io .swagger .v3 .oas .annotations .media .ArraySchema ;
56import io .swagger .v3 .oas .annotations .tags .Tag ;
67import lombok .RequiredArgsConstructor ;
78import org .springframework .http .ResponseEntity ;
89import org .springframework .web .bind .annotation .*;
910import shympyo .global .response .CommonResponse ;
1011import shympyo .global .response .ResponseUtil ;
12+ import shympyo .map .domain .PlaceType ;
1113import shympyo .map .dto .NearbyListResponse ;
1214import shympyo .map .dto .NearbyMapResponse ;
1315import shympyo .map .dto .PlaceDetailResponse ;
@@ -25,40 +27,103 @@ public class MapController {
2527
2628 @ Operation (
2729 summary = "주변 장소 지도 조회" ,
28- description = "위도(lat), 경도(lon) 좌표를 기준으로 반경 내 장소를 지도 형태로 조회한다."
30+ description = """
31+ 위도(lat), 경도(lon) 좌표를 기준으로 반경 내 장소를 지도용으로 조회한다.
32+
33+ - `radius` : 검색 반경 (미터), 최소 1m ~ 최대 5km
34+ - `limit` : 조회 최대 개수, 최대 200
35+ - `types` : 조회할 장소 타입 필터 (예: CULTURE, SHELTER, USER_SHELTER 등).
36+ - 여러 개 지정 가능 → `types=CULTURE&types=SHELTER`
37+ - 쉼표 구분도 가능 → `types=CULTURE,SHELTER`
38+ - 비워두면 모든 타입 조회
39+ """
2940 )
3041 @ GetMapping ("/nearby" )
3142 public ResponseEntity <CommonResponse <List <NearbyMapResponse >>> nearby (
32- @ Parameter (description = "위도" , example = "37.5665" ) @ RequestParam double lat ,
33- @ Parameter (description = "경도" , example = "126.9780" ) @ RequestParam double lon ,
34- @ Parameter (description = "검색 반경 (미터)" , example = "200" ) @ RequestParam (defaultValue = "100" ) int radius ,
35- @ Parameter (description = "조회 최대 개수" , example = "50" ) @ RequestParam (defaultValue = "100" ) int limit
43+ @ Parameter (description = "위도" , example = "37.5665" )
44+ @ RequestParam double lat ,
45+
46+ @ Parameter (description = "경도" , example = "126.9780" )
47+ @ RequestParam double lon ,
48+
49+ @ Parameter (description = "검색 반경 (m)" , example = "200" )
50+ @ RequestParam (defaultValue = "100" ) int radius ,
51+
52+ @ Parameter (description = "조회 최대 개수" , example = "50" )
53+ @ RequestParam (defaultValue = "100" ) int limit ,
54+
55+ @ Parameter (
56+ description = "조회할 타입 목록. 예: types=CULTURE,SHELTER or types=CULTURE&types=SHELTER" ,
57+ array = @ io .swagger .v3 .oas .annotations .media .ArraySchema (
58+ schema = @ io .swagger .v3 .oas .annotations .media .Schema (implementation = shympyo .map .domain .PlaceType .class )
59+ )
60+ )
61+ @ RequestParam (name = "types" , required = false ) List <PlaceType > types
3662 ) {
37- return ResponseUtil .success (mapService .findNearby (lat , lon , radius , limit ));
63+ return ResponseUtil .success (mapService .findNearby (lat , lon , radius , limit , types ));
3864 }
3965
66+
67+
4068 @ Operation (
4169 summary = "주변 장소 목록 조회" ,
42- description = "위도(lat), 경도(lon) 좌표를 기준으로 반경 내 장소를 리스트 형태로 조회한다."
70+ description = """
71+ 위도(lat), 경도(lon) 좌표를 기준으로 반경 내 장소를 리스트 형태로 조회한다.
72+
73+ - `radius` : 검색 반경 (미터), 최소 1m ~ 최대 5km
74+ - `limit` : 조회 최대 개수, 최대 200
75+ - `types` : 조회할 장소 타입 필터 (예: CULTURE, SHELTER, USER_SHELTER 등).
76+ - 여러 개 지정 가능 → `types=CULTURE&types=SHELTER`
77+ - 쉼표 구분도 가능 → `types=CULTURE,SHELTER`
78+ - 비워두면 모든 타입 조회
79+ """
4380 )
4481 @ GetMapping ("/nearby-list" )
4582 public ResponseEntity <CommonResponse <List <NearbyListResponse >>> nearbyList (
46- @ Parameter (description = "위도" , example = "37.5665" ) @ RequestParam double lat ,
47- @ Parameter (description = "경도" , example = "126.9780" ) @ RequestParam double lon ,
48- @ Parameter (description = "검색 반경 (미터)" , example = "200" ) @ RequestParam (defaultValue = "100" ) int radius ,
49- @ Parameter (description = "조회 최대 개수" , example = "20" ) @ RequestParam (defaultValue = "50" ) int limit
83+ @ Parameter (description = "위도" , example = "37.5665" )
84+ @ RequestParam double lat ,
85+
86+ @ Parameter (description = "경도" , example = "126.9780" )
87+ @ RequestParam double lon ,
88+
89+ @ Parameter (description = "검색 반경 (m)" , example = "200" )
90+ @ RequestParam (defaultValue = "100" ) int radius ,
91+
92+ @ Parameter (description = "조회 최대 개수" , example = "50" )
93+ @ RequestParam (defaultValue = "50" ) int limit ,
94+
95+ @ Parameter (
96+ description = "조회할 타입 목록. 여러 개 가능 (예: CULTURE,SHELTER)" ,
97+ array = @ ArraySchema (
98+ schema = @ io .swagger .v3 .oas .annotations .media .Schema (implementation = shympyo .map .domain .PlaceType .class )
99+ )
100+ )
101+ @ RequestParam (name = "types" , required = false ) List <PlaceType > types
102+ ) {
103+ return ResponseUtil .success (mapService .findNearbyList (lat , lon , radius , limit , types ));
104+ }
105+
106+
107+ @ Operation (
108+ summary = "공공 쉼터 상세 조회" ,
109+ description = "공공 데이터(Map)에 등록된 쉼터의 상세 정보를 조회한다."
110+ )
111+ @ GetMapping ("/public/{id}" )
112+ public ResponseEntity <CommonResponse <PlaceDetailResponse >> getMap (
113+ @ Parameter (description = "공공 쉼터 ID" , example = "123" )
114+ @ PathVariable Long id
50115 ) {
51- return ResponseUtil .success (mapService .findNearbyList ( lat , lon , radius , limit ));
116+ return ResponseUtil .success (mapService .getMap ( id ));
52117 }
53118
54119 @ Operation (
55- summary = "장소 상세 조회" ,
56- description = "장소 ID를 사용해 상세 정보를 조회한다."
120+ summary = "사용자 제공 쉼터 상세 조회" ,
121+ description = "민간 데이터(Place)에 등록된 쉼터의 상세 정보를 조회한다."
57122 )
58- @ GetMapping ("/{id}" )
59- public ResponseEntity <CommonResponse <PlaceDetailResponse >> place (
60- @ Parameter ( description = "장소 ID" , example = "123" ) @ PathVariable Long id
123+ @ GetMapping ("/user/ {id}" )
124+ public ResponseEntity <CommonResponse <PlaceDetailResponse >> getPlace (
125+ @ PathVariable Long id
61126 ) {
62- return ResponseUtil .success (mapService .findPlace (id ));
127+ return ResponseUtil .success (mapService .getPlace (id ));
63128 }
64129}
0 commit comments