https://github.com/shev0k/parking-system-be
https://github.com/shev0k/parking-system-be
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/shev0k/parking-system-be
- Owner: shev0k
- Created: 2024-09-14T16:34:36.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-09-14T16:35:38.000Z (8 months ago)
- Last Synced: 2025-01-11T08:31:03.365Z (4 months ago)
- Language: Java
- Size: 122 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# DEVELOPMENT SETUP
## Data base setup
1) Download an image from dockerhub:
`docker run --name parking_system -e MYSQL_DATABASE=parking_system_db_dev -e MYSQL_ROOT_PASSWORD=*YOUR_PASSWORD!* -p 3390:3306 -d mysql`
2) Insert your password in application-dev.properties
```properties
spring.datasource.url=jdbc:mysql://localhost:3390/parking_system_db_dev
spring.datasource.username=root
spring.datasource.password=*YOUR_PASSWORD!*
spring.jpa.hibernate.ddl-auto=update
```3) change active profile to dev in app configuration
## Endpoints
- #### Get appointments paginated (GET)
*Request:*
```
api/appointments/pages
?page=int
&pageSize=int
```
*Response:*
```json
{
"content": [
{
"id": 5,
"datetime": "2024-04-11T11:16:00",
"guest": "Danila Solovenko",
"employee": "Cooler Solovenko",
"guestEmail": "[email protected]",
"employeeEmail": "[email protected]",
"description": "smth",
"carPlateNumber": "DEF451"
}
],
"pageable": {
"pageNumber": 1,
"pageSize": 1,
"sort": {
"empty": true,
"sorted": false,
"unsorted": true
},
"offset": 1,
"paged": true,
"unpaged": false
},
"last": false,
"totalElements": 4,
"totalPages": 4,
"size": 1,
"number": 1,
"sort": {
"empty": true,
"sorted": false,
"unsorted": true
},
"first": false,
"numberOfElements": 1,
"empty": false
}
```- #### Get appointments for a specific month (GET)
*Request:*
```
api/appointments/calendar_overview
?year=int
&month=int
```
*Response:*
```json
[
{
"id": 5,
"datetime": "2024-04-11T11:16:00",
"guest": "Danila Solovenko",
"employee": "Cooler Solovenko",
"guestEmail": "[email protected]",
"employeeEmail": "[email protected]",
"description": "smth",
"carPlateNumber": "DEF451"
}
]
```
- #### Get a specific appointment (GET)
*Request:*
```
api/appointments/5
```
*Response:*
```json
{
"id": 3,
"datetime": "2024-04-11T11:15:00",
"guest": "Eva Garcia",
"employee": "Michael Clark",
"guestEmail": "[email protected]",
"employeeEmail": "[email protected]",
"description": "Tire rotation",
"carPlateNumber": "DEF456"
}
```- #### Create an appointment (POST)
*Request:*
```
api/appointments
```
*Body:*
```json
{
"datetime": "2024-04-11T11:18:00",
"guest": "Danila Solovenko",
"employee": "Cooler Solovenko",
"guestEmail": "[email protected]",
"employeeEmail": "[email protected]",
"description": "smth",
"carPlateNumber": "DEF451"
}
```
*Response:*
```json
6
```
- #### Edit an appointment (PUT)
*Request:*
```
api/appointments/5
```
*Response:*
```json
```- #### Delete an appointment (DELETE)
*Request:*
```
api/appointments/5
```
*Response:*
```json
```