ソースを参照

修改api地址

Lu Xianghui 2 週間 前
コミット
c014af7655

+ 4 - 4
README.md

@@ -1,6 +1,6 @@
-# Data Collector Gateway
+# 汇采调试工具
 
-基于 FastAPI 的数据采集 HTTP 网关,用于通过 HTTP 接口读取 Modbus TCP、Siemens S7 TCP 和 BACnet/IP 设备。
+基于 FastAPI 的汇采调试工具,用于通过 HTTP 接口读取 Modbus TCP、Siemens S7 TCP 和 BACnet/IP 设备。
 
 ## 环境要求
 
@@ -31,7 +31,7 @@ uvicorn main:app --host 0.0.0.0 --port 8000
 
 ## 接口
 
-基础路径:`/api/dc-gateway`
+基础路径:`/api/dc-debugtool`
 
 | 方法 | 路径 | 说明 |
 |---|---|---|
@@ -48,7 +48,7 @@ uvicorn main:app --host 0.0.0.0 --port 8000
 示例:
 
 ```bash
-curl -X POST http://127.0.0.1:8000/api/dc-gateway/modbus/read \
+curl -X POST http://127.0.0.1:8000/api/dc-debugtool/modbus/read \
   -H "Content-Type: application/json" \
   -d '{
     "device_type": "ModbusTCP",

+ 4 - 4
app/main.py

@@ -31,10 +31,10 @@ def validation_error_message(exc: RequestValidationError) -> str:
 
 
 def create_app() -> FastAPI:
-    app = FastAPI(title="Data Collector Gateway")
-    app.include_router(modbus_router, prefix="/api/dc-gateway")
-    app.include_router(s7_router, prefix="/api/dc-gateway")
-    app.include_router(bacnet_router, prefix="/api/dc-gateway")
+    app = FastAPI(title="汇采调试工具")
+    app.include_router(modbus_router, prefix="/api/dc-debugtool")
+    app.include_router(s7_router, prefix="/api/dc-debugtool")
+    app.include_router(bacnet_router, prefix="/api/dc-debugtool")
 
     @app.exception_handler(RequestValidationError)
     async def request_validation_exception_handler(

+ 9 - 9
docs/bacnet-http-api.md

@@ -8,10 +8,10 @@
 
 ## 接口列表
 
-- `POST /api/dc-gateway/bacnet/read_points`:按点位对象读取,固定返回 `present-value`。
-- `POST /api/dc-gateway/bacnet/search_points`:读取设备 `object-list`,搜索常见 BACnet 点位对象并返回基础信息和值。
-- `POST /api/dc-gateway/bacnet/bbmd/whois`:按环境变量配置注册 BBMD Foreign Device,通过 BBMD 分发 `Who-Is` 并返回 `I-Am` 设备列表。
-- `GET /api/dc-gateway/health`:健康检查。
+- `POST /api/dc-debugtool/bacnet/read_points`:按点位对象读取,固定返回 `present-value`。
+- `POST /api/dc-debugtool/bacnet/search_points`:读取设备 `object-list`,搜索常见 BACnet 点位对象并返回基础信息和值。
+- `POST /api/dc-debugtool/bacnet/bbmd/whois`:按环境变量配置注册 BBMD Foreign Device,通过 BBMD 分发 `Who-Is` 并返回 `I-Am` 设备列表。
+- `GET /api/dc-debugtool/health`:健康检查。
 
 ## 通用返回约定
 
@@ -95,7 +95,7 @@
 ### URL
 
 ```http
-POST /api/dc-gateway/bacnet/read_points
+POST /api/dc-debugtool/bacnet/read_points
 ```
 
 ### 请求体
@@ -185,7 +185,7 @@ POST /api/dc-gateway/bacnet/read_points
 ### URL
 
 ```http
-POST /api/dc-gateway/bacnet/search_points
+POST /api/dc-debugtool/bacnet/search_points
 ```
 
 ### 请求体
@@ -259,7 +259,7 @@ POST /api/dc-gateway/bacnet/search_points
 ### URL
 
 ```http
