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

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

/**
 * @author linyun
 * @version V1.0
 * @Title: LockResponseData
 * @Description: 上锁响应
 * @date 2022/11/15
 **/
@Data
public class LockResponseData extends ResponseData {

    /**上锁状态:0上锁成功 1上锁失败 2车架号不匹配 FF异常*/
    private int lockStatus;

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

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