first commit
This commit is contained in:
56
README.md
Normal file
56
README.md
Normal file
@@ -0,0 +1,56 @@
|
||||
# JT808 Spring Boot Transport Server
|
||||
|
||||
This project has been modernized to a Spring Boot 3 + Netty architecture, supporting both TCP (JT808) and HTTP API channels.
|
||||
|
||||
## Features
|
||||
|
||||
- **Dual Channel**:
|
||||
- **TCP (Port 20048)**: Standard JT808 protocol for device connections.
|
||||
- **HTTP API (Port 8080)**: RESTful API for testing or third-party integration.
|
||||
- **Web UI**: Built-in Dashboard at `http://localhost:8080/`.
|
||||
- **Docker Ready**: Simple deployment via Docker.
|
||||
|
||||
## Structure
|
||||
|
||||
- `src/main/java/com/hua/transport/jt808`
|
||||
- `Jt808Application.java`: Spring Boot Entry Point.
|
||||
- `server/Jt808NettyServer.java`: Netty Server Wrapper.
|
||||
- `controller/DeviceController.java`: HTTP API Controller.
|
||||
- `service/`: Business Logic Layer.
|
||||
- `tcp/`: Original JT808 Protocol Logic.
|
||||
- `src/main/resources/static`: Frontend Static Files (Vue 3 Dashboard).
|
||||
|
||||
## How to Run
|
||||
|
||||
### Local Development
|
||||
```bash
|
||||
mvn clean spring-boot:run
|
||||
```
|
||||
Access Dashboard: http://localhost:8080/
|
||||
|
||||
### Docker
|
||||
1. Build JAR:
|
||||
```bash
|
||||
mvn clean package -DskipTests
|
||||
```
|
||||
2. Build Image:
|
||||
```bash
|
||||
docker build -t jt808-server .
|
||||
```
|
||||
3. Run:
|
||||
```bash
|
||||
docker run -d -p 8080:8080 -p 20048:20048 --name jt808 jt808-server
|
||||
```
|
||||
|
||||
## API Usage
|
||||
|
||||
**Report Location (HTTP):**
|
||||
POST /api/v1/device/location
|
||||
```json
|
||||
{
|
||||
"imei": "123456789012",
|
||||
"lat": 30.123456,
|
||||
"lon": 120.654321,
|
||||
"speed": 60.0
|
||||
}
|
||||
```
|
||||
Reference in New Issue
Block a user