import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { DmsBaseInspectProjectVO, DmsBaseInspectProjectForm, DmsBaseInspectProjectQuery } from '@/api/dms/dmsBaseInspectProject/types';

/**
 * 查询点巡检项目信息列表
 * @param query
 * @returns {*}
 */

export const listDmsBaseInspectProject = (query?: DmsBaseInspectProjectQuery): AxiosPromise<DmsBaseInspectProjectVO[]> => {
  return request({
    url: '/dms/dmsBaseInspectProject/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询点巡检项目信息详细
 * @param inspectProjectId
 */
export const getDmsBaseInspectProject = (inspectProjectId: string | number): AxiosPromise<DmsBaseInspectProjectVO> => {
  return request({
    url: '/dms/dmsBaseInspectProject/' + inspectProjectId,
    method: 'get'
  });
};

/**
 * 新增点巡检项目信息
 * @param data
 */
export const addDmsBaseInspectProject = (data: DmsBaseInspectProjectForm) => {
  return request({
    url: '/dms/dmsBaseInspectProject',
    method: 'post',
    data: data
  });
};

/**
 * 修改点巡检项目信息
 * @param data
 */
export const updateDmsBaseInspectProject = (data: DmsBaseInspectProjectForm) => {
  return request({
    url: '/dms/dmsBaseInspectProject',
    method: 'put',
    data: data
  });
};

/**
 * 删除点巡检项目信息
 * @param inspectProjectId
 */
export const delDmsBaseInspectProject = (inspectProjectId: string | number | Array<string | number>) => {
  return request({
    url: '/dms/dmsBaseInspectProject/' + inspectProjectId,
    method: 'delete'
  });
};


/**
 * 下拉框查询点巡检项目信息列表
 * @param query
 * @returns {*}
 */
export function getDmsBaseInspectProjectList (query) {
    return request({
        url: '/dms/dmsBaseInspectProject/getDmsBaseInspectProjectList',
        method: 'get',
        params: query
    });
};
