/billing/usage/{tenant_id}/apps/{app_id}
按应用维度查询资源使用量统计(用户数、存储量、API调用次数)。默认查询近 30 天数据。
请求参数
| 名称 | 位置 | 类型 | 必填 | 默认值 | 示例 | 约束 | 描述 |
|---|---|---|---|---|---|---|---|
tenant_id |
path |
string |
是 | 租户ID | |||
app_id |
path |
string |
是 | 应用ID | |||
start_date |
query |
string |
否 | 30天前 |
开始日期 (YYYY-MM-DD) | ||
end_date |
query |
string |
否 | 今天 |
结束日期 (YYYY-MM-DD) |
响应
| 状态 | 描述 | Schema |
|---|---|---|
| 200 | 使用统计查询成功 | service-billing/internal/handler/dto.UsageStatsDetailResponse |
| 400 | 请求参数错误 | object |
| 401 | 未授权 | object |
| 500 | 服务器内部错误 | object |
引用的 Schema
service-billing/internal/handler/dto.UsageStatItem
| 字段 | 类型 | 必填 | 示例 | 约束 | 描述 |
|---|---|---|---|---|---|
limit |
integer |
否 | 100 |
||
unit |
string |
否 | 个 |
||
used |
integer |
否 | 8 |
service-billing/internal/handler/dto.UsageStatsDetailResponse
| 字段 | 类型 | 必填 | 示例 | 约束 | 描述 |
|---|---|---|---|---|---|
code |
integer |
否 | |||
data |
service-billing/internal/handler/dto.UsageStatsResponse |
否 | |||
message |
string |
否 | |||
timestamp |
string |
否 |
service-billing/internal/handler/dto.UsageStatsResponse
| 字段 | 类型 | 必填 | 示例 | 约束 | 描述 |
|---|---|---|---|---|---|
api_calls |
service-billing/internal/handler/dto.UsageStatItem |
否 | |||
app_id |
string |
否 | app_001 |
||
period_end |
string |
否 | 2026-04-01 |
||
period_start |
string |
否 | 2026-03-01 |
||
storage |
service-billing/internal/handler/dto.UsageStatItem |
否 | |||
tenant_id |
string |
否 | tnt_xyz789 |
||
users |
service-billing/internal/handler/dto.UsageStatItem |
否 |