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 java.sql.Timestamp;
import java.io.Serializable;

/**
 * @author ww
 **/
@Entity
@Data
@Table(name="tb_shop_video")
public class TbShopVideo implements Serializable {

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

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

    @Column(name = "`name`")
    @ApiModelProperty(value = "描述信息")
    private String name;

    @Column(name = "`channel_id`")
    @ApiModelProperty(value = "渠道id(视频号id)")
    private Integer channelId;

    @Column(name = "`type`")
    @ApiModelProperty(value = "1-公众号；2-小程序；3-视频号；")
    private Integer type;

    @Column(name = "`source_id`")
    @ApiModelProperty(value = "资源Id(视频号id)(公众号id)")
    private Integer sourceId;

    @Column(name = "`source_url`")
    @ApiModelProperty(value = "资源地址")
    private String sourceUrl;

    @Column(name = "`status`")
    @ApiModelProperty(value = "0:关闭；1：开启；")
    private Integer status;

    @Column(name = "`created_time`")
    @ApiModelProperty(value = "创建时间")
    private Timestamp createdTime;

    @Column(name = "`update_time`")
    @ApiModelProperty(value = "更新时间")
    private Timestamp updateTime;

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