validate email fields in request
This commit is contained in:
parent
5baf5ed7e9
commit
8ddfe7a626
@ -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 {
|
||||||
|
|||||||
@ -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"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -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"`
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user