refactor(info): 删除多余的信息结构体文件
- 移除了多个未使用的 Java 和 Go 信息结构体文件 - 优化了项目结构,减少了冗余代码 - 这些文件可能是早期开发阶段的遗留代码,现在已不再需要
This commit is contained in:
@@ -1,24 +1,42 @@
|
||||
package handler
|
||||
|
||||
import (
|
||||
"blazing/common/serialize/bytearray"
|
||||
)
|
||||
|
||||
// TomeeHeader 结构体字段定义
|
||||
type TomeeHeader struct {
|
||||
Version string `json:"version"`
|
||||
UserID int `json:"userId"`
|
||||
Error int `json:"error"`
|
||||
CMDID int `json:"cmdId"`
|
||||
Result int `json:"result"`
|
||||
Len uint32 `json:"len"`
|
||||
Version string `json:"version"`
|
||||
UserID uint32 `json:"userId"`
|
||||
Error uint32 `json:"error"`
|
||||
CMDID uint32 `json:"cmdId"`
|
||||
Result uint32 `json:"result"`
|
||||
Data []byte `json:"data"`
|
||||
}
|
||||
type TomeeHandler struct {
|
||||
|
||||
Callback func(data TomeeHeader)
|
||||
}
|
||||
|
||||
func NewTomeeHandler() *TomeeHandler {
|
||||
return &TomeeHandler{
|
||||
|
||||
}
|
||||
return &TomeeHandler{}
|
||||
}
|
||||
|
||||
// Handle entry receiver
|
||||
func (h *TomeeHandler) Handle(data []byte ) {
|
||||
func (h *TomeeHandler) Handle(data []byte) { //处理接收到的数据 ,
|
||||
//fmt.Println("接收数据", data)
|
||||
|
||||
}
|
||||
header := TomeeHeader{}
|
||||
|
||||
tempdata := bytearray.CreateByteArray(data)
|
||||
header.Len, _ = tempdata.ReadUInt32()
|
||||
header.Version, _ = tempdata.ReadString(1)
|
||||
header.CMDID, _ = tempdata.ReadUInt32()
|
||||
header.UserID, _ = tempdata.ReadUInt32()
|
||||
|
||||
header.Result, _ = tempdata.ReadUInt32()
|
||||
header.Data = tempdata.BytesAvailable()
|
||||
//fmt.Println("接收封包", header)
|
||||
h.Callback(header)
|
||||
//return header
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user