mirror of
https://gitee.com/dromara/mayfly-go
synced 2025-11-04 00:10:25 +08:00
refactor: 后端validator校验错误转译
This commit is contained in:
@@ -2,14 +2,14 @@ package form
|
||||
|
||||
type AccountCreateForm struct {
|
||||
Id uint64 `json:"id"`
|
||||
Name string `json:"name" binding:"required"`
|
||||
Username string `json:"username" binding:"required,min=4,max=16"`
|
||||
Name string `json:"name" binding:"required,max=16"`
|
||||
Username string `json:"username" binding:"pattern=account_username"`
|
||||
Password string `json:"password"`
|
||||
}
|
||||
|
||||
type AccountUpdateForm struct {
|
||||
Name string `json:"name" binding:"max=16"` // 姓名
|
||||
Username string `json:"username" binding:"max=20"`
|
||||
Username string `json:"username" binding:"omitempty,pattern=account_username"`
|
||||
Password *string `json:"password"`
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user