28 lines
413 B
Go
28 lines
413 B
Go
package dto
|
|
|
|
import (
|
|
"errors"
|
|
"net/http"
|
|
)
|
|
|
|
type LoginRequest struct {
|
|
Login string `json:"login"`
|
|
Password string `json:"password"`
|
|
}
|
|
|
|
func (l *LoginRequest) Bind(r *http.Request) error {
|
|
if l.Login == "" {
|
|
return errors.New("login required")
|
|
}
|
|
|
|
if l.Password == "" {
|
|
return errors.New("password required")
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
type LoginResponse struct {
|
|
AccessToken string `json:"accessToken"`
|
|
}
|