// @ts-ignore
/* eslint-disable */
import { request } from '@umijs/max';

/** 创建基础department POST /department/createDepartment */
export async function postDepartmentCreateDepartment(
  body: API.Department,
  options?: { [key: string]: any },
) {
  return request<API.Response & { msg?: string }>(`/api/v1/department/createDepartment`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 删除department DELETE /department/deleteDepartment */
export async function deleteDepartmentDeleteDepartment(
  body: API.Department,
  options?: { [key: string]: any },
) {
  return request<API.Response & { msg?: string }>(`/api/v1/department/deleteDepartment`, {
    method: 'DELETE',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 删除选中Department DELETE /department/deleteDepartmentsByIds */
export async function deleteDepartmentDeleteDepartmentsByIds(
  body: API.IdsReq,
  options?: { [key: string]: any },
) {
  return request<API.Response & { msg?: string }>(`/api/v1/department/deleteDepartmentsByIds`, {
    method: 'DELETE',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 根据id获取department POST /department/getDepartmentById */
export async function postDepartmentGetDepartmentById(
  body: API.GetById,
  options?: { [key: string]: any },
) {
  return request<API.Response & { data?: API.DepartmentResponse }>(
    `/api/v1/department/getDepartmentById`,
    {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
      },
      data: body,
      ...(options || {}),
    },
  );
}

/** 分页获取角色列表 POST /department/getDepartmentFkSelect */
export async function postDepartmentGetDepartmentFkSelect(options?: { [key: string]: any }) {
  return request<API.Response & { data?: API.FkResult; msg?: string }>(
    `/api/v1/department/getDepartmentFkSelect`,
    {
      method: 'POST',
      ...(options || {}),
    },
  );
}

/** 分页获取Department列表 POST /department/getDepartmentList */
export async function postDepartmentGetDepartmentList(
  body: API.PageInfo,
  options?: { [key: string]: any },
) {
  return request<API.Response & { data?: API.PageResult; msg?: string }>(
    `/api/v1/department/getDepartmentList`,
    {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
      },
      data: body,
      ...(options || {}),
    },
  );
}

/** 获得名称列表 POST /department/getDepartmentNames */
export async function postDepartmentGetDepartmentNames(
  body: API.IdsReq,
  options?: { [key: string]: any },
) {
  return request<API.Response & { data?: API.NamesResult; msg?: string }>(
    `/api/v1/department/getDepartmentNames`,
    {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
      },
      data: body,
      ...(options || {}),
    },
  );
}

/** 获取部门树 POST /department/getDepartmentTree */
export async function postDepartmentGetDepartmentTree(options?: { [key: string]: any }) {
  return request<API.Response & { data?: API.TreeResponse; msg?: string }>(
    `/api/v1/department/getDepartmentTree`,
    {
      method: 'POST',
      ...(options || {}),
    },
  );
}

/** 修改基础department PUT /department/updateDepartment */
export async function putDepartmentUpdateDepartment(
  body: API.Department,
  options?: { [key: string]: any },
) {
  return request<API.Response & { msg?: string }>(`/api/v1/department/updateDepartment`, {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
