import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { DmsInspectRouteDetailVO, DmsInspectRouteDetailForm, DmsInspectRouteDetailQuery } from '@/api/dms/dmsInspectRouteDetail/types';

/**
 * 查询点巡检线路明细列表
 * @param query
 * @returns {*}
 */

export const listDmsInspectRouteDetail = (query?: DmsInspectRouteDetailQuery): AxiosPromise<DmsInspectRouteDetailVO[]> => {
  return request({
    url: '/dms/dmsInspectRouteDetail/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询点巡检线路明细详细
 * @param routeDetailId
 */
export const getDmsInspectRouteDetail = (routeDetailId: string | number): AxiosPromise<DmsInspectRouteDetailVO> => {
  return request({
    url: '/dms/dmsInspectRouteDetail/' + routeDetailId,
    method: 'get'
  });
};

/**
 * 新增点巡检线路明细
 * @param data
 */
export const addDmsInspectRouteDetail = (data: DmsInspectRouteDetailForm) => {
  return request({
    url: '/dms/dmsInspectRouteDetail',
    method: 'post',
    data: data
  });
};

/**
 * 修改点巡检线路明细
 * @param data
 */
export const updateDmsInspectRouteDetail = (data: DmsInspectRouteDetailForm) => {
  return request({
    url: '/dms/dmsInspectRouteDetail',
    method: 'put',
    data: data
  });
};

/**
 * 删除点巡检线路明细
 * @param routeDetailId
 */
export const delDmsInspectRouteDetail = (routeDetailId: string | number | Array<string | number>) => {
  return request({
    url: '/dms/dmsInspectRouteDetail/' + routeDetailId,
    method: 'delete'
  });
};


/**
 * 下拉框查询点巡检线路明细列表
 * @param query
 * @returns {*}
 */
export function getDmsInspectRouteDetailList (query) {
    return request({
        url: '/dms/dmsInspectRouteDetail/getDmsInspectRouteDetailList',
        method: 'get',
        params: query
    });
};
