Files
taiji-pda-v0/docs/TENANT-USER-BUSINESS-FEATURES.md
T

6.8 KiB
Raw Blame History

租户端(User Portal)业务功能与接口清单

本文档梳理了租户用户端(Tenant User Portal)的所有业务功能点、已对接的接口,以及部分未对接功能的业务数据需求。

访问地址: 租户登录后的主界面 核心模块: 仪表板、服务网关、数据工具、代理工厂、编排中心、计费资源


1. 仪表板 (Dashboard - Overview)

路径: /

业务功能 功能描述 对应接口/方法 状态 备注/数据需求
Hero统计 展示活跃Agent、全局API调用、EU余额、系统健康度 1. GET /api/user/dashboard/stats
2. GET /api/user/billing/balance
3. GET /api/v1/monitoring/dashboard
✅ 已对接 并行调用多个接口聚合数据
EU消耗趋势 展示过去24小时的EU消耗曲线 GET /api/v1/monitoring/dashboard (monitoring.euConsumption24h) ✅ 已对接
每日调用统计 展示每周/每日的API调用柱状图 GET /api/v1/monitoring/dashboard (monitoring.weeklyApiCalls) ✅ 已对接
模型分布 展示不同模型调用比例的饼图 GET /api/v1/monitoring/dashboard (monitoring.modelUsage) ✅ 已对接
系统组件状态 展示各服务组件的健康状态与延迟 GET /api/v1/monitoring/dashboard (monitoring.health) ✅ 已对接

2. 代理工厂 (Agent Factory)

路径: /agent-factory

业务功能 功能描述 对应接口/方法 状态 备注/数据需求
可用Agent库 展示渠道分配给租户的平台Agent模板及配额状态 GET /api/user/platform-agents/available ✅ 已对接 getUserAvailablePlatformAgents()
已部署实例 展示当前租户已部署的Agent实例数量及列表 GET /api/user/platform-agents/instances ✅ 已对接 getUserPlatformAgentInstances()
资源使用概览 展示租户的CPU/内存总配额与使用量 GET /api/user/custom-agent-quota ✅ 已对接 getUserCustomAgentQuota()
部署Agent 部署新的Agent实例,选择网关、副本数、模型 POST /api/user/agents/deploy ✅ 已对接 deployUserAgent()
参数: agentId, instances, model, gateway

3. 服务网关 (Service Gateway)

路径: /model-gateway

业务功能 功能描述 对应接口/方法 状态 备注/数据需求
网关统计 可用网关数、服务端点数、平均延迟、今日调用 Aggr:
1. GET /api/user/gateway/apis
2. GET /api/user/gateway/monitoring
3. GET /api/user/dashboard/stats
✅ 已对接 聚合数据
创建API 注册新的网关API路由(JSON/URL) POST /api/user/gateway/api/create ✅ 已对接 createGatewayAPI()
API列表 展示已注册的网关API及其状态 GET /api/user/gateway/apis ✅ 已对接 getGatewayAPIs()
模型供应商 查看可用的模型供应商状态 GET /api/providers/models ✅ 已对接 getModelProviders()

4. 数据与工具 (Data & Tools)

路径: /data-tools

业务功能 功能描述 对应接口/方法 状态 备注/数据需求
工具统计 总工具数、生成的工具、活跃Pods GET /stats (Data Ingestion Svc) ✅ 已对接 直接调用 Data Ingestion Service
工具列表 展示可用API工具注册表 GET /tools (Data Ingestion Svc) ✅ 已对接 直接调用 Data Ingestion Service
创建数据模板 配置JSON API或云存储数据源 POST /api/user/data-templates/create ✅ 已对接 createDataTemplate()
生成工具 基于模板生成API工具 POST /api/user/tools/generate ✅ 已对接 generateTool()
(目前在前端代码中入口较隐蔽)

5. 编排中心 (Orchestration Hub)

路径: /orchestration

业务功能 功能描述 对应接口/方法 状态 备注/数据需求
工作流列表 展示已创建的工作流及其状态 GET /api/user/workflows/list ✅ 已对接 getWorkflows()
可用Agent选择 选择用于编排的Agent (平台+自定义) 1. GET /api/user/agents/platform
2. GET /api/user/custom-agents
✅ 已对接 注意:此处用的 /api/user/agents/platform 与 Agent Factory 的接口略有不同
创建工作流 创建新的Agent工作流 (最大3节点) POST /api/user/workflows/create ✅ 已对接 createWorkflow()
运行工作流 执行指定工作流 POST /api/user/workflows/{id}/run ✅ 已对接 runWorkflow()
删除工作流 删除工作流 DELETE /api/user/workflows/{id} ✅ 已对接 deleteWorkflow()
并发执行状态 展示是否支持并发 无 (前端静态) ❌ 未对接 当前显示为"不支持"

6. 计费与资源 (Billing & Resources)

路径: /billing

业务功能 功能描述 对应接口/方法 状态 备注/数据需求
账户余额 查看当前账户余额、月度消费、EU余额 GET /api/user/billing/balance ✅ 已对接 getBillingBalance()
消费历史 查看EU消费趋势图表 (7天) GET /api/user/billing/history ✅ 已对接 getBillingHistory()
费用明细 查看按类别(Agent类型)分类的费用统计 GET /api/user/billing/history ✅ 已对接 前端基于 History 数据聚合计算
充值 账户余额充值 POST /api/user/billing/recharge ✅ 已对接 rechargeBalance()
资源使用监控 查看详细资源使用率 (CPU/Mem/Storage/API) 无 ❌ 未对接 需求数据: resourceUsage 对象。
- cpu: {used, total}
- memory: {used, total}
- storage: {used, total}
- apiCalls: {used, total}
预测费用 预计月底费用、平均每日费用 无 ❌ 未对接 需求数据: projectedCost, avgDailyCost。当前为硬编码。
定价详情 展示各项服务的EU定价 无 (前端静态) ⚠️ 静态 如果定价策略会变动,建议增加定价查询接口

总结

租户端的前端功能覆盖率较高,核心的 Agent部署、API调用、工作流编排 和 基础计费 功能均已完整对接。

主要待完善点:

  1. 计费详情: 资源使用监控(CPU/内存/存储的具体数值)和费用预测目前是 Mock 数据。
  2. 数据工具: Data Tools 模块目前直接连接 Data Ingestion Service,需确认是否有租户隔离机制。
  3. 接口一致性: Orchestration 和 Agent Factory 获取平台 Agent 列表使用了两个不同的接口 (/api/user/agents/platform vs /api/user/platform-agents/available),建议统一。