# springBootDemo **Repository Path**: jiuseng/springBootDemo ## Basic Information - **Project Name**: springBootDemo - **Description**: demo库,自己学习使用 - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-08-09 - **Last Updated**: 2025-09-03 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # SpringBootDemo Development Documentation ## Project Introduction This is a comprehensive demonstration project based on Spring Boot, containing multiple modules such as audio service, WebSocket, Netty, Hadoop, Redis, RabbitMQ, etc. The project aims to showcase how to integrate various technologies using the Spring Boot framework, including network communication, message queues, databases, search, scheduled tasks, and more. ## Module Overview - **NAudioServerCentos / NAudioServerWindows**: Audio server module, used for playing audio files, TTS, real-time paging, monitoring, and other functions. - **hk-server**: Hikvision camera SDK integration module, used for video surveillance, device control, etc. - **webSocket**: WebSocket communication module, supports real-time communication. - **netty**: Implements TCP/UDP communication using the Netty framework. - **activiti**: Workflow module, uses Activiti for process management. - **rabbitmq**: RabbitMQ message queue module, used for asynchronous message processing. - **redis**: Redis caching module, used for caching data and message subscription. - **elasticSearch**: Implements data search using Elasticsearch. - **mybatisPlus**: MyBatis Plus module, used for database operations. - **scheduleTask**: Scheduled task module, uses Quartz for task scheduling. - **pageDemo**: Page display module, uses the Thymeleaf template engine. - **influxdb**: InfluxDB time-series database integration module. - **binlog4j-demo**: MySQL Binlog parsing module, used for database change monitoring. - **cacal_demo**: Canal module, used for MySQL database incremental log parsing. - **javaDemo**: Java sample code, including examples of algorithms, design patterns, Groovy, Maven, multithreading, and more. - **pdf**: PDF processing module, used for PDF file operations. - **dynamicAnalysis**: Dynamic analysis module, used for IP address analysis and email sending. ## Quick Start ### Environment Requirements - JDK 1.8 or higher - Maven 3.x - Spring Boot 2.x - Third-party libraries required by each module (e.g., Netty, Redis, RabbitMQ, Elasticsearch, etc.) ### Build and Run 1. **Clone the Project** ```bash git clone https://gitee.com/jiuseng/springBootDemo_dev.git cd springBootDemo_dev ``` 2. **Build the Project** ```bash mvn clean install ``` 3. **Run a Module** Each module has its own startup class (e.g., `NAudioApplication.java`), and can be run as follows: ```bash mvn spring-boot:run -pl NAudioServerCentos -am ``` Or run the main class directly: ```bash java -jar NAudioServerCentos/target/NAudioServerCentos.jar ``` ## Usage Instructions ### Audio Service (NAudioServer) - **Play Audio File**: `PlayAudioFileTest()` - **Play TTS**: `PlayTTSTest()` - **Real-Time Paging**: `PagingTest()` - **Audio Monitoring**: `MonitorTest()` - **Stream Playback**: `PcmStreamPlayTest()`, `Mp3StreamPlayTest()`, `ImaAdpcmStreamPlayTest()` ### Hikvision Camera Service (hk-server) - **Login Camera**: `login()` - **Get Channel Info**: `getChannelInfo()` - **Search Historical Video**: `findHistoryVideoFileV40()` - **Download Historical Video**: `downloadHistoryVideoByFileName()` ### WebSocket Communication (webSocket) - **Establish WebSocket Connection**: The `consum()` method is used to receive messages. - **Scheduled Tasks**: The `@Scheduled` annotation is used for scheduled tasks. ### Netty Communication (netty) - **TCP Server**: `TcpServer.create()` starts the TCP server. - **UDP Server**: `UdpServer.create()` starts the UDP server. - **WebSocket Server**: `WebSocketServer.create()` starts the WebSocket server. ### Database Operations (mybatisPlus) - **CRUD Operations**: `UserController` provides basic create, read, update, and delete interfaces. - **SQL Injector**: `SqlOnjector` implements custom SQL interception. ### Message Queue (rabbitmq) - **Message Publishing**: `RabbitController.convertAndSend()` sends messages. - **Message Listening**: The `rabbitListen` class listens for queue messages. ### Caching (redis) - **Cache Operations**: `RedisController` provides Redis cache create, read, update, and delete interfaces. - **Message Subscription**: `RedisMessageListener` listens for Redis messages. ### Search (elasticSearch) - **Data Indexing**: `ElasticSearchDao` provides data indexing operations. - **Search**: `ElasticSearchcomplexDao` provides functions such as highlighting, sorting, and range queries. ### Scheduled Tasks (scheduleTask) - **Task Scheduling**: `QuartzUtil.addTask()` adds scheduled tasks. - **Task Execution**: `Job1.job2()` is a sample task. ### Page Display (pageDemo) - **Page Interceptor**: `WebRequest` implements request interception. - **Page Controller**: `IndexController` provides page navigation functionality. ### PDF Processing (pdf) - **PDF Conversion**: `PDFUtils.pdfToPdf()` implements PDF content conversion. ### Dynamic Analysis (dynamicAnalysis) - **IP Address Analysis**: `AnalysisIpAddressUtil` provides IP address analysis and email sending functionality. ### Database Monitoring (binlog4j-demo / cacal_demo) - **MySQL Binlog Parsing**: `Binlog4jDemoApplication` monitors database changes. - **Canal Integration**: `CacalApplication` uses Alibaba Canal to parse MySQL incremental logs. ## Dependency Management - **JNA**: Used to invoke native libraries (e.g., `libNAudioServer.so` or `HCNetSDK.dll`). - **Netty**: Used for TCP/UDP/WebSocket communication. - **Redis**: Used for caching and message subscription. - **RabbitMQ**: Used for asynchronous message processing. - **Elasticsearch**: Used for full-text search. - **MyBatis Plus**: Used for database operations. - **Quartz**: Used for task scheduling. - **Thymeleaf**: Used for page rendering. - **InfluxDB**: Used for time-series data storage. - **Canal / Binlog4j**: Used for MySQL database change monitoring. ## Project Structure ``` springBootDemo_dev/ ├── NAudioServerCentos/ # Audio server module (Linux) ├── NAudioServerWindows/ # Audio server module (Windows) ├── hk-server/ # Hikvision camera SDK integration ├── webSocket/ # WebSocket communication module ├── netty/ # Netty TCP/UDP communication module ├── activiti/ # Activiti workflow module ├── rabbitmq/ # RabbitMQ message queue module ├── redis/ # Redis caching module ├── elasticSearch/ # Elasticsearch search module ├── mybatisPlus/ # MyBatis Plus database module ├── scheduleTask/ # Quartz scheduled task module ├── pageDemo/ # Page display module ├── influxdb/ # InfluxDB time-series database module ├── binlog4j-demo/ # MySQL Binlog parsing module ├── cacal_demo/ # Canal database monitoring module ├── javaDemo/ # Java example code ├── pdf/ # PDF processing module ├── mvnw / mvnw.cmd # Maven Wrapper ├── pom.xml # Main project POM file └── README.md # Project documentation ``` ## Contributor Guidelines - **Code Style**: Use Spring Boot standard coding conventions. - **Commit Standards**: Use clear commit messages, such as `feat: add new feature` or `fix: bug fix`. - **Pull Request**: Ensure the code passes tests and follows the project structure before submitting a PR. ## License This project uses the [Apache License 2.0](LICENSE) open-source license.