refactor: 优化命令注册和请求处理逻辑

This commit is contained in:
xinian
2026-04-06 07:07:15 +08:00
committed by cnb
parent f030b61645
commit 77057e01b6
3 changed files with 129 additions and 84 deletions

View File

@@ -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 //返回体
}