-
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.
[#17] refactor: Renaming Dish to Item
- Mockup API의 네이밍에 맞게 Dish라는 명칭을 Item으로 수정
- Loading branch information
Showing
4 changed files
with
37 additions
and
37 deletions.
There are no files selected for viewing
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
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
28 changes: 0 additions & 28 deletions
28
backend/src/main/java/com/team15/sidedish/service/DishService.java
This file was deleted.
Oops, something went wrong.
28 changes: 28 additions & 0 deletions
28
backend/src/main/java/com/team15/sidedish/service/ItemService.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,28 @@ | ||
package com.team15.sidedish.service; | ||
|
||
import com.team15.sidedish.domain.ItemRepository; | ||
import com.team15.sidedish.dto.ItemDTO; | ||
import org.springframework.stereotype.Service; | ||
|
||
import java.util.List; | ||
|
||
@Service | ||
public class ItemService { | ||
private final ItemRepository itemRepository; | ||
|
||
public ItemService(ItemRepository itemRepository) { | ||
this.itemRepository = itemRepository; | ||
} | ||
|
||
public List<ItemDTO> showDishes() { | ||
return itemRepository.findAll(); | ||
} | ||
|
||
public ItemDTO showSingleDish(String hash) { | ||
return itemRepository.findById(hash).orElseThrow(IllegalArgumentException::new); | ||
} | ||
|
||
public List<ItemDTO> showDishsBySection(String section) { | ||
return itemRepository.findAllBySection(section); | ||
} | ||
} |