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 javax.validation.constraints.*;
import java.io.Serializable;

@Entity
@Data
@Table(name="tb_platform_dict")
public class TbPlatformDict 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 = "`value`")
    @ApiModelProperty(value = "值")
    private String value;

    @Column(name = "`font_color`")
    @ApiModelProperty(value = "字体色")
    private String fontColor;

    @Column(name = "`back_color`")
    @ApiModelProperty(value = "背景色")
    private String backColor;

    @Column(name = "`jump_type`")
    @ApiModelProperty(value = "类型: scan：拉起相机；relative：内部页面；absolute：外链url  ")
    private String jumpType;

    @NotBlank
    @ApiModelProperty(value = "homeDistrict--金刚区（首页） \n" +
            "carousel--轮播图  \n" +
            "proTag--商品标签  \n" +
            "shopTag--店铺标签\n" +
            "icon--小图标\n" +
            "subShop--预约到店顶部图\n" +
            "数字--数字为团购卷分类id\n" +
            "ownMenu--个人中心菜单")
    private String type;

    @Column(name = "`cover_img`")
    @ApiModelProperty(value = "展示图")
    private String coverImg;

    @Column(name = "`share_img`")
    @ApiModelProperty(value = "标签前小图标")
    private String shareImg;

    @ApiModelProperty(value = "视频URL地址")
    private String video;

    @Column(name = "`video_cover_img`")
    @ApiModelProperty(value = "视频封面图")
    private String videoCoverImg;

    @Column(name = "`abs_url`")
    @ApiModelProperty(value = "绝对跳转地址")
    private String absUrl;

    @Column(name = "`created_at`")
    @ApiModelProperty(value = "创建时间")
    private Long createdAt;

    @Column(name = "`updated_at`")
    @ApiModelProperty(value = "更新时间")
    private Long updatedAt;

    @Column(name = "`is_show_cash`")
    @ApiModelProperty(value = "收银端展示 0:不展示 1:展示")
    private Integer isShowCash;

    @Column(name = "`is_show_mall`")
    @ApiModelProperty(value = "小程序端展示 0:不展示 1:展示")
    private Integer isShowMall;

    @Column(name = "`is_show_app`")
    @ApiModelProperty(value = "APP端展示 0:不展示 1:展示")
    private Integer isShowApp;

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

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