import { request } from '../request';
/**
 * 获取部门列表
 */
export function fetchGetDepartmentList(data: Recordable) {
  return request<Api.SystemManage.DepartmentModel[]>({
    url: '/smqjh-system/api/v1/dept',
    method: 'GET',
    params: data
  });
}

/**
 *  修改部门
 * @param data
 * @returns
 */
export function fetchEditDepartment(data: Api.SystemManage.DepartmentModel) {
  return request({
    url: '/admin/dept',
    method: 'PUT',
    data
  });
}

/**
 * 新增部门
 * @param data
 * @returns
 */
export function fetchAddDepartment(data: Api.SystemManage.DepartmentModel) {
  return request({
    url: '/admin/dept',
    method: 'POST',
    data
  });
}

/**
 * 删除部门
 * @param data
 * @returns
 */
export function fetchDeleteDepartment(deptId: number) {
  return request({
    url: `/admin/dept/${deptId}`,
    method: 'DELETE'
  });
}
