where-go-server
所属分类:Java书籍
开发工具:Java
文件大小:0KB
下载次数:0
上传日期:2023-11-23 03:55:31
上 传 者:
sh-1993
说明: Spring Boot项目,用于旅游推广和酒店预订。这个RESTful web服务充当旅游和酒店业的后端...
(Spring Boot project for tourism promotion and hotel booking. This RESTful web service serves as the backend for a tourism and hospitality platform, allowing users to discover and book hotels, access tourist information, and plan their travel experiences.)
文件列表:
.mvn/ (0, 2023-11-22)
.mvn/wrapper/ (0, 2023-11-22)
.mvn/wrapper/maven-wrapper.jar (62547, 2023-11-22)
.mvn/wrapper/maven-wrapper.properties (233, 2023-11-22)
.run/ (0, 2023-11-22)
.run/App.run.xml (383, 2023-11-22)
mvnw (11290, 2023-11-22)
mvnw.cmd (7592, 2023-11-22)
pom.xml (5129, 2023-11-22)
src/ (0, 2023-11-22)
src/main/ (0, 2023-11-22)
src/main/java/ (0, 2023-11-22)
src/main/java/com/ (0, 2023-11-22)
src/main/java/com/wherego/ (0, 2023-11-22)
src/main/java/com/wherego/wheregoserver/ (0, 2023-11-22)
src/main/java/com/wherego/wheregoserver/ServletInitializer.java (422, 2023-11-22)
src/main/java/com/wherego/wheregoserver/WhereGoServerApplication.java (332, 2023-11-22)
src/main/java/com/wherego/wheregoserver/boundary/ (0, 2023-11-22)
src/main/java/com/wherego/wheregoserver/boundary/ArticleResource.java (3767, 2023-11-22)
src/main/java/com/wherego/wheregoserver/boundary/AuthenticateResource.java (6172, 2023-11-22)
src/main/java/com/wherego/wheregoserver/boundary/BookingResource.java (1262, 2023-11-22)
src/main/java/com/wherego/wheregoserver/boundary/HotelResource.java (1581, 2023-11-22)
src/main/java/com/wherego/wheregoserver/boundary/PlaceResource.java (1723, 2023-11-22)
src/main/java/com/wherego/wheregoserver/boundary/RestaurantResource.java (1674, 2023-11-22)
src/main/java/com/wherego/wheregoserver/boundary/SearchResource.java (3389, 2023-11-22)
src/main/java/com/wherego/wheregoserver/boundary/ShareResource.java (1784, 2023-11-22)
src/main/java/com/wherego/wheregoserver/boundary/TravelerResource.java (4404, 2023-11-22)
src/main/java/com/wherego/wheregoserver/boundary/WriterResource.java (2609, 2023-11-22)
src/main/java/com/wherego/wheregoserver/config/ (0, 2023-11-22)
src/main/java/com/wherego/wheregoserver/config/ApplicationConfig.java (727, 2023-11-22)
src/main/java/com/wherego/wheregoserver/config/DelegatedAuthenticationEntryPoint.java (1043, 2023-11-22)
src/main/java/com/wherego/wheregoserver/config/SecurityConfig.java (3709, 2023-11-22)
src/main/java/com/wherego/wheregoserver/constant/ (0, 2023-11-22)
src/main/java/com/wherego/wheregoserver/constant/FileConstant.java (311, 2023-11-22)
src/main/java/com/wherego/wheregoserver/constant/UserRole.java (299, 2023-11-22)
src/main/java/com/wherego/wheregoserver/dto/ (0, 2023-11-22)
src/main/java/com/wherego/wheregoserver/dto/ResponseMessageDto.java (319, 2023-11-22)
src/main/java/com/wherego/wheregoserver/dto/article/ (0, 2023-11-22)
... ...
# WhereGo? RESTfull API web service
Spring Boot project for tourism promotion and hotel booking. This RESTful web service serves as the backend for a tourism and hospitality platform, allowing users to discover and book hotels, access tourist information, and plan their travel experiences.
## Tech Stack
- **Spring Framework:** Spring Boot, Spring Web, Spring Security, Spring Data JPA
- **Language:** Java
## Maven external dependencies
- Lombok
- Mapstruct
- Hibernate validator
- Jsonwebtoken
## API Reference
User roles:
- [Guest/Public](https://github.com/Qhung3217/where-go-server/blob/master/#role-guestpublic)
- [Hotel api](https://github.com/Qhung3217/where-go-server/blob/master/#hotel-api-)
- [Get all hotel](https://github.com/Qhung3217/where-go-server/blob/master/#get-all-hotel)
- [Get random hotel](https://github.com/Qhung3217/where-go-server/blob/master/#get-hotel-random)
- [Get hotel](https://github.com/Qhung3217/where-go-server/blob/master/#get-hotel)
- [Get hotel filter information](https://github.com/Qhung3217/where-go-server/blob/master/#get-hotel-filter-information)
- [Place api](https://github.com/Qhung3217/where-go-server/blob/master/#place-api-)
- [Get all place](https://github.com/Qhung3217/where-go-server/blob/master/#get-all-place)
- [Get random place](https://github.com/Qhung3217/where-go-server/blob/master/#get-place-random)
- [Get place](https://github.com/Qhung3217/where-go-server/blob/master/#get-place)
- [Get place filter information](https://github.com/Qhung3217/where-go-server/blob/master/#get-place-filter-information)
- [Restaurant api](https://github.com/Qhung3217/where-go-server/blob/master/#restaurant-api-)
- [Get all restaurant](https://github.com/Qhung3217/where-go-server/blob/master/#get-all-restaurant)
- [Get random restaurant](https://github.com/Qhung3217/where-go-server/blob/master/#get-restaurant-random)
- [Get restaurant](https://github.com/Qhung3217/where-go-server/blob/master/#get-restaurant)
- [Get restaurant filter information](https://github.com/Qhung3217/where-go-server/blob/master/#get-restaurant-filter-information)
- [Article api](https://github.com/Qhung3217/where-go-server/blob/master/#article-api-)
- [Get all article](https://github.com/Qhung3217/where-go-server/blob/master/#get-all-article)
- [Get article random](https://github.com/Qhung3217/where-go-server/blob/master/#get-article-random)
- [Get article](https://github.com/Qhung3217/where-go-server/blob/master/#get-article)
- [Search api](https://github.com/Qhung3217/where-go-server/blob/master/#search-api-)
- [Search by name and category](https://github.com/Qhung3217/where-go-server/blob/master/#search-by-name-and-category)
- [Share api](https://github.com/Qhung3217/where-go-server/blob/master/#share-api-)
- [Render image](https://github.com/Qhung3217/where-go-server/blob/master/#render-image)
- [User Authentication api](https://github.com/Qhung3217/where-go-server/blob/master/#user-authentication-api-)
- [Login](https://github.com/Qhung3217/where-go-server/blob/master/#login)
- [Writer Register](https://github.com/Qhung3217/where-go-server/blob/master/#writer-register)
- [Check Writer Username Exist](https://github.com/Qhung3217/where-go-server/blob/master/#check-writer-username-exist)
- [Check Writer Email Exist](https://github.com/Qhung3217/where-go-server/blob/master/#check-writer-email-exist)
- [Traveler Register](https://github.com/Qhung3217/where-go-server/blob/master/#traveler-register)
- [Check Traveler Username Exist](https://github.com/Qhung3217/where-go-server/blob/master/#check-traveler-username-exist)
- [Check Traveler Email Exist](https://github.com/Qhung3217/where-go-server/blob/master/#check-traveler-email-exist)
- [Traveler](https://github.com/Qhung3217/where-go-server/blob/master/#role-traveler-)
- [Get traveler detail](https://github.com/Qhung3217/where-go-server/blob/master/#get-traveler-detail)
- [Update account](https://github.com/Qhung3217/where-go-server/blob/master/#update-account)
- [Change password](https://github.com/Qhung3217/where-go-server/blob/master/#change-password)
- [Review](https://github.com/Qhung3217/where-go-server/blob/master/#review-hotelrestaurantplace)
- [Booking](https://github.com/Qhung3217/where-go-server/blob/master/#booking)
- [Writer](https://github.com/Qhung3217/where-go-server/blob/master/#role-writer-)
- [Get writer detail](https://github.com/Qhung3217/where-go-server/blob/master/#get-writer-detail)
- [Update account](https://github.com/Qhung3217/where-go-server/blob/master/#update-account-1)
- [Change password](https://github.com/Qhung3217/where-go-server/blob/master/#change-password-1)
- [Create article](https://github.com/Qhung3217/where-go-server/blob/master/#create-article)
- [Update article](https://github.com/Qhung3217/where-go-server/blob/master/#update-article)
---
### Role Guest/Public
#### Hotel api [](https://github.com/Qhung3217/where-go-server/blob/master/#api-reference)
##### Get all hotel
```http
GET /api/hotel
```
##### Get hotel random
```http
GET /api/hotel/random?quantity={quantity}
```
| Parameter | Type | Description |
|-----------|------|-------------|
| `quantity` | `Integer` | **Not required.** Default value is 20 |
##### Get hotel
```http
GET /api/hotel/{hotel_id}
```
| Parameter | Type | Description|
|--|--|--|
| `hotel_id` | `Long` | **Required.** Id of hotel to fetch |
##### Get hotel filter information
```http
GET /api/hotel/filter-infor
```
#### Place api [](https://github.com/Qhung3217/where-go-server/blob/master/#api-reference)
##### Get all place
```http
GET /api/place
```
##### Get place random
```http
GET /api/place/random?quantity={quantity}
```
| Parameter | Type | Description |
|-----------|------|-------------|
| `quantity` | `Integer` | **Not required.** Default value is 20 |
##### Get place
```http
GET /api/place/{place_id}
```
| Parameter | Type | Description|
|--|--|--|
| `place_id` | `Long` | **Required.** Id of place to fetch |
##### Get place filter information
```http
GET /api/place/filter-infor
```
#### Restaurant api [](https://github.com/Qhung3217/where-go-server/blob/master/#api-reference)
##### Get all restaurant
```http
GET /api/restaurant
```
##### Get restaurant random
```http
GET /api/restaurant/random?quantity={quantity}
```
| Parameter | Type | Description |
|-----------|------|-------------|
| `quantity` | `Integer` | **Not required.** Default value is 20 |
##### Get restaurant
```http
GET /api/restaurant/{restaurant_id}
```
| Parameter | Type | Description|
|--|--|--|
| `restaurant_id` | `Long` | **Required.** Id of restaurant to fetch |
##### Get restaurant filter information
```http
GET /api/restaurant/filter-infor
```
#### Article api [](https://github.com/Qhung3217/where-go-server/blob/master/#api-reference)
##### Get all article
```http
GET /api/article
```
##### Get article random
```http
GET /api/article/random?quantity={quantity}
```
| Parameter | Type | Description |
|-----------|------|-------------|
| `quantity` | `Integer` | **Not required.** Default value is 20 |
##### Get article
```http
GET /api/article/detail/{article_id}
```
| Parameter | Type | Description|
|--|--|--|
| `article_id` | `Long` | **Required.** Id of article to fetch |
#### Search api [](https://github.com/Qhung3217/where-go-server/blob/master/#api-reference)
##### Search by name and category
```http
GET /api/search?category={category}&keyword={keyword}
```
| Parameter | Type | Description |
|-----------|------|-------------|
| `category` | `String` | **Required.** Value in range: `'hotel'|'restaurant'|'place'|'article'` |
|`keyword`|`String`|**Required.** The keyword searches for items with matching names|
#### Share api [](https://github.com/Qhung3217/where-go-server/blob/master/#api-reference)
##### Render image
```http
GET /api/render/{image_file}
```
| Parameter | Type | Description |
|-----------|------|-------------|
| `image_file` | `String` | **Required.** The full file name to render |
#### User authentication api [](https://github.com/Qhung3217/where-go-server/blob/master/#api-reference)
##### Login
```http
POST /api/auth/login?role={user_role}
```
| Parameter | Type | Description |
|-----------|------|-------------|
| `user_role` | `String` | **Required.** Specify login as role `writer` or role `traveler` |
Request body (**JSON format**)
| Parameter | Type | Description|
|--|--|--|
| `email ` | `String` | **Required.** Email for login |
| `password` | `String` | **Required.** Account password |
##### Writer register
```http
POST /api/auth/writer/register
```
Request body (**Form-data**)
| Parameter | Type | Description|
|--|--|--|
| `email ` | `String` | **Required.** Email for login |
| `name` | `String` | **Required.** Full name |
| `tels` | `String` | **Required.** Phone number |
| `dob` | `Date:YYYY-MM-DD`| **Required.** Date of birth |
| `username` | `String` | **Required.** Account username |
| `password` | `String` | **Required.** Account password |
##### Check writer username exist
```http
POST /api/auth/writer/check-username-exist
```
Request body (**x-www-form-urlencoded**)
| Parameter | Type | Description|
|--|--|--|
| `username` | `String` | **Required.** Username to check existence |
##### Check writer email exist
```http
POST /api/auth/writer/check-email-exist
```
Request body (**x-www-form-urlencoded**)
| Parameter | Type | Description|
|--|--|--|
| `email` | `String` | **Required.** Email to check existence |
##### Traveler register
```http
POST /api/auth/traveler/register
```
Request body (**Form-data**)
| Parameter | Type | Description|
|--|--|--|
| `email ` | `String` | **Required.** Email for login |
| `name` | `String` | **Required.** Full name |
| `tels` | `String` | **Required.** Phone number |
| `dob` | `Date:YYYY-MM-DD`| **Required.** Date of birth |
| `username` | `String` | **Required.** Account username |
| `password` | `String` | **Required.** Account password |
##### Check traveler username exist
```http
GET /api/auth/traveler/check-username-exist?username={username}
```
| Parameter | Type | Description|
|--|--|--|
| `username` | `String` | **Required.** Username to check existence |
##### Check traveler email exist
```http
GET /api/auth/traveler/check-email-exist?email={email}
```
| Parameter | Type | Description|
|--|--|--|
| `email` | `String` | **Required.** Email to check existence |
### Role Traveler [](https://github.com/Qhung3217/where-go-server/blob/master/#api-reference)
- Access requires the `traveler` role
- Attach the **Bearer Token** to the **request header** for access
##### Get traveler detail
```http
GET /api/traveler
```
##### Update account
```http
POST /api/traveler/update
```
Request body (**Form-data**)
| Parameter | Type | Description|
|--|--|--|
| `name` | `String` | **Not required.** Full name |
| `tels` | `String` | **Not required.** Phone number |
| `dob` | `Date:YYYY-MM-DD`| **Not required.** Date of birth |
| `username` | `String` | **Not required.** Account username |
| `avatar` | `File` | **Not required.** Account avatar |
##### Change password
```http
POST /api/traveler/change-password
```
Request body (**JSON format**)
| Parameter | Type | Description|
|--|--|--|
| `currentPassword` | `String` | **Required.** Current account password |
| `newPassword` | `String` | **Required.** New account password |
##### Review hotel/restaurant/place
```http
POST /api/traveler/review?category={category}
```
| Parameter | Type | Description|
|--|--|--|
| `category` | `String` | **Required.** Specify a review for `hotel`, `restaurant` or `place` |
Request body (**Form-data**)
| Parameter | Type | Description|
|--|--|--|
| `commment` | `String` | **Required.** Leave a comment about the object |
| `rating` | `Integer` | **Required.** Provide a rating between 1 and 5 for the object |
| `categoryId` | `Long`| **Required.** The id of the object |
##### Booking
```http
POST /api/traveler/booking
```
Request body (**JSON format**)
| Parameter | Type | Description|
|--|--|--|
| `hotelId` | `Long` | **Required.** The id of the hotel booking |
| `people` | `Integer` | **Required.** Total people |
| `price` | `Long`| **Required.** Total booking price |
| `checkIn` | `Date:YYYY-MM-DD`| **Required.** Check-in date |
| `checkOut` | `Date:YYYY-MM-DD`| **Required.** Check-out date |
### Role Writer [](https://github.com/Qhung3217/where-go-server/blob/master/#api-reference)
- Access requires the `writer` role
- Attach the **Bearer Token** to the **request header** for access
##### Get writer detail
```http
GET /api/writer
```
##### Update account
```http
POST /api/writer/update
```
Request body (**Form-data**)
| Parameter | Type | Description|
|--|--|--|
| `name` | `String` | **Not required.** Full name |
| `tels` | `String` | **Not required.** Phone number |
| `dob` | `Date:YYYY-MM-DD`| **Not required.** Date of birth |
| `username` | `String` | **Not required.** Account username |
| `avatar` | `File` | **Not required.** Account avatar |
##### Change password
```http
POST /api/writer/change-password
```
Request body (**JSON format**)
| Parameter | Type | Description|
|--|--|--|
| `currentPassword` | `String` | **Required.** Current account password |
| `newPassword` | `String` | **Required.** New account password |
##### Create article
```http
POST /api/article/create
```
Request body (**Form-data**)
| Parameter | Type | Description|
|--|--|--|
| `title` | `String` | **Required.** Article title|
| `shortDescription` | `String` | **Required.** Article short content |
| `content` | `String` | **Required.** Article content |
| `thumbnail` | `File` | **Required.** Article thumbnail |
##### Update article
```http
POST /api/article/update/{article_id}
```
| Parameter | Type | Description|
|--|--|--|
| `article_id` | `Long` | **Required.** The id of the article to update |
Request body (**Form-data**)
| Parameter | Type | Description|
|--|--|--|
| `title` | `String` | **Not Required.** Article title|
| `shortDescription` | `String` | **Not Required.** Article short content |
| `content` | `String` | **Not Required.** Article content |
| `thumbnail` | `File` | **Not Required.** Article thumbnail |
近期下载者:
相关文件:
收藏者: