Skip to content

Commit

Permalink
[#70] feat : 게스트버전 관광지 상세보기
Browse files Browse the repository at this point in the history
  • Loading branch information
mmihye committed Jun 11, 2024
1 parent 9446a98 commit d9691d5
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ public ApiResponse<PlaceDetailRes> getPlaceDetail(@AuthenticationPrincipal Princ
return ApiResponse.success(Success.GET_PLACE_DETAIL_SUCCESS, placeService.getPlaceDetail(principalDetails.getMember(), placeId));
}

@GetMapping("guest/{placeId}")
public ApiResponse<PlaceDetailGuestRes> getPlaceDetail(@PathVariable Long placeId){
return ApiResponse.success(Success.GET_PLACE_DETAIL_SUCCESS, placeService.getGeustPlaceDetail(placeId));
}

@PostMapping("/review/{placeId}")
public ApiResponse<?> createReivew(@AuthenticationPrincipal PrincipalDetails principalDetails,
@RequestPart(required = false) List<MultipartFile> images,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package Journey.Together.domain.place.dto.response;

import Journey.Together.domain.place.entity.Place;

import java.util.List;

public record PlaceDetailGuestRes(
Long placeId,
String name,
String imgae,
String address,
String category,
String overview,
String mapX,
String mapY,

Integer bookmarkNum,

List<Long> disability,
List<String> subDisability,
List<PlaceReviewDto> reviewList
) {
static String cat = "관광지";
public static PlaceDetailGuestRes of(Place place, Integer bookmarkNum, List<Long> disability, List<String> subDisability, List<PlaceReviewDto> reviewList){
if(place.getCategory().equals("B02"))
cat = "숙소";
else if (place.getCategory().equals("A05"))
cat = "맛집";


return new PlaceDetailGuestRes(place.getId(), place.getName(), place.getFirstImg(), place.getAddress(), cat, place.getOverview(), place.getMapX().toString(), place.getMapY().toString(),
bookmarkNum, disability, subDisability, reviewList);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,19 @@ public PlaceDetailRes getPlaceDetail(Member member, Long placeId){

}

public PlaceDetailGuestRes getGeustPlaceDetail(Long placeId){
// PlaceDetailRes of(Place place, Boolean isMark, Integer bookmarkNum, List<String> disability, List<String> subDisability, List< PlaceReviewDto > reviewList)

Place place = getPlace(placeId);

List<PlaceBookmark> placeBookmarkList = placeBookmarkRepository.findAllByPlace(place);
List<Long> disability = disabilityPlaceCategoryRepository.findDisabilityCategoryIds(placeId);
List<String> subDisability = disabilityPlaceCategoryRepository.findDisabilitySubCategoryNames(placeId);

return PlaceDetailGuestRes.of(place, placeBookmarkList.size(), disability, subDisability, null);

}

public SearchPlaceRes searchPlaceList(String category, String query, List<Long> disabilityType, List<Long> detailFilter, String areacode, String sigungucode, String arrange,
Pageable pageable, Double minX, Double maxX, Double minY, Double maxY){
List<PlaceRes> placeResList =new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
.requestMatchers("v1/place/review/{placeReviewId}").permitAll()
.requestMatchers("/v1/plan/guest/**").permitAll()
.requestMatchers("/v1/place/search").permitAll()
.requestMatchers("/v1/place/guest/**").permitAll()
// 메인 페이지, 공고 페이지 등에 한해 인증 정보 없이 접근 가능 (추후 추가)
// 이외의 모든 요청은 인증 정보 필요
.anyRequest().authenticated());
Expand Down

0 comments on commit d9691d5

Please sign in to comment.