fix: harden auth flows and align api contracts
This commit is contained in:
@@ -43,7 +43,7 @@ func NewSMSHandler(authService *service.AuthService, smsCodeService *service.SMS
|
||||
// @Success 200 {object} Response "发送成功"
|
||||
// @Failure 400 {object} Response "请求参数错误"
|
||||
// @Failure 503 {object} Response "短信服务未配置"
|
||||
// @Router /api/v1/sms/send [post]
|
||||
// @Router /api/v1/auth/send-code [post]
|
||||
func (h *SMSHandler) SendCode(c *gin.Context) {
|
||||
if h.smsCodeService == nil {
|
||||
c.JSON(http.StatusServiceUnavailable, gin.H{"code": 503, "message": "SMS service not configured"})
|
||||
@@ -80,7 +80,7 @@ func (h *SMSHandler) SendCode(c *gin.Context) {
|
||||
// @Failure 400 {object} Response "请求参数错误"
|
||||
// @Failure 401 {object} Response "验证码错误"
|
||||
// @Failure 503 {object} Response "短信登录未配置"
|
||||
// @Router /api/v1/sms/login [post]
|
||||
// @Router /api/v1/auth/login/code [post]
|
||||
func (h *SMSHandler) LoginByCode(c *gin.Context) {
|
||||
if h.authService == nil {
|
||||
c.JSON(http.StatusServiceUnavailable, gin.H{"code": 503, "message": "SMS login not configured"})
|
||||
|
||||
Reference in New Issue
Block a user