From d17a2b5098c9e93ea1ce236a6e6a0a261d65596e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Wi=C4=99cek?= Date: Tue, 22 Jan 2019 02:49:08 +0000 Subject: [PATCH] Update 'README.md' --- README.md | 206 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 204 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8d140cd..90c335c 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,205 @@ -# DINO_SCRUM +# DINO\_SCRUM -DINO_SCRUM \ No newline at end of file +DINO\_SCRUM + +## API Endpoints + +*POST* **/api/product/change-quantity** + +```json +{ + "id": Int, + "change": Int +} +``` + +Return: + +```json +{ + "id": Int, + "name": String, + "price": Float, + "quantity": Int, + "quantityMax": Int, + "imageLink": String +} +``` + +Edit quantity and return the product. + +* * * + +*GET* **/api/get-all** + +Return all products sorted by id. + +*GET* **/api/get-all?page=X&size=Y** + +Return page *X* with size *Y* of all products sorted by id. + +*GET* **/api/get-all?page=X&size=Y&sorted=Z** + +Return page *X* with size *Y* of all products sorted by *Z* field. + +*GET* **/api/get-all?sorted=Z** + +Return all products sorted by *Z*. + +Return: + +```json +{ + "content": [ + { + "id": Int, + "name": String, + "price": Float, + "quantity": Int, + "quantityMax": Int, + "imageLink": String + } + { + (...) + } + ], + "pageable": { + "sort": { + "sorted": Boolean, + "unsorted": Boolean, + "empty": Boolean + }, + "offset": Int, + "pageSize": Int, + "pageNumber": Int, + "unpaged": Boolean, + "paged": Boolean + }, + "totalPages": Int, + "totalElements": Int, + "last": Boolean, + "size": Int, + "number": Int, + "numberOfElements": Int, + "first": Boolean, + "sort": { + "sorted": Boolean, + "unsorted": Boolean, + "empty": Boolean + }, + "empty": Boolean +} +``` + +* * * + +*GET* **/api/get-price-of-all** + +Return: + +```json +{ + "price-of-all": Float +} +``` + +Return price of all products. + +* * * + +*POST* **/api/product/add** + +```json +{ + "id": Int, + "name": String, + "price": Float, + "quantity": Int, + "quantityMax": Int, + "imageLink": String +} +``` + +Return: + +```json +{ + "id": Int, + "name": String, + "price": Float, + "quantity": Int, + "quantityMax": Int, + "imageLink": String +} +``` + +Create and return a new product. + +* * * + +*DELETE* **/api/delete-product** + +```json +{ + "id": Int +} +``` + +Delete product with id. + +* * * + +*GET* **/api/product/get-by-id** + +```json +{ + "id": Int +} +``` + +Return: + +```json +{ + "id": Int, + "name": String, + "price": Float, + "quantity": Int, + "quantityMax": Int, + "imageLink": String +} +``` + +Return product with id. + +* * * + +*POST* /api/product/update/{id} + +Id is require, other field could be null. + +```json +{ + "id": Int, + "name": String, + "price": Float, + "quantity": Int, + "quantityMax": Int, + "imageLink": String +} +``` + +Return: + +```json +{ + "id": Int, + "name": String, + "price": Float, + "quantity": Int, + "quantityMax": Int, + "imageLink": String +} +``` + +Return updated product. \ No newline at end of file