passport

package
v0.0.0-...-900783e Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorMessage

type ErrorMessage struct {
	Message string `json:"message"`
}

ErrorMessage 定义错误信息的结构

type LoginRequest

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

LoginRequest 定义登录请求的结构

type RegisterRequest

type RegisterRequest struct {
	Username        string `json:"username"`
	Email           string `json:"email"`
	Password        string `json:"password"`
	ConfirmPassword string `json:"confirmPassword"`
}

RegisterRequest 定义注册请求的结构

type Service

type Service struct {
	Repo *model.Repo
	JWT  *auth.JWTService
}

func Init

func Init(db *gorm.DB, jwtService *auth.JWTService) (*Service, error)

func (*Service) ApplyMux

func (svr *Service) ApplyMux(group gin.IRouter)

func (*Service) HandleLogin

func (svr *Service) HandleLogin(c *gin.Context)

HandleLogin 处理登录请求

func (*Service) HandleRegister

func (svr *Service) HandleRegister(c *gin.Context)

HandleRegister 处理注册请求

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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