From 7e42b073705db201c0e5bec1131ead6c3eb833eb Mon Sep 17 00:00:00 2001 From: summit45 Date: Tue, 21 Nov 2023 01:39:39 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EB=82=B4=20=EA=B0=80=EA=B2=8C=EC=9D=98?= =?UTF-8?q?=20=EB=A9=94=EB=89=B4=20=EC=A1=B0=ED=9A=8C=ED=95=98=EA=B8=B0=20?= =?UTF-8?q?api=20=EA=B8=B0=EB=8A=A5=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/kusitms/jipbap/store/StoreController.java | 7 +++++++ src/main/java/com/kusitms/jipbap/store/StoreService.java | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/src/main/java/com/kusitms/jipbap/store/StoreController.java b/src/main/java/com/kusitms/jipbap/store/StoreController.java index 20ac9cc..94a6efa 100644 --- a/src/main/java/com/kusitms/jipbap/store/StoreController.java +++ b/src/main/java/com/kusitms/jipbap/store/StoreController.java @@ -130,6 +130,13 @@ public CommonResponse> getAllMenuListByStoreId(@ return new CommonResponse<>(storeService.getAllMenuListByStoreId(storeId)); } + @Operation(summary = "내 가게의 모든 메뉴 가져오기") + @GetMapping("/menu") + @ResponseStatus(HttpStatus.OK) + public CommonResponse> getMyStoreMenu(@Auth AuthInfo authInfo) { + return new CommonResponse<>(storeService.getMyStoreMenu(authInfo.getEmail())); + } + @Operation(summary = "가게의 주문내역에 맞는 주문 리스트 가져오기") @GetMapping("order-history/{orderStatus}") public CommonResponse getStoreOrderHistoryByOrderStatus( diff --git a/src/main/java/com/kusitms/jipbap/store/StoreService.java b/src/main/java/com/kusitms/jipbap/store/StoreService.java index 0457aa7..0cbbb2d 100644 --- a/src/main/java/com/kusitms/jipbap/store/StoreService.java +++ b/src/main/java/com/kusitms/jipbap/store/StoreService.java @@ -227,4 +227,10 @@ public List getAllMenuListByStoreId(Long storeId) { return foodDetailByStoreResponseList; } + public List getMyStoreMenu(String email){ + User user = userRepository.findByEmail(email).orElseThrow(()-> new UserNotFoundException("유저 정보가 존재하지 않습니다.")); + Store store = storeRepository.findByOwner(user).orElseThrow(()-> new StoreNotExistsException("가게 정보가 존재하지 않습니다.")); + + return getAllMenuListByStoreId(store.getId()); + } }