47 lines
2.1 KiB
Go
47 lines
2.1 KiB
Go
package param
|
|
|
|
import "wireguard-dashboard/constant"
|
|
|
|
// Login
|
|
// @description: 登陆
|
|
type Login struct {
|
|
Account string `json:"account" form:"account" binding:"required"` // 账号
|
|
Password string `json:"password" form:"password" binding:"required"` // 密码
|
|
CaptchaId string `json:"captchaId" form:"captchaId" binding:"required"` // 验证码id
|
|
CaptchaAnswer string `json:"captchaAnswer" form:"captchaAnswer" binding:"required"` // 验证码
|
|
}
|
|
|
|
// SaveUser
|
|
// @description: 新增/编辑用户信息
|
|
type SaveUser struct {
|
|
ID string `json:"id" form:"id" binding:"omitempty"`
|
|
Name string `json:"name" form:"name" binding:"required"` // 用户名
|
|
Account string `json:"account" form:"account" binding:"required"` // 账号 唯一
|
|
Avatar string `json:"avatar" form:"avatar" binding:"omitempty"` // 头像
|
|
Email string `json:"email" form:"email" binding:"omitempty"` // 联系邮箱
|
|
Password string `json:"password" form:"password" binding:"omitempty"` // 密码
|
|
IsAdmin *constant.UserType `json:"isAdmin" form:"isAdmin" binding:"omitempty"` // 是否为管理员 0 - 否 | 1 - 是
|
|
Status *constant.UserStatus `json:"status" form:"status" binding:"required"` // 用户状态 0 - 禁用 | 1 - 正常
|
|
}
|
|
|
|
// ChangePassword
|
|
// @description: 更改密码
|
|
type ChangePassword struct {
|
|
OriginPassword string `json:"originPassword" form:"originPassword" binding:"required"` // 原密码
|
|
NewPassword string `json:"newPassword" form:"newPassword" binding:"required"` // 新密码
|
|
ConfirmPassword string `json:"confirmPassword" form:"confirmPassword" binding:"required,eqfield=NewPassword"` // 确认密码
|
|
}
|
|
|
|
// UserList
|
|
// @description: 用户列表
|
|
type UserList struct {
|
|
page
|
|
}
|
|
|
|
// ChangeUserState
|
|
// @description: 变更状态
|
|
type ChangeUserState struct {
|
|
ID string `json:"id" form:"id" binding:"required"` // 用户id
|
|
Status string `json:"status" form:"status" binding:"required,oneof=0 1"` // 用户状态
|
|
}
|