From 488c4552a8fcf39eda8127ea126939ef347863d6 Mon Sep 17 00:00:00 2001 From: gitseoyeon Date: Thu, 7 Nov 2024 01:12:39 +0900 Subject: [PATCH 1/2] =?UTF-8?q?Refactor:=20getGroupReservation=20=EB=A9=94?= =?UTF-8?q?=EC=86=8C=EB=93=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/booth/BoothReservationService.java | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/openbook/openbook/service/booth/BoothReservationService.java b/src/main/java/com/openbook/openbook/service/booth/BoothReservationService.java index 56173d5b..fc25d730 100644 --- a/src/main/java/com/openbook/openbook/service/booth/BoothReservationService.java +++ b/src/main/java/com/openbook/openbook/service/booth/BoothReservationService.java @@ -57,7 +57,7 @@ public List getReservationsByBooth(long boothId){ if(!booth.getStatus().equals(BoothStatus.APPROVE)){ throw new OpenBookException(ErrorCode.BOOTH_NOT_APPROVED); } - return getGroupReservation(boothId); + return getGroupReservation(boothId, false); } @Transactional @@ -66,10 +66,10 @@ public List getAllManageReservations(Long userId, Long boot if(!booth.getManager().getId().equals(userId)){ throw new OpenBookException(ErrorCode.FORBIDDEN_ACCESS); } - return getGroupReservation(boothId); + return getGroupReservation(boothId, true); } - private List getGroupReservation(Long boothId){ + private List getGroupReservation(Long boothId, boolean isAdmin) { List reservations = getBoothReservations(boothId); Map> groupedByName = reservations.stream() .collect(Collectors.groupingBy(BoothReservation::getName)); @@ -85,6 +85,18 @@ private List getGroupReservation(Long boothId){ List details = dateEntry.getValue().stream() .flatMap(reservation -> reservationDetailService .getReservationDetails(reservation.getId()).stream()) + .map(detail -> { + if (isAdmin) { + return detail; + } else { + return new BoothReservationDetailDto( + detail.id(), + detail.times(), + detail.status(), + null + ); + } + }) .collect(Collectors.toList()); return BoothReservationDateDto.of(date, details); From 22ca452ec10693a5c49433f906acd042a684ecd2 Mon Sep 17 00:00:00 2001 From: gitseoyeon Date: Thu, 7 Nov 2024 15:40:45 +0900 Subject: [PATCH 2/2] =?UTF-8?q?Chore:=20=EB=8F=84=EC=BB=A4=20=EB=B9=8C?= =?UTF-8?q?=EB=93=9C=20=EB=AA=85=EB=A0=B9=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/gradle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 0638320c..379e988f 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -47,7 +47,7 @@ jobs: run: test -f ./src/main/resources/application.properties && echo "File exists" || echo "File does not exist" - name: docker image build - run: docker build -t ${{ secrets.DOCKER_USERNAME }}/openbook:latest . + run: docker build --build-arg DEPENDENCY=build/dependency -t ${{ secrets.DOCKER_USERNAME }}/openbook --platform linux/amd64 . - name: docker login uses: docker/login-action@v2