import { get, post, put } from '../request' export interface Tenant { id: string name: string code: string status: string owner_user_id?: string | null quota: Record retention_policy_id?: string | null create_time?: string } /** 租户列表 */ export const getTenants = () => get('/tenants') /** 租户详情 */ export const getTenant = (id: string) => get(`/tenants/${id}`) /** 创建租户 */ export const createTenant = (payload: Partial) => post('/tenants', payload) /** 更新租户 */ export const updateTenant = (id: string, payload: Partial) => put(`/tenants/${id}`, payload) /** 设置租户配额 */ export const setTenantQuota = (id: string, quota: Record) => put(`/tenants/${id}/quota`, { quota }) /** 设置租户留存策略 */ export const setTenantRetention = (id: string, retention_policy_id: string) => put(`/tenants/${id}/retention-policy`, { retention_policy_id })