auth

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: May 13, 2020 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

Copyright 2019-2020 Axetroy. All rights reserved. MIT license.

Copyright 2019-2020 Axetroy. All rights reserved. MIT license.

Copyright 2019-2020 Axetroy. All rights reserved. MIT license.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindingEmail

func BindingEmail(c helper.Context, input BindingEmailParams) (res schema.Response)

绑定邮箱

func BindingEmailRouter

func BindingEmailRouter(c *gin.Context)

func BindingPhone

func BindingPhone(c helper.Context, input BindingPhoneParams) (res schema.Response)

绑定手机号

func BindingPhoneRouter

func BindingPhoneRouter(c *gin.Context)

func BindingWechat

func BindingWechat(c helper.Context, input BindingWechatMiniAppParams) (res schema.Response)

绑定微信

func BindingWechatRouter

func BindingWechatRouter(c *gin.Context)

func CreateUserTx

func CreateUserTx(tx *gorm.DB, userInfo *model.User, inviterCode *string) (err error)

创建用户帐号,包括创建的邀请码,钱包数据等,继承到一起

func GenerateAuthCode

func GenerateAuthCode() string

func ResetPassword

func ResetPassword(input ResetPasswordParams) (res schema.Response)

func ResetPasswordRouter

func ResetPasswordRouter(c *gin.Context)

func SendEmailAuthCode

func SendEmailAuthCode(c helper.Context, input SendEmailAuthCodeParams) (res schema.Response)

发送邮箱验证码 (不需要登陆)

func SendEmailAuthCodeRouter

func SendEmailAuthCodeRouter(c *gin.Context)

func SendPhoneAuthCode

func SendPhoneAuthCode(c helper.Context, input SendPhoneAuthCodeParams) (res schema.Response)

发送手机验证码 (不需要登陆)

func SendPhoneAuthCodeRouter

func SendPhoneAuthCodeRouter(c *gin.Context)

func SignIn

func SignIn(c helper.Context, input SignInParams) (res schema.Response)

普通帐号登陆

func SignInRouter

func SignInRouter(c *gin.Context)

func SignInWithEmail

func SignInWithEmail(c helper.Context, input SignInWithEmailParams) (res schema.Response)

邮箱 + 验证码登陆

func SignInWithEmailRouter

func SignInWithEmailRouter(c *gin.Context)

func SignInWithOAuth

func SignInWithOAuth(c helper.Context, input SignInWithOAuthParams) (res schema.Response)

使用 oAuth 认证方式登陆

func SignInWithOAuthRouter

func SignInWithOAuthRouter(c *gin.Context)

func SignInWithPhone

func SignInWithPhone(c helper.Context, input SignInWithPhoneParams) (res schema.Response)

手机 + 验证码登陆

func SignInWithPhoneRouter

func SignInWithPhoneRouter(c *gin.Context)

func SignInWithWechat

func SignInWithWechat(c helper.Context, input SignInWithWechatParams) (res schema.Response)

使用微信小程序登陆

func SignInWithWechatRouter

func SignInWithWechatRouter(c *gin.Context)

func SignUpWithEmail

func SignUpWithEmail(input SignUpWithEmailParams) (res schema.Response)

使用邮箱注册

func SignUpWithEmailAction

func SignUpWithEmailAction(input SignUpWithEmailActionParams) (res schema.Response)

使用邮箱登陆 (发送邮件)

func SignUpWithEmailActionRouter

func SignUpWithEmailActionRouter(c *gin.Context)

func SignUpWithEmailRouter

func SignUpWithEmailRouter(c *gin.Context)

func SignUpWithPhone

func SignUpWithPhone(input SignUpWithPhoneParams) (res schema.Response)

使用手机注册

func SignUpWithPhoneRouter

func SignUpWithPhoneRouter(c *gin.Context)

func SignUpWithUsername

func SignUpWithUsername(input SignUpWithUsernameParams) (res schema.Response)

使用用户名注册

func SignUpWithUsernameRouter

func SignUpWithUsernameRouter(c *gin.Context)

func UnbindingEmail

func UnbindingEmail(c helper.Context, input UnbindingEmailParams) (res schema.Response)

解除邮箱绑定

func UnbindingEmailRouter

func UnbindingEmailRouter(c *gin.Context)

func UnbindingPhone

func UnbindingPhone(c helper.Context, input UnbindingPhoneParams) (res schema.Response)

解除手机绑定

func UnbindingPhoneRouter

func UnbindingPhoneRouter(c *gin.Context)

func UnbindingWechat

func UnbindingWechat(c helper.Context, input UnbindingWechatParams) (res schema.Response)

