🎨用户接口处理完毕
This commit is contained in:
6
http/param/base.go
Normal file
6
http/param/base.go
Normal file
@@ -0,0 +1,6 @@
|
||||
package param
|
||||
|
||||
type page struct {
|
||||
Current int `json:"current" form:"current" binding:"required"`
|
||||
Size int `json:"size" form:"size" binding:"required"`
|
||||
}
|
@@ -1,8 +1,46 @@
|
||||
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"`
|
||||
CaptchaAnswer string `json:"captchaAnswer" form:"captchaAnswer" binding:"required"`
|
||||
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:"required"` // 是否为管理员 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"` // 用户状态
|
||||
}
|
||||
|
Reference in New Issue
Block a user