import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { AuditInfoVO, AuditInfoForm, AuditInfoQuery } from '@/api/system/info/types';

/**
 * 查询【请填写功能名称】列表
 * @param query
 * @returns {*}
 */

export const listInfo = (query?: AuditInfoQuery): AxiosPromise<AuditInfoVO[]> => {
  return request({
    url: '/system/info/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询【请填写功能名称】详细
 * @param documentId
 */
export const getInfos = (documentId: string | number): AxiosPromise<AuditInfoVO> => {
  return request({
    url: '/system/info/' + documentId,
    method: 'get'
  });
};

/**
 * 新增【请填写功能名称】
 * @param data
 */
export const addInfo = (data: AuditInfoForm) => {
  return request({
    url: '/system/info',
    method: 'post',
    data: data
  });
};

/**
 * 修改【请填写功能名称】
 * @param data
 */
export const updateInfo = (data: AuditInfoForm) => {
  return request({
    url: '/system/info',
    method: 'put',
    data: data
  });
};

/**
 * 删除【请填写功能名称】
 * @param appId
 */
export const delInfo = (documentId: string | number | Array<string | number>) => {
  return request({
    url: '/system/info/' + documentId,
    method: 'delete'
  });
};
