import request from '@/utils/request'

// 查询常用功能收藏夹列表
export function listFavorites(query) {
  return request({
    url: '/system/favorites/list',
    method: 'get',
    params: query
  })
}

// 查询常用功能收藏夹详细
export function getFavorites(id) {
  return request({
    url: '/system/favorites/' + id,
    method: 'get'
  })
}

// 新增常用功能收藏夹
export function addFavorites(data) {
  return request({
    url: '/system/favorites',
    method: 'post',
    data: data
  })
}

// 修改常用功能收藏夹
export function updateFavorites(data) {
  return request({
    url: '/system/favorites',
    method: 'put',
    data: data
  })
}

// 删除常用功能收藏夹
export function delFavorites(id) {
  return request({
    url: '/system/favorites/' + id,
    method: 'delete'
  })
}
// 启用
export function enabled(id) {
  return request({
    url: '/system/favorites/enable/' + id,
    method: 'delete'
  })
}

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

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