Bills 账单管理 模块 API 文档
基础信息
- Base URL:
/api/admin - 认证方式: JWT Bearer Token
数据库表
bills— 账单表bill_members— 账单成员表users— 用户表
接口列表
1. 获取账单列表
GET /api/admin/bills
Query 参数:
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| start_date | string | 选填 | 创建时间起始 |
| end_date | string | 选填 | 创建时间截止 |
| owner_id | string | 选填 | 账单所有者ID |
| shared_with | string | 选填 | 共享成员ID |
响应:
[{
"id": "string",
"name": "string",
"owner_id": "string",
"owner_nickname": "string",
"member_count": 3,
"tx_count": 45,
"created_at": "ISO8601"
}]
2. 获取账单详情
GET /api/admin/bills/:billId
说明: 获取账单详细信息及成员列表(含各成员的自定义 Prompt)
响应:
{
"id": "string",
"name": "string",
"owner_id": "string",
"owner_nickname": "string",
"created_at": "ISO8601",
"members": [{
"id": "string",
"user_id": "string",
"role": "owner|edit|read",
"nickname": "string",
"custom_prompt": "string|null"
}]
}
3. 更新账单成员自定义 Prompt
PUT /api/admin/bills/:billId/members/:memberId/prompt
说明: 管理后台为指定账单成员设置自定义 AI Prompt(用于 AI 对话时的上下文注入)
路径参数:
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| billId | string | 必填 | 账单 ID |
| memberId | string | 必填 | 账单成员 ID(bill_members 表主键,非 user_id) |
请求体:
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| custom_prompt | string | 选填 | 自定义 Prompt 文本,设为 null 或空字符串则清除自定义 Prompt(使用系统默认) |
响应:
{ "success": true }
备注: 每个用户在每个账单可设置独立的 custom_prompt,互不影响