import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { DmsBaseShutTypeVO, DmsBaseShutTypeForm, DmsBaseShutTypeQuery } from '@/api/dms/dmsBaseShutType/types';

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

export const listDmsBaseShutType = (query?: DmsBaseShutTypeQuery): AxiosPromise<DmsBaseShutTypeVO[]> => {
  return request({
    url: '/dms/dmsBaseShutType/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询停机类型信息详细
 * @param shutTypeId
 */
export const getDmsBaseShutType = (shutTypeId: string | number): AxiosPromise<DmsBaseShutTypeVO> => {
  return request({
    url: '/dms/dmsBaseShutType/' + shutTypeId,
    method: 'get'
  });
};

/**
 * 新增停机类型信息
 * @param data
 */
export const addDmsBaseShutType = (data: DmsBaseShutTypeForm) => {
  return request({
    url: '/dms/dmsBaseShutType',
    method: 'post',
    data: data
  });
};

/**
 * 修改停机类型信息
 * @param data
 */
export const updateDmsBaseShutType = (data: DmsBaseShutTypeForm) => {
  return request({
    url: '/dms/dmsBaseShutType',
    method: 'put',
    data: data
  });
};

/**
 * 删除停机类型信息
 * @param shutTypeId
 */
export const delDmsBaseShutType = (shutTypeId: string | number | Array<string | number>) => {
  return request({
    url: '/dms/dmsBaseShutType/' + shutTypeId,
    method: 'delete'
  });
};


/**
 * 下拉框查询停机类型信息列表
 * @param query
 * @returns {*}
 */
export function getDmsBaseShutTypeList (query) {
    return request({
        url: '/dms/dmsBaseShutType/getDmsBaseShutTypeList',
        method: 'get',
        params: query
    });
};
