Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#70] feat : 게스트버전 관광지 상세보기 #72

Merged
merged 1 commit into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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