chore: stabilize lint and verify builds

This commit is contained in:
2026-02-06 11:51:32 +08:00
parent edede17880
commit 1782f64417
114 changed files with 3032 additions and 1345 deletions

View File

@@ -1,6 +1,7 @@
package auth
import (
"quyun/v2/app/errorx"
"quyun/v2/app/http/v1/dto"
"quyun/v2/app/services"
@@ -22,7 +23,11 @@ type Auth struct{}
// @Success 200 {object} string "OTP sent"
// @Bind form body
func (a *Auth) SendOTP(ctx fiber.Ctx, form *dto.SendOTPForm) error {
return services.User.SendOTP(ctx, form.Phone)
if err := services.User.SendOTP(ctx, form.Phone); err != nil {
return errorx.ErrOperationFailed.WithCause(err)
}
return nil
}
// @Router /v1/auth/login [post]
@@ -35,5 +40,10 @@ func (a *Auth) SendOTP(ctx fiber.Ctx, form *dto.SendOTPForm) error {
// @Success 200 {object} dto.LoginResponse
// @Bind form body
func (a *Auth) Login(ctx fiber.Ctx, form *dto.LoginForm) (*dto.LoginResponse, error) {
return services.User.LoginWithOTP(ctx, 0, form.Phone, form.OTP)
resp, err := services.User.LoginWithOTP(ctx, 0, form.Phone, form.OTP)
if err != nil {
return nil, errorx.ErrOperationFailed.WithCause(err)
}
return resp, nil
}