feat(user): require email when admin creates a user

- Add `email` as a required field in `createUserRequest`
- Enforce email format verification and database uniqueness checks in the admin user creation handler
- Update the admin user creation frontend modal with validation and form field
- Update the corresponding backend unit tests and regenerate Swagger docs
This commit is contained in:
ryan
2026-06-13 16:23:07 +08:00
parent 5b13d5b464
commit 922f764241
8 changed files with 115 additions and 0 deletions
+2
View File
@@ -16,4 +16,6 @@ const (
usernameRequired = "用户名不能为空"
passwordTooShort = "密码长度不能少于 8 位" //nolint:gosec // false positive: this is an error message, not hardcoded credentials
createUserFailed = "创建用户失败"
emailRequired = "邮箱不能为空"
emailExists = "邮箱已被注册"
)