Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package de.foodtracking.backend.controller;
- import java.util.List;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.web.bind.annotation.GetMapping;
- import org.springframework.web.bind.annotation.PathVariable;
- import org.springframework.web.bind.annotation.RestController;
- import de.foodtracking.backend.repository.FoodData;
- import de.foodtracking.backend.service.FoodDataService;
- @RestController
- public class FoodDataController {
- @Autowired
- private FoodDataService foodDataService;
- public FoodDataController(FoodDataService foodDataService) {
- this.foodDataService = foodDataService;
- }
- @GetMapping("/fooddata/{day}")
- public List<FoodData> findFoodData(@PathVariable String day) {
- return foodDataService.findFoodDataByDay(day);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement