@@ -74,10 +74,7 @@ public GetReviewPlaceDetailRes getReviewPlaceDetail(Long placeId) {
7474 Place place = findPlaceById (placeId );
7575
7676 // 식당, 카페만 조회 가능하도록 제한
77- if (place .getType () != PlaceType .CAFETERIA && place .getType () != PlaceType .CAFE
78- && place .getType () != PlaceType .CAFE_TEMP && place .getType () != PlaceType .CAFT_TEMP && place .getType () != PlaceType .CONV_TEMP ) {
79- throw new GlobalException (ResultCode .NOT_SUPPORTED_PLACE_TYPE );
80- }
77+ checkReviewPlaceType (place );
8178
8279 // 장소 대표 사진 조회 (사진 5장 제한 - 원본 사진)
8380 List <SearchPlaceImageRes > placeImageList = new ArrayList <>();
@@ -119,9 +116,7 @@ public List<SearchReviewImageRes> getReviewPlaceDetailImages(Long placeId, Long
119116 Place place = findPlaceById (placeId );
120117
121118 // 식당, 카페만 조회 가능하도록 제한
122- if (place .getType () != PlaceType .CAFETERIA && place .getType () != PlaceType .CAFE ) {
123- throw new GlobalException (ResultCode .NOT_SUPPORTED_PLACE_TYPE );
124- }
119+ checkReviewPlaceType (place );
125120
126121 // 리뷰 전체 이미지 조회(원본 - 10장까지)
127122 return fileRepository .getReviewFilesByPlaceWithPage (placeId , lastFileId , 10 ).stream ().map (file -> new SearchReviewImageRes (file .getId (), file .getFileSavedName ())).toList ();
@@ -277,6 +272,17 @@ private Review findReviewById(Long reviewId) {
277272 return reviewRepository .findById (reviewId ).orElseThrow (() -> new GlobalException (ResultCode .NOT_FOUND_REVIEW ));
278273 }
279274
275+ /**
276+ * 리뷰에 해당하는 장소 타입인지 확인
277+ */
278+ private void checkReviewPlaceType (Place place ) {
279+ // 식당, 카페만 조회 가능하도록 제한
280+ if (place .getType () != PlaceType .CAFETERIA && place .getType () != PlaceType .CAFE
281+ && place .getType () != PlaceType .CAFE_TEMP && place .getType () != PlaceType .CAFT_TEMP && place .getType () != PlaceType .CONV_TEMP ) {
282+ throw new GlobalException (ResultCode .NOT_SUPPORTED_PLACE_TYPE );
283+ }
284+ }
285+
280286 /**
281287 * 장소별 리뷰 태그 조회
282288 */
0 commit comments