Skip to content

Commit

Permalink
#139 feat:예약 확정 개수 메인페이지에 추가 (#182)
Browse files Browse the repository at this point in the history
  • Loading branch information
leeseunghakhello authored Nov 29, 2023
1 parent 1daedeb commit a5883fc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,10 @@ public AdminMainRes mainAdminExperienceGift(UserPrincipal userPrincipal) {
LocalDate currentDate = LocalDate.now();

Long bookedReservationsCount = reservationRepository.countByExperienceGift_ShopOwnerAndReservationStatus(shopOwner, ReservationStatus.WAITING);
Long bookedCheckCount = reservationRepository.countByExperienceGift_ShopOwnerAndReservationStatus(shopOwner, ReservationStatus.BOOKED);

return AdminMainRes.toDto(currentDate, bookedReservationsCount);

return AdminMainRes.toDto(currentDate, bookedReservationsCount,bookedCheckCount);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,14 @@ public class AdminMainRes {
private LocalDate currentDate;
@Schema(type = "Long", description = "예약 접수 개수", example = "3")
private Long bookedReservationsCount;
@Schema(type = "Long", description = "예약 확인 개수", example = "3")
private Long bookedCheckCount;

public static AdminMainRes toDto(LocalDate currentDate, Long bookedReservationsCount) {
public static AdminMainRes toDto(LocalDate currentDate, Long bookedReservationsCount,Long bookedCheckCount) {
return AdminMainRes.builder()
.currentDate(currentDate)
.bookedReservationsCount(bookedReservationsCount)
.bookedCheckCount(bookedCheckCount)
.build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public ResponseCustom<AdminMainRes> mainAdminExperienceGift(
) {
return ResponseCustom.OK(experienceGiftService.mainAdminExperienceGift(userPrincipal));
}

@Operation(summary = "관리자 경험 선물 조회", description = "관리자 경험 선물 조회합니다.")
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "관리자 경험 선물 조회 성공",content = {@Content(mediaType = "application/json", schema = @Schema(implementation = AdminExperienceRes.class))}),
Expand Down

0 comments on commit a5883fc

Please sign in to comment.