import request from '@/utils/request'

// 查询【请填写功能名称】列表
export function listTenant(query) {
  request.defaults.baseURL = '/ezhizao-yzbh-sys'
  return request({
    url: '/business/tenant/list',
    method: 'get',
    params: query
  })
}

// 查询【请填写功能名称】详细
export function getTenant(id) {
  request.defaults.baseURL = '/ezhizao-yzbh-sys'
  return request({
    url: '/business/tenant/' + id,
    method: 'get'
  })
}

// 查询【请填写功能名称】详细
export function getTenantById(id) {
  request.defaults.baseURL = '/ezhizao-yzbh-sys'
  return request({
    url: '/business/tenant/' + id,
    method: 'get'
  })
}


// 新增【请填写功能名称】
export function addTenant(data) {
  request.defaults.baseURL = '/ezhizao-yzbh-sys'
  return request({
    url: '/business/tenant',
    method: 'post',
    data: data
  })
}

// 修改【请填写功能名称】
export function updateTenant(data) {
  request.defaults.baseURL = '/ezhizao-yzbh-sys'
  return request({
    url: '/business/tenant',
    method: 'put',
    data: data
  })
}

// 删除【请填写功能名称】
export function delTenant(id) {
  request.defaults.baseURL = '/ezhizao-yzbh-sys'
  return request({
    url: '/business/tenant/' + id,
    method: 'delete'
  })
}
// 初始化租户信息
export function checkTenantInit(tenantId) {
  request.defaults.baseURL = '/ezhizao-yzbh-sys'
  return request({
    url: '/business/tenant/checkTenantInit',
    method: 'get',
    params: {
      tenantId: tenantId
    }
  })
}
// 检查租户初始化情况
export function initTenant(data) {
  request.defaults.baseURL = '/ezhizao-yzbh-sys'
  return request({
    url: '/business/tenant/initTenant',
    method: 'post',
    data: data
  })
}
