-
Notifications
You must be signed in to change notification settings - Fork 1
[feat] 웨이블존 추천, 검색 응답 필드에 장애 시설 정보 추가 #66
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
Changes from all commits
8ce0faf
45aa645
3a6af0d
469de36
5d74fb2
5243f3f
00f1bb1
841ccac
9467274
9a17da3
47b220e
350df6c
f33972f
49aac1a
7faeda1
8b70d24
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| package com.wayble.server.explore.dto; | ||
|
|
||
| import com.wayble.server.explore.entity.EsWaybleZoneFacility; | ||
| import lombok.Builder; | ||
|
|
||
| @Builder | ||
| public record FacilityResponseDto( | ||
| Boolean hasSlope, | ||
| Boolean hasNoDoorStep, | ||
| Boolean hasElevator, | ||
| Boolean hasTableSeat, | ||
| Boolean hasDisabledToilet, | ||
| String floorInfo | ||
| ) { | ||
| public static FacilityResponseDto from(EsWaybleZoneFacility facility) { | ||
| if (facility == null) { | ||
| return null; | ||
| } | ||
|
|
||
| return FacilityResponseDto.builder() | ||
| .hasSlope(facility.isHasSlope()) | ||
| .hasNoDoorStep(facility.isHasNoDoorStep()) | ||
| .hasElevator(facility.isHasElevator()) | ||
| .hasTableSeat(facility.isHasTableSeat()) | ||
| .hasDisabledToilet(facility.isHasDisabledToilet()) | ||
| .floorInfo(facility.getFloorInfo()) | ||
| .build(); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| package com.wayble.server.explore.entity; | ||
|
|
||
| import com.wayble.server.wayblezone.entity.WaybleZoneFacility; | ||
| import lombok.*; | ||
|
|
||
| @ToString | ||
| @Builder(access = AccessLevel.PRIVATE) | ||
| @Getter | ||
| @AllArgsConstructor(access = AccessLevel.PROTECTED) | ||
| @NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
| public class EsWaybleZoneFacility { | ||
|
|
||
| private boolean hasSlope; | ||
| private boolean hasNoDoorStep; | ||
| private boolean hasElevator; | ||
| private boolean hasTableSeat; | ||
| private boolean hasDisabledToilet; | ||
| private String floorInfo; | ||
|
|
||
| public static EsWaybleZoneFacility from(WaybleZoneFacility facility) { | ||
| if (facility == null) { | ||
| return null; | ||
| } | ||
|
|
||
| return EsWaybleZoneFacility.builder() | ||
| .hasSlope(facility.isHasSlope()) | ||
| .hasNoDoorStep(facility.isHasNoDoorStep()) | ||
| .hasElevator(facility.isHasElevator()) | ||
| .hasTableSeat(facility.isHasTableSeat()) | ||
| .hasDisabledToilet(facility.isHasDisabledToilet()) | ||
| .floorInfo(facility.getFloorInfo()) | ||
| .build(); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -33,6 +33,9 @@ public class WaybleZoneDocument { | |||||
| @Field(type = FieldType.Object) | ||||||
| private EsAddress address; | ||||||
|
|
||||||
| @Field(type = FieldType.Object) | ||||||
| private EsWaybleZoneFacility facility; | ||||||
|
|
||||||
| private double averageRating; | ||||||
|
|
||||||
| private long reviewCount; | ||||||
|
|
@@ -42,8 +45,9 @@ public static WaybleZoneDocument fromEntity(WaybleZone waybleZone) { | |||||
| .zoneId(waybleZone.getId()) | ||||||
| .zoneName(waybleZone.getZoneName()) | ||||||
| .zoneType(waybleZone.getZoneType()) | ||||||
| .thumbnailImageUrl("thumbnail image url") // TODO: 이미지 경로 추가 | ||||||
| .thumbnailImageUrl(waybleZone.getMainImageUrl() != null ? waybleZone.getMainImageUrl() : null) // TODO: 이미지 경로 추가 | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion 불필요한 삼항 연산자 사용 현재 로직은 다음과 같이 수정하세요: -.thumbnailImageUrl(waybleZone.getMainImageUrl() != null ? waybleZone.getMainImageUrl() : null) // TODO: 이미지 경로 추가
+.thumbnailImageUrl(waybleZone.getMainImageUrl()) // TODO: 이미지 경로 추가📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| .address(EsAddress.from(waybleZone.getAddress())) | ||||||
| .facility(EsWaybleZoneFacility.from(waybleZone.getFacility())) | ||||||
| .averageRating(0.0) | ||||||
| .reviewCount(0L) | ||||||
| .build(); | ||||||
|
|
@@ -56,6 +60,7 @@ public static WaybleZoneDocument fromDto(WaybleZoneDocumentRegisterDto dto) { | |||||
| .zoneType(dto.waybleZoneType()) | ||||||
| .thumbnailImageUrl(dto.thumbnailImageUrl()) | ||||||
| .address(EsAddress.from(dto.address())) | ||||||
| .facility(EsWaybleZoneFacility.from(dto.facility())) | ||||||
| .averageRating(dto.averageRating() != null ? dto.averageRating() : 0.0) | ||||||
| .reviewCount(dto.reviewCount() != null ? dto.reviewCount() : 0L) | ||||||
| .build(); | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -3,6 +3,8 @@ | |||||
| import com.wayble.server.user.entity.LoginType; | ||||||
| import com.wayble.server.user.entity.User; | ||||||
| import org.springframework.data.jpa.repository.JpaRepository; | ||||||
| import org.springframework.data.jpa.repository.Query; | ||||||
| import org.springframework.data.repository.query.Param; | ||||||
|
Comment on lines
+6
to
+7
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent ❓ Verification inconclusive사용되지 않는 import 구문일 가능성 확인 필요
다음 스크립트로 해당 annotation들이 실제로 사용되는지 확인해주세요: 🏁 Script executed: #!/bin/bash
# UserRepository에서 @Query와 @Param이 실제로 사용되는지 확인
rg -A 10 "@Query|@Param" src/main/java/com/wayble/server/user/repository/UserRepository.javaLength of output: 94 사용되지 않는 import 제거 필요
수정 위치:
제안된 diff: - import org.springframework.data.jpa.repository.Query;
- import org.springframework.data.repository.query.Param;📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
|
|
||||||
| import java.util.Optional; | ||||||
|
|
||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -13,6 +13,7 @@ | |||||||||||||||||||
| import jakarta.validation.constraints.NotBlank; | ||||||||||||||||||||
| import jakarta.validation.constraints.NotNull; | ||||||||||||||||||||
| import lombok.RequiredArgsConstructor; | ||||||||||||||||||||
| import org.springframework.security.core.context.SecurityContextHolder; | ||||||||||||||||||||
| import org.springframework.web.bind.annotation.*; | ||||||||||||||||||||
|
|
||||||||||||||||||||
| import java.util.List; | ||||||||||||||||||||
|
|
@@ -57,7 +58,8 @@ public CommonResponse<WaybleZoneDetailResponseDto> getWaybleZoneDetail( | |||||||||||||||||||
| ) { | ||||||||||||||||||||
|
|
||||||||||||||||||||
| // TODO: JWT에서 userId 추출해서 상세 조회 기록 남기기 | ||||||||||||||||||||
| // waybleZoneVisitLogService.saveVisitLog(null, waybleZoneId); | ||||||||||||||||||||
| Long userId = (Long) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); | ||||||||||||||||||||
| waybleZoneVisitLogService.saveVisitLog(userId, waybleZoneId); | ||||||||||||||||||||
|
Comment on lines
+61
to
+62
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. JWT에서 사용자 ID 추출 시 안전성 검증 필요
다음과 같이 안전한 구현으로 수정하는 것을 권장합니다: - Long userId = (Long) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
- waybleZoneVisitLogService.saveVisitLog(userId, waybleZoneId);
+ Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
+ if (authentication != null && authentication.getPrincipal() instanceof Long userId) {
+ waybleZoneVisitLogService.saveVisitLog(userId, waybleZoneId);
+ } else {
+ // 인증되지 않은 사용자의 경우 로그 처리 방식 결정 필요
+ waybleZoneVisitLogService.saveVisitLog(null, waybleZoneId);
+ }📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||
| return CommonResponse.success(waybleZoneService.getWaybleZoneDetail(waybleZoneId)); | ||||||||||||||||||||
| } | ||||||||||||||||||||
| } | ||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
중복된 AWS SDK 의존성 제거 필요
AWS SDK 의존성이 두 번 선언되어 있습니다 (라인 38-39와 48-49). 중복 선언을 제거해야 합니다.
다음 diff를 적용하여 중복을 제거하세요:
Also applies to: 48-49
🤖 Prompt for AI Agents