api

package
v0.0.0-...-cc65f9c Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2020 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ActivateUser

func ActivateUser(form st.ActivateUserForm, ctx *context.Context)

ActivateUser 邮箱注册激活用户 @tags 前端 - 用户注册 @Summary 邮箱注册激活用户 @Accept x-www-form-urlencoded @Success 200 {object} context.JSONResult @Param s query string false "邮件激活码" @Router /api/reg/activate [get]

func Authorize

func Authorize(config *config.Config, ctx *context.Context)

Authorize 登录认证

func Info

func Info(ctx *context.Context)

Info 用户信息 @tags 前端 - 用户信息 @Summary 用户信息 @Accept x-www-form-urlencoded @Success 200 {object} context.JSONResult @Router /api/profile [get] @Security ApiKeyAuth

func Login

func Login(form st.LoginForm, ctx *context.Context)

Login 手机号\邮箱\用户名和密码登录 @tags 前端 - 用户登录 @Summary 手机号\邮箱\用户名和密码登录 @Accept x-www-form-urlencoded @Success 200 {object} context.JSONResult{data=string} "令牌" @Param login_name formData string false "[手机号|邮箱|用户名]" @Param password formData string false "密码" @Router /api/login [post]

func LoginByMobile

func LoginByMobile(form st.LoginWithMobileAndCodeForm, config *config.Config, cache cache.Cache, ctx *context.Context)

LoginByMobile 手机号和验证码登录 @tags 前端 - 用户登录 @Summary 手机号和验证码登录 @Accept x-www-form-urlencoded @Success 200 {object} context.JSONResult{data=string} "令牌" @Param mobile formData string false "手机号" @Param code formData string false "验证码" @Router /api/login/mobile [post]

func LoginByThirdCode

func LoginByThirdCode(form st.LoginWithThirdCodeForm, cache cache.Cache, ctx *context.Context)

LoginByThirdCode 第三方使用code登录 @tags 前端 - 用户登录 @Summary 第三方QQ,微信,微博使用code登录 @Accept x-www-form-urlencoded @Success 200 {object} context.JSONResult{data=string} "令牌" @Param id path string true "第三方编号" @Param code formData string false "第三方授权后返回的code" @Param state formData string false "第三方授权后返回的state" @Router /api/login/th/{id} [post]

func LoginByWeiXinMPCode

func LoginByWeiXinMPCode(form st.LoginWithWeiXinMPCodeForm, cache cache.Cache, ctx *context.Context)

LoginByWeiXinMPCode 微信小程序code获取session @tags 前端 - 用户登录 @Summary 微信小程序登录 @Accept x-www-form-urlencoded @Success 200 {object} context.JSONResult{data=string} "令牌" @Param id path string true "第三方编号" @Param code formData string false "微信小程序通过wx.login获取的临时登录凭证" @Param only_session formData bool false "是否只登录微信小程序" @Router /api/login/th/weixinmp/{id} [post]

func ReSendActivateCode

func ReSendActivateCode(form st.EmailForm, ctx *context.Context)

ReSendActivateCode 重发邮件激活码 @tags 前端 - 用户注册 @Summary 重发邮件激活码 @Accept x-www-form-urlencoded @Success 200 {object} context.JSONResult @Param email formData string false "邮箱" @Router /api/reg/activate/resend [post]

func RedirectURLForThird

func RedirectURLForThird(form st.LoginWithThirdForm, ctx *context.Context)

RedirectURLForThird 第三方登录 @tags 前端 - 用户登录 @Summary 第三方QQ,微信,微博登录地址 @Accept x-www-form-urlencoded @Success 200 {object} context.JSONResult{data=string} 第三方请求地址 @Param id path string true "第三方编号" @Param state query string false "第三方授权后返回的state" @Router /api/login/th/{id} [get]

func RegisterWithEmailAndPassword

func RegisterWithEmailAndPassword(form st.RegisterEmailForm, ctx *context.Context)

RegisterWithEmailAndPassword 邮箱和密码注册 @tags 前端 - 用户注册 @Summary 邮箱和密码注册 @Accept x-www-form-urlencoded @Success 200 {object} context.JSONResult{data=string} "令牌" @Param email formData string false "邮箱" @Param password formData string false "密码" @Router /api/reg/email [post]

func RegisterWithMobileAndPassword

func RegisterWithMobileAndPassword(form st.RegisterMobileForm, cache cache.Cache, ctx *context.Context)

RegisterWithMobileAndPassword 手机号和密码注册 @tags 前端 - 用户注册 @Summary 手机号和密码注册 @Accept x-www-form-urlencoded @Success 200 {object} context.JSONResult{data=string} "令牌" @Param mobile formData string false "手机号" @Param password formData string false "密码" @Param code formData string false "验证码" @Router /api/reg/mobile [post]

func RegisterWithNameAndPassword

func RegisterWithNameAndPassword(form st.RegisterNameForm, ctx *context.Context)

