refactor: 优化命令注册和请求处理逻辑
This commit is contained in:
@@ -22,8 +22,14 @@ var ctx = context.TODO()
|
||||
type Cmd struct {
|
||||
Func reflect.Value //方法函数
|
||||
Req reflect.Type //请求体
|
||||
// HeaderFieldIndex 是请求结构体中 TomeeHeader 字段的索引路径。
|
||||
HeaderFieldIndex []int
|
||||
// UseConn 标记第二个参数是否为 gnet.Conn。
|
||||
UseConn bool
|
||||
// 新增:预缓存的req创建函数(返回结构体指针)
|
||||
NewReqFunc func() interface{}
|
||||
// NewReqValue 返回请求结构体指针的 reflect.Value,避免重复构造类型信息。
|
||||
NewReqValue func() reflect.Value
|
||||
//Res reflect.Value //返回体
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user