import request from '@/utils/request'
import { preventRepeatFu } from "@/utils/hciot";

// 查询企业租户列表
export function listTenant(query) {
    return request({
        url: '/system/tenant/list',
        method: 'get',
        params: query
    })
}

// 查询企业租户详细
export function getTenant(tenantId) {
    return request({
        url: '/system/tenant/' + tenantId,
        method: 'get'
    })
}

// 新增企业租户
export function addTenant(data) {
    preventRepeatFu(true)
    return request({
        url: '/system/tenant',
        method: 'post',
        data: data
    })
}

// 修改企业租户
export function updateTenant(data) {
    preventRepeatFu(true)
    return request({
        url: '/system/tenant',
        method: 'put',
        data: data
    })
}

// 删除企业租户
export function delTenant(tenantId) {
    return request({
        url: '/system/tenant/' + tenantId,
        method: 'delete'
    })
}

// 导出报警记录
export function exportRecord(query) {
  return request({
      url: '/system/tenant/export',
      method: 'get',
      params: query
  })
}
