package com.ktg.common.core.domain.model;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * Bean基类
 *
 * @author ruoyi
 */
@Data
public class BaseBean implements Serializable
{
    private static final long serialVersionUID = 1L;

    @Schema(description = "创建人")
    @TableField(fill = FieldFill.INSERT)
    private String createBy;

    @JsonFormat(timezone="GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @Schema(description = "创建时间")
    private Date createTime;

    /** 更新者 */
    @Schema(description = "更新者")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private String updateBy;

    /** 更新时间 */
    @JsonFormat(timezone="GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @Schema(description = "更新时间")
    private Date updateTime;

    /** 备注 */
    @Schema(description = "备注")
    private String remark;

    @ApiModelProperty(value = "权限数据")
    @TableField(exist = false)
    private Map<String, Object> paramMap;

    public Map<String, Object> getParamMap()
    {
        if (paramMap == null)
        {
            paramMap = new HashMap<>();
        }
        return paramMap;
    }

    public void setParamMap(Map<String, Object> paramMap)
    {
        this.paramMap = paramMap;
    }

}
