/*
*  Copyright 2019-2020 Zheng Jie
*
*  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 cn.ysk.cashier.pojo.shop;

import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.io.Serializable;

/**
* @website https://eladmin.vip
* @description /
* @author lyf
* @date 2024-02-28
**/
@Entity
@Data
@Table(name="tb_print_machine")
public class TbPrintMachine implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "`id`")
    @ApiModelProperty(value = "id")
    private Integer id;

    @Column(name = "`name`",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "设备名称")
    private String name;

    @Column(name = "`type`")
    @ApiModelProperty(value = "printer")
    private String type;

    @Column(name = "`connection_type`")
    @ApiModelProperty(value = "现在打印机支持USB 和 网络、蓝牙")
    private String connectionType;

    @Column(name = "`address`")
    @ApiModelProperty(value = "ip地址")
    private String address;

    @Column(name = "`port`")
    @ApiModelProperty(value = "端口")
    private String port;

    @Column(name = "`sub_type`")
    @ApiModelProperty(value = "打印类型（分类）")
    private String subType;

    @Column(name = "`status`")
    @ApiModelProperty(value = "状态 online")
    private Integer status;

    @Column(name = "`shop_id`")
    @ApiModelProperty(value = "店铺Id")
    private String shopId;

    @Column(name = "`category_ids`")
    @ApiModelProperty(value = "分类Id")
    private String categoryIds;

    @Column(name = "`content_type`")
    @ApiModelProperty(value = "现在打印机支持USB 和 网络两种")
    private String contentType;

    @Column(name = "`config`")
    @ApiModelProperty(value = "主配置")
    private String config;

    @Column(name = "`created_at`")
    @ApiModelProperty(value = "createdAt")
    private Long createdAt;

    @Column(name = "`updated_at`")
    @ApiModelProperty(value = "updatedAt")
    private Long updatedAt;

    @Column(name = "`category_list`")
    @ApiModelProperty(value = "分类")
    private String categoryList;

    @Column(name = "`sort`")
    @ApiModelProperty(value = "排序")
    private Integer sort;

    @Column(name = "`vendor_id`")
    @ApiModelProperty(value = "Android打印机需要标识设备ID ")
    private String vendorId;

    @Column(name = "`product_id`")
    @ApiModelProperty(value = "Android打印机需要标识设备ID ")
    private String productId;

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