Pu Zhibing
2025-03-07 297512bc22b179b7038d96a1ff033eceaed38c4b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package com.ruoyi.dataInterchange.model;
 
import com.fasterxml.jackson.annotation.JsonProperty;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.ByteBufUtil;
import io.netty.buffer.Unpooled;
import lombok.Data;
 
/**
 * 从链路断开通知
 * @author zhibing.pu
 * @Date 2025/2/24 11:12
 */
@Data
public class DOWNDisconnectInform {
    /**
     * 错误代码
     * 0x00:无法连接下级平台指定的服务无IP与端口
     * 0x01:上级平台客户端与下级平台服务端断开
     * 0xFF:其他错误
     */
    private int errorCode;
    
    
    public byte[] encode() {
        ByteBuf byteBuf = Unpooled.buffer(1);
        byteBuf.writeInt(this.getErrorCode());
        byte[] bytes = ByteBufUtil.getBytes(byteBuf);
        byteBuf.release();
        return bytes;
    }
}