web

package
v0.0.0-...-d13da26 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterRoutes

func RegisterRoutes() *gin.Engine

Types

type Result

type Result struct {
	// 这个叫做业务错误码
	Code int    `json:"code"`
	Msg  string `json:"msg"`
	Data any    `json:"data"`
}

type UserClaims

type UserClaims struct {
	jwt.RegisteredClaims
	// 声明你自己的要放进去 token 里面的数据
	Uid int64
	// 自己随便加
	UserAgent string
}

type UserHandler

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

UserHandler 我准备在它上面定义跟用户有关的路由

func NewUserHandler

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

func (*UserHandler) Edit

func (u *UserHandler) Edit(ctx *gin.Context)

func (*UserHandler) Login

func (u *UserHandler) Login(ctx *gin.Context)

func (*UserHandler) LoginJWT

func (u *UserHandler) LoginJWT(ctx *gin.Context)

func (*UserHandler) LoginSMS

func (u *UserHandler) LoginSMS(ctx *gin.Context)

func (*UserHandler) Logout

func (u *UserHandler) Logout(ctx *gin.Context)

func (*UserHandler) Profile

func (u *UserHandler) Profile(ctx *gin.Context)

func (*UserHandler) ProfileJWT

func (u *UserHandler) ProfileJWT(ctx *gin.Context)

func (*UserHandler) RegisterRoutes

func (u *UserHandler) RegisterRoutes(server *gin.Engine)

func (*UserHandler) RegisterRoutesV1

func (u *UserHandler) RegisterRoutesV1(ug *gin.RouterGroup)

func (*UserHandler) SendLoginSMSCode

func (u *UserHandler) SendLoginSMSCode(ctx *gin.Context)

func (*UserHandler) SignUp

func (u *UserHandler) 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