smshandlers

package
v0.0.0-...-851e7b8 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SMSHandlers

type SMSHandlers struct {
	*basichandlers.Basic
}

SMSHandlers is SMS APIs

func (*SMSHandlers) ActionsList

func (s *SMSHandlers) ActionsList() gin.HandlerFunc

ActionsList defined SMS actions API request @Summary 获取可用短信类型 @Tags 短信 @Description 获取可用的短信类型,发送短信时用于匹配验证码文本 @Accept json @Produce json @Success 200 "{"code":200,"data":{},"message":"操作成功"}" @Router /sms/actions/list [get]

func (*SMSHandlers) Login

func (s *SMSHandlers) Login() gin.HandlerFunc

Login defined uss SMS Login(authentication) API request @Summary 使用短信进行登录授权 @Tags 短信 @Description 获取可用的短信类型,发送短信时用于匹配验证码文本 @Accept json @Produce json @Accept application/x-json-stream @Param ValidateSMSCodeRequest body smshandlers.ValidateSMSCodeRequest true "登录" @Success 200 "{"code":200,"data":{},"message":"操作成功"}" @Router /sms/login [post]

func (*SMSHandlers) Send

func (s *SMSHandlers) Send() gin.HandlerFunc

Send defined send SMS API request @Summary 发送短信验证码 @Tags 短信 @Description 向指定的手机号,或者指定用户发送验证码 @Accept json @Produce json @Accept application/x-json-stream @Param SendSMSRequest body smshandlers.SendSMSRequest true "文章" @Success 200 "{"code":200,"data":{},"message":"操作成功"}" @Router /sms/send [post]

func (*SMSHandlers) Test

func (s *SMSHandlers) Test() gin.HandlerFunc

Test defined Test SMS API request @Summary 开发环境下测试验证码真实性,此接口仅在debug模式下可用,生产环境下,将直接返回错误信息 @Tags 短信 @Description 校验短信验证码的真实性,用于redis调试 @Accept json @Produce json @Accept application/x-json-stream @Param ValidateSMSCodeRequest body smshandlers.ValidateSMSCodeRequest true "文章" @Success 200 "{"code":200,"data":{},"message":"操作成功"}" @Router /sms/test [post]

type SendSMSRequest

type SendSMSRequest struct {
	// 用于发送短信的手机号码
	//
	// required: true
	// min: 11
	Mobile string `json:"mobile"`
	// 发送短信的行为,注意:匹配操作类型将直接影响验证码模板
	// 如果不匹配的类型,虽然短信验证码发送成功,但可能依旧无法通过校验
	//
	// required: true
	// min: 0
	Action string `json:"action"`
	// 验证码输入
	//
	// required: true
	// min: 0
	*basichandlers.CaptchaRequest
}

SendSMSRequest defined send SMS json bindings swagger:model SendSMSReq

type ValidateSMSCodeRequest

type ValidateSMSCodeRequest struct {
	// 用于发送短信的手机号码
	//
	// required: true
	// min: 11
	Mobile string `json:"mobile"`
	// 发送短信的行为,注意:匹配操作类型将直接影响验证码模板
	// 如果不匹配的类型,虽然短信验证码发送成功,但可能依旧无法通过校验
	// 需保持与请求验证码时一致的action,否则将导致验证码校验无法通过
	//
	// required: true
	// min: 0
	Action string `json:"action"`
	// 验证码
	// 验证码将用于校验
	//
	// required: true
	// min: 4
	Code string `json:"code"`
	// Key 用于校验
	//
	// required: true
	// min: 4
	Key string `json:"key"`
}

ValidateSMSCodeRequest is basic validation data struction swagger:model SendSMSReq

Jump to

Keyboard shortcuts

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