Skip to content

Commit

Permalink
[#19]Feat : Create DishService
Browse files Browse the repository at this point in the history
- DishService 생성 및 테스트 코드 추가
  • Loading branch information
choitree committed Apr 21, 2021
1 parent 8aabc10 commit a25bfcb
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions backend/src/main/java/com/team15/sidedish/service/DishService.java
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);
// }

}

0 comments on commit a25bfcb

Please sign in to comment.