/*
*  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 me.zhengjie.modules.dm.printingQueue.domain;

import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import me.zhengjie.modules.dm.printingRequest.domain.DmPrintingRequest;

import javax.persistence.*;
import javax.validation.constraints.*;
import java.sql.Timestamp;
import java.io.Serializable;

/**
* @website https://el-admin.vip
* @description /
* @author xwx
* @date 2021-03-17
**/
@Entity
@Data
@Table(name="dm_printing_queue")
public class DmPrintingQueue implements Serializable {

    @Id
    @Column(name = "id")
    @ApiModelProperty(value = "主键")
    private Long id;

    @OneToOne
    @JoinColumn(name = "request_id")
    @ApiModelProperty(value = "打印申请")
    private DmPrintingRequest printingRequest;

    @Column(name = "start_time")
    @ApiModelProperty(value = "进入队列时间")
    private Timestamp startTime;

    @Column(name = "status")
    @ApiModelProperty(value = "状态")
    private String status;

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