import request from '@/utils/request'

// 查询应用列表
export function listFastGptRole(query) {
  return request({
    url: '/fastGpt/role/list',
    method: 'get',
    params: query
  })
}

export function getAllRoleList(query) {
  return request({
    url: '/fastGpt/role/getAllRoleList',
    method: 'get',
    params: query
  })
}


// 查询应用详细
export function getFastGptRole(roleId) {
  return request({
    url: '/fastGpt/role/' + roleId,
    method: 'get'
  })
}

// 新增应用
export function addFastGptRole(data) {
  return request({
    url: '/fastGpt/role',
    method: 'post',
    data: data
  })
}
export function copyFastGptRole(data) {
  return request({
    url: '/fastGpt/role/copy',
    method: 'post',
    data: data
  })
}
// 修改应用
export function updateFastGptRole(data) {
  return request({
    url: '/fastGpt/role',
    method: 'put',
    data: data
  })
}

//解除绑定
export function relieveFastGptRole(roleId) {
  return request({
    url: '/fastGpt/role/relieveFastGptRole/'+roleId,
    method: 'get',
  })
}
// 删除应用
export function delFastGptRole(roleId) {
  return request({
    url: '/fastGpt/role/' + roleId,
    method: 'delete'
  })
}

// 导出应用
export function exportFastGptRole(query) {
  return request({
    url: '/fastGpt/fastGptRole/export',
    method: 'get',
    params: query
  })
}
