package com.sy.coinage.log.model;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Date;

import com.alibaba.fastjson2.annotation.JSONField;
import com.sy.coinage.core.annotation.Conver;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * 登入登出记录实体类
 */
@Data
@EqualsAndHashCode(callSuper = false)

@TableName("sys_login_log")
@ApiModel(value = "登入登出记录对象", description = "登入登出记录")
public class LoginLog implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 自增主键 -10
     */
    @ApiModelProperty(value = "自增主键")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 类型(1-登入,2-登出) -3
     */
    @ApiModelProperty(value = "类型(1-登入,2-登出)")
    @TableField(value = "type")
    @Conver(keys = {"1", "2"}, values = {"登入", "登出"})
    private Integer type;

    /**
     * 用户id -10
     */
    @ApiModelProperty(value = "用户id")
    @TableField(value = "user_id")
    private Integer userId;

    /**
     * 姓名 -10
     */
    @ApiModelProperty(value = "姓名")
    @TableField(value = "real_name")
    private String realName;

    /**
     * 用户名 -16
     */
    @ApiModelProperty(value = "用户名")
    @TableField(value = "username")
    private String username;

    /**
     * 操作ip -16
     */
    @ApiModelProperty(value = "请求ip")
    @TableField(value = "ip")
    private String ip;

    /**
     * 创建时间 -19
     */
    @ApiModelProperty(value = "创建时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    /**
     * 租户id -10
     */
    @ApiModelProperty(value = "租户id")
    @TableField(value = "tenant_id")
    private Integer tenantId;

}
