package com.zhongshu.card.client.model.devices.deviceProduct;

import com.github.microservice.models.type.DeviceSpecType;
import com.github.microservice.models.type.DeviceType;
import com.zhongshu.card.client.model.base.SuperModel;
import com.zhongshu.card.client.model.devices.DeviceInfoModel;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.ObjectUtils;

/**
 * @author TRX
 * @date 2025/1/8
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class DeviceProductBindDeviceModel extends SuperModel {

    @Schema(description = "所属产品")
    private DeviceProductModel deviceProduct;

    private String deviceProductId;

    public String getDeviceProductId() {
        if (ObjectUtils.isNotEmpty(deviceProduct)) {
            return deviceProduct.getId();
        }
        return "";
    }

    @Schema(description = "设备信息")
    private DeviceInfoModel deviceInfo;

    @Schema(description = "设备ID、设备号")
    private String deviceId;

    @Schema(description = "设备名称")
    private String deviceName;

    @Schema(description = "设备类型，如 消费机 门禁机")
    private DeviceType deviceType;

    @Schema(description = "设备型号")
    private DeviceSpecType deviceModel;

}
