This is a complete overview of my recent project apnaHotel, which I did using JAVA, SpringBoot.
All end points that as access among Admin or User, will require JWT token to verify their identity.
Description: Registers a new user in the system.
Endpoint Url | /auth/register |
---|---|
Method | Post |
Data | {
} |
Access | Anyone (no authentication required) |
Description: Login a registered user in the system. Returns a JWT token that contains user identity along with role.
Endpoint Url | /auth/login |
---|---|
Method | POST |
Data | {
} |
Access | Anyone (no authentication required) |
Description : Retrieves a list of all users.
Endpoint Url | /users/all |
---|---|
Method | GET |
Data | Requires JWT token in Auth Headers. |
Access | Only Admin |
Description : Returns a specific user by their ID.
Endpoint Url | /users/get-by-id/{userId} |
---|---|
Method | GET |
Data | UserId [Long (path parameter)] |
Access | Anyone |
Description : Deletes a user by their ID.
Endpoint Url | /users/delete/{userId} |
---|---|
Method | DELETE |
Data | UserId [Long (path parameter)] |
Access | Only Admin |
Description : Returns the profile information of the currently logged-in user.
Endpoint Url | /users/get-logged-in-profile-info |
---|---|
Method | GET |
Data | None |
Access | Anyone (must be logged in) |
Description : Returns the booking history for a specific user.
Endpoint Url | /users/get-user-bookings/{userId} |
---|---|
Method | GET |
Data | UserId (path parameter) |
Access | Anyone |
Description : Add a new room to the hotel’s inventory.
Endpoint Url | /rooms/add |
---|---|
Method | POST |
Data |
(All field required) |
Access | Only Admin |
Description : Updates the details of added rooms.
Endpoint Url | /rooms/update/{roomId} |
---|---|
Method | PUT |
Data | RoomId (path parameter) FormData. (photo, roomType, roomPrice, roomDescription) (All fields required) |
Access | Only Admin |
Description : Returns List of all the rooms.
Endpoint Url | /rooms/all |
---|---|
Method | GET |
Data | None |
Access | Anyone. |
Description : Returns List of all types of rooms registered.
Endpoint Url | /rooms/types |
---|---|
Method | GET |
Data | None |
Access | Anyone. |
Description : Returns a specific room by its ID.
Endpoint Url | /rooms/rom-by-id/{roomId} |
---|---|
Method | GET |
Data | roomId [Path parameter] |
Access | Anyone. |
Description : Returns a list of all available rooms. (Non booked rooms)
Endpoint Url | /rooms/all-available-rooms |
---|---|
Method | GET |
Data | None |
Access | Anyone. |
Description : Returns available rooms based on the specified check-in date, check-out date, and room type.
Endpoint Url | /rooms/available-rooms-by-date-and-type |
---|---|
Method | GET |
Data | CheckIn Date, CheckOut Date, RoomType (All fields required) |
Access | Anyone. |
Description : Deletes a room by its ID.
Endpoint Url | /rooms/delete/{roomId} |
---|---|
Method | DELETE |
Data | RoomId as path parameter. |
Access | Admin. |
Description : Creates a new booking for a room.
Endpoint Url | /bookings/book-room/{roomId}/{userId} |
---|---|
Method | POST |
Data | roomId (path parameter) userId (path parameter) Booking object in the request body. checkInDate: LocalDate checkOutDate: LocalDate |
Access | Admin or User |
Description : Retrieves a list of all bookings.
Endpoint Url | /bookings/all |
---|---|
Method | GET |
Data | none |
Access | Admin only |
Description : Retrieves a booking by its confirmation code.
Endpoint Url | /bookings/get-by-confirmation-code/{confirmationCode} |
---|---|
Method | GET |
Data | confirmationCode as path variable |
Access | Anyone |
Description : Delete a booking by booking id.
Endpoint Url | /bookings/cancel/{bookingId} |
---|---|
Method | DELETE |
Data | Booking id as path parameter |
Access | Admin or User |