user

package
v0.0.0-...-8336b8e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 25, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChangeRequest

type ChangeRequest struct {
	OldPassword string `json:"old_password" binding:"required"`
	NewPassword string `json:"new_password" binding:"required"`
	RepPassword string `json:"rep_password" binding:"required,eqfield=NewPassword"`
}

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

func (*Handler) ChangePassword

func (h *Handler) ChangePassword(ctx *gin.Context)

func (*Handler) GetUser

func (h *Handler) GetUser(ctx *gin.Context)

func (*Handler) Login

func (h *Handler) Login(ctx *gin.Context)

func (*Handler) Register

func (h *Handler) Register(ctx *gin.Context)

type HandlerService

type HandlerService interface {
	Login(ctx *gin.Context)          // use RetrieveInstance to get user
	Register(ctx *gin.Context)       // use CreateInstance to create user
	GetUser(ctx *gin.Context)        // use RetrieveInstance to get user
	ChangePassword(ctx *gin.Context) // use UpdateInstanceOfPassword to update user
}

func NewHandlerService

func NewHandlerService(db *gorm.DB, rd *redis.Client) HandlerService

type LoginRequest

type LoginRequest struct {
	Username string `json:"username" binding:"required"`
	Password string `json:"password" binding:"required"`
}

type RegisterRequest

type RegisterRequest struct {
	Username string `json:"username" binding:"required"`
	Password string `json:"password" binding:"required"`
	Email    string `json:"email" binding:"required,email"`
	Code     string `json:"code" binding:"required"`
	Avatar   string `json:"avatar" binding:"required"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL