validate email fields in request
This commit is contained in:
parent
5baf5ed7e9
commit
8ddfe7a626
@ -10,9 +10,9 @@ import (
|
||||
)
|
||||
|
||||
type createUserInput struct {
|
||||
Email string `json:"email"`
|
||||
Password string `json:"password"`
|
||||
Name string `json:"name"`
|
||||
Email string `json:"email" validate:"required,email"`
|
||||
Password string `json:"password" validate:"required"`
|
||||
Name string `json:"name" validate:"required"`
|
||||
}
|
||||
|
||||
type createUserOutput struct {
|
||||
|
||||
@ -10,7 +10,7 @@ import (
|
||||
)
|
||||
|
||||
type loginUserInput struct {
|
||||
Login string `json:"email"`
|
||||
Login string `json:"email" validate:"required,email"`
|
||||
Password string `json:"password"`
|
||||
}
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ import (
|
||||
"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 {
|
||||
Status string `json:"status"`
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user