import request from "@/utils/request";

import { parseStrEmpty } from "@/utils/ruoyi";

// fetch table template list
export function list(data, page) {
  return request({
    url: "/system/template/list",
    method: "post",
    data: data,
    params: page,
  });
}

// fetch table template item
export function item(id) {
  return request({
    url: "/system/template/detail/" + parseStrEmpty(id),
    method: "get",
  });
}

// fetch table template item
export function add(data) {
  return request({
    url: "/system/template/add",
    method: "post",
    data: data,
  });
}

// fetch table template item
export function edit(data) {
  return request({
    url: "/system/template/edit",
    method: "post",
    data: data,
  });
}

// fetch table template item
export function remove(id) {
  return request({
    url: "/system/template/delete/" + parseStrEmpty(id),
    method: "get",
  });
}

// fetch table template item
export function role(id) {
  return request({
    url: "/system/template/template_role/detail/" + parseStrEmpty(id),
    method: "get",
  });
}

// fetch table template list
export function auth(data, page) {
  return request({
    url: "/system/template/role/add",
    method: "post",
    data: data,
    params: page,
  });
}
