import request from '@/utils/request';

/**
 * 查询设备类型信息列表
 * @param query
 * @returns {*}
 */

export const listDeviceType = (query) => {
  return request({
    url: '/jdyw/deviceType/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询设备类型信息详细
 * @param id
 */
export const getDeviceType = (id) => {
  return request({
    url: '/jdyw/deviceType/' + id,
    method: 'get'
  });
};

/**
 * 新增设备类型信息
 * @param data
 */
export const addDeviceType = (data) => {
  return request({
    url: '/jdyw/deviceType',
    method: 'post',
    data: data
  });
};

/**
 * 修改设备类型信息
 * @param data
 */
export const updateDeviceType = (data) => {
  return request({
    url: '/jdyw/deviceType',
    method: 'put',
    data: data
  });
};

/**
 * 删除设备类型信息
 * @param id
 */
export const delDeviceType = (id: string | number | Array<string | number>) => {
  return request({
    url: '/jdyw/deviceType/' + id,
    method: 'delete'
  });
};

/**
 * 设备分项系统信息
 * @param query
 * @returns {*}
 */

export const getDeviceSystemTree = (query) => {
  return request({
    url: '/jdyw/deviceSystem/list',
    method: 'get',
    params: query
  });
};
/**
 * 新增设备分项系统信息
 * @param query
 * @returns {*}
 */

export const addDeviceSystem = (data) => {
  return request({
    url: '/jdyw/deviceSystem',
    method: 'post',
    data
  });
};
/**
 * 修改设备分项系统信息
 * @param query
 * @returns {*}
 */

export const editDeviceSystem = (data) => {
  return request({
    url: '/jdyw/deviceSystem',
    method: 'put',
    data
  });
};
/**
 * 删除设备分项系统信息
 * @param query
 * @returns {*}
 */

export const delDeviceSystem = (id) => {
  return request({
    url: `/jdyw/deviceSystem/${id}`,
    method: 'delete'
  });
};
/**
 * 物模型获取
 * @returns {*}
 */

export const getModels = (id) => {
  return request({
    url: `/jdyw/models/${id}`,
    method: 'get'
  });
};
/**
 * 物模型新增
 * @returns {*}
 */

export const addModels = (data) => {
  return request({
    url: `/jdyw/models`,
    method: 'post',
    data
  });
};
/**
 * 物模型修改
 * @returns {*}
 */

export const editModels = (data) => {
  return request({
    url: `/jdyw/models`,
    method: 'put',
    data
  });
};
/**
 * 获取设备详细类型列表
 * @returns {*}
 */
export const getDeviceTypeDetailList = (query) => {
  return request({
    url: `/jdyw/deviceTypeDetail/list`,
    method: 'get',
    params: query
  });
};
/**
 * 获取设备详细类型详情
 * @returns {*}
 */
export const getDeviceTypeDetail = (id) => {
  return request({
    url: `/jdyw/deviceTypeDetail/${id}`,
    method: 'get'
  });
};
/**
 * 新增设备详细类型
 * @returns {*}
 */
export const addDeviceTypeDetail = (data) => {
  return request({
    url: `/jdyw/deviceTypeDetail`,
    method: 'post',
    data
  });
};
/**
 * 修改设备详细类型
 * @returns {*}
 */
export const updateDeviceTypeDetail = (data) => {
  return request({
    url: `/jdyw/deviceTypeDetail`,
    method: 'put',
    data
  });
};
/**
 * 删除设备详细类型
 * @param id
 */
export const delDeviceTypeDetail = (id: string | number | Array<string | number>) => {
  return request({
    url: '/jdyw/deviceTypeDetail/' + id,
    method: 'delete'
  });
};
