import { http } from '@/utils/http/axios';

/**
 * @description: 获取租户列表
 */
export function getTenantList(params) {
  return http.request({
    url: '/tenant/page',
    method: 'get',
    params,
  });
}

/**
 * @description: 根据ID获取详情
 */
export function getTenantDetail(tenantId) {
  return http.request({
    url: '/tenant/detail/' + tenantId,
    method: 'get',
  });
}

/**
 * @description: 添加租户
 */
export function tenantAdd(data: any) {
  return http.request({
    url: '/tenant/add',
    method: 'POST',
    data,
  });
}

/**
 * @description: 更新租户
 */
export function tenantUpdate(data: any) {
  return http.request({
    url: '/tenant/update',
    method: 'PUT',
    data,
  });
}

/**
 * @description: 删除租户
 */
export function tenantDelete(tenantId) {
  return http.request({
    url: '/tenant/delete/' + tenantId,
    method: 'DELETE',
  });
}

/**
 * @description: 批量删除租户
 */
export function tenantBatchDelete(data: any) {
  return http.request({
    url: '/tenant/batchDelete',
    method: 'DELETE',
    data,
  });
}

/**
 * @description: 创建租户账号
 */
export function tenantAccount(data: any) {
  return http.request({
    url: '/tenant/account',
    method: 'POST',
    data,
  });
}
