XuqmGroup-Web/ops-platform/src/api/ops.ts

38 行
808 B
TypeScript

2026-04-21 22:07:29 +08:00
import client from './client'
export interface TenantItem {
id: string
username: string
nickname: string
email: string
phone?: string
type: 'MAIN' | 'SUB'
status: 'ACTIVE' | 'DISABLED' | 'PENDING_EMAIL'
parentId?: string
createdAt: string
}
export interface TenantPage {
content: TenantItem[]
total: number
totalPages: number
}
export interface Statistics {
totalTenants: number
todayNew: number
activeApps: number
onlineUsers: number
}
export const opsApi = {
listTenants: (keyword = '', page = 0, size = 20) =>
client.get<{ data: TenantPage }>('/ops/tenants', { params: { keyword, page, size } }),
toggleStatus: (id: string) =>
client.post(`/ops/tenants/${id}/toggle-status`),
statistics: () =>
client.get<{ data: Statistics }>('/ops/statistics'),
}