1 Star 0 Fork 0

hongzhaomin / ginplus

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
handler_mapping.go 1.07 KB
一键复制 编辑 原始数据 按行查看 历史
hongzm 提交于 2023-06-19 14:22 . 支持路径参数和文件参数绑定
package ginplus
import "reflect"
// 处理器调用链,以controller为维度
type handlerMappingChain struct {
controller IController
mappings []*handlerMapping
}
type handlerMapping struct {
url string // 处理器映射url
method string // 请求方式
fun handlerFun // 处理器函数
permissions []string // 权限值,从字段TAG(Permission)中解析出来的值列表
ctrlType ControllerType // 控制器类型
}
type handlerFun struct {
rvFun reflect.Value
funParams []handlerFunParam
}
type handlerFunParam struct {
definedSpecialParamType DefinedSpecialParamTypeEnum // 定义的特殊参数类型
definedParamIsPtr bool // 定义的参数是否为指针类型:true -> 是;false -> 否
rtParam reflect.Type // 参数的 reflect.Type 值
pName string // 参数名称
defaultValMap map[string]string // 参数字段默认值(只支持结构体参数),使用default TAG声明
}
Go
1
https://gitee.com/hongzhaomin/ginplus.git
git@gitee.com:hongzhaomin/ginplus.git
hongzhaomin
ginplus
ginplus
master

搜索帮助