package cn.ysk.cashier.pojo;

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.io.Serializable;

@Entity
@Data
@Table(name="tb_platform_dict_type")
public class TbPlatformDictType implements Serializable {

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

    @Column(name = "`name`")
    @ApiModelProperty(value = "类型名称")
    private String name;

    @Column(name = "`key`")
    @ApiModelProperty(value = "类型标识")
    private String key;

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

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