package com.njzscloud.common.localizer.jt808.message;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;

/**
 * 终端消息体
 */
@Getter
@Setter
@ToString
@Accessors(chain = true)
public class TerminalMessageBody {
    /**
     * 终端ID
     */
    protected String terminalId;
    /**
     * 消息体
     */
    protected byte[] body;
    /**
     * 消息 Id
     */
    private int messageId;
    /**
     * 流水号
     */
    private int flowId;

    public TerminalMessageBody(JT808Message message) {
        this.terminalId = message.getTerminalPhone();
        this.messageId = message.getMessageId();
        this.flowId = message.getFlowId();
        this.body = message.getMessageBody();
    }
}
