package com.pwt.netty.common.vehicle2old.server;

import com.pwt.netty.common.vehicle2old.ResponseData;
import io.netty.buffer.ByteBuf;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * @author linyun
 * @version V1.0
 * @Title: SettlementComfirmResponseData
 * @Description: 结算确认
 * @date 2022/11/15
 **/
@Data
@EqualsAndHashCode
public class SettlementComfirmResponseData extends ResponseData {

    /**结算状态: 0确认成功 1确认失败 2车架号不匹配 FF异常*/
    private int settlementStatus;

    /***
     * 子类编码
     * @param byteBuf
     */
    @Override
    protected void encodeInternal(ByteBuf byteBuf)
    {
        byteBuf.writeByte(settlementStatus);
    }

    /**
     * 子类解码
     *
     * @param byteBuf
     */
    @Override
    protected void decodeInternal(ByteBuf byteBuf)
    {
        this.settlementStatus = byteBuf.readUnsignedByte();
    }
}
