import { ApiClientFactory } from '../core/api.client.factory'; import { SmokeList, SmokeCombinationList, SmokeDetail } from '../model/smokeConfig.model'; export class SmokeConfigService { constructor(private factory: ApiClientFactory) {} async loadSmokeList(projectId: string): Promise { const result = await this.factory.entity.get(`/api/web/projects/${projectId}/smoke`); return result; } async loadSmokeCombinationList(projectId: string): Promise { const result = await this.factory.entity.get( `/api/web/projects/${projectId}/smoke/deviceObject` ); return result; } async createSmokeCombinstion(projectId: string, deviceIds: string[]): Promise { return await this.factory.entity.post( `/api/web/projects/${projectId}/smoke/deviceObject `, deviceIds ); } async editSmokeCombinstionName(projectId: string, id: string, name: string): Promise { return await this.factory.entity.put(`/api/web/projects/${projectId}/smoke/deviceObject`, { id, name }); } async deleteSmokeCombination(projectId: string, id: string): Promise { return await this.factory.entity.delete(`/api/web/projects/${projectId}/smoke/deviceObject/${id}`); } async loadSmokeDetail(projectId: string, id: string): Promise { const result = await this.factory.entity.get( `/api/web/projects/${projectId}/smoke/deviceObject/${id}` ); return result; } }