import { ApiClientFactory } from '../core/api.client.factory'; import { HangingBarPresetModel } from '../model'; import { AutoMarkReq, AutoMarkResponse, BatchSaveBboxListReq, BatchSaveShituConfigReq, EdgeHoleBboxReq, EdgeHoleConfigModel, EdgeHoleConfigPushReq, EdgeHoleSaveReq, EdgeHoleTestReq, ShituItemModel, ShituItemReq, } from '../model/EdgeHole.model'; import { YsVideoList } from '../model/ysConfig.model'; export class EdgeHoleService { constructor(private factory: ApiClientFactory) {} /** * ysy摄像机 */ getYsyCameraList(projectId: string) { return this.factory.surveillance.get(`/config/ysy/projects/${projectId}/devices?type=Camera`); } /** * 获取配置 */ getConfigList(projectId: string) { return this.factory.surveillance.get(`/edge/hole/configs/list`, { projectId }); } /** * 保存配置 */ saveConfig(req: EdgeHoleSaveReq) { return this.factory.surveillance.post(`/edge/hole/configs/one`, req); } /** * 删除配置 */ deleteConfig(configId: string, productCode = 'gvs') { return this.factory.surveillance.delete(`/edge/hole/configs?configId=${configId}&productCode=${productCode}`); } /** * 下发配置 */ pushConfig(req: EdgeHoleConfigPushReq) { return this.factory.surveillance.post(`/edge/hole/configs/push`, req); } /** * 清空下发配置 */ clearPushedConfig(req: EdgeHoleConfigPushReq) { return this.factory.surveillance.delete(`/edge/hole/configs/clearPushConfig`, req); } /** * 启用停用 */ enableConfig(id: string, on: Boolean = true) { return this.factory.surveillance.post(`/edge/hole/configs/on`, { id, on }); } /** * 模拟测试 */ runTest(req: EdgeHoleTestReq) { return this.factory.surveillance.post(`/edge/hole/ai/test`, req); } getPresetPointList(projectId: string, deviceId: string) { return this.factory.surveillance.get(`/ptz/preset`, { projectId, deviceId, }); } presetSnap(presetId: string) { return this.factory.surveillance.put(`/ptz/preset/call/image/${presetId}`); } saveEdgeHoleBbox(req: EdgeHoleBboxReq) { return this.factory.surveillance.post(`/edge/hole/configs/bbox`, req); } deleteEdgeHoleBbox(configId: string, bboxId: string) { return this.factory.surveillance.delete(`/edge/hole/configs/bbox?configId=${configId}&boxId=${bboxId}`); } //图库列表 getShituItemList(projectId: string) { return this.factory.surveillance.get(`/edgehole/shitu/config/${projectId}/list`); } saveShituItem(projectId: string, req: ShituItemReq) { return this.factory.surveillance.put(`/edgehole/shitu/config/${projectId}/save`, req); } enableShituItem(projectId: string, id: string, on: boolean) { return this.factory.surveillance.put(`/edgehole/shitu/config/${projectId}/${id}/${on ? 'on' : 'off'}`); } deleteShituItem(projectId: string, id: string) { return this.factory.surveillance.delete(`/edgehole/shitu/config/${projectId}/delete?id=${id}`); } autoMark(req: AutoMarkReq) { return this.factory.surveillance.post(`/ai/auto/anno`, req); } batchSaveBboxList(req: BatchSaveBboxListReq) { return this.factory.surveillance.post('/edge/hole/configs/batchSaveBboxList', req); } batchSaveShituConfig(req: BatchSaveShituConfigReq) { return this.factory.surveillance.post('/edge/hole/configs/batchSaveShituConfig', req); } shituPushData(projectId: string, gboxId: string){ return this.factory.surveillance.post(`/edgehole/shitu/config/${projectId}/issue?deviceId=${gboxId}`) } }