解除微信绑定

func UnbindingWechatRouter

func UnbindingWechatRouter(c *gin.Context)

Types

type BindingEmailParams

type BindingEmailParams struct {
	Email string `json:"email" valid:"required~请输入邮箱"` // 邮箱
	Code  string `json:"code" valid:"required~请输入验证码"` // 邮箱收到的验证码
}

type BindingPhoneParams

type BindingPhoneParams struct {
	Phone string `json:"phone" valid:"required~请输入手机号"` // 手机号
	Code  string `json:"code" valid:"required~请输入验证码"`  // 手机收到的验证码
}

type BindingWechatMiniAppParams

type BindingWechatMiniAppParams struct {
	Code string `json:"code" valid:"required~请输入微信认证码"` // 微信小程序调用 wx.login() 之后,返回的 code
}

type ResetPasswordParams

type ResetPasswordParams struct {
	Code        string `json:"code" valid:"required~请输入激活码"`
	NewPassword string `json:"new_password" valid:"required~请输入新密码"`
}

type SendEmailAuthCodeParams

type SendEmailAuthCodeParams struct {
	Email string `json:"email" valid:"required~请输入邮箱"`
}

type SendPhoneAuthCodeParams

type SendPhoneAuthCodeParams struct {
	Phone string `json:"phone" valid:"required~请输入手机号"`
}

type SignInParams

type SignInParams struct {
	Account  string `json:"account" valid:"required~请输入登陆账号"`
	Password string `json:"password" valid:"required~请输入密码"`
}

type SignInWithEmailParams

type SignInWithEmailParams struct {
	Email string `json:"email" valid:"required~请输入邮箱"`
	Code  string `json:"code" valid:"required~请输入验证码"`
}

type SignInWithOAuthParams

type SignInWithOAuthParams struct {
	Code string `json:"code" valid:"required~请输入授权代码"` // oAuth 授权之后回调返回的 code
}

type SignInWithPhoneParams

type SignInWithPhoneParams struct {
	Phone string `json:"phone" valid:"required~请输入手机号"`
	Code  string `json:"code" valid:"required~请输入验证码"`
}

type SignInWithWechatParams

type SignInWithWechatParams struct {
	Code string `json:"code" valid:"required~请输入微信授权代码"` // 微信小程序授权之后返回的 code
}

type SignUpWithEmailActionParams

type SignUpWithEmailActionParams struct {
	Email string `json:"email" valid:"required~请输入邮箱"` // 邮箱
}

type SignUpWithEmailParams

type SignUpWithEmailParams struct {
	Email      string  `json:"email" valid:"required~请输入邮箱"`    // 邮箱
	Password   string  `json:"password" valid:"required~请输入密码"` // 密码
	Code       string  `json:"code" valid:"required~请输入邮箱验证码"`  // 邮箱验证码
	InviteCode *string `json:"invite_code"`                     // 邀请码
}

type SignUpWithPhoneParams

type SignUpWithPhoneParams struct {
	Phone      string  `json:"phone" valid:"required~请输入手机号"`  // 手机号
	Code       string  `json:"code" valid:"required~请输入手机验证码"` // 短信验证码
	InviteCode *string `json:"invite_code"`                    // 邀请码
}

type SignUpWithUsernameParams

type SignUpWithUsernameParams struct {
	Username   string  `json:"username" valid:"required~请输入用户名"` // 用户名
	Password   string  `json:"password" valid:"required~请输入密码"`  // 密码
	InviteCode *string `json:"invite_code"`                      // 邀请码
}

type UnbindingEmailParams

type UnbindingEmailParams struct {
	Code string `json:"code" valid:"required~请输入验证码"` // 解除邮箱绑定前,需要发送邮箱验证码验证
}

type UnbindingPhoneParams

type UnbindingPhoneParams struct {
	Code string `json:"code" valid:"required~请输入验证码"` // 解除手机号绑定前,需要发送手机验证码验证
}

type UnbindingWechatParams

type UnbindingWechatParams struct {
	Code string `json:"code" valid:"required~请输入验证码"` // 验证码,如果帐号已绑定手机,则为手机号收到的验证码,如果有为邮箱,则用邮箱收到的验证码,否则使用 `wx.login()` 返回的 code
}

type WechatCompleteParams

type WechatCompleteParams struct {
	Code     string  `json:"code" valid:"required~请输入微信授权代码"` // 微信小程序授权之后返回的 code
	Phone    *string `json:"phone"`                           // 手机号
	Username *string `json:"username"`                        // 用户名
}

Jump to

Keyboard shortcuts

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