|
|
@@ -50,14 +50,30 @@ export function getCurrentChannel(data: GetCurrentChannelRequest): Promise<IBase
|
|
|
// ==================== PTZ 控制 (代理到 PTZ 服务) ====================
|
|
|
|
|
|
// PTZ 控制
|
|
|
+// PTZ 方向动作
|
|
|
+// up: 向上, down: 向下, left: 向左, right: 向右
|
|
|
+// up_left: 左上, up_right: 右上, down_left: 左下, down_right: 右下
|
|
|
+// zoom_in: 放大, zoom_out: 缩小
|
|
|
+// stop: 停止
|
|
|
export interface PTZControlRequest {
|
|
|
cameraId: string
|
|
|
- command: string
|
|
|
- speed?: number
|
|
|
+ action:
|
|
|
+ | 'up'
|
|
|
+ | 'down'
|
|
|
+ | 'left'
|
|
|
+ | 'right'
|
|
|
+ | 'up_left'
|
|
|
+ | 'up_right'
|
|
|
+ | 'down_left'
|
|
|
+ | 'down_right'
|
|
|
+ | 'zoom_in'
|
|
|
+ | 'zoom_out'
|
|
|
+ | 'stop'
|
|
|
+ speed: number
|
|
|
}
|
|
|
|
|
|
export function ptzControl(data: PTZControlRequest): Promise<BaseResponse> {
|
|
|
- return post(`/camera/control/${data.cameraId}/ptz/control`, data)
|
|
|
+ return post(`/camera/control/ptz/control`, data)
|
|
|
}
|
|
|
|
|
|
// PTZ 能力
|
|
|
@@ -66,7 +82,7 @@ export interface PTZCapabilitiesRequest {
|
|
|
}
|
|
|
|
|
|
export function getPTZCapabilities(data: PTZCapabilitiesRequest): Promise<BaseResponse> {
|
|
|
- return post(`/camera/control/${data.cameraId}/ptz/capabilities`, data)
|
|
|
+ return post(`/camera/control/ptz/capabilities`, data)
|
|
|
}
|
|
|
|
|
|
// ==================== 预置位 ====================
|
|
|
@@ -83,7 +99,7 @@ export interface PresetListRequest {
|
|
|
}
|
|
|
|
|
|
export function presetList(data: PresetListRequest): Promise<IBaseResponse<PresetInfo[]>> {
|
|
|
- return post(`/camera/control/${data.cameraId}/preset/list`, data)
|
|
|
+ return post(`/camera/control/preset/list`, data)
|
|
|
}
|
|
|
|
|
|
// 跳转预置位
|
|
|
@@ -93,7 +109,7 @@ export interface PresetGotoRequest {
|
|
|
}
|
|
|
|
|
|
export function presetGoto(data: PresetGotoRequest): Promise<IBaseResponse<boolean>> {
|
|
|
- return post(`/camera/control/${data.cameraId}/preset/goto`, data)
|
|
|
+ return post(`/camera/control/preset/goto`, data)
|
|
|
}
|
|
|
|
|
|
// 设置预置位
|
|
|
@@ -106,7 +122,7 @@ export interface PresetSetRequest {
|
|
|
}
|
|
|
|
|
|
export function presetSet(data: PresetSetRequest): Promise<BaseResponse> {
|
|
|
- return post(`/camera/control/${data.cameraId}/preset/set`, data)
|
|
|
+ return post(`/camera/control/preset/set`, data)
|
|
|
}
|
|
|
|
|
|
// 删除预置位
|
|
|
@@ -116,7 +132,7 @@ export interface PresetRemoveRequest {
|
|
|
}
|
|
|
|
|
|
export function presetRemove(data: PresetRemoveRequest): Promise<BaseResponse> {
|
|
|
- return post(`/camera/control/${data.cameraId}/preset/remove`, data)
|
|
|
+ return post(`/camera/control/preset/remove`, data)
|
|
|
}
|
|
|
|
|
|
// ==================== Admin APIs ====================
|