统一支持设置请求开始时间

This commit is contained in:
白茶清欢 2024-07-21 22:03:59 +08:00
parent deead87688
commit 8a6182d0de

View File

@ -9,15 +9,14 @@ package router
import (
"fmt"
"git.zhangdeman.cn/zhangdeman/exception"
"git.zhangdeman.cn/zhangdeman/gin/middleware"
"git.zhangdeman.cn/zhangdeman/gin/request"
"git.zhangdeman.cn/zhangdeman/gin/response"
"net/http"
"reflect"
"strings"
"git.zhangdeman.cn/zhangdeman/exception"
"git.zhangdeman.cn/zhangdeman/gin/response"
"git.zhangdeman.cn/zhangdeman/gin/request"
"git.zhangdeman.cn/zhangdeman/wrapper"
"github.com/gin-gonic/gin"
@ -168,6 +167,9 @@ func registerUri(uriConfig *UriConfig, methodValue reflect.Value, middlewareList
}
}
middlewareList = append(middlewareList, handlerFunc)
middlewareList = append([]gin.HandlerFunc{
middleware.InitRequest(),
}, middlewareList...)
switch uriConfig.Method {
case http.MethodGet:
ginRouter.GET(uriConfig.Path, middlewareList...)