// 系统api
import request from "@/utils/request";
/**
 *  系统参数
 */
// 获取系统参数列表
export const getParamList = (data) => {
  return request({
    url: `/bill/param/list`,
    method: "post",
    data,
  });
};
// 查看系统参数
export const getParamInfo = (params) => {
  return request({
    url: `/bill/param/info`,
    method: "get",
    params,
  });
};
// 保存编辑系统参数
export const saveParam = (data) => {
  return request({
    url: `/bill/param/save`,
    method: "post",
    data,
  });
};
// 删除系统参数
export const delParam = (params) => {
  return request({
    url: `/bill/param/delete`,
    method: "get",
    params,
  });
};

/**
 *  任务信息
 */
// 获取任务信息列表
export const getTaskList = (data) => {
  return request({
    url: `/bill/task/list`,
    method: "post",
    data,
  });
};
// 查看任务信息
export const getTaskInfo = (params) => {
  return request({
    url: `/bill/task/info`,
    method: "get",
    params,
  });
};
// 保存编辑任务信息
export const saveTask = (data) => {
  return request({
    url: `/bill/task/save`,
    method: "post",
    data,
  });
};
// 删除任务信息
export const delTask = (params) => {
  return request({
    url: `/bill/task/delete`,
    method: "get",
    params,
  });
};

/**
 *  操作日志
 */

// 获取操作日志
export const getlogsList = (data) => {
  return request({
    url: `/bill/oper/log/list`,
    method: "post",
    data,
  });
};
// 查看操作日志
export const getlog = (params) => {
  return request({
    url: `/bill/oper/log/info`,
    method: "get",
    params,
  });
};

/**
 *  资源信息
 */

// 获取资源信息列表
export const getResourceList = (data) => {
  return request({
    url: `/bill/resource/list`,
    method: "post",
    data,
  });
};
// 获取资源信息详情
export const getResourceDetail = (params) => {
  return request({
    url: `/bill/resource/info`,
    method: "get",
    params,
  });
};
// 添加资源信息
export const saveResource = (data) => {
  return request({
    url: `/bill/resource/save`,
    method: "post",
    data,
  });
};
// 删除资源信息
export const deleteResource = (params) => {
  return request({
    url: `/bill/resource/delete`,
    method: "get",
    params,
  });
};
// 刷新资源
export const refreshResource = (data) => {
  return request({
    url: `/bill/resource/refreshUrl`,
    method: "post",
    data,
  });
};
/**
 *  区县接入系统
 */

// 获取接入区县列表
export const getAccessList = (data) => {
  return request({
    url: `/bill/access/list`,
    method: "post",
    data,
  });
};
// 查看接入区县
export const getAccessInfo = (params) => {
  return request({
    url: `/bill/access/info`,
    method: "get",
    params,
  });
};
// 保存编辑接入区县
export const saveAccess = (data) => {
  return request({
    url: `/bill/access/save`,
    method: "post",
    data,
  });
};
// 删除接入区县
export const delAccess = (params) => {
  return request({
    url: `/bill/access/delete`,
    method: "get",
    params,
  });
};

/**
 *  角色
 */

// 获取角色列表
export const getRoleList = (data) => {
  return request({
    url: `/bill/role/list`,
    method: "post",
    data,
  });
};
// 获取角色详情
export const getRole = (params) => {
  return request({
    url: `/bill/role/get`,
    method: "get",
    params,
  });
};
// 保存角色
export const addRole = (data) => {
  return request({
    url: `/bill/role/save`,
    method: "post",
    data,
  });
};
// 删除角色
export const deleteRole = (params) => {
  return request({
    url: `/bill/role/delete`,
    method: "get",
    params,
  });
};
// 获取角色资源列表
export const getRoleResourceList = (data) => {
  return request({
    url: `/bill/role/auth/list`,
    method: "post",
    data,
  });
};
// 添加角色资源
export const addRoleResource = (data) => {
  return request({
    url: `/bill/role/auth/distributionSource`,
    method: "post",
    data,
  });
};

/**
 *  用户管理
 */
// 获取用户列表
export const getUserList = (data) => {
  return request({
    url: `/bill/user/list`,
    method: "post",
    data,
  });
};
// 获取用户信息
export const getUserInfo = (params) => {
  return request({
    url: `/bill/user/info`,
    method: "get",
    params,
  });
};
// 保存用户
export const saveUser = (data) => {
  return request({
    url: `/bill/user/save`,
    method: "post",
    data,
  });
};
// 删除用户
export const deleteUser = (params) => {
  return request({
    url: `/bill/user/delete`,
    method: "get",
    params,
  });
};
