wip: user stuff

This commit is contained in:
loveuer
2025-07-11 22:12:37 +08:00
parent 99cbe8c523
commit b926a8fb80
16 changed files with 447 additions and 3 deletions

29
internal/api/api.go Normal file
View File

@ -0,0 +1,29 @@
package api
import (
"context"
"loveuer/utodo/internal/handler"
"loveuer/utodo/internal/opt"
g_handler "loveuer/utodo/pkg/handler"
"loveuer/utodo/pkg/middleware/trace"
"github.com/gofiber/fiber/v3"
l3 "github.com/gofiber/fiber/v3/middleware/logger"
r3 "github.com/gofiber/fiber/v3/middleware/recover"
)
func New(ctx context.Context) *fiber.App {
app := fiber.New()
app.Use(trace.New())
app.Use(l3.New())
app.Use(r3.New())
app.Get("/healthz", g_handler.Healthz(opt.Cfg.Name, opt.Cfg.Version))
{
api := app.Group("/api/v1/auth")
api.Post("/login", handler.Login())
}
return app
}