import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { ArStepMediaVO, ArStepMediaForm, ArStepMediaQuery } from '@/api/inspection/stepMedia/types';

/**
 * 查询步骤媒体文件列表
 * @param query
 * @returns {*}
 */
export const listArStepMedia = (query?: ArStepMediaQuery): AxiosPromise<ArStepMediaVO[]> => {
  return request({
    url: '/inspection/stepMedia/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询步骤媒体文件详细
 * @param id
 */
export const getArStepMedia = (id: string | number): AxiosPromise<ArStepMediaVO> => {
  return request({
    url: '/inspection/stepMedia/' + id,
    method: 'get'
  });
};

/**
 * 新增步骤媒体文件
 * @param data
 */
export const addArStepMedia = (data: ArStepMediaForm) => {
  return request({
    url: '/inspection/stepMedia',
    method: 'post',
    data: data
  });
};

/**
 * 修改步骤媒体文件
 * @param data
 */
export const updateArStepMedia = (data: ArStepMediaForm) => {
  return request({
    url: '/inspection/stepMedia',
    method: 'put',
    data: data
  });
};

/**
 * 删除步骤媒体文件
 * @param id
 */
export const delArStepMedia = (id: string | number | Array<string | number>) => {
  return request({
    url: '/inspection/stepMedia/' + id,
    method: 'delete'
  });
};
