package me.zhengjie.modules.dm.video.domain;

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

import javax.persistence.*;
import java.io.Serializable;

@Entity
@Data
@Table(name="dm_video")
public class DmVideo implements Serializable {

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

    @Column(name = "path")
    @ApiModelProperty(value = "视频路径")
    private String path;

    public DmVideo(String path) {
        this.path = path;
    }

    public DmVideo() {

    }

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