import request from '@/utils/request'

// 查询租户SQL执行记录列表
export function listRecord(query) {
  return request({
    url: '/tenant/record/list',
    method: 'get',
    params: query
  })
}

// 查询租户SQL执行记录详细
export function getRecord(id) {
  return request({
    url: '/tenant/record/' + id,
    method: 'get'
  })
}

// 新增租户SQL执行记录
export function addRecord(data) {
  return request({
    url: '/tenant/record',
    method: 'post',
    data: data
  })
}

export function uploadScript(data) {
  return request({
    url: '/tenant/record/uploadScript',
    method: 'post',
    data: data
  })
}

// 修改租户SQL执行记录
export function updateRecord(data) {
  return request({
    url: '/tenant/record',
    method: 'put',
    data: data
  })
}

// 删除租户SQL执行记录
export function delRecord(id) {
  return request({
    url: '/tenant/record/' + id,
    method: 'delete'
  })
}

// 导出租户SQL执行记录
export function exportRecord(query) {
  return request({
    url: '/tenant/record/export',
    method: 'get',
    params: query
  })
}
