# wjb_query **Repository Path**: three2one_xu/wjb_query ## Basic Information - **Project Name**: wjb_query - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-03-15 - **Last Updated**: 2026-03-25 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 使用示例 ## Docker 部署 ```bash # 启动所有服务(首次运行会构建镜像) docker-compose up -d # 修改代码后重启后端(无需重新构建) docker-compose restart backend # 查看日志 docker-compose logs -f backend ``` ## 站点数据查询 API 根据站点类型自动返回相应数据,无需指定 `metric` 参数: ### 1. 雨量站查询 ```bash # 返回降雨量数据 curl -X GET "http://localhost:5555/api/v1/station/data?station_code=50100700" ``` 响应示例: ```json { "station_code": "50100100", "station_name": "某某雨量站", "station_type": "rain", "start": "2025-03-24T10:00:00", "end": "2025-03-25T10:00:00", "data": [ {"timestamp": "2025-03-24T10:00:00", "rainfall_mm": 5.2}, {"timestamp": "2025-03-24T11:00:00", "rainfall_mm": 3.1} ] } ``` ### 2. 河道站查询 ```bash # 同时返回水位和流量数据 curl -X GET "http://localhost:5555/api/v1/station/data?station_code=50100500" ``` 响应示例: ```json { "station_code": "50100500", "station_name": "王家坝", "station_type": "river", "start": "2025-03-24T10:00:00", "end": "2025-03-25T10:00:00", "data": [ { "timestamp": "2025-03-24T10:00:00", "water_level_m": 10.5, "discharge_cms": 1000 }, { "timestamp": "2025-03-24T11:00:00", "water_level_m": 10.8, "discharge_cms": 1200 } ] } ``` ### 3. 混合站查询(既是雨量站又是河道站) ```bash # 同时返回雨量、水位、流量数据 curl -X GET "http://localhost:5555/api/v1/station/data?station_code=50100500" ``` 响应示例: ```json { "station_code": "50100500", "station_name": "某某混合站", "station_type": "both", "start": "2025-03-24T10:00:00", "end": "2025-03-25T10:00:00", "data": [ { "timestamp": "2025-03-24T10:00:00", "rainfall_mm": 5.2, "water_level_m": 10.5, "discharge_cms": 1000 } ] } ``` ### 4. 指定时间窗口 ```bash # 最近18小时数据 curl -X GET "http://localhost:5555/api/v1/station/data?station_code=50100500&hours=18" # 指定时间段 curl -X GET "http://localhost:5555/api/v1/station/data?station_code=50100500&start=2024-01-15T00:00:00&end=2024-01-16T00:00:00" # 最近48小时数据 curl -X GET "http://localhost:5555/api/v1/station/data?station_code=50100500&hours=48" ``` ## 站点类型说明 | 站点类型 | 返回数据 | |---------|---------| | `rain` | `rainfall_mm` | | `river` | `water_level_m` + `discharge_cms` | | `both` | `rainfall_mm` + `water_level_m` + `discharge_cms` |