1
0
Fork 0
DINO_SCRUM
Go to file
prgres b80b51730c fix ignore 2019-01-22 04:38:43 +01:00
.idea fix ignore 2019-01-22 04:38:43 +01:00
.mvn/wrapper all 2019-01-13 18:41:23 +01:00
src fix ignore 2019-01-22 04:38:43 +01:00
target ignore 2019-01-22 04:33:32 +01:00
.gitignore ignore 2019-01-22 04:33:32 +01:00
README.md Update 'README.md' 2019-01-22 02:49:08 +00:00
init initialized backend branch 2019-01-13 19:49:28 +01:00
mvnw all 2019-01-13 18:41:23 +01:00
mvnw.cmd all 2019-01-13 18:41:23 +01:00
pom.xml fix pom.xml 2019-01-22 03:55:29 +01:00
sysmag.iml all 2019-01-13 18:41:23 +01:00

README.md

DINO_SCRUM

DINO_SCRUM

API Endpoints

POST /api/product/change-quantity

{
 "id": Int,
 "change": Int
}

Return:

{
 "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:

{
    "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:

{
 "price-of-all": Float
}

Return price of all products.


POST /api/product/add

{
 "id": Int,
 "name": String,
 "price": Float,
 "quantity": Int,
 "quantityMax": Int,
 "imageLink": String
}

Return:

{
 "id": Int,
 "name": String,
 "price": Float,
 "quantity": Int,
 "quantityMax": Int,
 "imageLink": String
}

Create and return a new product.


DELETE /api/delete-product

{
 "id": Int
}

Delete product with id.


GET /api/product/get-by-id

{
 "id": Int
}

Return:

{
 "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.

{
 "id": Int,
 "name": String,
 "price": Float,
 "quantity": Int,
 "quantityMax": Int,
 "imageLink": String
}

Return:

{
 "id": Int,
 "name": String,
 "price": Float,
 "quantity": Int,
 "quantityMax": Int,
 "imageLink": String
}

Return updated product.