-
Notifications
You must be signed in to change notification settings - Fork 1
Client and Server REST service.
NaniiGheorghe edited this page Jan 23, 2019
·
1 revision
Full API description is available here.
Below you will be able to find all available REST endpoints:
| Endpoint | Type | Description |
|---|---|---|
| /api/v1/action/ | POST | Create an action |
| /api/v1/action/list/ | GET | Get all actions |
| /api/v1/action/{id}/ | DELETE | Create an action |
| /api/v1/action/{id}/ | PUT | Update an action |
| /api/v1/doorlock/ | POST | Create new door-lock |
| /api/v1/doorlock/list/ | GET | Get all door-locks |
| /api/v1/doorlock/{id}/ | DELETE | Delete a door-lock |
| /api/v1/doorlock/{id}/ | PUT | Update a door-lock |
| /api/v1/employee/ | POST | Create an employee |
| /api/v1/employee/request_access/{employee_id}/{room_id} | POST | Request access to a room |
| /api/v1/employee/give_access/{employee_id}/{room_id}/ | POST | Give access to a employee to a room |
| /api/v1/employee/list/ | GET | Get all employee list |
| /api/v1/employee/{id}/ | DELETE | Delete an employee |
| /api/v1/employee/{id}/ | PUT | Uodate an employee |
| /api/v1/key/ | POST | Create an key |
| /api/v1/key/list/ | GET | Get all keys |
| /api/v1/key/{id}/ | DELETE | Create a key |
| /api/v1/key/{id}/ | PUT | Update a key |
| /api/v1/officeroom/ | POST | Create an office room |
| /api/v1/officeroom/list/ | GET | Get all office rooms |
| /api/v1/officeroom/{id}/ | DELETE | Create a office room |
| /api/v1/officeroom/{id}/ | PUT | Update a office room |
| /api/v1/officeroom/accessible_rooms/{employee_id}/ | POST | See all accessible rooms |
| /api/v1/user/login | GET | Login |
When user is registered in the database is stored a new hashed value, the password is encrypted using spring encoder BCryptPasswordEncoder.
When user tries to login in the system based on hashed password from db and current date a new token is generated, the token is returned through REST back to the client.
The client stores the token in the cookies file. Every time when the user access the system client validate with server if the token is still active, if not, the user is redirected in the login page.
Home Page