
Code Ứng dụng Web Bán Hàng Live Food sử dụng Java Spring Boot
by Tran Giain Java , Scripts & Code on November 6, 2024Choose Your Desired Option(s)
Become a SourceCodec member for full access. Your first 7 days are free.
Code Ứng dụng Web Bán Hàng Live Food sử dụng Java Spring Boot
- Java 17 or lastest
- Apache Maven 3.8.8
- MySQL ver 8.4.0
This is my setup
- Spring Boot, Spring Security with JWT, Spring JPA
- Springdoc Swagger, Lombok, MySQL



installation instructions:
download source code
- Move to the APP DIRECTORY
cd LiveFood
- Create a new MySQL Database
- Change to your Data URL and fill in username, password.
spring.datasource.url=jdbc:HERE
spring.datasource.username=HERE
spring.datasource.password=HERE
spring.datasource.username=HERE
spring.datasource.password=HERE
This is my URL JDBC URL: spring.datasource.url=jdbc:mysql://localhost:3306/livefood
- Install dependency throught Maven
mvn clean install
- Run app or Run ClientApplication.java from your IDE
mvn spring-boot:run
- Description: Get all user information.
- Response: 200 – OK
- Description: Send a register request
- Body Parameters:
- Response: 201 – CREATED
- Error Codes:
- 409 – CONFLICT: Register information unvalid
- 409 – CONFLICT: Username or Mail existed
- Description: Get user information with ID.
- Path Parameters:
/api/user/USER_ID
- Response: 200 – OK
- Description: Send a delete id user
- Path Parameters:
/api/user/USER_ID
- Response: 200 – OK
- Error Codes:
- 409 – CONFLICT: ID User unexist
- Description: Search with username or mail.
- Param Parameters:
Name ParamTypeDescriptionRequiredusernamestringUser nameFALSEmailstringUser mail addressFALSE
- Response: 200 – OK
- Description: Send a delete id user
- Body Parameters:
- Response: 200 – OK
- Error Codes:
- 400 – BAD REQUEST: Invalid update data
- 404 – NOT FOUND: User information unexist
- Description: Get all Product Information.
- Response: 200 – OK
- Description: Send an add product request
- Body Parameters:
{
name: “Coconut”,
price: 120.2,
category: “FRUIT”
}
name: “Coconut”,
price: 120.2,
category: “FRUIT”
}
- Response: 201 – CREATED
- Error Codes:
- 409 – CONFLICT: Register information invalid
- 409 – CONFLICT: Product name existed
- Description: Get product information with ID.
- Path Parameters:
/api/product/PRODUCT_ID
- Response: 200 – OK
- Description: Send a delete id user
- Path Parameters:
/api/product/PRODUCT_ID
- Response: 200 – OK
- Error Codes:
- 409 – CONFLICT: ID User unexist
- Description: Send request to update product information.
- Path Parameters:
/api/product/PRODUCT_ID
-Body Parameters:
{
code: “TEMP”,
name: “example”,
price: 120.2,
category : “FRUITS”
}
code: “TEMP”,
name: “example”,
price: 120.2,
category : “FRUITS”
}
- Response: 200 – OK
- Error Codes:
- 400 – BAD REQUEST: Invalid update data
- 404 – NOT FOUND: ID Product unexist
- Description: Get Media Information.
- Response: 200 – OK
- Description: Get Media Information with ID
- Path Parameters:
/api/media/getMedia/MEDIA_ID
- Response: 200 – OK
- Description: Upload multiple File to Product Media with Product’s ID and save it to DIRECTORY.
- Param Parameters:
Name ParamTypeDescriptionRequiredfilesFileImage FileTRUE
- Path Parameters:
/api/media/uploadproductMedia/PRODUCT_ID
- Response: 200 – OK
- Error Codes:
- 404 – NOT FOUND: Product unexist
- *500 – INTERNAL SERVER ERROR: Image upload failed
| Download Category | Java, Scripts & Code |
| Product Homepage URL→ | |
| Product Version | |
| File Type | JAVA, . . . |
| File Size | 18.3 MB |
| Developer | |
| Documentation |





