优化代码组织
This commit is contained in:
@ -9,6 +9,7 @@ package router
|
||||
|
||||
import (
|
||||
"git.zhangdeman.cn/zhangdeman/exception"
|
||||
"git.zhangdeman.cn/zhangdeman/gin/define"
|
||||
"git.zhangdeman.cn/zhangdeman/gin/request"
|
||||
"git.zhangdeman.cn/zhangdeman/gin/response"
|
||||
"github.com/gin-gonic/gin"
|
||||
@ -47,13 +48,13 @@ func RequestHandler(uriCfg UriConfig) gin.HandlerFunc {
|
||||
}
|
||||
|
||||
// 初始化响应之后logic
|
||||
logicAfterResponse := &LogicAfterResponse{
|
||||
logicAfterResponse := &define.LogicAfterResponse{
|
||||
SuccessHookFuncList: make([]func(), 0),
|
||||
FailureHookFuncList: make([]func(), 0),
|
||||
Lock: &sync.RWMutex{},
|
||||
}
|
||||
// 此处暴露出去,是为了使用方可以获取到对应数据
|
||||
ctx.Set(LogicAfterResponseKey, logicAfterResponse)
|
||||
ctx.Set(define.LogicAfterResponseKey, logicAfterResponse)
|
||||
|
||||
// 执行逻辑
|
||||
inputValue := reflect.ValueOf(formValue)
|
||||
|
Reference in New Issue
Block a user