videoChannel.ts
1.19 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
import {
  VideoChannelItemType,
  VideoChannelPlayAddressType,
  VideoChannelQueryParamsType,
  VideoChanneControlType,
} 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',
}
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,
    },
    {}
  );
};
export const setVideoControl = (tbDeviceId, channelId, params: VideoChanneControlType) => {
  return defHttp.get<VideoChannelPlayAddressType>({
    url: `${Api.SET_VIDEO_CONTROL_CONTROL}/${tbDeviceId}/${channelId}`,
    // timeout: 30 * 1000,
    params,
  });
};