From 9bd2a88ca92bea5227d2244e60981ec35457586d Mon Sep 17 00:00:00 2001 From: StoneCAU Date: Fri, 21 Feb 2025 04:55:25 +0900 Subject: [PATCH 1/7] =?UTF-8?q?fix:=20=EC=9E=A5=EC=86=8C=20=EA=B2=80?= =?UTF-8?q?=EC=83=89=20=EC=8B=9C=20=EC=82=AC=EC=A7=84=EC=9D=B4=20=EC=97=86?= =?UTF-8?q?=EC=9C=BC=EB=A9=B4=20null=20=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/mapping/placeCourse/service/PlaceCourseService.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/umc/catchy/domain/mapping/placeCourse/service/PlaceCourseService.java b/src/main/java/umc/catchy/domain/mapping/placeCourse/service/PlaceCourseService.java index 8b67546b..dd757e97 100644 --- a/src/main/java/umc/catchy/domain/mapping/placeCourse/service/PlaceCourseService.java +++ b/src/main/java/umc/catchy/domain/mapping/placeCourse/service/PlaceCourseService.java @@ -366,6 +366,8 @@ private String parsePlaceImageFromJson(String response) throws Exception { } } + if (photoReference.isBlank()) return null; + // photo_reference로 photo_url 받아오기 String query = String.format( "photo?maxwidth=400&photoreference=%s&key=GOOGLE_API_KEY", From c3e615f12156ab9a90955f87d396d47a2467143a Mon Sep 17 00:00:00 2001 From: StoneCAU Date: Fri, 21 Feb 2025 05:00:13 +0900 Subject: [PATCH 2/7] =?UTF-8?q?fix:=20isVisited=20=ED=95=84=EB=93=9C?= =?UTF-8?q?=EB=AA=85=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapping/placeCourse/dto/response/PlaceInfoDetail.java | 2 +- .../java/umc/catchy/domain/place/converter/PlaceConverter.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/umc/catchy/domain/mapping/placeCourse/dto/response/PlaceInfoDetail.java b/src/main/java/umc/catchy/domain/mapping/placeCourse/dto/response/PlaceInfoDetail.java index 973d7898..2863b9a7 100644 --- a/src/main/java/umc/catchy/domain/mapping/placeCourse/dto/response/PlaceInfoDetail.java +++ b/src/main/java/umc/catchy/domain/mapping/placeCourse/dto/response/PlaceInfoDetail.java @@ -20,6 +20,6 @@ public class PlaceInfoDetail { private Long reviewCount; private Double placeLatitude; private Double placeLongitude; - private boolean visited; + private boolean isVisited; private boolean liked; } diff --git a/src/main/java/umc/catchy/domain/place/converter/PlaceConverter.java b/src/main/java/umc/catchy/domain/place/converter/PlaceConverter.java index cfbe92b2..dd5237ba 100644 --- a/src/main/java/umc/catchy/domain/place/converter/PlaceConverter.java +++ b/src/main/java/umc/catchy/domain/place/converter/PlaceConverter.java @@ -78,7 +78,7 @@ public static PlaceInfoDetail toPlaceInfoDetail (Place place, Long reviewCount, .reviewCount(reviewCount) .placeLatitude(place.getLatitude()) .placeLongitude(place.getLongitude()) - .visited(isVisited) + .isVisited(isVisited) .liked(isLiked) .build(); } From 92718babbf8c646f7d694a9646531c78ec50791b Mon Sep 17 00:00:00 2001 From: StoneCAU Date: Fri, 21 Feb 2025 06:41:00 +0900 Subject: [PATCH 3/7] =?UTF-8?q?fix:=20=EC=BD=94=EC=8A=A4=20=EC=A1=B0?= =?UTF-8?q?=ED=9A=8C=20API=20=EB=A1=9C=EC=A7=81=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapping/memberCourse/dao/MemberCourseRepositoryImpl.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/umc/catchy/domain/mapping/memberCourse/dao/MemberCourseRepositoryImpl.java b/src/main/java/umc/catchy/domain/mapping/memberCourse/dao/MemberCourseRepositoryImpl.java index 8728444f..50c0134a 100644 --- a/src/main/java/umc/catchy/domain/mapping/memberCourse/dao/MemberCourseRepositoryImpl.java +++ b/src/main/java/umc/catchy/domain/mapping/memberCourse/dao/MemberCourseRepositoryImpl.java @@ -10,6 +10,7 @@ import umc.catchy.domain.category.domain.BigCategory; import umc.catchy.domain.course.domain.CourseType; +import umc.catchy.domain.course.util.LocationUtils; import umc.catchy.domain.mapping.memberCourse.dto.response.MemberCourseResponse; @@ -76,6 +77,8 @@ public Slice findCourseByFilters(CourseType courseType, St .from(memberCourse) .leftJoin(memberCourse.course,course).on(memberCourse.course.id.eq(course.id)) .leftJoin(memberCourse.member,member).on(memberCourse.member.id.eq(member.id)) + .leftJoin(placeCourse).on(course.id.eq(placeCourse.course.id)) + .leftJoin(place).on(placeCourse.place.id.eq(place.id)) .where( memberCourse.member.id.eq(memberId), course.courseType.eq(courseType), @@ -126,7 +129,7 @@ private BooleanExpression upperLocationFilter(String upperLocation) { if ("all".equals(upperLocation)) { return null; } - return place.roadAddress.startsWith(upperLocation + " "); + return place.roadAddress.startsWith(LocationUtils.normalizeLocation(upperLocation) + " "); } private BooleanExpression lowerLocationFilter(String lowerLocation) { From 735bea792f28ea7bcbefaf4baa02bfb65dd7da3d Mon Sep 17 00:00:00 2001 From: StoneCAU Date: Fri, 21 Feb 2025 06:52:25 +0900 Subject: [PATCH 4/7] =?UTF-8?q?fix:=20=EC=9E=A5=EC=86=8C=20=EC=83=81?= =?UTF-8?q?=EC=84=B8=EB=B3=B4=EA=B8=B0=20response=20=EA=B0=92=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../umc/catchy/domain/place/converter/PlaceConverter.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/umc/catchy/domain/place/converter/PlaceConverter.java b/src/main/java/umc/catchy/domain/place/converter/PlaceConverter.java index dd5237ba..2eae4951 100644 --- a/src/main/java/umc/catchy/domain/place/converter/PlaceConverter.java +++ b/src/main/java/umc/catchy/domain/place/converter/PlaceConverter.java @@ -8,6 +8,7 @@ import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern; +import umc.catchy.domain.category.domain.BigCategory; import umc.catchy.domain.course.dto.response.CourseInfoResponse; import umc.catchy.domain.mapping.placeCourse.dto.response.PlaceInfoDetail; import umc.catchy.domain.mapping.placeCourse.dto.response.PlaceInfoPreview; @@ -55,11 +56,11 @@ public static PlaceInfoPreview toPlaceInfoPreview(Place place, Long reviewCount, } public static PlaceInfoDetail toPlaceInfoDetail (Place place, Long reviewCount, Boolean isVisited, Boolean isLiked) { - String categoryName = null; + BigCategory categoryName = null; Double rating = 0.0; if (place.getCategory() != null) { - categoryName = place.getCategory().getName(); + categoryName = place.getCategory().getBigCategory(); } if (place.getRating() != null) { @@ -70,7 +71,7 @@ public static PlaceInfoDetail toPlaceInfoDetail (Place place, Long reviewCount, .placeId(place.getId()) .imageUrl(place.getImageUrl()) .placeName(place.getPlaceName()) - .categoryName(categoryName) + .categoryName(categoryName.toString()) .roadAddress(place.getRoadAddress()) .activeTime(place.getActiveTime()) .placeSite(place.getPlaceSite()) From ad801d65759d1d1d3ad27f0e3f02e3371604a929 Mon Sep 17 00:00:00 2001 From: StoneCAU Date: Fri, 21 Feb 2025 07:07:19 +0900 Subject: [PATCH 5/7] =?UTF-8?q?fix:=20=EC=9E=A5=EC=86=8C=20=EC=83=81?= =?UTF-8?q?=EC=84=B8=EB=B3=B4=EA=B8=B0=20response=20=EA=B0=92=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../umc/catchy/domain/place/converter/PlaceConverter.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/umc/catchy/domain/place/converter/PlaceConverter.java b/src/main/java/umc/catchy/domain/place/converter/PlaceConverter.java index 2eae4951..cf147704 100644 --- a/src/main/java/umc/catchy/domain/place/converter/PlaceConverter.java +++ b/src/main/java/umc/catchy/domain/place/converter/PlaceConverter.java @@ -67,11 +67,16 @@ public static PlaceInfoDetail toPlaceInfoDetail (Place place, Long reviewCount, rating = place.getRating(); } + String category; + + if (categoryName == null) category = null; + else category = categoryName.toString(); + return PlaceInfoDetail.builder() .placeId(place.getId()) .imageUrl(place.getImageUrl()) .placeName(place.getPlaceName()) - .categoryName(categoryName.toString()) + .categoryName(category) .roadAddress(place.getRoadAddress()) .activeTime(place.getActiveTime()) .placeSite(place.getPlaceSite()) From cac31a1f290bf2eb57bee0b26ffe3eedb2024bfe Mon Sep 17 00:00:00 2001 From: StoneCAU Date: Fri, 21 Feb 2025 07:08:25 +0900 Subject: [PATCH 6/7] =?UTF-8?q?fix:=20=EC=BD=94=EC=8A=A4=20=EC=A1=B0?= =?UTF-8?q?=ED=9A=8C=20=EB=A1=9C=EC=A7=81=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapping/memberCourse/dao/MemberCourseRepositoryImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/umc/catchy/domain/mapping/memberCourse/dao/MemberCourseRepositoryImpl.java b/src/main/java/umc/catchy/domain/mapping/memberCourse/dao/MemberCourseRepositoryImpl.java index 50c0134a..48aacb13 100644 --- a/src/main/java/umc/catchy/domain/mapping/memberCourse/dao/MemberCourseRepositoryImpl.java +++ b/src/main/java/umc/catchy/domain/mapping/memberCourse/dao/MemberCourseRepositoryImpl.java @@ -68,7 +68,7 @@ public Slice findCourseByBookmarks(Long memberId, int page @Override public Slice findCourseByFilters(CourseType courseType, String upperLocation, String lowerLocation, Long memberId, Long lastCourseId) { - List results = queryFactory.select(Projections.constructor(MemberCourseResponse.class, + List results = queryFactory.selectDistinct(Projections.constructor(MemberCourseResponse.class, course.id, course.courseType, course.courseImage, From 2e282adda4e25b0ccb43628dd31d9402b6b76e2b Mon Sep 17 00:00:00 2001 From: StoneCAU Date: Fri, 21 Feb 2025 08:20:35 +0900 Subject: [PATCH 7/7] =?UTF-8?q?fix:=20=EC=B9=B4=ED=85=8C=EA=B3=A0=EB=A6=AC?= =?UTF-8?q?=20FetchType=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/umc/catchy/domain/place/domain/Place.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/umc/catchy/domain/place/domain/Place.java b/src/main/java/umc/catchy/domain/place/domain/Place.java index f703406f..1eb57c90 100644 --- a/src/main/java/umc/catchy/domain/place/domain/Place.java +++ b/src/main/java/umc/catchy/domain/place/domain/Place.java @@ -51,7 +51,7 @@ public class Place extends BaseTimeEntity { private Double rating; // 장소 총 평점 : 처음에 0으로 초기화해주세요 @Setter - @ManyToOne(fetch = FetchType.LAZY) + @ManyToOne(fetch = FetchType.EAGER) @JoinColumn(name = "category_id") private Category category;