import { Pageable } from '../'; import { ApiClientFactory } from '../core/api.client.factory'; import { DeviceList, EventTypeList, CategoryReq, CategoryList, JobList, JobReq } from '../model/CategoryManage.model'; export class CategoryManageService { constructor(private factory: ApiClientFactory) {} /** * 获取设备列表 * @param projectId * @returns */ async loadDeviceList(projectId: string): Promise { const result = await this.factory.surveillance.get(`/safe/backlog/category/${projectId}/deviceList`); return result; } /** * 获取事件类型列表 * @param projectId * @returns */ async loadEventTypeList(projectId: string): Promise { const result = await this.factory.surveillance.get( `/safe/backlog/category/${projectId}/eventTypeList` ); return result; } /** * 保存分类场景 * @param projectId * @param CategoryReq * @returns */ async saveCategory(projectId: string, categoryReq: CategoryReq): Promise { const result = await this.factory.surveillance.put(`/safe/backlog/category/${projectId}/save`, categoryReq); return result; } /** * 删除分类场景 * @param projectId * @param cagetoryid * @returns */ async deleteCategory(projectId: string, cagetoryId: string): Promise { const result = await this.factory.surveillance.delete(`/safe/backlog/category/${projectId}/${cagetoryId}`); return result; } /** * 获取分类场景列表 * @param projectId * @returns */ async loadCategoryList(projectId: string): Promise { const result = await this.factory.surveillance.get(`/safe/backlog/category/${projectId}/list`); return result; } /** * 获取岗位字典 * @param projectId * @returns */ async loadJobDict(projectId: string): Promise { const result = await this.factory.surveillance.get(`/safe/job/${projectId}/jobDict`); return result; } /** * 获取保存的岗位 * @param projectId * @returns */ async loadJobList(projectId: string): Promise { const result = await this.factory.surveillance.get(`/safe/job/${projectId}/projectJobList`); return result; } /** * 保存岗位设置 * @param projectId * @param param * @returns */ async saveJob(projectId: string, param: JobReq): Promise { const result = await this.factory.surveillance.post(`/safe/job/${projectId}/save`, param); return result; } /** * 删除岗位 * @param projectId * @param jobId * @returns */ async deleteJob(projectId: string, jobId: string): Promise { const result = await this.factory.surveillance.delete(`/safe/job/${projectId}/delete/${jobId}`); return result; } }