import { ApiClientFactory } from '../core/api.client.factory'; import { DroneModel, HelpDoc, DroneRequestParam } from '../model/Drone.model'; import { PhotogrHistory } from '..//model/TimeLapsePhotogr.model'; import { Pageable } from '../'; export class DronesConfigService { constructor(private factory: ApiClientFactory) {} async loadDronesList(projectId: string): Promise { const url = `/api/uav/projects/${projectId}/devices`; const result = await this.factory.entity.get(url); return result; } async getDroneInfo(projectId: string, id: string): Promise { const url = `/api/uav/projects/${projectId}/devices/${id}`; const result = await this.factory.entity.get(url); return result; } async addDrone(projectId: string, param: DroneModel) { const url = `/api/uav/projects/${projectId}/devices`; const result = await this.factory.entity.put(url, param); return result; } async deleteDrone(projectId: string, id: string) { const url = `/api/uav/projects/${projectId}/devices/${id}`; const result = await this.factory.entity.delete(url); return result; } async pushRtmp(projectId: string, id: string): Promise { const url = `/api/uav/projects/${projectId}/devices/${id}/pushRtmp`; const result = await this.factory.entity.put(url); return result; } async getHelpDoc(projectId: string): Promise { const url = `/api/uav/projects/${projectId}/devices/download/getUrl`; const result = await this.factory.entity.get(url); return result; } /** * @function loadPhotogrHistoryData 项目级获取历史数据 */ async getHistoryData(req: DroneRequestParam): Promise> { const result = await this.factory.surveillance.get>(`/record/history`, req); return result; } /** * @function loadPhotogrHistoryData 企业级获取历史数据 */ async getEnterpriseHistoryData(req: DroneRequestParam): Promise> { const result = await this.factory.surveillance.get>(`/record/org/history`, req); return result; } /** * 企业级获取历史数据 * @param req * @returns */ async loadOrgEnterpriseHistoryData(req: DroneRequestParam): Promise> { const result = await this.factory.surveillance.get>(`/dji/inspection/video/history`, req); return result; } /** * @function loadDeviceTypeList 获取无人机类型 */ async getDeviceTypes(): Promise { const result = await this.factory.surveillance.get>(`/record/getDeviceCategories`); return result; } /** * @functioin loadDeviceList 项目级获取无人机设备列表 */ async loadDeviceList(projectId: string): Promise { const result = await this.factory.surveillance.get>(`/record/devices?projectId=${projectId}`); return result; } /** * @functioin loadEnterpriseDeviceList 企业级获取无人机设备列表 */ async loadEnterpriseDeviceList(projectIds: string): Promise { const result = await this.factory.surveillance.get>( `/record/org/devices?projectIds=${projectIds}` ); return result; } /** * 企业级获取无人机设备列表 * @param tenantId * @param orgId * @param videoCategory * @returns */ async loadOrgDeviceList(tenantId: string, orgId: string, videoCategory: string): Promise { const result = await this.factory.surveillance.get>(`/record/tenantDevices?`, { tenantId, orgId, videoCategory, }); return result; } /** * @function 监控全部 */ async addAllMonitors(projectId: string) { return await this.factory.surveillance.put(`/uav/projects/${projectId}/devices/monitor`); } /** * @function 取消监控全部 */ async cancelAllMonitors(projectId: string) { return await this.factory.surveillance.put(`/uav/projects/${projectId}/devices/cancelMonitor`); } /** * @function 加入监控 */ async addMonitors(projectId: string, deviceId: string) { return await this.factory.surveillance.put(`/uav/projects/${projectId}/devices/${deviceId}/monitor`); } /** * @function 取消监控 */ async cancelMonitors(projectId: string, deviceId: string) { return await this.factory.surveillance.put(`/uav/projects/${projectId}/devices/${deviceId}/cancelMonitor`); } }