validate email fields in request

This commit is contained in:
Sergey Chubaryan 2025-02-07 13:07:19 +03:00
parent 5baf5ed7e9
commit 8ddfe7a626
3 changed files with 5 additions and 5 deletions

View File

@ -10,9 +10,9 @@ import (
) )
type createUserInput struct { type createUserInput struct {
Email string `json:"email"` Email string `json:"email" validate:"required,email"`
Password string `json:"password"` Password string `json:"password" validate:"required"`
Name string `json:"name"` Name string `json:"name" validate:"required"`
} }
type createUserOutput struct { type createUserOutput struct {

View File

@ -10,7 +10,7 @@ import (
) )
type loginUserInput struct { type loginUserInput struct {
Login string `json:"email"` Login string `json:"email" validate:"required,email"`
Password string `json:"password"` Password string `json:"password"`
} }

View File

@ -8,7 +8,7 @@ import (
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
) )
type Handler[Input, Output any] func(ctx context.Context, input Input) (Output, error) type Handler[Input, Output interface{}] func(ctx context.Context, input Input) (Output, error)
type ResponseOk struct { type ResponseOk struct {
Status string `json:"status"` Status string `json:"status"`