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(title = "ID", hidden = true)
    private Long id;

    /**
     * 设备类型ID
     */
    @TableField(exist = false)
    private Long deviceTypeId;

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

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

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

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

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

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

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

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

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

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

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

    /**
     * 型号字典用于APP页面跳转
     * app_model_dictionary
     */
    @Schema(title = "型号字典用于APP页面跳转")
    private String appModelDictionary;

    /**
     * 型号字典用于PC页面跳转
     * pc_model_dictionary
     */
    @Schema(title = "型号字典用于PC页面跳转")
    private String pcModelDictionary;


}
