package com.dk.mdm.model.vo.core;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.dk.common.infrastructure.annotaiton.ExportTitle;
import com.dk.common.infrastructure.handler.TimestampTypeHandler;
import com.dk.common.infrastructure.handler.UuidTypeHandler;
import com.dk.common.model.pojo.PageInfo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 *  用户权限
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@ExportTitle("用户权限")
@TableName(value = "t_user_right", autoResultMap = true)
@ApiModel(value="实体类：用户权限", description="表名：t_user_right")
public class UserRightVO extends PageInfo<UserRightVO> implements Serializable {

    /*
     * 数据库字段
     */

    /**
     * 用户ID
     */
    @TableId(value = "user_id", type = IdType.AUTO)
    @ApiModelProperty(value = "用户ID")
    private Integer userId;


    /**
     * 功能ID
     */
    @Excel(name = "功能ID")
    @ApiModelProperty(value = "功能ID")
    @TableField(typeHandler = UuidTypeHandler.class)
    private String funUuid;


    /**
     * 授权类型 (1：追加 -1：拒绝)
     */
    @Excel(name = "授权类型 (1：追加 -1：拒绝)")
    @ApiModelProperty(value = "授权类型 (1：追加 -1：拒绝)")
    private Integer rightType;


    /**
     * 应用代码
     */
    @Excel(name = "应用代码")
    @ApiModelProperty(value = "应用代码")
    private String appCode;


    /**
     * 工厂ID
     */
    @Excel(name = "工厂ID")
    @ApiModelProperty(value = "工厂ID")
    private Integer ftyId;


    /**
     * 创建时间 (触发器自动处理)
     */
    @Excel(name = "创建时间 (触发器自动处理)", format = "yyyy-MM-dd HH:mm:ss", width = 20)
    @ApiModelProperty(value = "创建时间 (触发器自动处理)")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField(typeHandler = TimestampTypeHandler.class)
    private LocalDateTime opCreateTime;


    /**
     * 创建用户 (触发器自动处理)
     */
    @Excel(name = "创建用户 (触发器自动处理)")
    @ApiModelProperty(value = "创建用户 (触发器自动处理)")
    private Long opCreateUserId;


    /*
     * 相关属性
     * @TableField(exist = false)
     */

    /*
     * 关联属性 + 查询条件
     * @TableField(exist = false)
     */


    private static final long serialVersionUID = 1L;

}
