perf: paginate user addresses and optimize ownership queries (#1105)

* perf: paginate user addresses and optimize mail ownership queries

* docs: document user address pagination

* fix: address pagination review feedback

* fix: cover user address pagination flows

* test: fix user mailbox tab selector

* test: stabilize remote address search flow

* test: stabilize user address browser flow

* fix: preserve address pagination compatibility

* refactor: simplify bound address query types

* refactor: reuse list query for bound addresses

* fix: preserve paginated address totals

* fix: preserve bound address helper contracts

* fix: require pagination for user addresses

* refactor: keep shared pagination behavior unchanged

* fix: align pagination docs and tests

* fix: clear stale address selections

* refactor: simplify user address pagination

* refactor: limit user address changes to pagination

* test: select a visible mailbox address

* fix: preserve bound address response fields
This commit is contained in:
Dream Hunter
2026-08-09 19:23:41 +08:00
committed by GitHub
parent f9281818e9
commit a09ede8944
12 changed files with 450 additions and 37 deletions
@@ -160,6 +160,36 @@ print(response.json())
- 用户 JWT 使用 `x-user-token: <jwt>` 访问 `/user_api/*` 接口
:::
### 用户绑定地址列表
`GET /user_api/bind_address` 使用服务端分页,支持以下查询参数:
未携带分页参数时返回默认第一页,不支持一次获取全部绑定地址。
| 参数 | 默认值 | 说明 |
| --- | --- | --- |
| `limit` | `20` | 每页数量,范围为 1–100 |
| `offset` | `0` | 分页偏移量 |
响应中的 `results` 仅包含当前页。仅 `offset=0` 时查询总数,后续页面的 `count``0`,客户端应保留第一页返回的总数。
```python
import requests
url = "https://<你的worker地址>/user_api/bind_address"
headers = {
"x-user-token": "<你的用户JWT Token>",
}
querystring = {
"limit": "20",
"offset": "0",
}
response = requests.get(url, headers=headers, params=querystring)
print(response.json())
```
### 用户邮件列表
支持 `address` 过滤
```python