import request from "@/utils/request";

// 查询用户配置文件列表
export function listConfig(query) {
  return request({
    url: "/system/UserConfiguration/list",
    method: "get",
    params: query,
  });
}

// 查询用户配置文件详细
export function getConfig(id) {
  return request({
    url: "/system/UserConfiguration/" + id,
    method: "get",
  });
}

// 新增用户配置文件
export function addConfig(data) {
  return request({
    url: "/system/UserConfiguration",
    method: "post",
    data: data,
  });
}

// 修改用户配置文件
export function updateConfig(data) {
  return request({
    url: "/system/UserConfiguration",
    method: "put",
    data: data,
  });
}

// 删除用户配置文件
export function delConfig(id) {
  return request({
    url: "/system/UserConfiguration/" + id,
    method: "delete",
  });
}
// 启用
export function enabled(id) {
  return request({
    url: "/system/UserConfiguration/enable/" + id,
    method: "delete",
  });
}

// 禁用
export function disabled(id) {
  return request({
    url: "/system/UserConfiguration/disable/" + id,
    method: "delete",
  });
}

// 状态修改
export function changeStatus(id, status) {
  const data = {
    id,
    status,
  };
  return request({
    url: "/system/UserConfiguration/changeStatus",
    method: "put",
    data: data,
  });
}
