package fr.organizee.controller;
import fr.organizee.model.Menu;
import fr.organizee.model.Team;
import fr.organizee.repository.MenuRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.persistence.EntityNotFoundException;
import java.util.List;
import java.util.Optional;
@RestController
@CrossOrigin("*")
@RequestMapping("/menus")
public class MenuController {
@Autowired
private MenuRepository menuRepository;
//Récupère les infos d'un menu par son ID
@GetMapping(value = "/{id}")
//@PreAuthorize("hasRole('ROLE_PARENT') or hasRole('ROLE_ENFANT')")
public ResponseEntity> findById(@PathVariable int id){
Optional