# spring-boot-csdn **Repository Path**: perzpy/spring-boot-csdn ## Basic Information - **Project Name**: spring-boot-csdn - **Description**: springboot复习+实践 - **Primary Language**: Java - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 138 - **Created**: 2026-01-12 - **Last Updated**: 2026-01-12 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Spring Boot Tutorial Project This project is a Spring Boot learning tutorial that includes commonly used technologies and best practices in Spring Boot development. Each module is an independent Spring Boot application that can be run directly for learning purposes. ## Project Structure ``` spring-boot-csdn/ ├── 01-spring-boot-auth-filter # Authentication Filter Module ├── 02-poi-easyExcel # Excel Processing Module ├── 03-spring-boot-aop # AOP Aspect Programming Module ├── 04-spring-boot-validator # Parameter Validation Module ├── 05-spring-boot-jasypt # Encrypted Configuration Module ├── 06-customize-starter # Custom Starter Module ├── 07-mybatis-mapper # MyBatis Mapper Module ├── 08-spring-boot-fastdfs # FastDFS File Upload Module ├── 09-spring-boot-interface-crypto # Interface Encryption/Decryption Module └── LICENSE # License File ``` ## Module Descriptions ### 01. Authentication Filter Module (auth-filter) Implements a Redis-based user authentication mechanism, including: - **Filter Layer**: Uses `LoginFilter` for request filtering - **Interceptor Layer**: Uses `LoginInterceptor` for interception handling - **ArgumentResolver**: Injects the current logged-in user via the `@LoginUser` annotation - **Aspect**: Implements login validation using the `@LoginValidator` annotation - **ThreadLocal**: Uses `LoginUserThread` to store the logged-in user for the current thread ### 02. Excel Processing Module (poi-easyExcel) Excel read/write operations based on Apache POI, including: - **EventUserModel**: Parses large Excel files using event-driven mode - **SimpleRead/Write**: Simple mode for reading and writing Excel files - **BigRead/Write**: Support for reading and writing large files - **SXSSFWorkbook**: Handling extremely large Excel files ### 03. AOP Aspect Programming Module (aop) Demonstrates various Spring Boot AOP pointcut expressions: - **Execution**: Method execution pointcut - **Within**: Type-matching pointcut - **Args**: Parameter-matching pointcut - **@Annotation**: Annotation-matching pointcut - **@target/@within**: Annotation-matching pointcut - **Bean**: Bean name-matching pointcut ### 04. Parameter Validation Module (validator) Uses Spring Validation for parameter validation: - **Basic Validation**: @NotBlank, @NotNull, etc. - **Group Validation**: Different validation rules for different scenarios using @Validated(UpdateUser.class) - **Custom Validation**: Custom password validation rule via @PasswordPattern - **Nested Validation**: Object nesting validation using @Valid - **Global Exception Handling**: Unified handling of validation exceptions ### 05. Encrypted Configuration Module (jasypt) Uses jasypt to encrypt configuration files: - **Custom Property Detector**: Identifies encrypted properties - **Custom Property Resolver**: Decrypts configuration values - **Custom Filter**: Controls the scope of encrypted properties ### 06. Custom Starter Module (customize-starter) Demonstrates how to develop a Spring Boot Starter: - **log-collection-starter**: Log collection Starter - @MyLog annotation for method call logging - Auto-configuration class `LogAutoConfiguration` - Auto-assembly via spring.factories - **sql-query-starter**: SQL Query Starter - Provides a generic SQL query utility class `SqlQuery` ### 07. MyBatis Mapper Module (mybatis-mapper) Simplifies MyBatis development using通用 Mapper: - **Generic Mapper**: Inherits from Mapper to implement single-table CRUD operations - **Pagination Plugin**: Integrates PageHelper for pagination queries - **Automatic Mapping**: Uses @Table and @Id annotations - **Naming Strategy**: Configures NameStyle as camelhumpAndLowercase ### 08. FastDFS File Upload Module (fastdfs) Distributed file storage based on FastDFS: - **File Upload**: Supports single and multiple file uploads - **Image Processing**: Generates thumbnails - **File Download**: Supports multiple download methods - **File Deletion**: Supports single and batch deletion - **File Type Detection**: Detects real file types via magic numbers - **Global Exception Handling**: Unified handling of file operation exceptions ### 09. Interface Encryption/Decryption Module (interface-crypto) Implements encryption/decryption of interface data: - **Request Decryption**: Decrypts request data using `@DecryptionAnnotation` - **Response Encryption**: Encrypts response data using `@EncryptionAnnotation` - **AES Encryption**: Supports AES/ECB/PKCS5Padding - **Input Stream Caching**: Caches HTTP request input streams to support multiple reads - **Unified Exception Handling**: Handles exceptions during encryption/decryption processes ## Technology Stack - **Spring Boot**: Version 2.x - **Redis**: Caching and session storage - **Apache POI**: Excel processing - **MyBatis**: Persistence framework - **FastDFS**: Distributed file storage - **Jasypt**: Configuration file encryption - **Hutool**: Utility library - **Lombok**: Code simplification ## How to Run Each module is an independent Spring Boot application and can be run individually: ```bash # Enter the module directory cd 01-spring-boot-auth-filter # Compile and run mvn spring-boot:run ``` ## Environment Requirements - JDK 1.8+ - Maven 3.6+ - Redis 5.x+ - FastDFS 5.x+ ## License This project is licensed under the [MIT License](LICENSE). ## Learning Suggestions 1. **Learn in Order**: Suggested to learn modules from 01 to 09 sequentially 2. **Combine with Source Code**: Each module includes complete code implementations; study alongside the source code 3. **Apply in Practice**: Apply learned technologies to real projects 4. **Extend and Explore**: Try extending functionality of each module to deepen understanding ## Contribution Guidelines If you find any issues or have improvement suggestions, feel free to submit an Issue or Pull Request.