first commit
This commit is contained in:
103
src/api/other/ys7Device/index.ts
Normal file
103
src/api/other/ys7Device/index.ts
Normal file
@ -0,0 +1,103 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { Ys7DeviceVO, Ys7DeviceForm, Ys7DeviceQuery, CameraListForm } from '@/api/other/ys7Device/types';
|
||||
|
||||
/**
|
||||
* 查询萤石摄像头列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
|
||||
export const listYs7Device = (query?: Ys7DeviceQuery): AxiosPromise<Ys7DeviceVO[]> => {
|
||||
return request({
|
||||
url: '/other/ys7Device/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询萤石摄像头详细
|
||||
* @param id
|
||||
*/
|
||||
export const getYs7Device = (id: string | number): AxiosPromise<Ys7DeviceVO> => {
|
||||
return request({
|
||||
url: '/other/ys7Device/' + id,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 新增萤石摄像头
|
||||
* @param data
|
||||
*/
|
||||
export const addYs7Device = (data: Ys7DeviceForm) => {
|
||||
return request({
|
||||
url: '/other/ys7Device',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 修改萤石摄像头
|
||||
* @param data
|
||||
*/
|
||||
export const updateYs7Device = (data: Ys7DeviceForm) => {
|
||||
return request({
|
||||
url: '/other/ys7Device',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 删除萤石摄像头
|
||||
* @param id
|
||||
*/
|
||||
export const delYs7Device = (id: string | number | Array<string | number>) => {
|
||||
return request({
|
||||
url: '/other/ys7Device/' + id,
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
||||
|
||||
/// 修改加密状态
|
||||
export const toggleEncrypt = (data?: any): AxiosPromise<{}> => {
|
||||
return request({
|
||||
url: '/other/ys7Device/video/encrypted',
|
||||
method: 'put',
|
||||
data
|
||||
});
|
||||
};
|
||||
|
||||
export const devicesLinkPro = (data: { id: string | number; projectId: string | number }): AxiosPromise<Ys7DeviceVO> => {
|
||||
return request({
|
||||
url: '/other/ys7Device/with/project',
|
||||
method: 'put',
|
||||
data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取 token
|
||||
* @param id
|
||||
*/
|
||||
export const getAccessToken = () => {
|
||||
return request({
|
||||
url: '/other/ys7Device/get/token',
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 根据项目查询萤石摄像头列表
|
||||
* @param id
|
||||
*/
|
||||
export const getCameraListByProjectId = (params: CameraListForm): AxiosPromise<Ys7DeviceVO> => {
|
||||
return request({
|
||||
url: '/other/ys7Device/list/project',
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
};
|
Reference in New Issue
Block a user