feat(shortcut): 新增 notification 命令组(通知 list/read/read-all/watch) #391

Closed
wyxttn wants to merge 0 commits from jiangtx/gitlink-cli:pr-shortcut-notification into master
Contributor

背景

GitLink 通知此前只能在 Web 端手工处理,无法脚本化。本 PR 新增 notification 命令组,补齐命令行入口,便于 CI/Agent 做通知聚合、批量已读、仓库关注等自动化。

改动内容

新增 shortcuts/notification/ 命令组(4 条子命令):

  • notification +list — 列出通知(--all 含已读、--participating 仅参与的,支持分页)
  • notification +read — 标记单条通知为已读(-i/--id
  • notification +read-all — 标记所有通知为已读
  • notification +watch — 关注/取消关注仓库通知(-o/--owner-r/--repo--unwatch 取消)

对应 OpenAPI

  • GET /notifications(带 page/limit/all/participating)
  • PUT /notifications/{id} / PUT /notifications
  • POST /watchers/{owner}/{repo}.json--unwatch 时 DELETE)

测试

shortcuts/notification/notification_test.go(7 个测试):覆盖 list 基础/过滤、read、read-all、watch、unwatch、缺 id 报错等。

文档

  • 帮助文档:doc/commands/notification.md
  • 变更说明:doc/changes/notification-shortcut.md
  • 注册:shortcuts/register.go 仅新增 3 行
## 背景 GitLink 通知此前只能在 Web 端手工处理,无法脚本化。本 PR 新增 `notification` 命令组,补齐命令行入口,便于 CI/Agent 做通知聚合、批量已读、仓库关注等自动化。 ## 改动内容 新增 `shortcuts/notification/` 命令组(4 条子命令): - `notification +list` — 列出通知(`--all` 含已读、`--participating` 仅参与的,支持分页) - `notification +read` — 标记单条通知为已读(`-i/--id`) - `notification +read-all` — 标记所有通知为已读 - `notification +watch` — 关注/取消关注仓库通知(`-o/--owner`、`-r/--repo`,`--unwatch` 取消) ## 对应 OpenAPI - GET `/notifications`(带 page/limit/all/participating) - PUT `/notifications/{id}` / PUT `/notifications` - POST `/watchers/{owner}/{repo}.json`(`--unwatch` 时 DELETE) ## 测试 `shortcuts/notification/notification_test.go`(7 个测试):覆盖 list 基础/过滤、read、read-all、watch、unwatch、缺 id 报错等。 ## 文档 - 帮助文档:`doc/commands/notification.md` - 变更说明:`doc/changes/notification-shortcut.md` - 注册:`shortcuts/register.go` 仅新增 3 行
wyxttn added 1 commit 2026-07-09 21:50:05 +08:00
1527f45dc1 feat(shortcut): add notification command group (list/read/read-all/watch)
新增 notification 命令组,封装 GitLink 通知 OpenAPI:

- notification +list     列出通知(--all/--participating/分页)
- notification +read     标记单条已读 (-i/--id)
- notification +read-all 全部标记已读
- notification +watch    关注/取消关注仓库通知 (-o/-r, --unwatch)

含单元测试(7 测试,覆盖 method/path/query)、帮助文档、变更说明。
来源:GitLink 大赛 2026 子赛题一。
wbtiger closed this pull request 2026-07-14 22:56:05 +08:00
wbtiger reopened this pull request 2026-07-14 23:01:49 +08:00
wbtiger closed this pull request 2026-07-14 23:04:30 +08:00

Pull request closed

Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Gitlink/gitlink-cli#391
No description provided.