https://github.com/timopattikawa/product-restful-api
Practice Create Restful API Product with Spring
https://github.com/timopattikawa/product-restful-api
restful-api spring
Last synced: about 2 months ago
JSON representation
Practice Create Restful API Product with Spring
- Host: GitHub
- URL: https://github.com/timopattikawa/product-restful-api
- Owner: timopattikawa
- Created: 2021-04-17T07:14:58.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-04-21T05:14:44.000Z (about 5 years ago)
- Last Synced: 2025-01-19T18:12:26.208Z (over 1 year ago)
- Topics: restful-api, spring
- Language: Java
- Homepage:
- Size: 63.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# API Spec
## Create Product
Request :
- Method : POST
- Endpoint : `/api/v1/products`
- Header :
- Content-Type: application/json
- Accept: application/json
- Body :
```json
{
"name" : "string",
"price" : "string",
"quantity" : "integer"
}
```
Response :
```json
{
"code" : "number",
"status" : "string",
"data" : {
"id" : "long, unique",
"name" : "string",
"price" : "string",
"quantity" : "integer",
}
}
```
## Get Product
Request :
- Method : GET
- Endpoint : `/api/products/{id_product}`
- Header :
- Accept: application/json
Response :
```json
{
"code" : "number",
"status" : "string",
"data" : {
"id" : "long, unique",
"name" : "string",
"price" : "string",
"quantity" : "integer",
}
}
```
## Update Product
Request :
- Method : PUT
- Endpoint : `/api/products/{id_product}`
- Header :
- Content-Type: application/json
- Accept: application/json
- Body :
```json
{
"name" : "string",
"price" : "string",
"quantity" : "integer"
}
```
Response :
```json
{
"code" : "number",
"status" : "string",
"data" : {
"id" : "long, unique",
"name" : "string",
"price" : "string",
"quantity" : "integer",
}
}
```
## List Product
Request :
- Method : GET
- Endpoint : `/api/products`
- Header :
- Accept: application/json
- Query Param :
- size : number,
- page : number
Response :
```json
{
"code" : "number",
"status" : "string",
"data" : [
{
"id" : "long, unique",
"name" : "string",
"price" : "string",
"quantity" : "integer",
},
{
"id" : "long, unique",
"name" : "string",
"price" : "string",
"quantity" : "integer",
}
]
}
```
## Delete Product
Request :
- Method : DELETE
- Endpoint : `/api/products/{id_product}`
- Header :
- Accept: application/json
Response :
```json
{
"code" : "number",
"status" : "string"
}
```