import { ApiClientFactory } from '../core/api.client.factory'; import { GeneraDisCernList, GeneraDisCernReq } from '../model/GeneralDiscernConfig.model'; import { Pageable } from '../model'; export class GeneralDiscernConfigService { constructor(private factory: ApiClientFactory) {} /** * 获取通用配置列表 * @param projectId * @returns */ async loadGeneraDisCernList(projectId: string): Promise { const result = await this.factory.surveillance.get( `/boxalgo/misinformer/config/${projectId}/list` ); return result; } /** * 保存通用配置 * @param projectId * @param param * @returns */ async saveGeneraDisCern(projectId: string, param: GeneraDisCernReq): Promise { const result = await this.factory.surveillance.put(`/boxalgo/misinformer/config/${projectId}/save`, param); return result; } /** * 删除通用识别配置 * @param projectId * @param id * @returns */ async deleteGeneraDisCern(projectId: string, id: string): Promise { const result = await this.factory.surveillance.delete( `/boxalgo/misinformer/config/${projectId}/delete?id=${id}` ); return result; } /** * 下发配置到盒子 * @param projectId * @param id * @returns */ async sendGeneraDisCern(projectId: string, id: string): Promise { const result = await this.factory.surveillance.post( `/boxalgo/misinformer/config/${projectId}/issue?deviceId=${id}` ); return result; } /** * 清空已下发的配置 * @param projectId * @param id * @returns */ async clearGeneraDisCern(projectId: string, id: string): Promise { const result = await this.factory.surveillance.post( `/boxalgo/misinformer/config/${projectId}/clearConfig?deviceId=${id}` ); return result; } /** * 设置全部通用识别启用状态 * @param projectId * @param type 启用:on,停用:off * @returns */ async setEnableStatusAll(projectId: string, type: string): Promise { const result = await this.factory.surveillance.put(`/boxalgo/misinformer/config/${projectId}/${type}`); return result; } /** * 设置单个通用识别启用状态 * @param projectId * @param type * @param id * @returns */ async setEnableStatus(projectId: string, type: string, id: string): Promise { const result = await this.factory.surveillance.put(`/boxalgo/misinformer/config/${projectId}/${id}/${type}`); return result; } }