feat(alarm-page): camera snapshot
This commit is contained in:
@@ -2,3 +2,4 @@ export * from './base';
|
||||
export * from './device';
|
||||
export * from './system';
|
||||
export * from './user';
|
||||
export * from './vimp';
|
||||
|
||||
1
src/apis/models/vimp/index.ts
Normal file
1
src/apis/models/vimp/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export * from './snap-result';
|
||||
5
src/apis/models/vimp/snap-result.ts
Normal file
5
src/apis/models/vimp/snap-result.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
export interface SnapResult {
|
||||
absoluteFilePath: string;
|
||||
path: string;
|
||||
url: string;
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ndmClient, type NdmCameraPageQuery, type NdmCameraResultVO, type NdmCameraUpdateVO, type PageParams, type PageResult } from '@/apis';
|
||||
import { ndmClient, type NdmCameraPageQuery, type NdmCameraResultVO, type NdmCameraUpdateVO, type PageParams, type PageResult, type SnapResult } from '@/apis';
|
||||
|
||||
export const postNdmCameraPage = async (stationCode: string, pageQuery: PageParams<NdmCameraPageQuery>, signal?: AbortSignal) => {
|
||||
const prefix = stationCode ? `/${stationCode}` : '';
|
||||
@@ -29,3 +29,12 @@ export const putNdmCamera = async (stationCode: string, updateVO: NdmCameraUpdat
|
||||
}
|
||||
return await getNdmCameraDetail(stationCode, ndmCamera.id ?? '');
|
||||
};
|
||||
|
||||
export const getSnapByDeviceIdApi = async (deviceId: string) => {
|
||||
const resp = await ndmClient.get<SnapResult>(`/api/ndm/ndmCamera/getSnapByDeviceId`, { params: { deviceId } });
|
||||
const [err, snap] = resp;
|
||||
if (err || !snap) {
|
||||
throw err;
|
||||
}
|
||||
return snap;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user