import request from "@/utils/request";

// 查询用户订阅资源列表
export function listResource(query) {
  return request({
    url: "/system/audit/resource/list",
    method: "get",
    params: query,
  });
}

// 查询用户订阅资源详细
export function getResource(id) {
  return request({
    url: "/system/audit/resource/" + id,
    method: "get",
  });
}

// 查询用户审核的资源
export function getUserItem(id) {
  return request({
    url: "/system/audit/resource/useritem",
    method: "get",
    params: { id },
  });
}

// 新增用户订阅资源
export function addResource(data) {
  return request({
    url: "/system/audit/resource",
    method: "post",
    data: data,
  });
}

// 修改用户订阅资源
export function updateResource(data) {
  return request({
    url: "/system/audit/resource",
    method: "put",
    data: data,
  });
}

// 审核用户订阅资源
export function auditResource(data) {
  return request({
    url: "/system/audit/resource/audit",
    method: "post",
    data: data,
  });
}

// 刷新用户订阅资源
export function refeshResource() {
  return request({
    url: "/system/audit/resource/refesh",
    method: "post",
  });
}

// 删除用户订阅资源
export function delResource(id) {
  return request({
    url: "/system/audit/resource/" + id,
    method: "delete",
  });
}