RegisterWithNameAndPassword 用户名和密码注册 @tags 前端 - 用户注册 @Summary 用户名和密码注册 @Accept x-www-form-urlencoded @Success 200 {object} context.JSONResult{data=string} "令牌" @Param login_name formData string false "用户名" @Param password formData string false "密码" @Router /api/reg/name [post]

func RegisterWithThirdCode

func RegisterWithThirdCode(form st.RegisterWithThirdForm, cache cache.Cache, ctx *context.Context)

RegisterWithThirdCode 第三方QQ,微信,微博使用code注册 @tags 前端 - 用户注册 @Summary 第三方QQ,微信,微博使用code注册 @Accept x-www-form-urlencoded @Success 200 {object} context.JSONResult{data=string} "令牌" @Param code formData string false "第三方授权后返回的code" @Router /api/reg/third [post]

func RegisterWithWeiXinMP

func RegisterWithWeiXinMP(form st.WeiXinMPForm, cache cache.Cache, ctx *context.Context)

RegisterWithWeiXinMP 微信小程序注册(通过用户信息) @tags 前端 - 用户注册 @Summary 微信小程序注册(通过用户信息) @Accept x-www-form-urlencoded @Success 200 {object} context.JSONResult{data=string} "令牌" @Param id path string true "第三方编号" @Param key formData string false "调用微信小程序登录接口(/login/th/weixinmp/{id})返回的内容" @Param encrypted_data formData string false "微信小程序通过wx.getUserInfo获取的encryptedData" @Param iv formData string false "微信小程序通过wx.getUserInfo获取的iv" @Router /api/reg/weixinmp/userinfo/{id} [post]

func RegisterWithWeiXinMPPhone

func RegisterWithWeiXinMPPhone(form st.WeiXinMPForm, cache cache.Cache, ctx *context.Context)

RegisterWithWeiXinMPPhone 微信小程序注册(通过手机号) @tags 前端 - 用户注册 @Summary 微信小程序注册(通过手机号) @Accept x-www-form-urlencoded @Success 200 {object} context.JSONResult{data=string} "令牌" @Param id path string true "第三方编号" @Param key formData string false "调用微信小程序登录接口(/login/th/weixinmp/{id})返回的内容" @Param encrypted_data formData string false "微信小程序通过getPhoneNumber获取的encryptedData" @Param iv formData string false "微信小程序通过getPhoneNumber获取的encryptedData" @Router /api/reg/weixinmp/mobile/{id} [post]

func ResetPasswordByCodeWithEmail

func ResetPasswordByCodeWithEmail(form st.ResetPasswordWithEmailCodeForm, ctx *context.Context, cache cache.Cache)

ResetPasswordByCodeWithEmail 忘记密码邮件验证码修改密码 @tags 前端 - 重置密码 @Summary 忘记密码重置 @Accept x-www-form-urlencoded @Success 200 {object} context.JSONResult @Param email formData string false "邮箱" @Param password formData string false "新密码" @Param code formData string false "邮件验证码" @Router /api/forgot/reset/email [post]

func Router

func Router(m *macaron.Macaron)

Router 设置路由

func SendCodeByForgotPasswordWithEmail

func SendCodeByForgotPasswordWithEmail(form st.EmailForm, ctx *context.Context, cache cache.Cache)

SendCodeByForgotPasswordWithEmail 重置密码验证码 @tags 前端 - 邮件验证码 @Summary 忘记密码重置验证码 @Accept x-www-form-urlencoded @Success 200 {object} context.JSONResult "验证码" @Param email formData string false "邮箱" @Router /api/code/forgot/email [post] @Security ApiKeyAuth

func SendCodeWithBindEmail

func SendCodeWithBindEmail(form st.EmailForm, ctx *context.Context, cache cache.Cache)

SendCodeWithBindEmail 绑定或更新邮箱验证码(用户已登录) @tags 前端 - 邮件验证码 @Summary 绑定或更新邮箱验证码(用户已登录) @Accept x-www-form-urlencoded @Success 200 {object} context.JSONResult "验证码" @Param email formData string false "邮箱" @Router /api/code/bind/email [post] @Security ApiKeyAuth

func SendCodeWithBindMobile

func SendCodeWithBindMobile(form st.MobileForm, ctx *context.Context, cache cache.Cache)

SendCodeWithBindMobile 绑定或更新手机号验证码(用户已登录) @tags 前端 - 手机验证码 @Summary 绑定或更新手机号验证码(用户已登录) @Accept x-www-form-urlencoded @Success 200 {object} context.JSONResult "验证码" @Param mobile formData string false "手机号" @Router /api/code/bind/mobile [post] @Security ApiKeyAuth

func SendCodeWithLogin

func SendCodeWithLogin(form st.MobileForm, ctx *context.Context, cache cache.Cache)

SendCodeWithLogin 登录验证码 @tags 前端 - 手机验证码 @Summary 手机登录验证码 @Accept x-www-form-urlencoded @Success 200 {object} context.JSONResult "验证码" @Param mobile formData string false "手机号" @Router /api/code/login [post]

