feat: 批量设置分组 + 可配置的默认注册分组 - #7
Merged
Merged
Conversation
…roup Bulk user actions only covered status/role/balance, so grouping users meant editing them one at a time. The default registration group was already supported by the API but had no console control, so admins could not tell new users would land in the auto-created 默认分组. - Add a set_group bulk action; an empty value clears the assignment, matching the single-user patch - Surface the default registration group in 设置 → 注册, alongside the existing default balance - Add a group picker plus action button to the user bulk bar Also includes the rebuilt bundle. Co-Authored-By: Claude Code <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
getAuthSettings返回defaultGroupId,updateAuthSettings接受它),但前端没有入口,管理员无法知道新用户会落进自动创建的「默认分组」改动
set_group:POST /api/users/bulk新增该 action;value为空表示移出分组(与单用户 PATCH 行为一致);分组不存在时在写入前拒绝验证
新增两个测试并通过:
TestBulkSetGroupAssignsAndClears—— 批量归组、未知分组被拒、空值清除且不影响未选中用户TestDefaultRegistrationGroupAppliesToNewUsers—— 默认分组持久化、未知分组被拒、新注册用户自动归入实测(本地起服务):
go test ./...全绿;npm run build通过。