package cn.common.repository.entity;

import cn.common.common.entity.BaseEntity;
import cn.common.common.utils.spring.SnowflakeIdWorker;
import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.*;
import java.time.Instant;
import java.util.Date;

/**
 * @author Singer create by singer email:singer-coder@qq.com
 * @projectName health-platform-api
 * @Description: 系统登陆日志实体
 * @date 2019-08-20
 */
@Data
@TableName("platform_login_log")
public class PlatformLoginLog extends BaseEntity implements Serializable {


    private static final long serialVersionUID = 4871041033499766328L;

    /**
     * 系统登陆日志主键ID
     */
    private String platformLoginLogId = SnowflakeIdWorker.uniqueMainId();


    /**
     * 用户名称
     */
    private String userName;

    /**
     * 登录时间
     */
    @JSONField(format="yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date loginTime = Date.from(Instant.now());

    /**
     * 登录地点
     */
    private String location;

    /**
     * 登陆IP
     */
    private String loginIp;

}
