Spring-REST-API
所属分类:数据库系统
开发工具:Java
文件大小:0KB
下载次数:0
上传日期:2023-08-26 00:36:18
上 传 者:
sh-1993
说明: 以WIP后端为中心的Spring Boot RESTful API实现,展示了重要的后端概念、软件开发最佳实践等...,
(WIP back-end focused Spring Boot RESTful API implementation showcasing essential backend concepts, software development best practices, advanced architectural approaches, database, and front-end integration.)
文件列表:
.mvn/ (0, 2023-12-29)
.mvn/wrapper/ (0, 2023-12-29)
.mvn/wrapper/maven-wrapper.jar (59925, 2023-12-29)
.mvn/wrapper/maven-wrapper.properties (1019, 2023-12-29)
mvnw (10284, 2023-12-29)
mvnw.cmd (6734, 2023-12-29)
pom.xml (2209, 2023-12-29)
src/ (0, 2023-12-29)
src/main/ (0, 2023-12-29)
src/main/java/ (0, 2023-12-29)
src/main/java/com/ (0, 2023-12-29)
src/main/java/com/example/ (0, 2023-12-29)
src/main/java/com/example/mySpringApi/ (0, 2023-12-29)
src/main/java/com/example/mySpringApi/MySpringApiApplication.java (396, 2023-12-29)
src/main/java/com/example/mySpringApi/Security/ (0, 2023-12-29)
src/main/java/com/example/mySpringApi/Security/SecurityConfig.java (4389, 2023-12-29)
src/main/java/com/example/mySpringApi/api/ (0, 2023-12-29)
src/main/java/com/example/mySpringApi/api/advice/ (0, 2023-12-29)
src/main/java/com/example/mySpringApi/api/advice/UserExceptionHandler.java (5073, 2023-12-29)
src/main/java/com/example/mySpringApi/api/controller/ (0, 2023-12-29)
src/main/java/com/example/mySpringApi/api/controller/UserController.java (10559, 2023-12-29)
src/main/java/com/example/mySpringApi/config/ (0, 2023-12-29)
src/main/java/com/example/mySpringApi/config/OpenApiConfig.java (2008, 2023-12-29)
src/main/java/com/example/mySpringApi/config/PasswordEncoderConfig.java (459, 2023-12-29)
src/main/java/com/example/mySpringApi/exception/ (0, 2023-12-29)
src/main/java/com/example/mySpringApi/exception/InvalidUserInputException.java (652, 2023-12-29)
src/main/java/com/example/mySpringApi/exception/UserAlreadyExistsException.java (837, 2023-12-29)
src/main/java/com/example/mySpringApi/exception/UserException.java (2427, 2023-12-29)
src/main/java/com/example/mySpringApi/exception/UserNotFoundException.java (1452, 2023-12-29)
src/main/java/com/example/mySpringApi/model/ (0, 2023-12-29)
src/main/java/com/example/mySpringApi/model/Address.java (1612, 2023-12-29)
src/main/java/com/example/mySpringApi/model/Role.java (957, 2023-12-29)
src/main/java/com/example/mySpringApi/model/User.java (2523, 2023-12-29)
src/main/java/com/example/mySpringApi/model/dto/ (0, 2023-12-29)
src/main/java/com/example/mySpringApi/model/dto/UserDTO.java (1689, 2023-12-29)
src/main/java/com/example/mySpringApi/model/dto/UserResponseDTO.java (695, 2023-12-29)
src/main/java/com/example/mySpringApi/repository/ (0, 2023-12-29)
src/main/java/com/example/mySpringApi/repository/RoleRepository.java (1250, 2023-12-29)
... ...
# User-Management-System
The User Management System is a comprehensive backend-focused RESTful API, showcasing a range of backend concepts, software development best practices, advanced architectural approaches, and integration with databases and front-end systems. This system is designed for robust user management, featuring extensive CRUD operations, advanced security measures, role-based access control, custom exception handling, and thorough documentation.
## Features
### **CRUD Operations**
- **Create**: Add a new user to the system with unique email identification.
- **Read**: Retrieve user details based on their ID or name. Additionally, fetch a list of all registered users.
- **Update**: Modify existing user details using their unique ID.
- **Delete**: Remove a user from the system using their unique ID.
### **Exception Handling**
- Customized responses for various exceptions to ensure clear communication of issues to the client.
- Detailed error messages for instances such as duplicate email entries or when attempting to access non-existent users.
### **Javadoc Documentation**
- Comprehensive documentation provided for each class and method to ensure clarity and ease of understanding for developers.
- Annotations and clear documentation on the purpose and usage of each REST endpoint.
### **Logging**
- Detailed logging provided at different levels (INFO, WARN) for better troubleshooting and system monitoring.
- Traceable logs for every significant action, such as user creation, update, or deletion.
### **Data Integrity**
- Enforced email uniqueness to ensure each user has a distinct email address.
- JPA integration for seamless object-relational mapping and data persistence to the "user_info" database table.
### **Response Structuring**
- Standardized response structure using `ResponseHandler` to maintain consistency in all API responses, which includes a status message and relevant data.
### **Role-Based Access Control**
- Implemented RBAC to enhance security and provide differentiated access levels.
- Users can be assigned roles (e.g., "ADMIN", "USER") with specific permissions for various operations
### **Enhanced Security with Spring Security**
- Integrated Spring Security for authentication and authorization.
- Database-backed user storage for secure user data management.
- Password encryption using BCrypt for enhanced security.
## Technologies Used
### Core
- Java
- Spring Boot
- Maven
### Web, Data & Testing
- Spring Web
- Spring Data JPA / Hibernate ORM
- MySQL Connector
- H2 Database
- JUnit
- Mockito
### Documentation
- OpenAPI and Swagger
- JavaDocs
### Validation
- Spring Validation
### Utility
- Lombok
## Usage
### **Get a User by ID**
Retrieve a user by their ID.
curl -X GET http://localhost:8080/userAPI/id/{id}
Replace `{id}` with the desired user's ID.
### **Get a User by Name**
Retrieve a user by their name.
curl -X GET "http://localhost:8080/userAPI/name/{name}"
Replace `{name}` with the desired user's name. Ensure the name is URL encoded if it contains spaces or special characters.
### **Get All Users**
Retrieve all users.
curl -X GET http://localhost:8080/userAPI
### **Create a User**
Add a new user to the system.
curl -X POST http://localhost:8080/userAPI/createUser \
-H "Content-Type: application/json" \
-d '{
"name": "John Doe",
"email": "john.doe@example.com",
"age": 25
}'
### **Update a User**
Update an existing user's details.
curl -X PUT http://localhost:8080/userAPI/updateUser \
-H "Content-Type: application/json" \
-d '{
"id": 1,
"name": "Johnathan Doe",
"email": "johnathan.doe@example.com",
"age": 26
}'
### **Delete a User**
Delete a user by their ID.
curl -X DELETE http://localhost:8080/userAPI/deleteUser/{id}
Replace `{id}` with the ID of the user you wish to delete.
## Author
Zachary Graceman
近期下载者:
相关文件:
收藏者: