videoChannel.ts
1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import {
VideoChannelItemType,
VideoChannelPlayAddressType,
VideoChannelQueryParamsType,
VideoChanneControlType,
EzvizControlType,
} from './model/videoChannelModel';
import { PaginationResult } from '/#/axios';
import { defHttp } from '/@/utils/http/axios';
enum Api {
GET_VIDEO_CHANNEL_LIST = '/video/channel',
GET_VIDEO_CONTROL_START = '/video/control/start',
GET_VIDEO_CONTROL_STOP = '/video/control/stop',
SET_VIDEO_CONTROL_CONTROL = '/video/control/control',
SET_EZVIZ_CONTROL = '/video/ezviz/controlling',
}
export const getVideoChannelList = (params: VideoChannelQueryParamsType) => {
return defHttp.get<PaginationResult<VideoChannelItemType>>({
url: Api.GET_VIDEO_CHANNEL_LIST,
params,
});
};
export const getVideoControlStart = ({
deviceId,
channelId,
}: Record<'deviceId' | 'channelId', string>) => {
return defHttp.get<VideoChannelPlayAddressType>(
{
url: `${Api.GET_VIDEO_CONTROL_START}/${deviceId}/${channelId}`,
timeout: 30 * 1000,
},
{
withShareToken: true,
}
);
};
export const setVideoControl = (tbDeviceId, channelId, params: VideoChanneControlType) => {
return defHttp.get<VideoChannelPlayAddressType>({
url: `${Api.SET_VIDEO_CONTROL_CONTROL}/${tbDeviceId}/${channelId}`,
// timeout: 30 * 1000,
params,
});
};
export const setEzvizControl = (params: EzvizControlType) => {
return defHttp.get({
url: Api.SET_EZVIZ_CONTROL,
params,
});
};