Example #1
0
    $recette = Recette::getRecetteByTemps($temps, $userId);
});
$app->get('/getRecetteByAll/:complexite/:note/:temps/:userId/:nbPersonne', function ($complexite, $note, $temps, $userId, $nbPersonne) {
    $recette = Recette::getRecetteByAll($complexite, $note, $temps, $userId, $nbPersonne);
});
$app->get('/getAllRecette/:userId', function ($userId) {
    //renvoi toutes les recettes
    $recette = Recette::getAllRecette($userId);
});
$app->get('/getPourcentageIngredient/:recetteId/:userId', function ($recetteId, $userId) {
    //renvoi le pourcentage de recette
    $recette = Recette::getPourcentageIngredient($recetteId, $userId);
});
$app->post('/addRecette', function () {
    //Ajoute une recette
    $recette = Recette::addRecette($_POST['nomRecette'], $_POST['complexite'], $_POST['note'], $_POST['temps'], $_POST['nbPersonne'], $_POST['description']);
});
$app->post('/addRecette_ingr', function () {
    //Ajoute une recette
    $recette = Recette::addRecette_ingr($_POST['ingredientId'], $_POST['recetteId'], $_POST['quantite']);
});
$app->put('/ModifRecette', function () {
    //Ajoute une recette
    $recette = Recette::ModifRecette($_POST['nomRecette'], $_POST['complexite'], $_POST['note'], $_POST['temps'], $_POST['nbPersonne'], $_POST['description'], $_POST['id']);
});
$app->delete('/DelRecette', function () {
    //Ajoute une recette
    $recette = Recette::DelRecette($_POST['id']);
});
$app->run();
?>