liusuyi
2024-10-23 2b43275bd260eda468f305ebca4b4f4291b0605d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
package com.ard.tianyu.netty.command;
 
import io.netty.buffer.ByteBuf;
import lombok.Data;
 
@Data
public abstract class BaseCommand {
    private short dataHeader; // 帧头
    private short dataLength; // 数据长度
    private byte cmdCode; // 指令编号
 
    // 编码方法,子类需要实现
    public abstract void encode(ByteBuf out);
}