Files
oneos-frontend/apps/web-naive/src/api/system/tenant/index.ts
k kfluous 2650d1cdf0
Some checks failed
CI / Test (ubuntu-latest) (push) Has been cancelled
CI / Test (windows-latest) (push) Has been cancelled
CI / Lint (ubuntu-latest) (push) Has been cancelled
CI / Lint (windows-latest) (push) Has been cancelled
CI / Check (ubuntu-latest) (push) Has been cancelled
CI / Check (windows-latest) (push) Has been cancelled
CI / CI OK (push) Has been cancelled
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
Deploy Website on push / Deploy Push Playground Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Docs Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Antd Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Element Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Naive Ftp (push) Has been cancelled
Deploy Website on push / Rerun on failure (push) Has been cancelled
Release Drafter / update_release_draft (push) Has been cancelled
Initial commit: OneOS frontend based on yudao-ui-admin-vben
2026-03-11 22:18:23 +08:00

77 lines
1.8 KiB
TypeScript

import type { PageParam, PageResult } from '@vben/request';
import { requestClient } from '#/api/request';
export namespace SystemTenantApi {
/** 租户信息 */
export interface Tenant {
id?: number;
name: string;
packageId: number;
contactName: string;
contactMobile: string;
accountCount: number;
expireTime: Date;
websites: string[];
status: number;
}
}
/** 租户列表 */
export function getTenantPage(params: PageParam) {
return requestClient.get<PageResult<SystemTenantApi.Tenant>>(
'/system/tenant/page',
{ params },
);
}
/** 获取租户精简信息列表 */
export function getSimpleTenantList() {
return requestClient.get<SystemTenantApi.Tenant[]>(
'/system/tenant/simple-list',
);
}
/** 查询租户详情 */
export function getTenant(id: number) {
return requestClient.get<SystemTenantApi.Tenant>(
`/system/tenant/get?id=${id}`,
);
}
/** 获取租户精简信息列表 */
export function getTenantList() {
return requestClient.get<SystemTenantApi.Tenant[]>(
'/system/tenant/simple-list',
);
}
/** 新增租户 */
export function createTenant(data: SystemTenantApi.Tenant) {
return requestClient.post('/system/tenant/create', data);
}
/** 修改租户 */
export function updateTenant(data: SystemTenantApi.Tenant) {
return requestClient.put('/system/tenant/update', data);
}
/** 删除租户 */
export function deleteTenant(id: number) {
return requestClient.delete(`/system/tenant/delete?id=${id}`);
}
/** 批量删除租户 */
export function deleteTenantList(ids: number[]) {
return requestClient.delete(
`/system/tenant/delete-list?ids=${ids.join(',')}`,
);
}
/** 导出租户 */
export function exportTenant(params: any) {
return requestClient.download('/system/tenant/export-excel', {
params,
});
}