refactor(controller): 重构返回处理逻辑,移除TomeeHeader的Ret方法并改为直接返回[]byte

This commit is contained in:
1
2025-07-25 07:46:31 +00:00
parent 43dc9394c5
commit b0ffe1e7f0
7 changed files with 24 additions and 42 deletions

View File

@@ -207,28 +207,19 @@ func Recv(c gnet.Conn, data handler.TomeeHeader) {
params = append(params, ptrValue1, reflect.ValueOf(c))
}
cmdlister.Call(params)
ret :=cmdlister.Call(params)
r := entity.Conn{MainConn: c}
// }
aa := ptrValue1.Elem().Field(0).Addr().Interface()
t := aa.(Blazingservice)
//st, ok := aa.(Blazingservice)
//fmt.Println(t.Ret())
if t.Ret() != nil {
err := r.SendPack(t.Ret())
if err != nil {
fmt.Println(err)
}
//t.Ret()
if len(ret)<=0 {
return
}
//r.SendPack(ret[0].Interface().([]byte))
a,ok:=ret[0].Interface().([]byte)
if ok {
r.SendPack(a)
}
}
type Blazingservice interface {
Ret() []byte
}