25 lines
1.6 KiB
Go
25 lines
1.6 KiB
Go
|
package param
|
||
|
|
||
|
import "wireguard-ui/global/constant"
|
||
|
|
||
|
// SaveUser
|
||
|
// @description: 新增/编辑用户信息
|
||
|
type SaveUser struct {
|
||
|
Id string `json:"id" form:"id" label:"id" binding:"omitempty"` // id
|
||
|
Account string `json:"account" form:"account" label:"账户号" binding:"required_without=Id"` // 账户号
|
||
|
Password string `json:"password" form:"password" label:"密码" binding:"required_without=Id"` // 密码
|
||
|
Nickname string `json:"nickname" form:"nickname" label:"昵称" binding:"required,min=2"` // 昵称
|
||
|
Avatar string `json:"avatar" form:"avatar" label:"头像" binding:"omitempty"` // 头像
|
||
|
Contact string `json:"contact" form:"contact" label:"联系方式" binding:"omitempty"` // 联系方式
|
||
|
IsAdmin *constant.UserType `json:"isAdmin" form:"isAdmin" label:"是否为管理员" binding:"required,oneof=0 1"` // 是否为管理员 0 - 否 | 1 - 是
|
||
|
Status *constant.Status `json:"status" form:"status" label:"状态" binding:"required,oneof=0 1"` // 用户状态 0 - 禁用 | 1 - 启用
|
||
|
}
|
||
|
|
||
|
// ChangePassword
|
||
|
// @description: 修改密码
|
||
|
type ChangePassword struct {
|
||
|
OriginalPassword string `json:"originalPassword" form:"originalPassword" label:"原密码" binding:"required,min=8,max=32"` // 原密码
|
||
|
NewPassword string `json:"newPassword" form:"newPassword" label:"新密码" binding:"required,min=8,max=32"` // 新密码
|
||
|
ConfirmPassword string `json:"confirmPassword" form:"confirmPassword" label:"确认密码" binding:"eqfield=NewPassword"` // 确认密码
|
||
|
}
|