refactor: 移除不必要的上下文调用,简化服务方法参数
This commit is contained in:
@@ -22,7 +22,7 @@ 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.Context(), form.Phone)
|
||||
return services.User.SendOTP(ctx, form.Phone)
|
||||
}
|
||||
|
||||
// Login logs in or registers a user with OTP.
|
||||
@@ -37,5 +37,5 @@ 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.Context(), form.Phone, form.OTP)
|
||||
return services.User.LoginWithOTP(ctx, form.Phone, form.OTP)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user