wip: 登录和认证
This commit is contained in:
@ -1,14 +1,30 @@
|
||||
package handler
|
||||
|
||||
import (
|
||||
"loveuer/utodo/pkg/logger"
|
||||
"loveuer/utodo/pkg/resp"
|
||||
|
||||
"github.com/gofiber/fiber/v3"
|
||||
)
|
||||
|
||||
func Login() fiber.Handler {
|
||||
return func(c fiber.Ctx) error {
|
||||
logger.InfoCtx(c.Context(), "login")
|
||||
return c.SendString("Hello, World!")
|
||||
type Req struct {
|
||||
Username string `json:"username"`
|
||||
Phone string `json:"phone"`
|
||||
Email string `json:"email"`
|
||||
Password string `json:"password" validate:"required,min=8"`
|
||||
}
|
||||
|
||||
var (
|
||||
err error
|
||||
req Req
|
||||
)
|
||||
|
||||
if err = c.Bind().JSON(&req); err != nil {
|
||||
return resp.R400(c, "", nil, err.Error())
|
||||
}
|
||||
|
||||
// TODO: 完成登录
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user