Last change
on this file was 8d11f8c, checked in by jovanmanchev <jovanmanchev3003@…>, 20 months ago |
code added, trial 2
|
-
Property mode
set to
100644
|
File size:
862 bytes
|
Line | |
---|
1 | package com.example.fooddeliverysystem.service.impl;
|
---|
2 |
|
---|
3 | import com.example.fooddeliverysystem.model.FoodItem;
|
---|
4 | import com.example.fooddeliverysystem.repository.FoodItemRepository;
|
---|
5 | import com.example.fooddeliverysystem.service.FoodItemService;
|
---|
6 | import org.springframework.stereotype.Service;
|
---|
7 |
|
---|
8 | import java.util.List;
|
---|
9 |
|
---|
10 | @Service
|
---|
11 | public class FoodItemServceImpl implements FoodItemService {
|
---|
12 |
|
---|
13 | private final FoodItemRepository foodItemRepository;
|
---|
14 |
|
---|
15 | public FoodItemServceImpl(FoodItemRepository foodItemRepository) {
|
---|
16 | this.foodItemRepository = foodItemRepository;
|
---|
17 | }
|
---|
18 |
|
---|
19 | @Override
|
---|
20 | public List<FoodItem> findAllFoodItemsByIds(List<Long> foodItemIds) {
|
---|
21 | return this.foodItemRepository.findAllById(foodItemIds);
|
---|
22 | }
|
---|
23 |
|
---|
24 | @Override
|
---|
25 | public FoodItem findFoodItemById(Long id) {
|
---|
26 | return this.foodItemRepository.findById(id).get();
|
---|
27 | }
|
---|
28 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.