package com.fjhx.entity.tda;

import com.fjhx.base.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tool.utils.ObjectUtil;

/**
 * <p>
 *
 * </p>
 *
 * @author ${author}
 * @since 2022-07-21
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class TdaProduct extends BaseEntity {


    /**
     * 资源空间表id
     */
    private Long tdaApplicationId;

    /**
     * 华为tda资源空间id
     */
    private String appId;

    /**
     * 华为tda产品id
     */
    private String productId;

    /**
     * 华为tda产品名称
     */
    private String name;

    /**
     * 华为tda产品设备类型
     */
    private String deviceType;

    /**
     * 华为tda产品厂商名称
     */
    private String manufacturerName;

    /**
     * 协议类型 默认MQTT
     */
    private String protocolType;

    /**
     * 数据格式 默认json
     */
    private String dataFormat;

    public String getProtocolType() {
        if (ObjectUtil.isEmpty(protocolType)) return "MQTT";
        return protocolType;
    }

    public String getDataFormat() {
        if (ObjectUtil.isEmpty(dataFormat)) return "json";
        return dataFormat;
    }
}
