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 ¶
- Variables
- func BindingEmail(c helper.Context, input BindingEmailParams) (res schema.Response)
- func BindingPhone(c helper.Context, input BindingPhoneParams) (res schema.Response)
- func BindingWechat(c helper.Context, input BindingWechatMiniAppParams) (res schema.Response)
- func CreateUserTx(tx *gorm.DB, userInfo *model.User, inviterCode *string) (err error)
- func GenerateAuthCode() string
- func ResetPassword(input ResetPasswordParams) (res schema.Response)
- func SendEmailAuthCode(c helper.Context, input SendEmailAuthCodeParams) (res schema.Response)
- func SendPhoneAuthCode(c helper.Context, input SendPhoneAuthCodeParams) (res schema.Response)
- func SignIn(c helper.Context, input SignInParams) (res schema.Response)
- func SignInWithEmail(c helper.Context, input SignInWithEmailParams) (res schema.Response)
- func SignInWithOAuth(c helper.Context, input SignInWithOAuthParams) (res schema.Response)
- func SignInWithPhone(c helper.Context, input SignInWithPhoneParams) (res schema.Response)
- func SignInWithWechat(c helper.Context, input SignInWithWechatParams) (res schema.Response)
- func SignUpWithEmail(input SignUpWithEmailParams) (res schema.Response)
- func SignUpWithEmailAction(input SignUpWithEmailActionParams) (res schema.Response)
- func SignUpWithPhone(input SignUpWithPhoneParams) (res schema.Response)
- func SignUpWithUsername(input SignUpWithUsernameParams) (res schema.Response)
- func UnbindingEmail(c helper.Context, input UnbindingEmailParams) (res schema.Response)
- func UnbindingPhone(c helper.Context, input UnbindingPhoneParams) (res schema.Response)
- func UnbindingWechat(c helper.Context, input UnbindingWechatParams) (res schema.Response)
- type BindingEmailParams
- type BindingPhoneParams
- type BindingWechatMiniAppParams
- type ResetPasswordParams
- type SendEmailAuthCodeParams
- type SendPhoneAuthCodeParams
- type SignInParams
- type SignInWithEmailParams
- type SignInWithOAuthParams
- type SignInWithPhoneParams
- type SignInWithWechatParams
- type SignUpWithEmailActionParams
- type SignUpWithEmailParams
- type SignUpWithPhoneParams
- type SignUpWithUsernameParams
- type UnbindingEmailParams
- type UnbindingPhoneParams
- type UnbindingWechatParams
- type WechatCompleteParams
Constants ¶
This section is empty.
Variables ¶
View Source
var BindingEmailRouter = router.Handler(func(c router.Context) { var ( input BindingEmailParams ) c.ResponseFunc(c.ShouldBindJSON(&input), func() schema.Response { return BindingEmail(helper.NewContext(&c), input) }) })
View Source
var BindingPhoneRouter = router.Handler(func(c router.Context) { var ( input BindingPhoneParams ) c.ResponseFunc(c.ShouldBindJSON(&input), func() schema.Response { return BindingPhone(helper.NewContext(&c), input) }) })
View Source
var BindingWechatRouter = router.Handler(func(c router.Context) { var ( input BindingWechatMiniAppParams ) c.ResponseFunc(c.ShouldBindJSON(&input), func() schema.Response { return BindingWechat(helper.NewContext(&c), input) }) })
View Source
var ResetPasswordRouter = router.Handler(func(c router.Context) { var ( input ResetPasswordParams ) c.ResponseFunc(c.ShouldBindJSON(&input), func() schema.Response { return ResetPassword(input) }) })
View Source
var SendEmailAuthCodeRouter = router.Handler(func(c router.Context) { var ( input SendEmailAuthCodeParams ) c.ResponseFunc(c.ShouldBindJSON(&input), func() schema.Response { return SendEmailAuthCode(helper.NewContext(&c), input) }) })
View Source
var SendPhoneAuthCodeRouter = router.Handler(func(c router.Context) { var ( input SendPhoneAuthCodeParams ) c.ResponseFunc(c.ShouldBindJSON(&input), func() schema.Response { return SendPhoneAuthCode(helper.NewContext(&c), input) }) })
View Source
var SignInRouter = router.Handler(func(c router.Context) { var ( input SignInParams ) c.ResponseFunc(c.ShouldBindJSON(&input), func() schema.Response { return SignIn(helper.NewContext(&c), input) }) })
View Source
var SignInWithEmailRouter = router.Handler(func(c router.Context) { var ( input SignInWithEmailParams ) c.ResponseFunc(c.ShouldBindJSON(&input), func() schema.Response { return SignInWithEmail(helper.NewContext(&c), input) }) })
View Source
var SignInWithOAuthRouter = router.Handler(func(c router.Context) { var ( input SignInWithOAuthParams ) c.ResponseFunc(c.ShouldBindJSON(&input), func() schema.Response { return SignInWithOAuth(helper.NewContext(&c), input) }) })
View Source
var SignInWithPhoneRouter = router.Handler(func(c router.Context) { var ( input SignInWithPhoneParams ) c.ResponseFunc(c.ShouldBindJSON(&input), func() schema.Response { return SignInWithPhone(helper.NewContext(&c), input) }) })
View Source
var SignInWithWechatRouter = router.Handler(func(c router.Context) { var ( input SignInWithWechatParams ) c.ResponseFunc(c.ShouldBindJSON(&input), func() schema.Response { return SignInWithWechat(helper.NewContext(&c), input) }) })
View Source
var SignUpWithEmailActionRouter = router.Handler(func(c router.Context) { var ( input SignUpWithEmailActionParams ) c.ResponseFunc(c.ShouldBindJSON(&input), func() schema.Response { return SignUpWithEmailAction(input) }) })
View Source
var SignUpWithEmailRouter = router.Handler(func(c router.Context) { var ( input SignUpWithEmailParams ) c.ResponseFunc(c.ShouldBindJSON(&input), func() schema.Response { return SignUpWithEmail(input) }) })
View Source
var SignUpWithPhoneRouter = router.Handler(func(c router.Context) { var ( input SignUpWithPhoneParams ) c.ResponseFunc(c.ShouldBindJSON(&input), func() schema.Response { return SignUpWithPhone(input) }) })
View Source
var SignUpWithUsernameRouter = router.Handler(func(c router.Context) { var ( input SignUpWithUsernameParams ) c.ResponseFunc(c.ShouldBindJSON(&input), func() schema.Response { return SignUpWithUsername(input) }) })
View Source
var UnbindingEmailRouter = router.Handler(func(c router.Context) { var ( input UnbindingEmailParams ) c.ResponseFunc(c.ShouldBindJSON(&input), func() schema.Response { return UnbindingEmail(helper.NewContext(&c), input) }) })
View Source
var UnbindingPhoneRouter = router.Handler(func(c router.Context) { var ( input UnbindingPhoneParams ) c.ResponseFunc(c.ShouldBindJSON(&input), func() schema.Response { return UnbindingPhone(helper.NewContext(&c), input) }) })
View Source
var UnbindingWechatRouter = router.Handler(func(c router.Context) { var ( input UnbindingWechatParams ) c.ResponseFunc(c.ShouldBindJSON(&input), func() schema.Response { return UnbindingWechat(helper.NewContext(&c), input) }) })
Functions ¶
func BindingEmail ¶
func BindingEmail(c helper.Context, input BindingEmailParams) (res schema.Response)
绑定邮箱
func BindingPhone ¶
func BindingPhone(c helper.Context, input BindingPhoneParams) (res schema.Response)
绑定手机号
func BindingWechat ¶
func BindingWechat(c helper.Context, input BindingWechatMiniAppParams) (res schema.Response)
绑定微信
func CreateUserTx ¶
创建用户帐号,包括创建的邀请码,钱包数据等,继承到一起
func GenerateAuthCode ¶
func GenerateAuthCode() string
func ResetPassword ¶
func ResetPassword(input ResetPasswordParams) (res schema.Response)
func SendEmailAuthCode ¶
func SendEmailAuthCode(c helper.Context, input SendEmailAuthCodeParams) (res schema.Response)
发送邮箱验证码 (不需要登陆)
func SendPhoneAuthCode ¶
func SendPhoneAuthCode(c helper.Context, input SendPhoneAuthCodeParams) (res schema.Response)
发送手机验证码 (不需要登陆)
func SignInWithEmail ¶
func SignInWithEmail(c helper.Context, input SignInWithEmailParams) (res schema.Response)
邮箱 + 验证码登陆
func SignInWithOAuth ¶
func SignInWithOAuth(c helper.Context, input SignInWithOAuthParams) (res schema.Response)
使用 oAuth 认证方式登陆
func SignInWithPhone ¶
func SignInWithPhone(c helper.Context, input SignInWithPhoneParams) (res schema.Response)
手机 + 验证码登陆
func SignInWithWechat ¶
func SignInWithWechat(c helper.Context, input SignInWithWechatParams) (res schema.Response)
使用微信小程序登陆
func SignUpWithEmail ¶
func SignUpWithEmail(input SignUpWithEmailParams) (res schema.Response)
使用邮箱注册
func SignUpWithEmailAction ¶
func SignUpWithEmailAction(input SignUpWithEmailActionParams) (res schema.Response)
使用邮箱登陆 (发送邮件)
func SignUpWithPhone ¶
func SignUpWithPhone(input SignUpWithPhoneParams) (res schema.Response)
使用手机注册
func SignUpWithUsername ¶
func SignUpWithUsername(input SignUpWithUsernameParams) (res schema.Response)
使用用户名注册
func UnbindingEmail ¶
func UnbindingEmail(c helper.Context, input UnbindingEmailParams) (res schema.Response)
解除邮箱绑定
func UnbindingPhone ¶
func UnbindingPhone(c helper.Context, input UnbindingPhoneParams) (res schema.Response)
解除手机绑定
func UnbindingWechat ¶
func UnbindingWechat(c helper.Context, input UnbindingWechatParams) (res schema.Response)
解除微信绑定
Types ¶
type BindingEmailParams ¶
type BindingPhoneParams ¶
type BindingWechatMiniAppParams ¶
type BindingWechatMiniAppParams struct {
Code string `json:"code" valid:"required~请输入微信认证码"` // 微信小程序调用 wx.login() 之后,返回的 code
}
type ResetPasswordParams ¶
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 SignInWithEmailParams ¶
type SignInWithOAuthParams ¶
type SignInWithOAuthParams struct {
Code string `json:"code" valid:"required~请输入授权代码"` // oAuth 授权之后回调返回的 code
}
type SignInWithPhoneParams ¶
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 SignUpWithPhoneParams ¶
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 ¶
Click to show internal directories.
Click to hide internal directories.