import { ApiClientFactory } from '../core'; import { HangingBarPresetModel, Pageable } from '../model'; import { AuditModel, AuditSaveReq, AutitListQueryModel, EventGroup, EventType, HighSpotModel, HighSpotReqModel, SelectOptionModel, PromptTreeNode, PushConfigModel, PushConfigReq, TestHighSpotReq, WorkAreaModel, WorkAreaTestModel, TenantProjectRankData, TenantReport, TenantProjectRankDataQueryParams, TenantReportQueryParams, AreaEvent, } from '../model/HighSpot.model'; import { YsVideoList } from '../model/ysConfig.model'; const hightSpotBaseUrl = '/high/point/config'; const WorkAreaBaseUrl = '/work/area/config'; export class HighSpotService { constructor(private api: ApiClientFactory) {} getHighSpotList(projectId: string) { return this.api.surveillance.get(`${hightSpotBaseUrl}?projectId=${projectId}`); } saveHighSpot(data: HighSpotReqModel) { return this.api.surveillance.post(`${hightSpotBaseUrl}`, data); } deleteHighSpot(id: string) { return this.api.surveillance.delete(`${hightSpotBaseUrl}?id=${id}`); } enableHighSpot(id: string, on: boolean) { return this.api.surveillance.post(`${hightSpotBaseUrl}/on`, { id, on, }); } getPromptList(projectId: string) { return this.api.surveillance.get(`/prompts/trees/project`, { projectId, }); } getWorkAreaListByProject(projectId: string) { return this.api.surveillance.get(`${WorkAreaBaseUrl}/project`, { projectId }); } getWorkAreaList(highPointId?: string) { return this.api.surveillance.get(`${WorkAreaBaseUrl}/high/point`, { highPointId, }); } presetSnap(presetId: string) { return this.api.surveillance.put(`/ptz/preset/call/image/${presetId}`); } saveWorkArea(data: WorkAreaModel) { return this.api.surveillance.post(`${WorkAreaBaseUrl}`, data); } deleteWorkArea(id: string) { return this.api.surveillance.delete(`${WorkAreaBaseUrl}?id=${id}`); } enableWorkArea(id: string, on: boolean) { return this.api.surveillance.post(`${WorkAreaBaseUrl}/on`, { id, on, }); } getPresetPointList(projectId: string, deviceId: string) { // /ivs/api/ptz/preset?projectId=495548628914688 return this.api.surveillance.get(`/ptz/preset`, { projectId, deviceId, }); } getYsyCameraList(projectId: string) { return this.api.surveillance.get(`/config/ysy/projects/${projectId}/devices?type=Camera`); } testWorkArea(req: WorkAreaTestModel) { return this.api.surveillance.post(`${WorkAreaBaseUrl}/test`, req); } testHighSpot(req: TestHighSpotReq) { return this.api.surveillance.post(`${hightSpotBaseUrl}/test`, req); } getAuth(projectId: string) { return this.api.surveillance.get(`/high/point/config/auth`, { projectId }); } nextHighSpotName(projectId: string) { return this.api.surveillance.get(`/high/point/config/nextName`, { projectId }); } nextWorkAreaName(projectId: string, highPointId: string) { return this.api.surveillance.get(`/work/area/config/nextName`, { projectId, highPointId }); } getVersionList(projectId: string, tenantId: string) { return this.api.surveillance.get(`/llm/prompt/version/list4Display`, { projectId, tenantId }); } getEventList(projectId: string) { return this.api.surveillance.get(`/gvs30/event/type/highPointEventTypes`, { projectId }); } getEventGroupList(projectId: string) { return this.api.surveillance.get(`/gvs30/event/type/highPointEventGroups`, { projectId }); } getPresetCamera(projectId: string) { return this.api.surveillance.get(`/high/point/config/cameras`, { projectId }); } pushConfig = { getTypes: () => { return this.api.surveillance.get(`/ai/content/config/types`); }, getConfig: (projectId: string) => { return this.api.surveillance.get(`/ai/content/config`, { projectId }); }, saveConfig: (data: PushConfigReq) => { return this.api.surveillance.post(`ai/content/config`, data); }, deleteConfig: (id: string) => { return this.api.surveillance.delete(`/ai/content/config?id=${id}`); }, enableConfig: (id: string, on: boolean) => { return this.api.surveillance.post(`/ai/content/config/on`, { id, on }); }, generateConfig: (configId: string, fromTime: number, toTime: number) => { return this.api.surveillance.post(`/ai/content/config/generate`, { configId, fromTime, toTime }); }, }; audit = { getAuditList: (projectId: string, params: AutitListQueryModel) => { return this.api.surveillance.get>(`/ai/content/audit/page`, { projectId, ...params }); }, saveAuditData: (data: AuditSaveReq) => { return this.api.surveillance.post(`/ai/content/audit`, data); }, deleteAuditData: (id: string) => { return this.api.surveillance.delete(`/ai/content/audit?id=${id}`); }, confirmAuditData: (id: string, confirm: number) => { return this.api.surveillance.post(`/ai/content/audit/confirm`, { id, confirm }); }, generateAuditData: (contentId: string) => { return this.api.surveillance.post(`/ai/content/audit/generate`, { contentId }); }, }; gvsTenant = { getDay7RankData: (params: TenantProjectRankDataQueryParams) => { return this.api.surveillance.get>(`/ai/content/tenant/page/day7`, params); }, getReportByDay: (params: TenantReportQueryParams) => { return this.api.surveillance.get>(`/ai/content/tenant/page/day`, params); }, getEventsByContendId: (projectId: string, contentId: string, n: number) => { return this.api.surveillance.get(`/ai/content/area?projectId=${projectId}&contentId=${contentId}&n=${n}`); }, getAreaEventsTopN: ( projectId: string, params: { contentId: string; workAreaId: string; }, n: number = 10 ) => { return this.api.surveillance.get( `/ai/content/area/events/topn?projectId=${projectId}&n=${n}`, params ); }, }; }