import request from '@/utils/request';
import { BackCategoryVO, BackCategoryQuery, BackCategoryForm } from './types';
import { AxiosPromise } from 'axios';

/**
 * 查询背调条款分类列表
 */
export const listBackCategory = (query?: BackCategoryQuery): AxiosPromise<BackCategoryVO[]> => {
  return request({
    url: '/system/backCategory/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询背调条款分类详细
 */
export const getBackCategory = (id: string | number): AxiosPromise<BackCategoryVO> => {
  return request({
    url: '/system/backCategory/' + id,
    method: 'get'
  });
};

/**
 * 新增背调条款分类
 */
export const addBackCategory = (data: BackCategoryForm) => {
  return request({
    url: '/system/backCategory',
    method: 'post',
    data: data
  });
};

/**
 * 修改背调条款分类
 */
export const updateBackCategory = (data: BackCategoryForm) => {
  return request({
    url: '/system/backCategory',
    method: 'put',
    data: data
  });
};

/**
 * 删除背调条款分类
 */
export const delBackCategory = (ids: string | number | Array<string | number>) => {
  return request({
    url: '/system/backCategory/' + ids,
    method: 'delete'
  });
};
