Skip to content

feat(admin): Add group filtering for account listings#561

Merged
Wei-Shaw merged 1 commit intoWei-Shaw:mainfrom
james-6-23:main
Feb 13, 2026
Merged

feat(admin): Add group filtering for account listings#561
Wei-Shaw merged 1 commit intoWei-Shaw:mainfrom
james-6-23:main

Conversation

@james-6-23
Copy link
Contributor

概述

本 PR 为管理后台账户列表新增「按分组筛选」功能,管理员可通过下拉选择指定分组,快速定位该分组下的所有账户。

变更内容

账户管理 - 分组筛选

  • 后端ListAccounts / ListWithFilters 方法新增 groupID 参数,查询时通过 HasGroupWith(accountgroup.ID(groupID)) 过滤指定分组的账户
  • Handler:解析 URL query 中的 group 参数并传递至 repository 层
  • 前端AccountTableFilters 组件新增分组下拉筛选器,选择分组后自动刷新列表
  • i18n:中英文新增分组筛选标签翻译(admin.accounts.groupFilter
  • 测试:更新 ListAccounts / ListWithFilters 的 stub 签名,补充 groupID 参数

涉及文件

文件 变更说明
backend/internal/repository/account_repo.go ListAccounts / ListWithFilters 增加 groupID 过滤条件
backend/internal/handler/admin/account_handler.go 解析 group query 参数并传入 repository
backend/internal/handler/admin/admin_service_stub_test.go 更新测试 stub 方法签名
frontend/src/components/admin/account/AccountTableFilters.vue 新增分组下拉筛选 UI
frontend/src/api/admin/accounts.ts 请求参数增加 groupID 字段
frontend/src/i18n/locales/zh.ts 新增分组筛选中文翻译
frontend/src/i18n/locales/en.ts 新增分组筛选英文翻译

测试计划

  • go build ./... 编译通过
  • gofmt / go vet 检查无报错
  • 账户列表选择分组后仅返回该分组下的账户
  • 不选分组时返回全部账户(行为不变)
  • 前端分组下拉正确加载可用分组列表
  • 切换分组筛选与状态筛选、搜索框可组合使用

- Add groupID parameter to ListAccounts and ListWithFilters methods
- Implement account filtering by group ID in repository query
- Add group query parameter parsing in account handler
- Update all ListAccounts/ListWithFilters call sites with groupID parameter
- Add group filter UI component to AccountTableFilters
- Add i18n translations for group filter label in English and Chinese
- Update API contract and test stubs to reflect new signature
- Enable filtering accounts by their assigned groups in admin panel
@Wei-Shaw Wei-Shaw merged commit b4c22ce into Wei-Shaw:main Feb 13, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants