Advertisement
Guest User

Untitled

a guest
Mar 8th, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.80 KB | None | 0 0
  1. package de.foodtracking.backend.controller;
  2.  
  3. import java.util.List;
  4.  
  5. import org.springframework.beans.factory.annotation.Autowired;
  6. import org.springframework.web.bind.annotation.GetMapping;
  7. import org.springframework.web.bind.annotation.PathVariable;
  8. import org.springframework.web.bind.annotation.RestController;
  9.  
  10. import de.foodtracking.backend.repository.FoodData;
  11. import de.foodtracking.backend.service.FoodDataService;
  12.  
  13. @RestController
  14. public class FoodDataController {
  15.  
  16.     @Autowired
  17.     private FoodDataService foodDataService;
  18.    
  19.     public FoodDataController(FoodDataService foodDataService) {
  20.         this.foodDataService = foodDataService;
  21.     }
  22.    
  23.     @GetMapping("/fooddata/{day}")
  24.     public List<FoodData> findFoodData(@PathVariable String day) {
  25.         return foodDataService.findFoodDataByDay(day);
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement