From ff4ddfacbae5b92d5893a5c1ed3e7d55a299a2fc Mon Sep 17 00:00:00 2001 From: crosstyan Date: Tue, 13 Jan 2026 14:50:26 +0800 Subject: [PATCH] refactor: rename zoom commands to use camelCase in API and PTZ control --- doc/API.md | 4 ++-- html/NextGB/src/views/realplay/PtzControlPanel.vue | 4 ++-- pkg/service/ptz.go | 2 -- pkg/service/ptz_test.go | 2 +- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/doc/API.md b/doc/API.md index c6828a9..7d745c1 100644 --- a/doc/API.md +++ b/doc/API.md @@ -277,8 +277,8 @@ SRS-SIP 是一个基于 GB28181 协议的视频监控系统,提供设备管理 - `down`: 向下 - `left`: 向左 - `right`: 向右 - - `zoom_in`: 放大 - - `zoom_out`: 缩小 + - `zoomin`: 放大 + - `zoomout`: 缩小 - `stop`: 停止 - `speed`: 控制速度(1-9) diff --git a/html/NextGB/src/views/realplay/PtzControlPanel.vue b/html/NextGB/src/views/realplay/PtzControlPanel.vue index 1eb5eec..fdd27fa 100644 --- a/html/NextGB/src/views/realplay/PtzControlPanel.vue +++ b/html/NextGB/src/views/realplay/PtzControlPanel.vue @@ -162,7 +162,7 @@ const isDisabled = computed(() => !props.activeWindow) @@ -172,7 +172,7 @@ const isDisabled = computed(() => !props.activeWindow) diff --git a/pkg/service/ptz.go b/pkg/service/ptz.go index f858b94..d62a4fa 100644 --- a/pkg/service/ptz.go +++ b/pkg/service/ptz.go @@ -15,8 +15,6 @@ var ( "upleft": 10, "zoomin": 16, "zoomout": 32, - "zoom_in": 16, - "zoom_out": 32, } ptzSpeedMap = map[string]uint8{ diff --git a/pkg/service/ptz_test.go b/pkg/service/ptz_test.go index 2d56483..a715a0f 100644 --- a/pkg/service/ptz_test.go +++ b/pkg/service/ptz_test.go @@ -159,7 +159,7 @@ func TestPTZCmdMap(t *testing.T) { // 验证所有预定义的命令都存在 expectedCommands := []string{ "stop", "right", "left", "down", "downright", "downleft", - "up", "upright", "upleft", "zoomin", "zoomout", "zoom_in", "zoom_out", + "up", "upright", "upleft", "zoomin", "zoomout", } for _, cmd := range expectedCommands {