-POST /api/dc-gateway/bacnet/bbmd/whois
+POST /api/dc-debugtool/bacnet/bbmd/whois
 ```
 
 服务会先向 BBMD 发送 `Register-Foreign-Device`,注册成功后发送 `Distribute-Broadcast-To-Network` 包装的 `Who-Is`,并在配置的超时时间内收集 `I-Am` 响应。请求结束前会用 TTL=0 注销 Foreign Device。
@@ -269,7 +269,7 @@ POST /api/dc-gateway/bacnet/bbmd/whois
 不需要请求体,直接调用即可:
 
 ```bash
-curl -X POST http://127.0.0.1:8000/api/dc-gateway/bacnet/bbmd/whois
+curl -X POST http://127.0.0.1:8000/api/dc-debugtool/bacnet/bbmd/whois
 ```
 
 配置环境变量:
@@ -337,7 +337,7 @@ curl -X POST http://127.0.0.1:8000/api/dc-gateway/bacnet/bbmd/whois
 
 ## 本地 BACnet 客户端绑定
 
-网关会为每次 BACnet 请求启动本地 BACnet 客户端,并自动推断到目标设备的本机地址。可通过环境变量覆盖:
+调试工具会为每次 BACnet 请求启动本地 BACnet 客户端,并自动推断到目标设备的本机地址。可通过环境变量覆盖:
 
 | 字段 | 默认值 | 说明 |
 |---|---|---|

+ 36 - 36
docs/localhost-data-colllector-gateway.md

@@ -1,8 +1,8 @@
-# Data Collector Gateway HTTP API
+# 汇采调试工具 HTTP API
 
 ## 文档用途
 
-本文档用于说明 Data Collector Gateway 的 HTTP 接口,目标是让 AI 或自动化程序能够根据本文档直接构造请求、理解每个接口的用途、理解每个字段的含义,并正确解析返回结果。
+本文档用于说明汇采调试工具的 HTTP 接口,目标是让 AI 或自动化程序能够根据本文档直接构造请求、理解每个接口的用途、理解每个字段的含义,并正确解析返回结果。
 
 当前接口支持通过 HTTP 调用 Modbus TCP、Siemens S7 TCP 和 BACnet/IP 设备。S7 详细请求和响应约定见 [s7-http-api.md](s7-http-api.md),BACnet 详细请求和响应约定见 [bacnet-http-api.md](bacnet-http-api.md)。
 
@@ -23,7 +23,7 @@ http://127.0.0.1:8000
 示例:
 
 ```text
-http://127.0.0.1:8000/api/dc-gateway/modbus/read
+http://127.0.0.1:8000/api/dc-debugtool/modbus/read
 ```
 
 如果部署到其他服务器,只需要替换服务器请求地址,例如:
@@ -68,7 +68,7 @@ Content-Type: application/json
 
 AI 调用接口时应按以下规则判断结果:
 
-1. HTTP 请求失败或超时:认为网关服务不可达。
+1. HTTP 请求失败或超时:认为调试工具服务不可达。
 2. HTTP 返回成功但 JSON 中 `code = 0`:认为业务调用成功。
 3. HTTP 返回成功但 JSON 中 `code != 0`:认为业务调用失败,失败原因读取 `msg`。
 
@@ -76,15 +76,15 @@ AI 调用接口时应按以下规则判断结果:
 
 | 接口 | 方法 | 路径 | 用途 |
 |---|---|---|---|
-| 健康检查 | `GET` | `/api/dc-gateway/health` | 检查网关服务是否存活。 |
-| 原始 Modbus 读取 | `POST` | `/api/dc-gateway/modbus/read` | 读取 Modbus 数据,但不解析为业务值,只返回 Tx/Rx 通信报文。 |
-| 点位读取并转换 | `POST` | `/api/dc-gateway/modbus/read_points` | 按点位定义读取 Modbus 数据,并按数据类型转换为业务值。 |
-| 点位读取并转换别名 | `POST` | `/api/dc-gateway/modbus/read-points` | 与 `/api/dc-gateway/modbus/read_points` 等价,建议优先使用下划线版本。 |
-| 原始 S7 读取 | `POST` | `/api/dc-gateway/s7/read` | 读取 S7 原始字节,只返回语义化 `communication`。 |
-| S7 点位读取并转换 | `POST` | `/api/dc-gateway/s7/read_points` | 按点位定义读取 S7 数据,并按数据类型转换为业务值。 |
-| S7 连接扫描 | `POST` | `/api/dc-gateway/s7/connect_scan` | 传 IP,可选 `device_type`,扫描可用的 `rock`、`slot`、`tsap_conn_type` 组合。 |
-| BACnet 点位读取 | `POST` | `/api/dc-gateway/bacnet/read_points` | 按 BACnet 对象读取 `present-value`。 |
-| BACnet 点位搜索 | `POST` | `/api/dc-gateway/bacnet/search_points` | 读取设备 `object-list`,返回常见点位对象信息和值。 |
+| 健康检查 | `GET` | `/api/dc-debugtool/health` | 检查调试工具服务是否存活。 |
+| 原始 Modbus 读取 | `POST` | `/api/dc-debugtool/modbus/read` | 读取 Modbus 数据,但不解析为业务值,只返回 Tx/Rx 通信报文。 |
+| 点位读取并转换 | `POST` | `/api/dc-debugtool/modbus/read_points` | 按点位定义读取 Modbus 数据,并按数据类型转换为业务值。 |
+| 点位读取并转换别名 | `POST` | `/api/dc-debugtool/modbus/read-points` | 与 `/api/dc-debugtool/modbus/read_points` 等价,建议优先使用下划线版本。 |
+| 原始 S7 读取 | `POST` | `/api/dc-debugtool/s7/read` | 读取 S7 原始字节,只返回语义化 `communication`。 |
+| S7 点位读取并转换 | `POST` | `/api/dc-debugtool/s7/read_points` | 按点位定义读取 S7 数据,并按数据类型转换为业务值。 |
+| S7 连接扫描 | `POST` | `/api/dc-debugtool/s7/connect_scan` | 传 IP,可选 `device_type`,扫描可用的 `rock`、`slot`、`tsap_conn_type` 组合。 |
+| BACnet 点位读取 | `POST` | `/api/dc-debugtool/bacnet/read_points` | 按 BACnet 对象读取 `present-value`。 |
+| BACnet 点位搜索 | `POST` | `/api/dc-debugtool/bacnet/search_points` | 读取设备 `object-list`,返回常见点位对象信息和值。 |
 
 ## S7 接口快速说明
 
@@ -113,7 +113,7 @@ S7 地址字段:
 S7 连接扫描接口:
 
 ```http
