feat: 添加告警画面截图相关设置
- 配置告警画面截图保留天数 - 是否自动获取告警画面截图
This commit is contained in:
@@ -3,4 +3,5 @@ export * from './ndm-camera-ignore';
|
||||
export * from './ndm-decoder';
|
||||
export * from './ndm-keyboard';
|
||||
export * from './ndm-media-server';
|
||||
export * from './ndm-snap';
|
||||
export * from './ndm-video-server';
|
||||
|
||||
20
src/apis/request/biz/video/ndm-snap.ts
Normal file
20
src/apis/request/biz/video/ndm-snap.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { ndmClient, userClient, type Station } from '@/apis';
|
||||
import { unwrapResponse } from '@/utils';
|
||||
|
||||
export async function retentionDaysApi(method: 'get', options?: { stationCode?: Station['code']; signal?: AbortSignal }): Promise<number>;
|
||||
export async function retentionDaysApi(method: 'post', options: { days: number; stationCode?: Station['code']; signal?: AbortSignal }): Promise<number>;
|
||||
export async function retentionDaysApi(method: 'get' | 'post', options?: { days?: number; stationCode?: Station['code']; signal?: AbortSignal }) {
|
||||
const { days, stationCode, signal } = options ?? {};
|
||||
const client = stationCode ? ndmClient : userClient;
|
||||
const prefix = stationCode ? `/${stationCode}` : '';
|
||||
const endpoint = `${prefix}/api/ndm/ndmSnap/retentionDays`;
|
||||
if (method === 'get') {
|
||||
const resp = await client.get<number>(endpoint, { signal });
|
||||
const data = unwrapResponse(resp);
|
||||
return data;
|
||||
} else {
|
||||
const resp = await client.post<number>(endpoint, days, { signal });
|
||||
const data = unwrapResponse(resp);
|
||||
return data;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user