package com.mortals.xhx.module.device.model;

import com.mortals.framework.annotation.Excel;
import com.mortals.xhx.module.device.model.vo.DeviceModuleDistributeVo;
import lombok.Data;
/**
 * 设备前端模块部署实体对象
 *
 * @author zxfei
 * @date 2023-08-21
 */
@Data
public class DeviceModuleDistributeEntity extends DeviceModuleDistributeVo {
    private static final long serialVersionUID = 1L;

    /**
     * 产品Id
     */
    private Long productId;
    /**
     * 产品编码
     */
    private String productCode;
    /**
     * 产品名称
     */
    private String productName;
    /**
     * 分辨率
     */
    private String imageResolution;
    /**
     * 分辨率值
     */
    @Excel(name = "分辨率值")
    private String imageResolutionValue;
    /**
     * 文件相对路径地址
     */
    @Excel(name = "文件相对路径地址")
    private String filePath;
    /**
     * 文件部署路径地址
     */
    @Excel(name = "文件部署路径地址")
    private String distributeFilePath;
    /**
     * 版本号
     */
    @Excel(name = "版本号")
    private String version;
    /**
     * 是否部署(0.否，1.是)
     */
    @Excel(name = "是否部署", readConverterExp = "0=否,1=是")
    private Integer distribute;
    /**
     * 站点Id，来源基础服务平台
     */
    private Long siteId;
    /**
     * 站点编号，来源基础服务平台
     */
    private String siteCode;
    /**
     * 站点名称
     */
    private String siteName;
    /**
     * 是否默认选择分辨率(0.否，1.是)
     */
    @Excel(name = "是否默认选择分辨率", readConverterExp = "0=否,1=是")
    private Integer selected;
    @Override
    public int hashCode() {
        return this.getId().hashCode();
    }
    @Override
    public boolean equals(Object obj) {
        if (obj == null) return false;
        if (obj instanceof DeviceModuleDistributeEntity) {
            DeviceModuleDistributeEntity tmp = (DeviceModuleDistributeEntity) obj;
            if (this.getId() == tmp.getId()) {
                return true;
            }
        }
        return false;
    }

    public void initAttrValue(){
        this.productId = null;
        this.productCode = "";
        this.productName = "";
        this.imageResolution = "";
        this.imageResolutionValue = "";
        this.filePath = "";
        this.distributeFilePath = "";
        this.version = "";
        this.distribute = 0;
        this.siteId = 0L;
        this.siteCode = "";
        this.siteName = "";
        this.selected = 1;
    }
}