-POST /api/dc-gateway/s7/connect_scan
+POST /api/dc-debugtool/s7/connect_scan
 ```
 
 请求体:
@@ -193,15 +193,15 @@ BACnet 点位搜索请求示例:
 | 字段 | 类型 | 必填 | 默认值 | 允许值或范围 | 含义 |
 |---|---|---:|---|---|---|
 | `device_type` | string | 否 | `ModbusTCP` | 只能是 `ModbusTCP` | 设备协议类型。当前仅支持 Modbus TCP。 |
-| `ip` | string | 是 | 无 | 合法 IPv4 或 IPv6 地址 | Modbus TCP 设备的 IP 地址,不是网关服务器地址。 |
+| `ip` | string | 是 | 无 | 合法 IPv4 或 IPv6 地址 | Modbus TCP 设备的 IP 地址,不是调试工具服务地址。 |
 | `port` | integer | 是 | 无 | `1..65535` | Modbus TCP 设备监听端口。常见端口为 `502`,示例使用 `505`。 |
 | `word_byte_order` | string | 否 | `ABCD` | `ABCD`、`BADC`、`CDAB`、`DCBA` | 多寄存器数据的字节序和字序,用于 `int32`、`float32`、`int64`、`float64` 等寄存器值转换。 |
-| `address_base` | integer | 否 | `0` | `>= 0` | 地址偏移量。网关实际发送给 Modbus 协议的地址为 `address + address_base`。通常传 `0`。 |
+| `address_base` | integer | 否 | `0` | `>= 0` | 地址偏移量。调试工具实际发送给 Modbus 协议的地址为 `address + address_base`。通常传 `0`。 |
 | `slave_id` | integer | 是 | 无 | `0..247` | Modbus 从站 ID,也称 Unit ID、Device ID 或 Slave Address。 |
 
 ### 地址规则
 
-请求体中的 `address` 是调用方传入的逻辑地址。网关实际发送给 Modbus 协议的地址计算方式如下:
+请求体中的 `address` 是调用方传入的逻辑地址。调试工具实际发送给 Modbus 协议的地址计算方式如下:
 
 ```text
 protocol_address = address + address_base
@@ -237,7 +237,7 @@ protocol_address = address + address_base
 
 ## communication 字段格式
 
