user

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2020 License: MIT Imports: 22 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.

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

Index

Constants

This section is empty.

Variables

View Source
var GetProfileRouter = router.Handler(func(c router.Context) {
	c.ResponseFunc(nil, func() schema.Response {
		return GetProfile(helper.NewContext(&c))
	})
})
View Source
var QRCodeAuthGrantRouter = router.Handler(func(c router.Context) {
	var (
		input QRCodeAuthParams
	)

	c.ResponseFunc(c.ShouldBindJSON(&input), func() schema.Response {
		return QRCodeAuthGrant(helper.NewContext(&c), input)
	})
})
View Source
var QRCodeAuthQueryRouter = router.Handler(func(c router.Context) {
	var (
		input QRCodeAuthParams
	)

	c.ResponseFunc(c.ShouldBindJSON(&input), func() schema.Response {
		return QRCodeAuthQuery(helper.NewContext(&c), c.Param("link"))
	})
})
View Source
var ResetPayPasswordRouter = router.Handler(func(c router.Context) {
	var (
		input ResetPayPasswordParams
	)

	c.ResponseFunc(c.ShouldBindJSON(&input), func() schema.Response {
		return ResetPayPassword(helper.NewContext(&c), input)
	})
})
View Source
var SendAuthEmailRouter = router.Handler(func(c router.Context) {
	c.ResponseFunc(nil, func() schema.Response {
		return SendAuthEmail(helper.NewContext(&c))
	})
})
View Source
var SendAuthPhoneRouter = router.Handler(func(c router.Context) {
	c.ResponseFunc(nil, func() schema.Response {
		return SendAuthPhone(helper.NewContext(&c))
	})
})
View Source
var SendResetPayPasswordRouter = router.Handler(func(c router.Context) {
	c.ResponseFunc(nil, func() schema.Response {
		return SendResetPayPassword(helper.NewContext(&c))
	})
})
View Source
var SetPayPasswordRouter = router.Handler(func(c router.Context) {
	var (
		input SetPayPasswordParams
	)

	c.ResponseFunc(c.ShouldBindJSON(&input), func() schema.Response {
		return SetPayPassword(helper.NewContext(&c), input)
	})
})
View Source
var SignOut = router.Handler(func(c router.Context) {
	c.ResponseFunc(nil, func() schema.Response {
		return schema.Response{}
	})
})
View Source
var UpdatePasswordRouter = router.Handler(func(c router.Context) {
	var (
		input UpdatePasswordParams
	)

	c.ResponseFunc(c.ShouldBindJSON(&input), func() schema.Response {
		return UpdatePassword(helper.NewContext(&c), input)
	})
})
View Source
var UpdatePayPasswordRouter = router.Handler(func(c router.Context) {
	var (
		input UpdatePayPasswordParams
	)

	c.ResponseFunc(c.ShouldBindJSON(&input), func() schema.Response {
		return UpdatePayPassword(helper.NewContext(&c), input)
	})
})
View Source
var UpdateProfileRouter = router.Handler(func(c router.Context) {
	var (
		input UpdateProfileParams
	)

	c.ResponseFunc(c.ShouldBindJSON(&input), func() schema.Response {
		return UpdateProfile(helper.NewContext(&c), input)
	})
})

Functions

func GenerateResetPayPasswordCode

func GenerateResetPayPasswordCode(uid string) string

func GetProfile

func GetProfile(c helper.Context) (res schema.Response)

func QRCodeAuthGrant added in v0.7.0

func QRCodeAuthGrant(c helper.Context, input QRCodeAuthParams) (res schema.Response)

func QRCodeAuthQuery added in v0.7.0

func QRCodeAuthQuery(c helper.Context, link string) (res schema.Response)

func ResetPayPassword

func ResetPayPassword(c helper.Context, input ResetPayPasswordParams) (res schema.Response)

func SendAuthEmail

func SendAuthEmail(c helper.Context) (res schema.Response)

func SendAuthPhone

