更新超级管理查看资源分配

This commit is contained in:
zhanggangyong
2026-01-12 17:16:55 +00:00
parent c6bab43f12
commit 0ddc548d0f
4 changed files with 1092 additions and 3 deletions
@@ -1,6 +1,6 @@
# 超级管理员控制台 - 接口对接文档
> **版本**: v1.0.4
> **版本**: v1.0.5
> **更新时间**: 2026-01-13
> **说明**: 本文档基于前端业务需求清单与后端API接口清单核实,列出所有超级管理员端接口的对接状态
> **最新测试**: 2026-01-06 14:54 UTC - 所有已对接接口测试通过
@@ -27,8 +27,8 @@
| 类别 | 总数 | 已对接 | 未对接 | 对接率 |
|------|------|--------|--------|--------|
| 数据展示接口 | 14 | 12 | 2 | 85.7% |
| 按钮操作接口 | 34 | 29 | 5 | 85.3% |
| **合计** | **48** | **41** | **7** | **85.4%** |
| 按钮操作接口 | 35 | 30 | 5 | 85.7% |
| **合计** | **49** | **42** | **7** | **85.7%** |
### 状态说明
- ✅ **已对接**: 后端接口已实现,前端可直接调用
@@ -915,6 +915,104 @@ curl -i -X DELETE "http://localhost:8002/api/channel/tenants/2c45b96d-c158-466f-
---
#### 18. 查看渠道资源分配详情 ✅ 已对接
| 属性 | 值 |
|------|-----|
| **接口路径** | `GET /api/admin/channels/{channel_id}/allocated-resources` |
| **后端状态** | ✅ 已实现 (admin.py) |
| **权限要求** | super_admin, billing_admin, operations_admin |
**按钮位置**: 渠道管理页面 → 渠道卡片 → "查看资源分配"菜单项
**说明**: 超级管理员查看渠道被分配的所有资源详情,包括自定义Agent配额、平台Agent配额、模型供应商、模型(RPM/TPM)等
**路径参数**:
| 参数 | 类型 | 必填 | 说明 |
|------|------|------|------|
| channel_id | string | 是 | 渠道ID |
**响应字段**:
```json
{
"success": true,
"data": {
"channelId": "channel-uuid",
"channelName": "渠道名称",
"channelEmail": "channel@example.com",
"channelStatus": "active",
"createdAt": "2026-01-01T00:00:00Z",
"channelCredit": 100000.0,
"commissionRate": 0.15,
"customAgentQuota": {
"cpuQuota": 20.0,
"memoryQuota": 40.0,
"cpuAllocatedToTenants": 12.0,
"memoryAllocatedToTenants": 24.0,
"cpuAvailable": 8.0,
"memoryAvailable": 16.0
},
"platformAgents": [
{
"templateName": "echo_agent",
"templateDisplayName": "Echo 测试服务",
"podQuota": 10,
"podUsed": 3,
"podAllocatedToTenants": 6,
"podAvailable": 4,
"cpuPerPod": "100m",
"memoryPerPod": "256Mi",
"allocatedAt": "2026-01-05T10:30:00Z"
}
],
"modelProviders": [
{
"providerId": "provider-uuid",
"providerName": "OpenAI",
"providerType": "openai",
"status": "active",
"models": [
{
"modelName": "taiji/gpt-4o",
"rpmLimit": 1000,
"tpmLimit": 100000,
"maxBudget": 5000.0,
"budgetDuration": "monthly"
}
]
}
],
"models": [
{
"modelName": "taiji/gpt-4o",
"providerName": "OpenAI",
"rpmLimit": 1000,
"tpmLimit": 100000,
"maxBudget": 5000.0,
"budgetDuration": "monthly",
"allocatedToTenants": 3
}
],
"summary": {
"totalCustomAgentCpuQuota": 20.0,
"totalCustomAgentMemoryQuota": 40.0,
"totalPlatformAgentPodQuota": 15,
"totalPlatformAgentPodUsed": 5,
"totalModelProviders": 2,
"totalModels": 3,
"totalTenantsWithResources": 5
}
},
"message": "获取渠道资源分配详情成功"
}
```
> **详细文档**: 参见 `Docs/项目文档/超级管理员查看渠道资源分配接口文档.md`
**前端调用**: `TaijiAPIClient.getChannelAllocatedResources(channelId)`
---
## 资源管理模块 (Resources)
### 数据展示接口
@@ -1520,6 +1618,7 @@ curl -i -X DELETE "http://localhost:8002/api/channel/tenants/2c45b96d-c158-466f-
| 34 | /api/admin/roles | GET | 角色列表 | 设置 |
| 35 | /api/admin/channels/{channel_id}/tenants/resources | GET | 查看渠道租户资源分配 | 渠道管理 |
| 36 | /api/channel/tenants/resources/summary | GET | 渠道管理员查看租户资源汇总 | 渠道管理 |
| 37 | /api/admin/channels/{channel_id}/allocated-resources | GET | 查看渠道资源分配详情 | 渠道管理 |
---
@@ -1613,6 +1712,13 @@ curl -i -X DELETE "http://localhost:8002/api/channel/tenants/2c45b96d-c158-466f-
## 更新日志
### v1.0.5 (2026-01-13)
- 新增接口 `GET /api/admin/channels/{channel_id}/allocated-resources`:超级管理员查看渠道资源分配详情
- 包含自定义Agent配额、平台Agent配额、模型供应商、模型(RPM/TPM)等完整资源信息
- 后端实现完成 (admin.py)
- 详细接口文档见 `Docs/项目文档/超级管理员查看渠道资源分配接口文档.md`
### v1.0.4 (2026-01-13)
- 新增 `GET /api/admin/channels/{channel_id}/tenants/resources` 接口:查看渠道下所有租户的资源分配(自定义Agent、平台Agent、模型)