package com.tofly.third.common.res;

import com.tofly.third.entity.ZnbZlLog;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

@Data
@ApiModel("未执行指令res")
public class WzxZlRes {

    @ApiModelProperty("未执行的开阀指令")
    private List<WzxZl> kfWzxZls = new ArrayList<>();

    @ApiModelProperty("未执行的关阀指令")
    private List<WzxZl> gfWzxZls = new ArrayList<>();

    @Data
    @ApiModel("未执行指令")
    public static class WzxZl {

        @ApiModelProperty("指令ID")
        private String zlId;

        @ApiModelProperty("指令值 0-关阀 1-开阀")
        private String zlvalue;

        public static WzxZl build(ZnbZlLog zlLog) {
            WzxZl wzxZl = new WzxZl();
            wzxZl.setZlId(zlLog.getId());
            wzxZl.setZlvalue(zlLog.getZlvalue());
            return wzxZl;
        }
    }

}
