auth

package
v0.0.0-...-ff8c6a7 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RefreshTokenExpired = 24 * time.Hour * 7
	AccessTokenExpired  = 2 * time.Hour
)

Variables

This section is empty.

Functions

func New

func New() routes.Routes

Types

type Auth

type Auth struct {
}

func (*Auth) GetAllArticles

func (a *Auth) GetAllArticles(c *gin.Context)

GetAllArticles 获取所有文章 godoc @Summary 获取所有文章 @Schemes @Description 获取所有文章 @Tags auth @Accept json @Produce json @Success 200 {object} model.CommonResponse[model.GetUserResponse] @Failure 400 {object} model.CommonResponse[any] @Router /getallArticles [get]

func (*Auth) GetAllMenus

func (a *Auth) GetAllMenus(c *gin.Context)

GetAllMenus 获取所有菜单 godoc @Summary 获取所有菜单 @Schemes @Description 获取所有菜单 @Tags auth @Accept json @Produce json @Success 200 {object} model.CommonResponse[[]model.MenuItem] @Failure 400 {object} model.CommonResponse[any] @Router /getAllMenus [get]

func (*Auth) InitGlobalRoute

func (a *Auth) InitGlobalRoute(g *gin.RouterGroup)

InitGlobalRoute 全局api,什么角色都可以调用

func (*Auth) InitRoute

func (a *Auth) InitRoute(g *gin.RouterGroup)

func (*Auth) IsValidSession

func (a *Auth) IsValidSession(c *gin.Context)

IsValidSession 是否登录 godoc @Summary 是否登录 @Schemes @Description 是否登录 @Tags auth @Accept json @Produce json @Param Authorization header string true "登录返回的Token" @Success 200 {object} model.CommonResponse[model.GetUserResponse] @Failure 400 {object} model.CommonResponse[any] @Router /isvalid [get]

func (*Auth) LoginWithEmail

func (a *Auth) LoginWithEmail(c *gin.Context)

LoginWithEmail 邮箱登录 godoc @Summary 邮箱登录 @Schemes @Description 邮箱登录 @Tags auth @Accept json @Produce json @Param LoginWithEmailRequest body model.LoginWithEmailRequest true "邮箱, 密码, 验证码" @Success 200 {object} model.CommonResponse[model.TokenResponse] @Failure 400 {object} model.CommonResponse[any] @Router /loginWithEmail [post]

func (*Auth) ResetPassword

func (a *Auth) ResetPassword(c *gin.Context)

ResetPassword /* 重置密码 */

func (*Auth) UserLogin

func (a *Auth) UserLogin(c *gin.Context)

UserLogin 用户名密码登录 godoc @Summary 用户名密码登录 @Schemes @Description 用户名密码登录 @Tags auth @Accept json @Produce json @Param userInfo body model.UserLoginRequest true "用户名, 密码" @Success 200 {object} model.CommonResponse[model.TokenResponse] @Failure 400 {object} model.CommonResponse[any] @Router /login [post]

func (*Auth) UserLoginRefresh

func (a *Auth) UserLoginRefresh(c *gin.Context)

UserLoginRefresh 刷新登录令牌 godoc @Summary 刷新登录令牌 @Schemes @Description 刷新登录令牌 @Tags auth @Accept json @Produce json @Param Authorization header string true "用户Refresh Token" @Success 200 {object} model.CommonResponse[model.TokenResponse] @Failure 400 {object} model.CommonResponse[any] @Router /refresh [post]

func (*Auth) UserRegister

func (a *Auth) UserRegister(c *gin.Context)

UserRegister 注册普通用户 godoc @Summary 注册普通用户 @Schemes @Description 注册普通用户 @Tags auth @Accept json @Produce json @Param registerInfo body model.RegisterUserRequest true "用户注册信息" @Success 200 {object} model.CommonResponse[string] @Failure 400 {object} model.CommonResponse[any] @Router /register [post]

Jump to

Keyboard shortcuts

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