/*
*  Copyright 2019-2025 Tz
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.modules.system.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.sql.Timestamp;

/**
* @description /
* @author tz
* @date 2025-05-21
**/
@Data
@TableName("bus_device_command")
public class BusDeviceCommand implements Serializable {

    @TableId(value = "id", type = IdType.AUTO)
    @ApiModelProperty(value = "指令唯一标识")
    private Long id;

    @ApiModelProperty(value = "指令代码（唯一）")
    private Long deviceId;

    @ApiModelProperty(value = "指令名称")
    private String commandName;

    @ApiModelProperty(value = "指令类型（FILE_TRANSFER=文件传输，PRINT_CONTROL=打印控制，VIDEO_STREAM=视频）")
    private String commandType;

    @ApiModelProperty(value = "指令描述")
    private String description;

    @ApiModelProperty(value = "状态：1有效，0无效")
    private Integer status;

    @ApiModelProperty(value = "指令参数（JSON格式）")
    private String commandParams;

    @ApiModelProperty(value = "创建者")
    private String createBy;

    @ApiModelProperty(value = "更新者")
    private String updateBy;

    @ApiModelProperty(value = "创建时间")
    private Timestamp createTime;

    @ApiModelProperty(value = "更新时间")
    private Timestamp updateTime;

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