func SendCodeWithPassword

func SendCodeWithPassword(ctx *context.Context, cache cache.Cache)

SendCodeWithPassword 更新密码验证码(用户已登录) @tags 前端 - 手机验证码 @Summary 更新密码验证码(用户已登录) @Accept x-www-form-urlencoded @Success 200 {object} context.JSONResult "验证码" @Router /api/code/password [post] @Security ApiKeyAuth

func SendCodeWithReg

func SendCodeWithReg(form st.MobileForm, ctx *context.Context, cache cache.Cache)

SendCodeWithReg 注册验证码 @tags 前端 - 手机验证码 @Summary 手机注册验证码 @Accept x-www-form-urlencoded @Success 200 {object} context.JSONResult "验证码" @Param mobile formData string false "手机号" @Router /api/code/reg [post]

func UpdateAvatar

func UpdateAvatar(ctx *context.Context)

UpdateAvatar 修改头像 @tags 前端 - 用户信息 @Summary 修改头像 @Accept x-www-form-urlencoded @Success 200 {object} context.JSONResult @Param avatar formData string false "头像地址" @Router /api/profile/update/avatar [post] @Security ApiKeyAuth

func UpdateEmailWidthCode

func UpdateEmailWidthCode(form st.UpdateEmailWithCodeForm, ctx *context.Context, cache cache.Cache)

UpdateEmailWidthCode 根据邮箱验证码绑定或更新邮箱 @tags 前端 - 用户信息 @Summary 根据邮箱验证码绑定或更新邮箱 @Accept x-www-form-urlencoded @Success 200 {object} context.JSONResult @Param email formData string false "邮箱" @Param code formData string false "验证码" @Router /api/profile/update/bind/email [post] @Security ApiKeyAuth

func UpdateGender

func UpdateGender(ctx *context.Context)

UpdateGender 修改性别 @tags 前端 - 用户信息 @Summary 修改性别 @Accept x-www-form-urlencoded @Success 200 {object} context.JSONResult @Param gender formData string false "性别" Enums(male, female) @Router /api/profile/update/gender [post] @Security ApiKeyAuth

func UpdateMobileWithCode

func UpdateMobileWithCode(form st.UpdateMobileWithCodeForm, ctx *context.Context, cache cache.Cache)

UpdateMobileWithCode 根据手机验证码绑定或更新手机号 @tags 前端 - 用户信息 @Summary 根据手机验证码绑定或更新手机号 @Accept x-www-form-urlencoded @Success 200 {object} context.JSONResult @Param mobile formData string false "手机号" @Param code formData string false "验证码" @Router /api/profile/update/bind/mobile [post] @Security ApiKeyAuth

func UpdateMobileWithWeiXinMP

func UpdateMobileWithWeiXinMP(form st.WeiXinMPForm, ctx *context.Context, cache cache.Cache)

UpdateMobileWithWeiXinMP 微信小程序更新手机号 @tags 前端 - 用户信息 @Summary 微信小程序更新手机号 @Accept x-www-form-urlencoded @Success 200 {object} context.JSONResult @Param id path string true "第三方编号" @Param key formData string false "调用微信小程序登录接口(/login/th/weixinmp/{id})返回的内容" @Param encrypted_data formData string false "微信小程序通过getPhoneNumber获取的encryptedData" @Param iv formData string false "微信小程序通过getPhoneNumber获取的encryptedData" @Router /api/profile/update/bind/mobile/weixinmp/{id} [post] @Security ApiKeyAuth

func UpdateNickname

func UpdateNickname(ctx *context.Context)

UpdateNickname 修改昵称 @tags 前端 - 用户信息 @Summary 修改昵称 @Accept x-www-form-urlencoded @Success 200 {object} context.JSONResult @Param nickname formData string false "昵称" @Router /api/profile/update/nickname [post] @Security ApiKeyAuth

func UpdatePasswordWithCode

func UpdatePasswordWithCode(form st.UpdatePasswordWithCodeForm, ctx *context.Context, cache cache.Cache)

UpdatePasswordWithCode 根据手机验证码修改密码 @tags 前端 - 用户信息 @Summary 根据手机验证码修改密码 @Accept x-www-form-urlencoded @Success 200 {object} context.JSONResult @Param password formData string false "新密码" @Param code formData string false "验证码" @Router /api/profile/update/password/mobile [post] @Security ApiKeyAuth

func UpdatePasswordWithOldPassword

func UpdatePasswordWithOldPassword(form st.UpdatePasswordWithOldPasswordForm, ctx *context.Context)

UpdatePasswordWithOldPassword 根据原密码修改密码 @tags 前端 - 用户信息 @Summary 根据原密码修改密码 @Accept x-www-form-urlencoded @Success 200 {object} context.JSONResult @Param old_password formData string false "原密码" @Param password formData string false "新密码" @Router /api/profile/update/password/old [post] @Security ApiKeyAuth

Types

This section is empty.

Jump to

Keyboard shortcuts

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