/*
*  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 me.zhengjie.modules.dm.floor.domain;

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 javax.persistence.Entity;
import javax.persistence.Table;

import me.zhengjie.base.BaseEntity;
import org.hibernate.annotations.*;
import java.sql.Timestamp;
import java.io.Serializable;

/**
* @website https://el-admin.vip
* @description /
* @author shiguangji
* @date 2021-03-11
**/
@Entity
@Data
@Table(name="dm_floor")
public class DmFloor extends BaseEntity implements Serializable {

    @Id
    @Column(name = "floor_id")
    @ApiModelProperty(value = "主键")
    private Long floorId;

    @Column(name = "floor_name",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "楼层名称")
    private String floorName;

    @Column(name = "floor_pic",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "楼层负责人(person in charge)")
    private String floorPic;

    @Column(name = "contacts",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "联系方式")
    private String contacts;

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

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