Files
td_official/src/api/other/ys7Device/index.ts

104 lines
2.0 KiB
TypeScript
Raw Normal View History

2025-08-19 10:19:29 +08:00
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
});
};