import { get, post, download } from '@/api/request';

const env = import.meta.env;
const PREFIX = env.VITE_API_PREFIX_SYSTEM;

// 租户列表
export const tenantListApi = (params: any) => {
  return post(`${PREFIX}tenant/list`, params);
};

// 创建租户
export const tenantAddApi = (params: any) => {
  return post(`${PREFIX}tenant/add`, params);
};

// 更新租户
export const tenantUpdateApi = (params: any) => {
  return post(`${PREFIX}tenant/update`, params);
};

// 租户详情
export const tenantGetTenantDetailByIdApi = (params: any) => {
  return get(`${PREFIX}tenant/getTenantDetailById`, params);
};

// 删除租户
export const tenantDeleteApi = (params: any) => {
  return get(`${PREFIX}tenant/delete`, params);
};

// 租户列表导出
export const tenantExportApi = (params: any, filename: string) => {
  return download(`${PREFIX}/tenant/export`, params, filename);
};
