|
|
@@ -25,7 +25,7 @@ export function listCameras(machineId?: string): Promise<IListResponse<CameraDTO
|
|
|
|
|
|
// 获取摄像头信息
|
|
|
export function getCamera(cameraId: string): Promise<IBaseResponse<CameraDTO>> {
|
|
|
- return get(`/camera/${cameraId}`)
|
|
|
+ return get(`/camera/control/${cameraId}`)
|
|
|
}
|
|
|
|
|
|
// 切换摄像头通道 (MVP核心)
|
|
|
@@ -40,19 +40,39 @@ export function getCurrentChannel(machineId: string): Promise<IBaseResponse<Chan
|
|
|
|
|
|
// 开始PTZ控制 (后台专用)
|
|
|
export function ptzStart(cameraId: string, action: PTZAction, speed: number = 50): Promise<BaseResponse> {
|
|
|
- return post(`/camera/${cameraId}/ptz/start`, undefined, {
|
|
|
+ return post(`/camera/control/${cameraId}/ptz/start`, undefined, {
|
|
|
params: { action, speed }
|
|
|
})
|
|
|
}
|
|
|
|
|
|
// 停止PTZ控制 (后台专用)
|
|
|
export function ptzStop(cameraId: string): Promise<BaseResponse> {
|
|
|
- return post(`/camera/${cameraId}/ptz/stop`)
|
|
|
+ return post(`/camera/control/${cameraId}/ptz/stop`)
|
|
|
}
|
|
|
|
|
|
// PTZ 直接控制 (pan/tilt/zoom 方式)
|
|
|
export function ptzDirectControl(cameraId: string, data: PTZControlRequest): Promise<BaseResponse> {
|
|
|
- return post(`/camera/${cameraId}/ptz/control`, data)
|
|
|
+ return post(`/camera/control/${cameraId}/ptz/control`, data)
|
|
|
+}
|
|
|
+
|
|
|
+// 获取预置位列表 (PTZ后端)
|
|
|
+export function presetList(cameraId: string): Promise<BaseResponse> {
|
|
|
+ return get(`/camera/control/${cameraId}/preset/list`)
|
|
|
+}
|
|
|
+
|
|
|
+// 跳转到预置位 (PTZ后端)
|
|
|
+export function presetGoto(cameraId: string, presetId: number): Promise<BaseResponse> {
|
|
|
+ return post(`/camera/control/${cameraId}/preset/goto`, { presetId })
|
|
|
+}
|
|
|
+
|
|
|
+// 设置预置位 (PTZ后端)
|
|
|
+export function presetSet(cameraId: string, presetId: number, presetName?: string): Promise<BaseResponse> {
|
|
|
+ return post(`/camera/control/${cameraId}/preset/set`, { presetId, presetName })
|
|
|
+}
|
|
|
+
|
|
|
+// 删除预置位 (PTZ后端)
|
|
|
+export function presetRemove(cameraId: string, presetId: number): Promise<BaseResponse> {
|
|
|
+ return post(`/camera/control/${cameraId}/preset/remove`, { presetId })
|
|
|
}
|
|
|
|
|
|
// ==================== Admin APIs ====================
|