wip: 登录和认证

This commit is contained in:
loveuer
2025-07-13 22:57:57 +08:00
parent 48af538f98
commit b48fa05d9f
33 changed files with 1961 additions and 33 deletions

View File

@ -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
}
}