31 lines
918 B
Go
31 lines
918 B
Go
package request
|
|
|
|
import (
|
|
"server/internal/pkg/validator"
|
|
)
|
|
|
|
type CreateSysUserRequest struct {
|
|
Username string `json:"username" validate:"required"`
|
|
Account string `json:"account" validate:"required,min=5,max=100"`
|
|
Password string `json:"password" validate:"required,min=6,max=255"`
|
|
AvatarID *int32 `json:"avatar_id" validate:"omitempty"`
|
|
}
|
|
|
|
type UpdateSysUserRequest struct {
|
|
Username *string `json:"username" validate:"omitempty,min=0,max=50"`
|
|
AvatarID validator.NullInt32 `json:"avatar_id" validate:"omitempty"`
|
|
}
|
|
|
|
type UpdateSysUserPassword struct {
|
|
Password string `json:"password" validate:"required,min=6,max=255"`
|
|
}
|
|
|
|
type SetSysUserRolesRequest struct {
|
|
RoleIDs []int32 `json:"role_ids" validate:"required,dive,gt=0"`
|
|
}
|
|
|
|
type LoginRequest struct {
|
|
Account string `json:"account" validate:"required,min=5,max=100"`
|
|
Password string `json:"password" validate:"required,min=6,max=255"`
|
|
}
|