import { $postParam, $post } from "@/plugins/axios";

export const questionTeatherUserQuery = ({ courseCode, param }) => {
  return $postParam("/api/admin/sys/user/user_list", { courseCode, param });
};
// user-manage
export const userListPage = datas => {
  return $postParam("/api/admin/sys/user/list", datas);
};
export const updateUser = datas => {
  return $post("/api/admin/sys/user/save", datas);
};
export const ableUser = ({ id, enable }) => {
  return $post("/api/admin/sys/user/enable", { id, enable });
};
export const resetPwd = id => {
  return $post("/api/admin/sys/user/reset_password", { id });
};
export const updatePwd = datas => {
  return $post("/api/admin/sys/user/update_password", datas);
};
export const userBindRoles = ({ id, roleIds }) => {
  return $post("/api/admin/sys/user/bind_roles", { id, roleIds });
};
export const userRoleListPage = () => {
  return $postParam("/api/admin/sys/role/list_to_user", {});
};

// role-manage
export const roleListPage = datas => {
  return $postParam("/api/admin/sys/role/list", datas);
};
export const ableRole = ({ id, enable }) => {
  return $post("/api/admin/sys/role/enable", { id, enable });
};
export const updateRole = datas => {
  return $post("/api/admin/sys/role/save", datas);
};
export const deleteRole = id => {
  return $postParam("/api/admin/sys/role/remove", { id });
};
export const userBoundRoles = userId => {
  return $postParam("/api/admin/sys/role/get_user_roles", { userId });
};
// menu-manage
export const menuAuthList = datas => {
  return $postParam("/api/admin/sys/privilege/list_auth", datas);
};
export const privilegeList = datas => {
  return $postParam("/api/admin/sys/privilege/list", datas);
};
export const roleBoundPrivileges = roleId => {
  return $postParam("/api/admin/sys/privilege/get_role_privileges", { roleId });
};
// organization-manage
export const organizationList = datas => {
  return $postParam("/api/admin/sys/org/list", datas);
};
export const updateOrganization = datas => {
  return $post("/api/admin/sys/org/save", datas);
};
export const ableOrganization = ({ id, enable }) => {
  return $post("/api/admin/sys/org/enable", { id, enable });
};
export const deleteOrganization = id => {
  return $post("/api/admin/sys/org/remove", { id });
};

// data-init-manage
export const dataInitList = datas => {
  return $postParam("/api/admin/sys/org/list", datas);
};
export const updateKnowledgeDimension = datas => {
  return $postParam("/api/admin/sys/org/list", datas);
};

// analysis-course-manage
export const analysisBatchList = datas => {
  return $postParam("/api/admin/sys/org/list", datas);
};
export const analysisBatchQuery = datas => {
  return $postParam("/api/admin/sys/org/list", datas);
};
export const updateAnalysisBatch = datas => {
  return $post("/api/admin/sys/org/save", datas);
};
export const deleteAnalysisBatch = ids => {
  return $post("/api/admin/sys/org/list", { ids });
};
export const analysisBatchPaperList = datas => {
  return $postParam("/api/admin/sys/org/list", datas);
};
export const addAnalysisBatchPaper = datas => {
  return $postParam("/api/admin/sys/org/list", datas);
};
export const deleteAnalysisBatchPaper = ids => {
  return $postParam("/api/admin/sys/org/list", { ids });
};
export const analysisPaperList = datas => {
  return $postParam("/api/admin/sys/org/list", datas);
};

// common
export const uploadFile = datas => {
  return $post("/api/admin/common/file/upload", datas);
};

// system
