import request from '@/utils/request'

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

// 查询列表
export function treeSelect() {
  return request({
    url: '/system/tenant/list/treeSelect',
    method: 'get'
  })
}

// 查询详细
export function getTenant(dictTenantId) {
  return request({
    url: '/system/tenant/info/detailById/' + dictTenantId,
    method: 'get'
  })
}

// 新增
export function addTenant(data) {
  return request({
    url: '/system/tenant/add/addTenant',
    method: 'post',
    data: data
  })
}

// 修改
export function updateTenant(data) {
  return request({
    url: '/system/tenant/update/updateTenant',
    method: 'put',
    data: data
  })
}

// 删除
export function delTenant(dictTenantId) {
  return request({
    url: '/system/tenant/delete/deleteById/' + dictTenantId,
    method: 'delete'
  })
}

// 导出
export function exportTenant(query) {
  return request({
    url: '/system/tenant/export',
    method: 'get',
    params: query
  })
}

export function nowTenantInfo() {
  return request({
    url: '/api/system/tenant/info/nowTenantInfo',
    method: 'get'
  })
}