-`communication` 只在 `/api/dc-gateway/modbus/read` 返回,用于记录本次 HTTP 请求期间网关与 Modbus 设备之间的原始通信报文。
+`communication` 只在 `/api/dc-debugtool/modbus/read` 返回,用于记录本次 HTTP 请求期间调试工具与 Modbus 设备之间的原始通信报文。
 
 示例:
 
@@ -250,8 +250,8 @@ Rx:002-00 00 33 00 00 00 0B 01 03 08 00 01 42 A8 00 00 40 F8
 
 | 片段 | 含义 |
 |---|---|
-| `Tx` | 网关发送给 Modbus 设备的 Modbus TCP ADU 报文。 |
-| `Rx` | Modbus 设备返回给网关的 Modbus TCP ADU 报文。 |
+| `Tx` | 调试工具发送给 Modbus 设备的 Modbus TCP ADU 报文。 |
+| `Rx` | Modbus 设备返回给调试工具的 Modbus TCP ADU 报文。 |
 | `001`、`002` | 当前 HTTP 请求内的报文序号,从 `001` 开始递增。 |
 | `-` 后内容 | 大写十六进制字节,字节之间使用空格分隔。 |
 
@@ -270,10 +270,10 @@ Rx:002-00 00 33 00 00 00 0B 01 03 08 00 01 42 A8 00 00 40 F8
 | 项 | 值 |
 |---|---|
 | 方法 | `GET` |
-| 路径 | `/api/dc-gateway/health` |
-| 完整地址 | `http://127.0.0.1:8000/api/dc-gateway/health` |
+| 路径 | `/api/dc-debugtool/health` |
+| 完整地址 | `http://127.0.0.1:8000/api/dc-debugtool/health` |
 | 请求体 | 无 |
-| 用途 | 判断 Data Collector Gateway HTTP 服务是否启动。 |
+| 用途 | 判断汇采调试工具 HTTP 服务是否启动。 |
 
 ### 成功返回
 
@@ -292,7 +292,7 @@ Rx:002-00 00 33 00 00 00 0B 01 03 08 00 01 42 A8 00 00 40 F8
 ### 调用示例
 
 ```bash
-curl http://127.0.0.1:8000/api/dc-gateway/health
+curl http://127.0.0.1:8000/api/dc-debugtool/health
 ```
 
 ## 接口:原始 Modbus 读取
@@ -302,8 +302,8 @@ curl http://127.0.0.1:8000/api/dc-gateway/health
 | 项 | 值 |
 |---|---|
 | 方法 | `POST` |
-| 路径 | `/api/dc-gateway/modbus/read` |
-| 完整地址 | `http://127.0.0.1:8000/api/dc-gateway/modbus/read` |
+| 路径 | `/api/dc-debugtool/modbus/read` |
+| 完整地址 | `http://127.0.0.1:8000/api/dc-debugtool/modbus/read` |
 | Content-Type | `application/json` |
 | 用途 | 向 Modbus TCP 设备发起一次读取请求,只返回通信报文,不返回解析后的业务值。 |
 
@@ -422,7 +422,7 @@ curl http://127.0.0.1:8000/api/dc-gateway/health
 ### 调用示例
 
 ```bash
-curl -X POST http://127.0.0.1:8000/api/dc-gateway/modbus/read \
+curl -X POST http://127.0.0.1:8000/api/dc-debugtool/modbus/read \
   -H "Content-Type: application/json" \
   -d '{
     "device_type": "ModbusTCP",
@@ -446,9 +446,9 @@ curl -X POST http://127.0.0.1:8000/api/dc-gateway/modbus/read \
 | 项 | 值 |
 |---|---|
 | 方法 | `POST` |
-| 推荐路径 | `/api/dc-gateway/modbus/read_points` |
-| 兼容路径 | `/api/dc-gateway/modbus/read-points` |
-| 完整地址 | `http://127.0.0.1:8000/api/dc-gateway/modbus/read_points` |
+| 推荐路径 | `/api/dc-debugtool/modbus/read_points` |
+| 兼容路径 | `/api/dc-debugtool/modbus/read-points` |
+| 完整地址 | `http://127.0.0.1:8000/api/dc-debugtool/modbus/read_points` |
 | Content-Type | `application/json` |
 | 用途 | 按点位定义逐个读取 Modbus 数据,并把原始 bit/register 转换为 `bool`、`int16`、`float32` 等业务值。 |
 
