Skip to content

Commit

Permalink
fix : 여행지 상세보기 상세유형 ids-> names 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
mmihye committed Jun 10, 2024
1 parent 8ebb1a4 commit 9446a98
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,17 @@ public record PlaceDetailRes(
Integer bookmarkNum,

List<Long> disability,
List<Long> subDisability,
List<String> subDisability,
List<PlaceReviewDto> reviewList
) {
static String cat = "관광지";
public static PlaceDetailRes of(Place place, Boolean isMark, Integer bookmarkNum, List<Long> disability, List<Long> subDisability, List<PlaceReviewDto> reviewList){
public static PlaceDetailRes of(Place place, Boolean isMark, 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 PlaceDetailRes(place.getId(), place.getName(), place.getFirstImg(), place.getAddress(), cat, place.getOverview(), place.getMapX().toString(), place.getMapY().toString(), isMark,
bookmarkNum, disability, subDisability, reviewList);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public interface DisabilityPlaceCategoryRepository extends JpaRepository<Disabil
"WHERE dpc.place.id = :placeId")
List<Long> findDisabilityCategoryIds(@Param("placeId") long placeId);

@Query("SELECT DISTINCT dpc.subCategory.id FROM DisabilityPlaceCategory dpc " +
@Query("SELECT DISTINCT dpc.subCategory.subname FROM DisabilityPlaceCategory dpc " +
"WHERE dpc.place.id = :placeId")
List<Long> findDisabilitySubCategoryIds(@Param("placeId") long placeId);
List<String> findDisabilitySubCategoryNames(@Param("placeId") long placeId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public PlaceDetailRes getPlaceDetail(Member member, Long placeId){
.anyMatch(placeBookmark -> placeBookmark.getMember().equals(member));

List<Long> disability = disabilityPlaceCategoryRepository.findDisabilityCategoryIds(placeId);
List<Long> subDisability = disabilityPlaceCategoryRepository.findDisabilitySubCategoryIds(placeId);
List<String> subDisability = disabilityPlaceCategoryRepository.findDisabilitySubCategoryNames(placeId);

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

Expand Down

0 comments on commit 9446a98

Please sign in to comment.