func SendAuthPhone(c helper.Context) (res schema.Response)

func SendResetPayPassword

func SendResetPayPassword(c helper.Context) (res schema.Response)

func SetPayPassword

func SetPayPassword(c helper.Context, input SetPayPasswordParams) (res schema.Response)

func UpdatePassword

func UpdatePassword(c helper.Context, input UpdatePasswordParams) (res schema.Response)

func UpdatePasswordByAdmin

func UpdatePasswordByAdmin(c helper.Context, userId string, input UpdatePasswordByAdminParams) (res schema.Response)

func UpdatePayPassword

func UpdatePayPassword(c helper.Context, input UpdatePayPasswordParams) (res schema.Response)

func UpdateProfile

func UpdateProfile(c helper.Context, input UpdateProfileParams) (res schema.Response)

Types

type QRCodeAuthParams added in v0.7.0

type QRCodeAuthParams struct {
	Url string `json:"url" validate:"required" comment:"URL"`
}

type ResetPayPasswordParams

type ResetPayPasswordParams struct {
	Code        string `json:"code" validate:"required" comment:"重置码"`                       // 重置码
	NewPassword string `json:"new_password" validate:"required,numeric,len=6" comment:"新密码"` // 新的交易密码
}

type SetPayPasswordParams

type SetPayPasswordParams struct {
	Password        string `json:"password" validate:"required,numeric,len=6" comment:"密码"`
	PasswordConfirm string `json:"password_confirm" validate:"required,numeric,len=6,eqfield=Password" comment:"确认密码"`
}

type UpdatePasswordByAdminParams

type UpdatePasswordByAdminParams struct {
	NewPassword string `json:"new_password" validate:"required,max=32" comment:"新密码"`
}

type UpdatePasswordParams

type UpdatePasswordParams struct {
	OldPassword string `json:"old_password" validate:"required,max=32" comment:"旧密码"`
	NewPassword string `json:"new_password" validate:"required,max=32,nefield=OldPassword" comment:"新密码"`
}

type UpdatePayPasswordParams

type UpdatePayPasswordParams struct {
	OldPassword string `json:"old_password" validate:"required,numeric,len=6" comment:"旧密码"`
	NewPassword string `json:"new_password" validate:"required,numeric,len=6,nefield=OldPassword" comment:"新密码"`
}

type UpdateProfileParams

type UpdateProfileParams struct {
	Username *string                    `json:"username" validate:"omitempty,max=32" comment:"用户名"` // 用户名,部分用户有机会修改自己的用户名,比如微信注册的帐号
	Nickname *string                    `json:"nickname" validate:"omitempty,max=32" comment:"昵称"`
	Gender   *model.Gender              `json:"gender" validate:"omitempty,number,oneof=0 1 2" comment:"性别"`
	Avatar   *string                    `json:"avatar" validate:"omitempty,url,max=255" comment:"头像"`
	Wechat   *UpdateWechatProfileParams `json:"wechat" validate:"omitempty" comment:"微信绑定信息"` // 更新微信绑定的帐号相关
}

type UpdateWechatProfileParams

type UpdateWechatProfileParams struct {
	Nickname  *string `json:"nickname" validate:"omitempty,max=32" comment:"微信昵称"`        // 用户昵称
	AvatarUrl *string `json:"avatar_url" validate:"omitempty,url,max=255" comment:"微信头像"` // 用户头像
	Gender    *int    `json:"gender" validate:"omitempty,number" comment:"性别"`            // 性别
	Country   *string `json:"country" validate:"omitempty,max=32" comment:"国家"`           // 国家
	Province  *string `json:"province" validate:"omitempty,max=32" comment:"省份"`          // 省份
	City      *string `json:"city" validate:"omitempty,max=32" comment:"城市"`              // 城市
	Language  *string `json:"language" validate:"omitempty,max=32" comment:"语言"`          // 语言
}

绑定的微信信息帐号相关

Jump to

Keyboard shortcuts

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