import { ApiClientFactory } from '../core/api.client.factory'; import { IscVideoList, Docs, CreateNVR, VendorList, CategoryList, DeviceDetail, IscAccountRep, IscAccountReq, RegionData, BathDevice, } from '../model/EightySevenConfig.model'; export class EightySevenConfigService { constructor(private factory: ApiClientFactory) {} /** * @function loadDocs 获取文档 * @param projectId 项目ID */ async loadDocs(projectId: string): Promise { const result = await this.factory.surveillance.get( `/config/isc/projects/${projectId}/devices/download/getUrl` ); return result; } /** * @function loadEightySeven 获取萤石NVR列表 * @param projectId 项目ID * @param type */ // //8700 数据列表接口 async loadEightySeven(projectId: string, type: string, params?: any): Promise { const result = await this.factory.surveillance.get( `/config/ivms/projects/${projectId}/devices?type=${type}`, params ); return result; } /** * @function loadNVRDeviceInfo 获取NVR设备信息 * @param projectId 项目ID * @param id NVR设备ID */ // async loadNVRDeviceInfo(projectId: string, id: string): Promise { // const result = await this.factory.surveillance.get(`/config/projects/${projectId}/devices/nvr/${id}`); // return result; // } /** * @function createVideoNVR 新建和更新NVR * @param projectId 项目ID * @param nvrData 更新的数据,具体参数查看CreateNVR */ async createVideoNVR(projectId: string, nvr: CreateNVR): Promise { return await this.factory.surveillance.put(`/config/isc/projects/${projectId}/devices/nvr`, nvr); } /** * @function createVideoCamera 新建和更新camera * @param projectId 项目ID * @param camera 更新的数据,具体参数查看CreateCamera */ // async createVideoCamera(projectId: string, camera: CreateCamera): Promise { // return await this.factory.surveillance.put(`/config/isc/projects/${projectId}/devices/ipc`, camera); // } /** * @function delteNvrDevice 删除nvr * @param projectId * @param id */ async deleteNvrDevice(projectId: string, id: string): Promise { return await this.factory.surveillance.delete(`config/isc/projects/${projectId}/devices/${id}`); } /** * @function deleteVideoDevice 删除视频相关设备 * @param projectId 项目ID * @param id 数据ID */ async deleteVideoDevice(projectId: string, id: string): Promise { return await this.factory.surveillance.delete(`/config/ivms/projects/${projectId}/devices/${id}`); } async deleteDeviceBath(projectId: string, bathDevice: BathDevice): Promise { return await this.factory.surveillance.delete( `/config/ivms/projects/${projectId}/devices/batch/delete`, bathDevice ); } /** * @function syncIscData 同步筑联的数据8700 * @param projectId 项目ID */ async syncIscData(projectId: string): Promise { return await this.factory.surveillance.put(`/config/ivms/projects/${projectId}/devices/syncDeviceInfo`); } /** * @function loadVendorList 获取vendor厂家信息列表 */ async loadVendorList(): Promise { const result = await this.factory.surveillance.get(`/system/dict/vendors`); return result; } /** * @function loadCategoryList 获取Category信息列表 */ async loadCategoryList(): Promise { const result = await this.factory.surveillance.get(`/system/dict/cameraTypes`); return result; } /** * @function loadDeviceDetail 获取设备详情信息 * @param projectId 项目ID * @param deviceId 设备ID */ async loadDeviceDetail(projectId: string, deviceId: string): Promise { const result = await this.factory.surveillance.get( `/config/ivms/projects/${projectId}/devices/${deviceId}` ); return result; } /** * @function 监控全部 */ async addAllMonitor(projectId: string) { return await this.factory.surveillance.put(`/config/ivms/projects/${projectId}/devices/monitor`); } /** * @function 取消监控全部 */ async cancelAllMonitor(projectId: string) { return await this.factory.surveillance.put(`/config/ivms/projects/${projectId}/devices/cancelMonitor`); } /** * @function 加入监控 */ async addMonitor(projectId: string, deviceId: string) { return await this.factory.surveillance.put(`config/ivms/projects/${projectId}/devices/${deviceId}/monitor`); } /** * @function 取消监控 */ async cancelMonitor(projectId: string, deviceId: string) { return await this.factory.surveillance.put( `config/ivms/projects/${projectId}/devices/${deviceId}/cancelMonitor` ); } /** * @function 同步摄像头 */ async syncDeviceImage(projectId: string) { return await this.factory.surveillance.put(`config/ivms/projects/${projectId}/devices/syncDeviceImage`); } /** * @function updateiscAccount 修改8700账号 */ async updateIscAccount(projectId: string, ivms8700ConfigInfo: IscAccountReq) { return await this.factory.surveillance.put(`project/video/source/config/ivms8700`, { projectId, ivms8700ConfigInfo, }); } /** * @function loadiscAccount 加载云账号 */ async loadIscAccount(projectId: string) { return await this.factory.surveillance.get(`project/video/source/config`, { projectId, }); } /** * 获取8700账号区域编码 * @param projectId */ async loadRegionCode(projectId: string) { return await this.factory.surveillance.get(`/config/ivms/projects/${projectId}/devices/ivmsRegions`); } }