feat:优化项目信息

This commit is contained in:
henry
2022-02-11 11:02:29 +08:00
parent 95f1401468
commit cbc0ad1a41
9 changed files with 132 additions and 24 deletions

View File

@ -7,7 +7,7 @@ import (
type Sms struct{}
func (a *Sms) sCaptcha(c *gin.Context) {
func (*Sms) Captcha(c *gin.Context) {
form := &struct {
Mobile string `json:"mobile" form:"mobile" binding:"required"`
}{}
@ -16,5 +16,18 @@ func (a *Sms) sCaptcha(c *gin.Context) {
return
}
err := controller.NewSms()().Captcha(form.Mobile)
APIResponse(err)
APIResponse(err)(c)
}
func (*Sms) CaptchaValidate(c *gin.Context) {
form := &struct {
Mobile string `json:"mobile" form:"mobile" binding:"required"`
Captcha string `json:"captcha" form:"captcha" binding:"required"`
}{}
if err := Bind(form)(c); err != nil {
APIFailure(err.(error))(c)
return
}
data, err := controller.NewSms()().CaptchaValidate(form.Mobile, form.Captcha)
APIResponse(err, data)(c)
}