-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore : not null 제거 * feat: 상품 ID , 날짜로 예약 조회 * feat: 사장님 상품id, 날짜로 예약 조회 * chore : Response Type 수정 * chore : swagger Scheme 변경 * refactor : uesr , shop owner 날짜로 예약 조회 반환값 변경 * docs : @Schema로 설명 추가
- Loading branch information
Showing
8 changed files
with
131 additions
and
19 deletions.
There are no files selected for viewing
8 changes: 6 additions & 2 deletions
8
src/main/java/com/shallwe/domain/reservation/application/ReservationService.java
This file contains 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,13 +1,17 @@ | ||
package com.shallwe.domain.reservation.application; | ||
|
||
import com.shallwe.domain.reservation.dto.ReservationResponse; | ||
import com.shallwe.domain.reservation.dto.ReservationIdOwnerRes; | ||
import com.shallwe.domain.reservation.dto.ReservationIdUserRes; | ||
import com.shallwe.global.config.security.token.UserPrincipal; | ||
import java.time.LocalDate; | ||
import java.util.List; | ||
|
||
public interface ReservationService { | ||
|
||
List<ReservationResponse> getReservationByDate (UserPrincipal userPrincipal, Long giftId, LocalDate date); | ||
|
||
List<ReservationIdOwnerRes> getReservationByDateOwner (UserPrincipal userPrincipal, Long giftId, LocalDate date); | ||
List<ReservationIdUserRes> getReservationByDateUser (UserPrincipal userPrincipal, Long giftId, LocalDate date); | ||
|
||
|
||
} | ||
|
This file contains 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
57 changes: 57 additions & 0 deletions
57
src/main/java/com/shallwe/domain/reservation/dto/ReservationIdOwnerRes.java
This file contains 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,57 @@ | ||
package com.shallwe.domain.reservation.dto; | ||
|
||
|
||
|
||
import com.shallwe.domain.reservation.domain.Reservation; | ||
import com.shallwe.domain.reservation.domain.ReservationStatus; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import java.time.LocalTime; | ||
import java.util.Optional; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Data | ||
@NoArgsConstructor | ||
public class ReservationIdOwnerRes { | ||
@Schema(description = "예약 Id") | ||
Long reservationId; | ||
|
||
@Schema(description = "예약 상태 {WAITING(예약대기), BOOKED(예약중), COMFIRMED(예약확정), COMPLETED(이용완료), CANCELED(예약취소)}") | ||
ReservationStatus status; | ||
|
||
@Schema(description = "보내는이 이름(예약자)") | ||
String sender; | ||
|
||
@Schema(description = "예약 시간") | ||
LocalTime time; | ||
|
||
@Schema(description = "전화번호") | ||
String phoneNum; | ||
|
||
@Schema(description = "예약 인원") | ||
Long person; | ||
|
||
@Builder | ||
public ReservationIdOwnerRes(Long reservationId, ReservationStatus status, String sender, | ||
LocalTime time, String phoneNum,Long person) { | ||
this.reservationId = reservationId; | ||
this.status = status; | ||
this.sender = sender; | ||
this.time = time; | ||
this.phoneNum = phoneNum; | ||
this.person = person; | ||
} | ||
|
||
public static ReservationIdOwnerRes toDtoOwner(Reservation reservation) { | ||
return ReservationIdOwnerRes.builder() | ||
.reservationId(reservation.getId()) | ||
.status(reservation.getReservationStatus()) | ||
.time(reservation.getTime()) | ||
.sender(Optional.ofNullable(reservation.getSender()).map( | ||
com.shallwe.domain.user.domain.User::getName).orElse(null)) | ||
.phoneNum(reservation.getPhoneNumber()) | ||
.person(reservation.getPersons()) | ||
.build(); | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
src/main/java/com/shallwe/domain/reservation/dto/ReservationIdUserRes.java
This file contains 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,30 @@ | ||
package com.shallwe.domain.reservation.dto; | ||
|
||
import com.shallwe.domain.reservation.domain.Reservation; | ||
import com.shallwe.domain.reservation.domain.ReservationStatus; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
|
||
@Data | ||
public class ReservationIdUserRes { | ||
|
||
@Schema(description = "예약 Id") | ||
Long reservationId; | ||
|
||
@Schema(description = "예약 상태 {WAITING(예약대기), BOOKED(예약중), COMFIRMED(예약확정), COMPLETED(이용완료), CANCELED(예약취소)}") | ||
ReservationStatus status; | ||
|
||
@Builder | ||
public ReservationIdUserRes(Long reservationId, ReservationStatus status) { | ||
this.reservationId = reservationId; | ||
this.status = status; | ||
} | ||
|
||
public static ReservationIdUserRes toDtoUser(Reservation reservation){ | ||
return ReservationIdUserRes.builder() | ||
.reservationId(reservation.getId()) | ||
.status(reservation.getReservationStatus()) | ||
.build(); | ||
} | ||
} |
This file contains 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 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 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 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