This commit is contained in:
aditya.siregar
2024-08-10 23:52:09 +07:00
parent 2fd676ef3e
commit 414c980c13
12 changed files with 68 additions and 28 deletions
+7 -1
View File
@@ -16,7 +16,13 @@ import (
"furtuna-be/internal/common/logger"
)
func RequestMiddleware() (handler gin.HandlerFunc) {
func RequestMiddleware(c ConfigLogger) (handler gin.HandlerFunc) {
if !c.IsLoggerEnabled() {
return func(ctx *gin.Context) {
ctx.Next()
}
}
return func(ctx *gin.Context) {
start := time.Now()
body, _ := readRequestBody(ctx.Request)