import request from '@/utils/request'

const api = {
  Points: '/Admin/Permission/Points',
  User: '/Admin/Permission/User',
  Resources: '/Admin/Permission/Resources',
  Resource: '/Admin/Permission/Resource'
}

export function getPermissionPoints(parameter) {
  return request({
    url: api.Points,
    method: 'get',
    params: parameter
  })
}

export function getUserPermissions(parameter) {
  return request({
    url: api.User,
    method: 'get',
    params: parameter
  })
}

export function setUserPermissions(parameter) {
  return request({
    url: api.User,
    method: 'post',
    data: parameter
  })
}

export function getPermissionResources(parameter) {
  return request({
    url: api.Resources,
    method: 'get',
    params: parameter
  })
}

export function updatePermissionResource(parameter) {
  return request({
    url: api.Resource,
    method: 'post',
    data: parameter
  })
}
