42 lines
1.3 KiB
Go
42 lines
1.3 KiB
Go
package dto
|
||
|
||
// SendCodeRequest 发送验证码请求
|
||
type SendCodeRequest struct {
|
||
Mobile string `json:"mobile" binding:"required"`
|
||
Scene string `json:"scene" binding:"required"` // register, password
|
||
}
|
||
|
||
// SendCodeResponse 发送验证码响应
|
||
type SendCodeResponse struct {
|
||
Code int `json:"code"`
|
||
Message string `json:"message"`
|
||
ExpiresIn int `json:"expires_in"` // 多少秒后可以重发
|
||
}
|
||
|
||
// VerifyCodeRequest 验证验证码请求
|
||
type VerifyCodeRequest struct {
|
||
Mobile string `json:"mobile" binding:"required"`
|
||
Code string `json:"code" binding:"required"`
|
||
Scene string `json:"scene" binding:"required"`
|
||
}
|
||
|
||
// VerifyCodeResponse 验证验证码响应
|
||
type VerifyCodeResponse struct {
|
||
Code int `json:"code"`
|
||
Message string `json:"message"`
|
||
Verified bool `json:"verified"`
|
||
VerifyToken string `json:"verify_token"`
|
||
ExpiresIn int `json:"expires_in"` // token有效期(秒)
|
||
}
|
||
|
||
// ResetPasswordRequest 匿名重置密码请求(忘记密码场景)
|
||
type ResetPasswordRequest struct {
|
||
Mobile string `json:"mobile" binding:"required,len=11"`
|
||
NewPassword string `json:"new_password" binding:"required,min=6"`
|
||
VerifyToken string `json:"verify_token" binding:"required"`
|
||
}
|
||
|
||
// ResetPasswordResponse 匿名重置密码响应(空,业务码通过 Base 表达)
|
||
type ResetPasswordResponse struct {
|
||
}
|