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()); + } }