package com.fuyuanshen.equipment.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.baomidou.mybatisplus.annotation.*;
import com.fuyuanshen.common.tenant.core.TenantEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;

/**
 * @Description: 设备类型
 * @Author: WY
 * @Date: 2025/5/14
 **/
@Data
@TableName("device_type")
public class DeviceType extends TenantEntity {

    @TableId(value = "id", type = IdType.AUTO)
    @Schema(name = "ID", hidden = true)
    private Long id;

    @Schema(name = "客户号")
    private Long customerId;

    @Schema(name = "创建该类型的客户")
    private Long ownerCustomerId;

    /**
     * 原始所有者（创建者）
     * original_owner_id
     */
    @Schema(name = "原始所有者（创建者）")
    private Long originalOwnerId;

    /**
     * 原始设备
     */
    @Schema(name = "原始设备类型")
    private Long originalDeviceId;

    @NotBlank(message = "设备类型名称不能为空")
    @Schema(name = "类型名称", required = true)
    private String typeName;

    @Schema(name = "是否支持蓝牙")
    private Boolean isSupportBle;

    @Schema(name = "定位方式", example = "0:无;1:GPS;2:基站;3:wifi;4:北斗")
    private String locateMode;

    @Schema(name = "联网方式", example = "0:无;1:4G;2:WIFI")
    private String networkWay;

    @Schema(name = "通讯方式", example = "0:4G;1:蓝牙")
    private String communicationMode;

    /**
     * 创建人名称
     */
    private String createByName;

    public void copy(DeviceType source) {
        BeanUtil.copyProperties(source, this, CopyOptions.create().setIgnoreNullValue(true));
    }

}
