This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"quyun/v2/app/services"
|
||||
"quyun/v2/database"
|
||||
"quyun/v2/database/models"
|
||||
"time"
|
||||
|
||||
"github.com/gofiber/fiber/v3"
|
||||
)
|
||||
@@ -13,6 +14,11 @@ import (
|
||||
// @provider
|
||||
type smsCodeSends struct{}
|
||||
|
||||
type SmsCodeManualSetBody struct {
|
||||
Phone string `json:"phone"`
|
||||
Code string `json:"code"`
|
||||
}
|
||||
|
||||
// List
|
||||
//
|
||||
// @Summary 短信验证码发送记录
|
||||
@@ -58,3 +64,17 @@ func (ctl *smsCodeSends) List(ctx fiber.Ctx, query *dto.SmsCodeSendListQuery) (*
|
||||
Items: items,
|
||||
}, nil
|
||||
}
|
||||
|
||||
// ManualSet
|
||||
//
|
||||
// @Summary 手动设置短信验证码(用于短信认证)
|
||||
// @Tags Admin SMS
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param body body SmsCodeManualSetBody true "请求体"
|
||||
// @Success 200 {object} models.SmsCodeSend "成功"
|
||||
// @Router /admin/v1/sms-code-sends/manual-set [post]
|
||||
// @Bind body body
|
||||
func (ctl *smsCodeSends) ManualSet(ctx fiber.Ctx, body *SmsCodeManualSetBody) (*models.SmsCodeSend, error) {
|
||||
return services.Users.SetPhoneCode(ctx.Context(), body.Phone, body.Code, 5*time.Minute)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user