forked from s442333/DINO_SCRUM
119 lines
1.2 KiB
Markdown
119 lines
1.2 KiB
Markdown
# DINO_SCRUM
|
||
|
||
DINO_SCRUM
|
||
|
||
## API Endpoints
|
||
|
||
*POST* **/api/product/change-quantity**
|
||
|
||
```json
|
||
{
|
||
"id": Int,
|
||
"change": Int
|
||
}
|
||
```
|
||
|
||
Return:
|
||
|
||
```json
|
||
{
|
||
"id": Int,
|
||
"name": String,
|
||
"price": Float,
|
||
"quantity": Int,
|
||
"imageLink": String
|
||
}
|
||
```
|
||
|
||
This endpoint return editet product.
|
||
|
||
---
|
||
|
||
*GET* **/api/get-all**
|
||
|
||
Return:
|
||
|
||
```
|
||
{
|
||
[
|
||
{
|
||
"id": Int,
|
||
"name": String,
|
||
"price": Float,
|
||
"quantity": Int,
|
||
"imageLink": String
|
||
},
|
||
{...}
|
||
]
|
||
}
|
||
```
|
||
|
||
---
|
||
|
||
*GET* **/api/get-price-of-all**
|
||
|
||
Return:
|
||
|
||
```json
|
||
{
|
||
"price-of-all": Float
|
||
}
|
||
```
|
||
|
||
---
|
||
|
||
*POST* **/api/product/add**
|
||
|
||
```json
|
||
{
|
||
"name": String,
|
||
"price": Float,
|
||
"quantity": Int,
|
||
"imageLing": String
|
||
}
|
||
```
|
||
|
||
Return:
|
||
|
||
```json
|
||
{
|
||
"id": Int,
|
||
"name": String,
|
||
"price": Float,
|
||
"quantity": Int,
|
||
"imageLink": String
|
||
}
|
||
```
|
||
|
||
This endpoint return a newly created product.
|
||
|
||
---
|
||
|
||
*DELETE* **/api/delete-product**
|
||
|
||
```json
|
||
{
|
||
"id": Int
|
||
}
|
||
```
|
||
|
||
This endpoint doesn't return any data.
|
||
|
||
---
|
||
|
||
*GET* **/api/product/get-by-id**
|
||
|
||
Return:
|
||
|
||
```json
|
||
{
|
||
"id": Int,
|
||
"name": String,
|
||
"price": Float,
|
||
"quantity": Int,
|
||
"imageLink": String
|
||
}
|
||
```
|
||
|
||
----
|