package com.usky.cdi.service.vo.info;

import com.usky.cdi.service.vo.base.BaseEnvMonitorPushVO;
import lombok.Data;

/**
 *
 * @author fyc
 * @email yuchuan.fu@chinausky.com
 * @date 2026/4/27
 */
@Data
public class WaterLevelVO extends BaseEnvMonitorPushVO {

    private static final long serialVersionUID = 1L;

    private static final Double MIN_SENSOR_VALUE = 0.0;
    private static final Double MAX_SENSOR_VALUE = 2.0;

    /**
     * 水位高度
     * 类型：double
     */
    private Double sensorValue;

    @Override
    public Number getSensorValue() {
        return sensorValue;
    }

    @Override
    protected void validateSensorValue() {
        // 位移值校验规则，根据实际业务需求调整
        if (sensorValue == null || sensorValue < MIN_SENSOR_VALUE || sensorValue > MAX_SENSOR_VALUE) {
            throw new IllegalArgumentException("水位高度（sensorValue）为必填项，且必须在" + MIN_SENSOR_VALUE + "到" + MAX_SENSOR_VALUE + "之间");
        }
    }

}
