import { ResPage, Dept } from "@/api/interface/index";
import { PORT1 } from "@/api/config/servicePort";
import http from "@/api";

/**
 * @name 菜单管理模块
 */
// 获取分页列表
export const getDeptList = (params: Dept.ReqDeptParams) => {
  return http.get<ResPage<Dept.ResDeptList>>(PORT1 + `/system/dept/list`, params);
};

// 新增
export const addDept = (params: Partial<Dept.ResDeptList>) => {
  return http.post(PORT1 + `/system/dept`, params);
};

// 编辑
export const editDept = (params: Partial<Dept.ResDeptList>) => {
  return http.put(PORT1 + `/system/dept`, params);
};

// 删除
export const deleteDept = (ids: string[]) => {
  return http.delete(PORT1 + `/system/dept/${ids.join(",")}`);
};
