import request from '@/utils/request'

// 查询集合列表
export function listFastGptCollection(query) {
  return request({
    url: '/fastGpt/fastGptCollection/list',
    method: 'get',
    params: query
  })
}

// 查询集合详细
export function getFastGptCollection(collectionId) {
  return request({
    url: '/fastGpt/fastGptCollection/' + collectionId,
    method: 'get'
  })
}

// 新增集合
export function addFastGptCollection(data) {
  return request({
    url: '/fastGpt/fastGptCollection',
    method: 'post',
    data: data
  })
}

// 修改集合
export function updateFastGptCollection(data) {
  return request({
    url: '/fastGpt/fastGptCollection',
    method: 'put',
    data: data
  })
}

// 删除集合
export function delFastGptCollection(collectionId) {
  return request({
    url: '/fastGpt/fastGptCollection/' + collectionId,
    method: 'delete'
  })
}

// 导出集合
export function exportFastGptCollection(query) {
  return request({
    url: '/fastGpt/fastGptCollection/export',
    method: 'get',
    params: query
  })
}

export function syncCollection(datasetId) {
  return request({
    url: '/fastGpt/fastGptCollection/syncCollection/'+datasetId,
    method: 'get',
  })
}
