"refactor(socket): 重构TomeeHeader结构,新增Ret方法并优化控制器返回逻辑"
This commit is contained in:
@@ -196,9 +196,25 @@ func Recv(c gnet.Conn, data handler.TomeeHeader) {
|
||||
params = append(params, ptrValue1, reflect.ValueOf(c))
|
||||
}
|
||||
|
||||
ret := cmdlister.Call(params)
|
||||
cmdlister.Call(params)
|
||||
|
||||
r := entity.Conn{c}
|
||||
r.SendPack(ret[0].Interface().([]byte))
|
||||
r := entity.Conn{MainConn: c}
|
||||
// // 遍历结构体字段
|
||||
// // fmt.Printf("结构体 %s 的字段信息:\n", t.Name())
|
||||
// for i := 0; i < ptrValue1.Type().NumField(); i++ {
|
||||
// field := ptrValue1.Type().Field(i)
|
||||
|
||||
// if field.Name == "Ret" { //判断Ret
|
||||
|
||||
// }
|
||||
|
||||
// }
|
||||
t, ok := ptrValue1.Interface().(entity.Blazingservice)
|
||||
|
||||
if ok {
|
||||
r.SendPack(t.Ret())
|
||||
t.Ret()
|
||||
}
|
||||
//r.SendPack(ret[0].Interface().([]byte))
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user