auth

package
v0.0.0-...-31439ab Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2024 License: GPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckCode

func CheckCode(svc *svc.Svc) gin.HandlerFunc

func Current

func Current(svc *svc.Svc) gin.HandlerFunc

func PasswordCheck

func PasswordCheck(svc *svc.Svc) gin.HandlerFunc

func Register

func Register(svc *svc.Svc) gin.HandlerFunc

func ResetPassword

func ResetPassword(svc *svc.Svc) gin.HandlerFunc

func RetrievePassword

func RetrievePassword(svc *svc.Svc) gin.HandlerFunc

func RetrievePasswordSendCode

func RetrievePasswordSendCode(svc *svc.Svc) gin.HandlerFunc

func SendRegisterEmailCode

func SendRegisterEmailCode(svc *svc.Svc, typ string) gin.HandlerFunc

func UpdateAvatar

func UpdateAvatar(svc *svc.Svc) gin.HandlerFunc

Types

type CheckCodeReq

type CheckCodeReq struct {
	UserID    string `json:"userID" binding:"required"`
	Key       string `json:"key" binding:"required"`
	Type      string `json:"type" binding:"required"`
	Email     string `json:"email" binding:"required,email"`
	EmailCode string `json:"emailCode" binding:"required"`
}

type PasswordCheckRequest

type PasswordCheckRequest struct {
	Password  string `json:"password"`  // 密码(加密前)
	TimeStamp int64  `json:"timestamp"` // 创建时间戳
}

type RegisterReq

type RegisterReq struct {
	// 用户数据
	LoginID    string `json:"loginID"`
	UserName   string `json:"userName"`
	ActualName string `json:"actualName"`
	EnName     string `json:"enName"`
	Password   string `json:"password"`
	TimeStamp  int64  `json:"timestamp"`
	QQ         string `json:"QQ"`

	// 验证
	Email     string `json:"email"`
	EmailCode string `json:"emailCode"`

	// 旧数据
	CubeID       string `json:"cubeID"`       // v2 留下的 CubeID
	InitPassword string `json:"initPassword"` // 初始化密码 todo bind
}

type ResetPasswordReq

type ResetPasswordReq struct {
	Password  string `json:"password" binding:"required"`
	TimeStamp int64  `json:"timestamp" binding:"required"`
}

type RetrievePasswordReq

type RetrievePasswordReq struct {
	CheckCodeReq

	Password  string `json:"password"`  // 密码(加密前)
	TimeStamp int64  `json:"timestamp"` // 创建时间戳
}

type RetrievePasswordResp

type RetrievePasswordResp struct {
	Key      string    `json:"key"`      // 授权key
	Type     string    `json:"type"`     // 处理类型
	Email    string    `json:"email"`    // 掩码处理
	Phone    string    `json:"phone"`    // 掩码处理
	Timeout  time.Time `json:"timeout"`  // 超时时间
	LastSend time.Time `json:"lastSend"` // 下次发送时间
	Msg      string    `json:"msg"`
}

type RetrievePasswordSendCodeReq

type RetrievePasswordSendCodeReq struct {
	LoginID string `json:"loginID"`
	Type    string `json:"type"` // email | phone(短信验证)
}

type SendRegisterEmailCodeReq

type SendRegisterEmailCodeReq struct {
	Email string `json:"email"`
	Name  string `json:"name"`
}

type SendRegisterEmailCodeResp

type SendRegisterEmailCodeResp struct {
	Email        string    `json:"email"`
	Timeout      time.Time `json:"timeout"`
	LastSendTime time.Time `json:"lastSendTime"`
}

type UpdateAvatarReq

type UpdateAvatarReq struct {
	URL       string `json:"URL"`
	ImageName string `json:"ImageName"` // baseFileName
	Data      string `json:"Data"`      // base64
}

Jump to

Keyboard shortcuts

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