增加CustomContext

This commit is contained in:
2025-04-12 21:01:59 +08:00
parent 53ecd0c267
commit 91a1d34474
11 changed files with 138 additions and 278 deletions

View File

@ -8,12 +8,14 @@
package request
import (
"git.zhangdeman.cn/zhangdeman/gin/define"
"git.zhangdeman.cn/zhangdeman/gin/request/parse_body"
"git.zhangdeman.cn/zhangdeman/wrapper"
"github.com/gin-gonic/gin"
"strings"
"sync"
"git.zhangdeman.cn/zhangdeman/gin/define"
"git.zhangdeman.cn/zhangdeman/gin/request/parse_body"
"git.zhangdeman.cn/zhangdeman/gin/router"
"git.zhangdeman.cn/zhangdeman/wrapper"
"github.com/gin-gonic/gin"
)
var (
@ -292,3 +294,8 @@ func (wh *wrapperHandle) GetLogicAfterResponse(ctx *gin.Context) *define.LogicAf
// 就这么写, key值如果被其他人覆盖成非法值, 此处会直接panic
return l.(*define.LogicAfterResponse)
}
// GetCustomContext 获取自定义context
func (wh *wrapperHandle) GetCustomContext(ctx *gin.Context) *define.Context {
return router.NewContext(ctx)
}