feat: 合并Gin_Vue

This commit is contained in:
TsMask
2023-10-16 17:10:38 +08:00
parent 5289818fd4
commit 40a32cb67f
203 changed files with 19719 additions and 178 deletions

View File

@@ -0,0 +1,23 @@
package middleware
import (
"time"
"ems.agt/src/framework/logger"
"github.com/gin-gonic/gin"
)
// Report 请求响应日志
func Report() gin.HandlerFunc {
return func(c *gin.Context) {
start := time.Now()
// 调用下一个处理程序
c.Next()
// 计算请求处理时间,并打印日志
duration := time.Since(start)
logger.Infof("%s %s report end=> %v", c.Request.Method, c.Request.RequestURI, duration)
}
}