import { ApiClientFactory } from '../core/api.client.factory'; import { PhotogrList, CustomPhotogrList, PhotogrReq, PhotogrHistoryReq, PhotogrHistory, CameraDevices, VideoInfo, VideoInfoReq, ShortVideoLogReq, } from '../model/TimeLapsePhotogr.model'; import { Pageable } from '../'; export class TimeLapsePhotogrService { constructor(private factory: ApiClientFactory) {} /** * @function loadPhotogrList 获取延时摄影计划列表信息 * @param projectId 项目ID */ async loadPhotogrList(projectId: string): Promise { const result = await this.factory.surveillance.get(`config/shortVideo/plan?`, { projectId }); return result; } /** * @function loadCustomPhotogrList 获取自定义合成视频列表 */ async loadCustomPhotogrList(projectId: string, type: string = 'ONETIME'): Promise { const result = await this.factory.surveillance.get(`config/shortVideo/plan`, { projectId, type, }); return result; } /** * @function createPhotogrPlan 创建或修改延时摄影计划 */ async createPhotogrPlan(req: PhotogrReq): Promise { const result = await this.factory.surveillance.put(`/config/shortVideo/plan`, req); return result; } /** * @function delePhotogrPlan 删除延时摄影计划 */ async delePhotogrPlan(planId: string): Promise { const result = await this.factory.surveillance.delete(`/config/shortVideo/plan/${planId}`); return result; } /** * @function openPhotogrPlan 开启延时摄影计划 */ async openPhotogrPlan(planId: string): Promise { const result = await this.factory.surveillance.post(`/config/shortVideo/plan/${planId}/on`); return result; } /** * @function closePhtogrPlan 关闭延时摄影计划 */ async closePhtogrPlan(planId: string): Promise { const result = await this.factory.surveillance.post(`/config/shortVideo/plan/${planId}/off`); return result; } /** * @function openAllPhotogrPlan 开启全部延时摄影计划 */ async openAllPhotogrPlan(projectId: string): Promise { const result = await this.factory.surveillance.post(`/config/shortVideo/plan/batchOn/${projectId}`); return result; } /** * @function closeAllPhotogrPlan 关闭全部延时摄影计划 */ async closeAllPhotogrPlan(projectId: string): Promise { const result = await this.factory.surveillance.post(`/config/shortVideo/plan/batchOff/${projectId}`); return result; } /** * @function loadPhotogrHistoryData 获取延时摄影历史数据 */ async loadPhotogrHistoryData(req: PhotogrHistoryReq): Promise> { const result = await this.factory.surveillance.get>(`shortVideo/history`, req); return result; } /** * 获取企业级延时摄影历史数据 * @param req * @returns */ async loadOrgPhotogrHistoryData(req: PhotogrHistoryReq): Promise> { const result = await this.factory.surveillance.get>(`shortVideo/org/history`, req); return result; } /** * @function loadDevicesList 获取摄像头设备列表 */ async loadDevicesList(projectId: string, type: string, planId?: string, deviceId?: string): Promise { const result = await this.factory.surveillance.get(`/config/shortVideo/plan/devices`, { projectId, type, planId, deviceId, }); return result; } /** * @function createVideo 把计划生成视频 */ async createVideo(projectId: string, planId: string): Promise { const result = await this.factory.gvsIvs.post(`/config/shortVideo/maker`, { projectId, planId, }); return result; } /** * @function loadVideoInfo 获取图片数量和视频时长 */ async loadVideoInfo(req: VideoInfoReq): Promise { const result = await this.factory.surveillance.post(`/config/shortVideo/plan/getImageInfo?`, req); return result; } /** * 合成视频 * @param param */ async syntheticVideo(param: object) { const result = await this.factory.surveillance.post('/mps/merge', { ...param, }); return result; } /** * 修改视频 * @param param * @returns */ async modifyVedio(param: object) { const result = await this.factory.surveillance.put('/mps/merge', { ...param, }); return result; } /** * 获取延时摄像组织树 * @param tenantId * @param orgId * @returns */ async loadShortVideoNavigateTree(tenantId: string, orgId: string, projectStatus: string) { const result = await this.factory.surveillance.get(`/org/shortVideoNavigateTree`, { tenantId, orgId, projectStatus, }); return result; } /** * 获取项目级延时摄影设备列表 * @param projectId * @returns */ async loadProjectDevicesList(projectId: string): Promise { const result = await this.factory.surveillance.get(`/shortVideo/devices`, { projectId, }); return result; } /** * 获取企业级延时摄影设备列表 * @param tenantId * @returns */ async loadOrgDevicesList(tenantId: string, orgId: string): Promise { const result = await this.factory.surveillance.get(`/shortVideo/org/devices`, { tenantId, orgId, }); return result; } /** * 获取延时摄影日志列表 * @param param * @returns */ async loadShortVideoLogList(param: ShortVideoLogReq): Promise { const result = await this.factory.surveillance.get(`/config/shortVideo/maker/log/page`, param); return result; } /** * 延时摄影重新生成视频 * @param id * @returns */ async remarkShortVideo(id: string): Promise { const result = await this.factory.surveillance.post(`/config/shortVideo/maker/remake?id=${id}`); return result; } }