import request from '@/utils/request'


// 获取插件 /api/v1/ot-plugins&pageIndex=0&pageSize=10 
export function listOtPlugins(query) {
  return request({
    url: '/api/v1/ot-plugins',
    method: 'get',
    params: query
  })
}



// 获取当前用户权限下的插件/api/v1/ot-plugins/{id}/withrole
export function singleOtPlugin(id) {
  return request({
    url: '/api/v1/ot-plugins/'+id+'/withrole',
    method: 'get',
  })
}

//创建插件  /api/v1/ot-plugins  post
export function addOtPlugins(data) {
  return request({
    url: '/api/v1/ot-plugins',
    method: 'post',
    data: data
  })
}

//修改插件 /api/v1/ot-plugins/{id}   put
export function updateOtPlugins(data, id) {
  return request({
    url: '/api/v1/ot-plugins/' + id,
    method: 'put',
    data: data
  })
}
// 删除插件 /api/v1/ot-plugins   {"ids":[1,2,3,4]}
export function delOtPlugins(data) {
  return request({
    url: '/api/v1/ot-plugins',
    method: 'delete',
    data: data
  })
}
