Init: setup uptrace and swagger

This commit is contained in:
2025-12-07 03:28:07 +08:00
parent a4096bf1a7
commit 56e83b0725
28 changed files with 662 additions and 81 deletions

16
middlewares/accessLog.go Normal file
View File

@@ -0,0 +1,16 @@
package middlewares
import (
"net/http"
"gitea.konchin.com/go2025/backend/tracing"
"github.com/uptrace/bunrouter"
)
func AccessLog(next bunrouter.HandlerFunc) bunrouter.HandlerFunc {
return func(w http.ResponseWriter, req bunrouter.Request) error {
tracing.Logger.Ctx(req.Context()).
Info(req.Method + " " + req.Params().Route())
return next(w, req)
}
}