web

package
v0.0.0-...-c234f5e Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var JWTKey = []byte("x12vN8JOO1C74P4DE4seqqgEeGPmWvuJ")

JWTKey 因为 JWT Key 不太可能变,所以可以直接写成常量 也可以考虑做成依赖注入

Functions

This section is empty.

Types

type Result

type Result struct {
	Code int    `json:"code"`
	Msg  string `json:"msg"`
	Data any    `json:"data"`
}

type UserClaims

type UserClaims struct {
	Uid       int64
	UserAgent string
	jwt.RegisteredClaims
}

type UserHandler

type UserHandler interface {
	RegisterRoutes(srv *gin.Engine)
	LoginSMS(ctx *gin.Context)
	SendLoginSMSCode(ctx *gin.Context)
	SignUp(ctx *gin.Context)
	LoginJWT(ctx *gin.Context)

	Profile(ctx *gin.Context)
	Edit(ctx *gin.Context)
	Logout(ctx *gin.Context)
	// contains filtered or unexported methods
}

func NewUserHandler

func NewUserHandler(svc service.UserService, codeSvc service.CodeService) UserHandler

NewUserHandler New UserHandler

type UserHandlerV1

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

func (*UserHandlerV1) Edit

func (uh *UserHandlerV1) Edit(ctx *gin.Context)

func (*UserHandlerV1) LoginJWT

func (uh *UserHandlerV1) LoginJWT(ctx *gin.Context)

func (*UserHandlerV1) LoginSMS

func (uh *UserHandlerV1) LoginSMS(ctx *gin.Context)

func (*UserHandlerV1) Logout

func (uh *UserHandlerV1) Logout(ctx *gin.Context)

func (*UserHandlerV1) Profile

func (uh *UserHandlerV1) Profile(ctx *gin.Context)

func (*UserHandlerV1) RegisterRoutes

func (uh *UserHandlerV1) RegisterRoutes(srv *gin.Engine)

func (*UserHandlerV1) SendLoginSMSCode

func (uh *UserHandlerV1) SendLoginSMSCode(ctx *gin.Context)

func (*UserHandlerV1) SignUp

func (uh *UserHandlerV1) SignUp(ctx *gin.Context)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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