"refactor(socket): 重构TomeeHeader结构,新增Ret方法并优化控制器返回逻辑"

This commit is contained in:
1
2025-07-15 21:11:56 +00:00
parent e493a2b970
commit 280cd58017
6 changed files with 61 additions and 29 deletions

View File

@@ -21,6 +21,7 @@ type TomeeHeader struct {
Result uint32 `json:"result"`
Data []byte `json:"data" struc:"skip"` //组包忽略此字段// struc:"[0]pad"
Return []byte `struc:"[0]pad"` //返回记录
}
func NewTomeeHeader() *TomeeHeader {
@@ -113,6 +114,11 @@ func (h *TomeeHeader) Pack(data any) []byte { //组包
return by.Bytes()
}
func (h *TomeeHeader) Ret() []byte { //默认返回方法
return h.Return
}
// MergeBytes 将多个字节数组合并为一个