@@ -494,7 +494,7 @@ curl -X POST http://127.0.0.1:8000/api/dc-gateway/modbus/read \
 
 | 字段 | 类型 | 必填 | 默认值 | 允许值或范围 | 含义 |
 |---|---|---:|---|---|---|
-| `points` | object[] | 是 | 无 | 至少 1 个元素 | 点位读取定义列表。网关会按数组顺序逐个读取。 |
+| `points` | object[] | 是 | 无 | 至少 1 个元素 | 点位读取定义列表。调试工具会按数组顺序逐个读取。 |
 | `points[].function_code` | integer | 是 | 无 | `1`、`2`、`3`、`4` | 当前点位使用的 Modbus 功能码。 |
 | `points[].address` | integer | 是 | 无 | `>= 0` | 当前点位起始地址。实际协议地址为 `points[].address + address_base`。 |
 | `points[].type` | string | 是 | 无 | `bool`、`int16`、`uint16`、`int32`、`uint32`、`int64`、`uint64`、`float32`、`float64` | 当前点位的数据类型。接口会按该类型决定读取寄存器数量和转换方式。输入会被转换为小写。 |
@@ -633,7 +633,7 @@ curl -X POST http://127.0.0.1:8000/api/dc-gateway/modbus/read \
 ### 调用示例
 
 ```bash
-curl -X POST http://127.0.0.1:8000/api/dc-gateway/modbus/read_points \
+curl -X POST http://127.0.0.1:8000/api/dc-debugtool/modbus/read_points \
   -H "Content-Type: application/json" \
   -d '{
     "device_type": "ModbusTCP",
@@ -668,15 +668,15 @@ AI 或自动化程序选择接口时遵循以下规则:
 
 | 目标 | 应调用接口 | 原因 |
 |---|---|---|
-| 只想检查网关是否启动 | `GET /api/dc-gateway/health` | 不访问 Modbus 设备,只检查 HTTP 服务。 |
-| 需要查看原始 Modbus Tx/Rx 报文 | `POST /api/dc-gateway/modbus/read` | 返回 `communication`,适合调试通信、对比 Modbus Poll 报文。 |
-| 需要得到点位业务值 | `POST /api/dc-gateway/modbus/read_points` | 返回 `points[].value`,自动按类型转换。 |
+| 只想检查调试工具是否启动 | `GET /api/dc-debugtool/health` | 不访问 Modbus 设备,只检查 HTTP 服务。 |
+| 需要查看原始 Modbus Tx/Rx 报文 | `POST /api/dc-debugtool/modbus/read` | 返回 `communication`,适合调试通信、对比 Modbus Poll 报文。 |
+| 需要得到点位业务值 | `POST /api/dc-debugtool/modbus/read_points` | 返回 `points[].value`,自动按类型转换。 |
 
 AI 构造请求时必须区分两个地址:
 
 | 地址 | 字段或配置 | 含义 |
 |---|---|---|
-| 网关服务器地址 | `http://127.0.0.1:8000` | HTTP API 服务地址,用于拼接请求 URL。 |
+| 调试工具服务地址 | `http://127.0.0.1:8000` | HTTP API 服务地址,用于拼接请求 URL。 |
 | Modbus 设备地址 | 请求体 `ip` 和 `port` | 实际被读取的 Modbus TCP 设备地址。 |
 
 AI 构造 `/modbus/read_points` 点位时应按以下步骤:

+ 7 - 7
docs/modbus-http-api.md

@@ -8,9 +8,9 @@
 
 ## 接口列表
 
-- `POST /api/dc-gateway/modbus/read`:原始 Modbus 读取,只返回通信报文,不返回解析值。
-- `POST /api/dc-gateway/modbus/read_points`:按点位定义读取,返回点位值。
-- `GET /api/dc-gateway/health`:健康检查。
+- `POST /api/dc-debugtool/modbus/read`:原始 Modbus 读取,只返回通信报文,不返回解析值。
+- `POST /api/dc-debugtool/modbus/read_points`:按点位定义读取,返回点位值。
+- `GET /api/dc-debugtool/health`:健康检查。
 
 ## 通用返回约定
 
@@ -94,7 +94,7 @@ protocol_address = address + address_base
 
 ## 读取数量限制
 
