docs: PR draft - update --unread + --until usage

pull/33/head
ChenyqThu 2026-05-10 20:49:19 -07:00 committed by jackwener
parent 48875ce875
commit c0a890d5f5
1 changed files with 11 additions and 0 deletions

View File

@ -35,6 +35,10 @@ wx biz-articles --account "Datawhale"
wx biz-articles --since 2026-05-10
wx biz-articles --since 2026-05-01 --until 2026-05-10
# Show only accounts with unread messages, one latest article per account
wx biz-articles --unread
wx biz-articles --unread --account "Datawhale" # combine: unread within specific account
# JSON output (for downstream piping)
wx biz-articles --json
wx biz-articles --since 2026-05-10 --json | jq '.[].url'
@ -66,6 +70,13 @@ Each article item includes:
- New `extract_cdata` helper function strips CDATA wrappers from XML content
- Results sorted by `pub_time` DESC (article publish time, not message receive time)
### `--unread` semantics
- Queries `session.db` for `unread_count > 0` rows whose `chat_type == official_account`, intersects with `--account` filter if both provided
- Returns at most **one latest article per account** (dedupe by `account_username` after the global pub_time DESC sort)
- Aligns with the behavior of `wx unread --filter official` for fast "what unread accounts are there + what's the latest title" scanning
- Empty intersection short-circuits before scanning biz tables
## Changes
- `src/ipc.rs`: Add `BizArticles` IPC request variant