-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- DishService 생성 및 테스트 코드 추가
- Loading branch information
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
backend/src/main/java/com/team15/sidedish/service/DishService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package com.team15.sidedish.service; | ||
|
||
import com.team15.sidedish.domain.Dish; | ||
import com.team15.sidedish.domain.DishRepository; | ||
import org.springframework.stereotype.Service; | ||
|
||
import java.security.PublicKey; | ||
import java.util.List; | ||
|
||
@Service | ||
public class DishService { | ||
private final DishRepository dishRepository; | ||
|
||
public DishService(DishRepository dishRepository) { | ||
this.dishRepository = dishRepository; | ||
} | ||
|
||
public List<Dish> showDishes() { | ||
List<Dish> dishes = (List<Dish>) dishRepository.findAll(); | ||
return dishes; | ||
} | ||
|
||
public Dish showSingleDish(String hash) { | ||
Dish dish = dishRepository.findById(hash).get(); | ||
return dish; | ||
} | ||
|
||
// public List<Dish> showDishesBySectionName(String sectionName) { | ||
// return dishRepository.findAllBySectionName(sectionName); | ||
// } | ||
|
||
} |