import { http } from "@/utils/http";

/** 获取部门树 */
export const getDepartmentTree = () => {
  return http.request<any>("post", "/department/tree");
};

/** 获取部门列表 */
export const getDepartmentList = (data?: object) => {
  return http.request<any>("post", "/department/list", { data });
};

/** 获取部门详情 */
export const getDepartmentDetail = (id: number) => {
  return http.request<any>("get", `/department/detail/${id}`);
};

/** 新增部门 */
export const addDepartment = (data: object) => {
  return http.request<any>("post", "/department/add", { data });
};

/** 修改部门 */
export const modifyDepartment = (data: object) => {
  return http.request<any>("post", "/department/modify", { data });
};

/** 删除部门 */
export const removeDepartment = (id: number) => {
  return http.request<any>("get", `/department/remove/${id}`);
};
