Skip to content
Snippets Groups Projects
Commit 423ec4c0 authored by florian.delbe.etu's avatar florian.delbe.etu
Browse files

YOLO

parent bdcb48f7
No related branches found
No related tags found
No related merge requests found
Showing
with 222 additions and 0 deletions
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<Context>
<CookieProcessor className="org.apache.tomcat.util.http.Rfc6265CookieProcessor"
sameSiteCookies="strict" />
</Context>
File moved
File added
File added
File added
File added
File added
File added
File added
File moved
File moved
File added
README.md 0 → 100644
# SAÉ 4.01 - Pizzeria en REST
> Binôme
> - DELBE florian
> - MARGELY Gwendal
# Sommaire
1. [INGREDIENTS](#ingredients)
2. [PATES](#pates-a-pizza)
3. [PIZZA](#pizza)
4. [COMMANDE](#commande)
## INGREDIENTS
### GET
Tous les ingrédients:
```bash
curl -X GET http://localhost:8080/pizzeria/ingredients
```
Un seul Ingrédient:
```bash
curl -X GET http://localhost:8080/pizzeria/ingredients/idIngredient
```
### POST
ajouter un ingredient
```bash
curl -X POST http://localhost:8080/pizzeria/ingredients -H "Autorization: Bearer <token>" -H "Content-Type:application/json" -H "Accept:application/json" -d '{"id":"<id>","nom":"<nom>","prix":"<prix>"}'
```
### DELETE
supprimer un ingredient
```bash
curl -X DELETE http://localhost:8080/pizzeria/ingredients/idIngredient -H "Autorization: Bearer <token>"
```
### PATCH
modifier un ingredient
```bash
curl -X PATCH http://localhost:8080/pizzeria/ingredients/idIngredient -H "Autorization: Bearer <token>" -H "Content-Type:application/json" -H "Accept:application/json" -d'<newDatas>'
```
## PATES A PIZZA
### GET
Toutes les pates:
```bash
curl -X GET http://localhost:8080/pizzeria/pates
```
Une seule pate:
```bash
curl -X GET http://localhost:8080/pizzeria/pates/idPates
```
### POST
ajouter une pate
```bash
curl -X POST http://localhost:8080/pizzeria/pates -H "Autorization: Bearer <token>" -H "Content-Type:application/json" -H "Accept:application/json" -d '{"id":"<id>","nom":"<nom>"}'
```
### DELETE
supprimer une pate
```bash
curl -X DELETE http://localhost:8080/pizzeria/pates/idPates -H "Autorization: Bearer <token>"
```
### PATCH
modifier une pate
```bash
curl -X PATCH http://localhost:8080/pizzeria/pates/idPates -H "Autorization: Bearer <token>" -H "Content-Type:application/json" -H "Accept:application/json" -d'<newDatas>'
```
## Pizza
### GET
Toutes les pizzas:
```bash
curl -X GET http://localhost:8080/pizzeria/pizzas
```
Une seule pizza:
```bash
curl -X GET http://localhost:8080/pizzeria/pizzas/idPizza
```
### POST
ajouter une pizza
```bash
curl -X POST http://localhost:8080/pizzeria/pizzas -H "Autorization: Bearer <token>" -H "Content-Type:application/json" -H "Accept:application/json" -d '{"id":"<id>","nom":"<nom>","prix":"<prix>","pate":"{"id":"<pateID>"}","ingredients":"[{"id":"<idIngredient1>"},{"id":"<idIngredient2>"}]"}'
```
ajouter un ingrédient a une pizza
```bash
curl -X POST http://localhost:8080/pizzeria/pizzas/idPizza -H "Autorization: Bearer <token>" -H "Content-Type:application/json" -H "Accept:application/json" -d '{"id":"<idIngredient>"}'
```
### DELETE
supprimer une pizza
```bash
curl -X DELETE http://localhost:8080/pizzeria/pizzas/idPizza -H "Autorization: Bearer <token>"
```
supprimer un ingrédient d'une pizza
```bash
curl -X POST http://localhost:8080/pizzeria/pizzas/idPizza/idIngrédient -H "Autorization: Bearer <token>" -H "Content-Type:application/json" -H "Accept:application/json" -d '{"id":"<idIngredient>"}'
```
### PATCH
modifier une pizza
```bash
curl -X PATCH http://localhost:8080/pizzeria/pizzas/idPizza -H "Autorization: Bearer <token>" -H "Content-Type:application/json" -H "Accept:application/json" -d'<newDatas>'
```
## COMMANDE
### GET
Toutes les pizzas:
```bash
curl -X GET http://localhost:8080/pizzeria/commandes
```
Une seule pizza:
```bash
curl -X GET http://localhost:8080/pizzeria/commandes/idCommande
```
### POST
ajouter une commande
```bash
curl -X POST http://localhost:8080/pizzeria/commandes -H "Autorization: Bearer <token>" -H "Content-Type:application/json" -H "Accept:application/json" -d '{"id":"<id>","utilisateur":"<nom>","prix":"<prix>","date":"{"id":"<pateID>"}","pizzas":"[{"id":"<idIngredient1>"},{"id":"<idIngredient2>"}]"}'
```
ajouter une pizza dans une commande
```bash
curl -X POST http://localhost:8080/pizzeria/commandes/idCommande -H "Autorization: Bearer <token>" -H "Content-Type:application/json" -H "Accept:application/json" -d '{"id":"<idPizza>"}'
```
### DELETE
supprimer une commande
```bash
curl -X DELETE http://localhost:8080/pizzeria/commandes/idCommande -H "Autorization: Bearer <token>"
```
supprimer une pizza d'une commande
```bash
curl -X DELETE http://localhost:8080/pizzeria/commandes/idCommande/idPizza -H "Autorization: Bearer <token>"
```
### PATCH
modifier une commande
```bash
curl -X PATCH http://localhost:8080/pizzeria/commandes/idCommande -H "Autorization: Bearer <token>" -H "Content-Type:application/json" -H "Accept:application/json" -d'<newDatas>'
```
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>pizzeria</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment