package com.genersoft.iot.vmp.jt1078.proc.response;

import com.genersoft.iot.vmp.jt1078.annotation.MsgId;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import lombok.Getter;
import lombok.Setter;

import java.util.List;

/**
 * 删除矩形区域
 */
@Setter
@Getter
@MsgId(id = "8603")
public class J8603 extends Rs {


    /**
     * 待删除的区域ID
     */
    private List<Long> idList;


    @Override
    public ByteBuf encode() {
        ByteBuf buffer = Unpooled.buffer();
        if (idList == null || idList.isEmpty()) {
            buffer.writeByte(0);
            return buffer;
        }else {
            buffer.writeByte(idList.size());
        }
        for (Long id : idList) {
            buffer.writeInt((int) (id & 0xffffffffL));
        }
        return buffer;
    }

}
