-
Notifications
You must be signed in to change notification settings - Fork 1
[feat] 웨이블존 리뷰 목록 조회 API 구현 #26
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
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
314694e
[feat] 웨이블존 영업 정보 엔티티 구현
seung-in-Yoo db165f1
[feat] 웨이블존 편의 시설 정보 엔티티 구현 (시설 정보 포함)
seung-in-Yoo 86a7639
[feat] 내가(유저가) 저장한 장소 엔티티 구현
seung-in-Yoo f3865a4
[feat] 유저 장소와 웨이블존 매핑 관련 엔티티 구현
seung-in-Yoo 98d13c8
[refactor] 웨이블존 편의 시설 정보 엔티티에 BaseEntity 적용
seung-in-Yoo f74b518
[refactor] 웨이블존 엔티티에 매핑 관계 필드 추가 및 누적 평점, 리뷰 수 필드 추가
seung-in-Yoo 5b56caa
[refactor] 리뷰 목록 조회 관련 레포지토리, Dto 리팩토링
seung-in-Yoo 5f10a45
[refactor] ReviewService에 목록 조회 메서드 추가
seung-in-Yoo 659b88f
[refactor] ReviewController에 리뷰 목록 조회 API 추가
seung-in-Yoo a45694d
[fix] 웨이블존 api 응답 실패시 에러 상태코드 변경
seung-in-Yoo d4d45c7
[refactor] 웨이블존 영업 정보 필드 타입 개선 및 ReviewController에 @Pattern 적용
seung-in-Yoo dadf282
[refactor] WaybleZoneOperatingHour에 검증 메서드 및 제약 조건 추가
seung-in-Yoo 38baa09
[refactor] WaybleZoneOperatingHour에 휴무일 시 시간 필드 처리 추가
seung-in-Yoo de1620e
[fix] 영업 여부에 따른 시간 정보 검증 로직 삭제
seung-in-Yoo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 12 additions & 2 deletions
14
src/main/java/com/wayble/server/review/dto/ReviewResponseDto.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,14 @@ | ||
| package com.wayble.server.review.dto; | ||
|
|
||
| public record ReviewResponseDto() { | ||
| } | ||
| import java.time.LocalDate; | ||
| import java.util.List; | ||
|
|
||
| public record ReviewResponseDto( | ||
| Long reviewId, | ||
| String userNickname, | ||
| double rating, | ||
| String content, | ||
| LocalDate visitDate, | ||
| int likes, | ||
| List<String> images | ||
| ) {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/main/java/com/wayble/server/user/entity/UserPlace.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| package com.wayble.server.user.entity; | ||
|
|
||
| import com.wayble.server.common.entity.BaseEntity; | ||
| import jakarta.persistence.*; | ||
| import lombok.AllArgsConstructor; | ||
| import lombok.Builder; | ||
| import lombok.Getter; | ||
| import lombok.NoArgsConstructor; | ||
|
|
||
|
|
||
| @Entity | ||
| @Getter | ||
| @Builder | ||
| @AllArgsConstructor | ||
| @NoArgsConstructor | ||
| @Table(name = "user_place") // 유져가 저장한 장소 | ||
| public class UserPlace extends BaseEntity { | ||
|
|
||
| @Id | ||
| @GeneratedValue(strategy = GenerationType.IDENTITY) | ||
| private Long id; | ||
|
|
||
| @Column(name = "title", nullable = false) | ||
| private String title; | ||
|
|
||
| @ManyToOne(fetch = FetchType.LAZY) | ||
| @JoinColumn(name = "user_id", nullable = false) | ||
| private User user; | ||
| } |
29 changes: 29 additions & 0 deletions
29
src/main/java/com/wayble/server/user/entity/UserPlaceWaybleZoneMapping.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| package com.wayble.server.user.entity; | ||
|
|
||
| import com.wayble.server.wayblezone.entity.WaybleZone; | ||
| import jakarta.persistence.*; | ||
| import lombok.AllArgsConstructor; | ||
| import lombok.Builder; | ||
| import lombok.Getter; | ||
| import lombok.NoArgsConstructor; | ||
|
|
||
| @Entity | ||
| @Getter | ||
| @Builder | ||
| @AllArgsConstructor | ||
| @NoArgsConstructor | ||
| @Table(name = "user_place_wayble_zone_mapping") // 유저 장소와 웨이블존 다대다 매핑 | ||
| public class UserPlaceWaybleZoneMapping { | ||
|
|
||
| @Id | ||
| @GeneratedValue(strategy = GenerationType.IDENTITY) | ||
| private Long id; | ||
|
|
||
| @ManyToOne(fetch = FetchType.LAZY) | ||
| @JoinColumn(name = "user_place_id", nullable = false) | ||
| private UserPlace userPlace; | ||
|
|
||
| @ManyToOne(fetch = FetchType.LAZY) | ||
| @JoinColumn(name = "wayble_zone_id", nullable = false) | ||
| private WaybleZone waybleZone; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
src/main/java/com/wayble/server/wayblezone/entity/WaybleZoneFacility.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| package com.wayble.server.wayblezone.entity; | ||
|
|
||
| import com.wayble.server.common.entity.BaseEntity; | ||
| import jakarta.persistence.*; | ||
| import lombok.*; | ||
|
|
||
|
|
||
| @Entity | ||
| @Getter | ||
| @Builder | ||
| @NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
| @AllArgsConstructor(access = AccessLevel.PROTECTED) | ||
| @Table(name = "wayble_zone_facility") // 웨이블존 편의 시설 정보 | ||
| public class WaybleZoneFacility extends BaseEntity { | ||
|
|
||
| @Id | ||
| @GeneratedValue(strategy = GenerationType.IDENTITY) | ||
| private Long id; | ||
|
|
||
| // 웨이블존 연관관계 (1:1로 가정 => 웨이블존당 시설 1세트) | ||
| @OneToOne(fetch = FetchType.LAZY) | ||
| @JoinColumn(name = "wayble_zone_id", nullable = false) | ||
| private WaybleZone waybleZone; | ||
|
|
||
| // 시설 정보 (있음/없음 여부) | ||
| @Column(nullable = false) | ||
| private boolean hasSlope; // 경사로 | ||
|
|
||
| @Column(nullable = false) | ||
| private boolean hasNoDoorStep; // 문턱 | ||
|
|
||
| @Column(nullable = false) | ||
| private boolean hasElevator; // 엘리베이터 | ||
|
|
||
| @Column(nullable = false) | ||
| private boolean hasTableSeat; // 테이블석 | ||
|
|
||
| @Column(nullable = false) | ||
| private boolean hasDisabledToilet; // 장애인 화장실 | ||
|
|
||
| @Column(length = 20) | ||
| private String floorInfo; // 층수 정보 (ex: "1층", "B1", "2층") | ||
| } |
64 changes: 64 additions & 0 deletions
64
src/main/java/com/wayble/server/wayblezone/entity/WaybleZoneOperatingHour.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| package com.wayble.server.wayblezone.entity; | ||
|
|
||
| import com.wayble.server.common.entity.BaseEntity; | ||
| import jakarta.persistence.*; | ||
| import lombok.AllArgsConstructor; | ||
| import lombok.Builder; | ||
| import lombok.Getter; | ||
| import lombok.NoArgsConstructor; | ||
|
|
||
| import java.time.DayOfWeek; | ||
| import java.time.LocalTime; | ||
|
|
||
|
|
||
| @Entity | ||
| @Getter | ||
| @Builder | ||
| @AllArgsConstructor | ||
| @NoArgsConstructor | ||
| @Table(name = "wayble_zone_operating_hours", | ||
| uniqueConstraints = @UniqueConstraint(columnNames = {"wayble_zone_id", "day_of_week"})) // 웨이블존 영업 정보 | ||
| public class WaybleZoneOperatingHour extends BaseEntity { | ||
|
|
||
| @Id | ||
| @GeneratedValue(strategy = GenerationType.IDENTITY) | ||
| private Long id; | ||
|
|
||
| @ManyToOne(fetch = FetchType.LAZY) | ||
| @JoinColumn(name = "wayble_zone_id", nullable = false) | ||
| private WaybleZone waybleZone; | ||
|
|
||
| @Enumerated(EnumType.STRING) | ||
| @Column(name = "day_of_week", nullable = false) | ||
| private DayOfWeek dayOfWeek; // 요일 정보 | ||
|
seung-in-Yoo marked this conversation as resolved.
|
||
|
|
||
| @Column(name = "start_time", nullable = false) | ||
| private LocalTime startTime; // 영업 시작 시간 | ||
|
|
||
| @Column(name = "close_time", nullable = false) | ||
| private LocalTime closeTime; // 영업 종료 시간 | ||
|
seung-in-Yoo marked this conversation as resolved.
|
||
|
|
||
| @Column(name = "is_closed", nullable = false) | ||
| private Boolean isClosed = false; // 영업 여부 | ||
|
|
||
| /* 필요하게 되면 나중에 사용 | ||
| @PrePersist | ||
| @PreUpdate | ||
| private void validateTimes() { | ||
| if (isClosed) { | ||
| // 휴무일에는 시간 정보가 있어서는 안 됨 | ||
| if (startTime != null || closeTime != null) { | ||
| throw new IllegalStateException("휴무일에는 시간 정보가 있을 수 없습니다."); | ||
| } | ||
| } else { | ||
| // 영업일에는 시간 정보가 필수 | ||
| if (startTime == null || closeTime == null) { | ||
| throw new IllegalStateException("영업일에는 시작 시간과 종료 시간이 필요합니다."); | ||
| } | ||
| if (startTime.equals(closeTime)) { | ||
| throw new IllegalStateException("시작 시간과 종료 시간이 동일할 수 없습니다."); | ||
| } | ||
| } | ||
| } | ||
| */ | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.