import { Pageable } from '../'; import { ApiClientFactory } from '../core/api.client.factory'; import { HolosensVideoList, CreateCamera, CreateLocalVideo, Docs, CreateNVR, VendorList, CategoryList, DeviceDetail, HolosensAccountRep, HolosensAccountReq, EventConfigs, HolosensOnlineLogParam, HolosensOnlineLogModel, } from '../model/HolosensConfig.model'; export class HolosensConfigService { constructor(private factory: ApiClientFactory) { } /** * @function loadDocs 获取文档 * @param projectId 项目ID */ async loadDocs(projectId: string): Promise { const result = await this.factory.surveillance.get( `/config/holosens/projects/${projectId}/devices/download/getUrl` ); return result; } /** * 获取萤石NVR列表 * @param projectId 项目ID * @param type */ async loadHolosensVideoList(projectId: string, type: string, params?: any): Promise { const result = await this.factory.surveillance.get( `/config/holosens/projects/${projectId}/devices?type=${type}`, params ); 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/holosens/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/holosens/projects/${projectId}/devices/ipc`, camera); } // /** // * @function createLocalVideo 新建和更新本地camera或nvr // * @param projectId 项目ID // */ // async createLocalVideo(projectId: string, req: CreateLocalVideo): Promise { // return await this.factory.surveillance.put(`/config/ysy/projects/${projectId}/devices/rtsp`, req); // } /** * 删除nvr * @param projectId * @param id */ async deleteNvrDevice(projectId: string, id: string): Promise { return await this.factory.surveillance.delete(`config/holosens/projects/${projectId}/devices/${id}`); } /** * 删除视频相关设备 * @param projectId 项目ID * @param id 数据ID */ async deleteVideoDevice(projectId: string, id: string): Promise { return await this.factory.surveillance.delete(`/config/holosens/projects/${projectId}/devices/${id}`); } // /** // * 删除设备本地配置 // * @param projectId // * @param id // */ // async deleteDeviceLocalConfig(projectId: string, id: string): Promise { // return await this.factory.surveillance.delete(`config/holosens/projects/${projectId}/devices/rtsp/${id}`); // } /** * 同步筑联的数据 * @param projectId 项目ID */ async syncHolosensData(projectId: string): Promise { return await this.factory.surveillance.put(`/config/holosens/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/holosens/projects/${projectId}/devices/${deviceId}` ); return result; } /** * @function 监控全部 */ async addAllMonitor(projectId: string) { return await this.factory.surveillance.put(`/config/holosens/projects/${projectId}/devices/monitor`); } /** * @function 取消监控全部 */ async cancelAllMonitor(projectId: string) { return await this.factory.surveillance.put(`/config/holosens/projects/${projectId}/devices/cancelMonitor`); } /** * @function 加入监控 */ async addMonitor(projectId: string, deviceId: string) { return await this.factory.surveillance.put( `config/holosens/projects/${projectId}/devices/${deviceId}/monitor` ); } /** * @function 取消监控 */ async cancelMonitor(projectId: string, deviceId: string) { return await this.factory.surveillance.put( `config/holosens/projects/${projectId}/devices/${deviceId}/cancelMonitor` ); } /** * @function 同步摄像头 */ async syncDeviceImage(projectId: string) { return await this.factory.surveillance.put(`config/holosens/projects/${projectId}/devices/syncDeviceImage`); } /** * @function updateHolosensAccount 修改好望云账号 */ async updateHolosensAccount(projectId: string, holoSensConfig: HolosensAccountReq) { return await this.factory.surveillance.put(`project/video/source/config/holosens`, { projectId, holoSensConfig, }); } /** * @function loadHolosensAccount 修改好望云账号 */ async loadHolosensAccount(projectId: string) { return await this.factory.surveillance.get(`project/video/source/config`, { projectId, }); } /** * 好望云事件列表 */ async loadHolosensEvent() { return await this.factory.surveillance.get(`eventConfig/eventTypes/holo`); } // /** // * @function updateYsyEvent 更新萤石云事件配置 // */ // async updateYsyEvent(param: EventConfigs) { // return await this.factory.surveillance.put(`eventConfig/device/eventConfig`, param); // } // /** // * 解绑好望云设备 // * @param projectId // * @param id // * @returns // */ // async deleteDeviceFromHolosens(projectId: string, id: string) { // return await this.factory.surveillance.put(`/config/holosens/projects/${projectId}/devices/deleteDeviceFromYsy`, { // id, // }); // } // /** // * 绑定好望云设备 // */ // async addDeviceToHolosens(projectId: string, id: string) { // return await this.factory.surveillance.put(`/config/holosens/projects/${projectId}/devices/addDeviceToYsy`, { // id, // }); // } // /** // * @function loadHolosensOnlineLog 萤石云在线日志 // */ // async loadHolosensOnlineLog(param: HolosensOnlineLogParam) { // return await this.factory.surveillance.get>(`/holosens/log/online/query`, param); // } // /** // * @function 萤石云重启设备 // */ // async restartDevice(deviceId: string) { // return await this.factory.surveillance.post(`/holosens/device/reboot?deviceId=${deviceId}`); // } /** * @function 萤石云设备资源信息 */ async fetchDeviceResourceStatus(deviceId: string) { return await this.factory.surveillance.get(`/holosens/device/status`, { deviceId }); } /** * @function 萤石云设备信息 */ async fetchDeviceSystemInfo(deviceId: string) { return await this.factory.surveillance.get(`/holosens/device/systemInfo?deviceId=${deviceId}`); } async fetchDeviceSystemInfoV2(deviceId: string) { return await this.factory.surveillance.get(`/holosens/device/systemInfoV2?deviceId=${deviceId}`); } // /** // * @function 转H264 // */ // async toh264(projectId: string, deviceId?: string): Promise { // const result = await this.factory.surveillance.post(`/holosens/stream/to264`, { // projectId, // deviceId, // }); // return result; // } // /** // * @function 转H265 // */ // async toh265(projectId: string, deviceId?: string): Promise { // const result = await this.factory.surveillance.post(`/holosens/stream/to265`, { // projectId, // deviceId, // }); // return result; // } // /** // * @function 好望云租户配置信息 // */ async fetchAccountConfigInfo(tenantId: string): Promise { const result = await this.factory.surveillance.get(`/tenant/video/source/config`, { tenantId, }); return result; } // /** // * @function 转H264 // */ // async setAccountConfigInfo(tenantId: string, holosensConfig: HolosensAccountReq): Promise { // const result = await this.factory.surveillance.put(`/tenant/video/source/config/holosens`, { // tenantId, // holosensConfig, // }); // return result; // } }