/*
*  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 com.youchain.user.domain;

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

/**
* @website https://eladmin.vip
* @description /
* @author DengJiangKun
* @date 2024-01-25
**/
@Entity
@Data
@Table(name="user_el_table_config")
public class ElTableConfig  extends BaseEntity implements Serializable {

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

    @Column(name = "`vue_url`")
    @ApiModelProperty(value = "页面的url")
    private String vueUrl;

    @Column(name = "`tag_style`")
    @ApiModelProperty(value = "tag的样式")
    private String tagStyle;

    @Column(name = "`vue_style`")
    @ApiModelProperty(value = "文字的样式")
    private String vueStyle;

    @Column(name = "`vue_path`")
    @ApiModelProperty(value = "页面存储路径")
    private String vuePath;

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

    @Column(name = "`default_content`")
    @ApiModelProperty(value = "没有数据时显示的内容")
    private String defaultContent;

    @Column(name = "`prop_name`")
    @ApiModelProperty(value = "字段名")
    private String propName;

    @Column(name = "`label_name`")
    @ApiModelProperty(value = "字段展示名")
    private String labelName;

    @Column(name = "`field_type`")
    @ApiModelProperty(value = "字段的存储类型")
    private String fieldType;

    @Column(name = "`i_icon`")
    @ApiModelProperty(value = "ioc图片")
    private String iIcon;

    @Column(name = "`tf_icon`",nullable = false)
    @NotNull
    @ApiModelProperty(value = "ioc图片是否展示")
    private Boolean tfIcon;

    @Column(name = "`tf_show_overflow_tooltip`",nullable = false)
    @NotNull
    @ApiModelProperty(value = "内容过度使用这个开关")
    private Boolean tfShowOverflowTooltip;

    @Column(name = "`tf_sortable`",nullable = false)
    @NotNull
    @ApiModelProperty(value = "排序开关|自定义自己加")
    private Boolean tfSortable;

    @Column(name = "`tf_el_tag`",nullable = false)
    @NotNull
    @ApiModelProperty(value = "tag开关")
    private Boolean tfElTag;

    @Column(name = "`tag_type`")
    @ApiModelProperty(value = "tag属性")
    private String tagType;

    @Column(name = "`user_id`")
    @ApiModelProperty(value = "用户id")
    private Long userId;

    @Column(name = "`tf_show`",nullable = false)
    @NotNull
    @ApiModelProperty(value = "是否展示")
    private Boolean tfShow;

    @Column(name = "`remarks`")
    @ApiModelProperty(value = "备注")
    private String remarks;

//    @Column(name = "`create_by`")
//    @ApiModelProperty(value = "创建者")
//    private String createBy;
//
//    @Column(name = "`update_by`")
//    @ApiModelProperty(value = "更新者")
//    private String updateBy;
//
//    @Column(name = "`create_time`")
//    @ApiModelProperty(value = "创建日期")
//    private Timestamp createTime;
//
//    @Column(name = "`update_time`")
//    @ApiModelProperty(value = "更新时间")
//    private Timestamp updateTime;

    @Column(name = "`width`",nullable = false)
    @NotNull
    @ApiModelProperty(value = "宽")
    private Integer width;

    @Column(name = "`page_no`",nullable = false)
    @NotNull
    @ApiModelProperty(value = "页面号")
    private Integer pageNo;

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