-`/api/dc-gateway/modbus/read` 的 `quantity` 范围为:
+`/api/dc-debugtool/modbus/read` 的 `quantity` 范围为:
 
 ```text
 1 <= quantity <= 125
@@ -117,7 +117,7 @@ protocol_address = address + address_base
 ### URL
 
 ```http
-POST /api/dc-gateway/modbus/read
+POST /api/dc-debugtool/modbus/read
 ```
 
 ### 请求体
@@ -190,7 +190,7 @@ POST /api/dc-gateway/modbus/read
 ### URL
 
 ```http
-POST /api/dc-gateway/modbus/read_points
+POST /api/dc-debugtool/modbus/read_points
 ```
 
 ### 请求体
@@ -287,7 +287,7 @@ python -m compileall app main.py
 调用原始读取接口:
 
 ```bash
-curl -X POST http://127.0.0.1:8000/api/dc-gateway/modbus/read \
+curl -X POST http://127.0.0.1:8000/api/dc-debugtool/modbus/read \
   -H "Content-Type: application/json" \
   -d '{
     "device_type": "ModbusTCP",

+ 11 - 11
docs/s7-http-api.md

@@ -8,9 +8,9 @@
 
 ## 接口列表
 
-- `POST /api/dc-gateway/s7/read`:读取一段 S7 地址数据,只返回语义化 `communication`。
-- `POST /api/dc-gateway/s7/read_points`:按点位定义读取,并返回转换后的业务值。
-- `POST /api/dc-gateway/s7/connect_scan`:传 `ip`,可选 `device_type`,扫描可用的 `rock`、`slot`、`tsap_conn_type` 组合。
+- `POST /api/dc-debugtool/s7/read`:读取一段 S7 地址数据,只返回语义化 `communication`。
+- `POST /api/dc-debugtool/s7/read_points`:按点位定义读取,并返回转换后的业务值。
+- `POST /api/dc-debugtool/s7/connect_scan`:传 `ip`,可选 `device_type`,扫描可用的 `rock`、`slot`、`tsap_conn_type` 组合。
 
 ## 通用返回约定
 
@@ -79,7 +79,7 @@
 
 ## communication 格式
 
-`communication` 是字符串数组,记录连接、读取、断开过程。该字段只在 `/api/dc-gateway/s7/read` 返回,`/api/dc-gateway/s7/read_points` 不返回该字段。
+`communication` 是字符串数组,记录连接、读取、断开过程。该字段只在 `/api/dc-debugtool/s7/read` 返回,`/api/dc-debugtool/s7/read_points` 不返回该字段。
 
 示例:
 
@@ -96,11 +96,11 @@ Rx:S7_DISCONNECTED
 
 | 片段 | 含义 |
 |---|---|
-| `Tx:S7_CONNECT` | 网关准备发起 S7 连接。 |
+| `Tx:S7_CONNECT` | 调试工具准备发起 S7 连接。 |
 | `Rx:S7_CONNECTED` | S7 连接成功,可能包含协商后的 `pdu_length`。 |
-| `Tx:S7_READ` | 网关准备读取指定区域、DB、起始偏移和字节数。 |
+| `Tx:S7_READ` | 调试工具准备读取指定区域、DB、起始偏移和字节数。 |
 | `Rx:11 22 33 44` | 读取返回的原始数据字节,十六进制大写,空格分隔。 |
-| `Tx:S7_DISCONNECT` | 网关准备断开连接。 |
+| `Tx:S7_DISCONNECT` | 调试工具准备断开连接。 |
 | `Rx:S7_DISCONNECTED` | 连接已断开。 |
 | `Rx:S7_ERROR` | 连接或读取失败,后面带错误消息。 |
 
@@ -109,7 +109,7 @@ Rx:S7_DISCONNECTED
 ### URL
 
 ```http
-POST /api/dc-gateway/s7/read
+POST /api/dc-debugtool/s7/read
 ```
 
 ### 请求体
@@ -186,7 +186,7 @@ POST /api/dc-gateway/s7/read
 ### URL
 
 ```http
-POST /api/dc-gateway/s7/read_points
+POST /api/dc-debugtool/s7/read_points
 ```
 
 ### 请求体
@@ -276,7 +276,7 @@ S7 多字节数值按大端字节序解析。
 ### URL
 
 ```http
-POST /api/dc-gateway/s7/connect_scan
+POST /api/dc-debugtool/s7/connect_scan
 ```
 
 ### 请求体
