https://github.com/erikrios/kotlin-restful-api
Learn to Build a RESTful API with Spring Framework
https://github.com/erikrios/kotlin-restful-api
kotlin postgresql postgresql-driver rest-api restful-api spring-boot spring-data-jpa spring-framework spring-validation spring-web-mvc
Last synced: 3 months ago
JSON representation
Learn to Build a RESTful API with Spring Framework
- Host: GitHub
- URL: https://github.com/erikrios/kotlin-restful-api
- Owner: erikrios
- Created: 2021-03-03T03:44:44.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-03-03T16:28:44.000Z (over 5 years ago)
- Last Synced: 2025-08-30T06:44:06.727Z (10 months ago)
- Topics: kotlin, postgresql, postgresql-driver, rest-api, restful-api, spring-boot, spring-data-jpa, spring-framework, spring-validation, spring-web-mvc
- Language: Kotlin
- Homepage:
- Size: 95.7 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# API Spec
## Authentication
All API must use this authentication
Request :
- Header
- Api-Key : "your secret api key"
## Create Product
Request :
- Method : POST
- Endpoint : `/api/products`
- Header
- Content-Type : applicatication/json
- Accept: application/json
- Body :
```json
{
"id": "string, unique",
"name": "string",
"price": "long",
"quantity": "integer"
}
```
Response :
```json
{
"code": "number",
"status": "string",
"data": {
"id": "string, unique",
"name": "string",
"price": "long",
"quantity": "integer",
"createdAt": "date",
"updatedAt": "date"
}
}
```
## Get Product
Request :
- Method : GET
- Endpoint : `/api/products/{id_product}`
- Header
- Accept: application/json
Response :
```json
{
"code": "number",
"status": "string",
"data": {
"id": "string, unique",
"name": "string",
"price": "long",
"quantity": "integer",
"createdAt": "date",
"updatedAt": "date"
}
}
```
## Update Product
Request :
- Method : PUT
- Endpoint : `/api/products/{id_product}`
- Header
- Content-Type : applicatication/json
- Accept: application/json
- Body :
```json
{
"name": "string",
"price": "long",
"quantity": "integer"
}
```
Response :
```json
{
"code": "number",
"status": "string",
"data": {
"id": "string, unique",
"name": "string",
"price": "long",
"quantity": "integer",
"createdAt": "date",
"updatedAt": "date"
}
}
```
## 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": "string, unique",
"name": "string",
"price": "long",
"quantity": "integer",
"createdAt": "date",
"updatedAt": "date"
},
{
"id": "string, unique",
"name": "string",
"price": "long",
"quantity": "integer",
"createdAt": "date",
"updatedAt": "date"
}
]
}
```
## Delete Product
Request :
- Method : DELETE
- Endpoint : `/api/products/{id_product}`
- Header
- Accept: application/json
Response :
```json
{
"code": "number",
"status": "string"
}
```