@@ -348,7 +348,7 @@ POST /api/dc-gateway/s7/connect_scan
 ### 调用示例
 
 ```bash
-curl -X POST http://127.0.0.1:8000/api/dc-gateway/s7/connect_scan \
+curl -X POST http://127.0.0.1:8000/api/dc-debugtool/s7/connect_scan \
   -H "Content-Type: application/json" \
   -d '{
     "device_type": "S7-Smart200",

+ 1 - 1
intergration/bacnet/common.py

@@ -42,7 +42,7 @@ class LocalApiServer:
         deadline = time.time() + 10
         while time.time() < deadline:
             try:
-                with urllib.request.urlopen(f"{self.base_url}/api/dc-gateway/health", timeout=1) as response:
+                with urllib.request.urlopen(f"{self.base_url}/api/dc-debugtool/health", timeout=1) as response:
                     if response.status == 200:
                         return
             except OSError:

+ 4 - 4
intergration/bacnet/test_bacnet_api.py

@@ -6,7 +6,7 @@ from common import assert_bacnet_device, assert_response_contract, device_payloa
 class BacnetApiIntegrationTest(unittest.TestCase):
     def test_validation_error_returns_http_200_contract(self):
         status, data = post_json(
-            "/api/dc-gateway/bacnet/read_points",
+            "/api/dc-debugtool/bacnet/read_points",
             {**device_payload(), "points": []},
         )
 
@@ -18,7 +18,7 @@ class BacnetApiIntegrationTest(unittest.TestCase):
     def test_search_points_returns_bacnet_points(self):
         payload = device_payload()
 
-        status, data = post_json("/api/dc-gateway/bacnet/search_points", payload)
+        status, data = post_json("/api/dc-debugtool/bacnet/search_points", payload)
 
         assert_response_contract(self, status, data)
         self.assertEqual(0, data["code"], data)
@@ -35,7 +35,7 @@ class BacnetApiIntegrationTest(unittest.TestCase):
 
     def test_read_points_uses_search_result(self):
         payload = device_payload()
-        status, search_data = post_json("/api/dc-gateway/bacnet/search_points", payload)
+        status, search_data = post_json("/api/dc-debugtool/bacnet/search_points", payload)
         assert_response_contract(self, status, search_data)
         self.assertEqual(0, search_data["code"], search_data)
         points = search_data["data"]["points"]
@@ -52,7 +52,7 @@ class BacnetApiIntegrationTest(unittest.TestCase):
             ],
         }
 
-        status, data = post_json("/api/dc-gateway/bacnet/read_points", read_payload)
+        status, data = post_json("/api/dc-debugtool/bacnet/read_points", read_payload)
 
         assert_response_contract(self, status, data)
         self.assertEqual(0, data["code"], data)

+ 1 - 1
intergration/modbus/common.py

@@ -62,7 +62,7 @@ class LocalApiServer:
         deadline = time.time() + 10
         while time.time() < deadline:
             try:
-                with urllib.request.urlopen(f"{self.base_url}/api/dc-gateway/health", timeout=1) as response:
+                with urllib.request.urlopen(f"{self.base_url}/api/dc-debugtool/health", timeout=1) as response:
                     if response.status == 200:
                         return
             except OSError:

+ 3 - 3
intergration/modbus/test_modbus_read_api.py

@@ -30,7 +30,7 @@ class ModbusReadApiIntegrationTest(unittest.TestCase):
     def test_raw_read_returns_modbus_poll_style_communication(self):
         payload = raw_read_payload(FUNC_CODE_HOLDING_REGISTER, address=0, quantity=4)
         status, data = post_json(
-            "/api/dc-gateway/modbus/read",
+            "/api/dc-debugtool/modbus/read",
             payload,
         )
 
@@ -63,7 +63,7 @@ class ModbusReadApiIntegrationTest(unittest.TestCase):
     def test_read_points_returns_all_function_codes_and_types(self):
         payload = point_read_payload(all_type_point_specs())
 
-        status, data = post_json("/api/dc-gateway/modbus/read_points", payload)
+        status, data = post_json("/api/dc-debugtool/modbus/read_points", payload)
 
         assert_response_contract(self, status, data)
         self.assertEqual(0, data["code"], data)
@@ -94,7 +94,7 @@ class ModbusReadApiIntegrationTest(unittest.TestCase):
 
     def test_validation_error_returns_http_200_contract(self):
         status, data = post_json(
-            "/api/dc-gateway/modbus/read",
+            "/api/dc-debugtool/modbus/read",
             raw_read_payload(FUNC_CODE_HOLDING_REGISTER, address=0, quantity=126),
         )
 

+ 1 - 1
intergration/s7/common.py

@@ -39,7 +39,7 @@ class ApiTestServer:
         deadline = time.time() + 10
         while time.time() < deadline:
             try:
-                with urllib.request.urlopen(f"{self.base_url}/api/dc-gateway/health", timeout=1) as response:
+                with urllib.request.urlopen(f"{self.base_url}/api/dc-debugtool/health", timeout=1) as response:
                     if response.status == 200:
                         return self
             except OSError:

+ 3 - 3
intergration/s7/test_s7_all_type_points.py

@@ -56,7 +56,7 @@ class S7AllTypePointsIntegrationTest(unittest.TestCase):
         with Snap7TestServer(db_data=memory) as s7_server, ApiTestServer() as api_server:
             payload = {**s7_device_payload(s7_server.port), "points": point_specs_for_area("DB")}
 
-            status, data = api_server.post_json("/api/dc-gateway/s7/read_points", payload)
+            status, data = api_server.post_json("/api/dc-debugtool/s7/read_points", payload)
 
         self.assert_all_type_response(status, data, payload, "DB")
 
@@ -72,7 +72,7 @@ class S7AllTypePointsIntegrationTest(unittest.TestCase):
                 "points": point_specs_for_area("I") + point_specs_for_area("Q") + point_specs_for_area("M"),
             }
 
-            status, data = api_server.post_json("/api/dc-gateway/s7/read_points", payload)
+            status, data = api_server.post_json("/api/dc-debugtool/s7/read_points", payload)
 
         assert_response_contract(self, status, data)
         self.assertEqual(0, data["code"], data)
@@ -90,7 +90,7 @@ class S7AllTypePointsIntegrationTest(unittest.TestCase):
                 "points": point_specs_for_area("V"),
             }
 
-            status, data = api_server.post_json("/api/dc-gateway/s7/read_points", payload)
+            status, data = api_server.post_json("/api/dc-debugtool/s7/read_points", payload)
 
         self.assert_all_type_response(status, data, payload, "V")
 

+ 4 - 4
intergration/s7/test_s7_api.py

@@ -13,7 +13,7 @@ class S7ApiIntegrationTest(unittest.TestCase):
                 "read": {"area": "DB", "db": 1, "start": 0, "size": 4},
             }
 
-            status, data = api_server.post_json("/api/dc-gateway/s7/read", payload)
+            status, data = api_server.post_json("/api/dc-debugtool/s7/read", payload)
 
         assert_response_contract(self, status, data)
         self.assertEqual(0, data["code"], data)
@@ -44,7 +44,7 @@ class S7ApiIntegrationTest(unittest.TestCase):
                 ],
             }
 
-            status, data = api_server.post_json("/api/dc-gateway/s7/read_points", payload)
+            status, data = api_server.post_json("/api/dc-debugtool/s7/read_points", payload)
 
         assert_response_contract(self, status, data)
         self.assertEqual(0, data["code"], data)
@@ -61,7 +61,7 @@ class S7ApiIntegrationTest(unittest.TestCase):
     def test_connect_scan_returns_only_available_connections(self):
         successful = {(0, 1, "PG"), (0, 2, "BASIC")}
         with patch_connect_scan(successful), ApiTestServer() as api_server:
-            status, data = api_server.post_json("/api/dc-gateway/s7/connect_scan", {"ip": "127.0.0.1"})
+            status, data = api_server.post_json("/api/dc-debugtool/s7/connect_scan", {"ip": "127.0.0.1"})
 
         assert_response_contract(self, status, data)
         self.assertEqual(0, data["code"], data)
@@ -78,7 +78,7 @@ class S7ApiIntegrationTest(unittest.TestCase):
     def test_validation_error_returns_http_200_contract(self):
         with ApiTestServer() as api_server:
             status, data = api_server.post_json(
-                "/api/dc-gateway/s7/read_points",
+                "/api/dc-debugtool/s7/read_points",
                 {
                     "ip": "127.0.0.1",
                     "rock": 0,