/**
 * Copyright 2008-2009. Chongqing Communications Industry Services Co.,Ltd Information Technology Branch. All rights reserved.
 * <a>http://www.crunii.com</a>
 */
package com.crunii.micro.domain.entity.main;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.util.Date;

/**
 * @author shenhs create 2023/7/12 14:51
 */
@Entity
@Table(name = "TSM_LOGIN_LOG")
@NamedQuery(name = "TsmLoginLog.findAll", query = "SELECT t FROM TsmLoginLog t")
@DynamicInsert
@DynamicUpdate
@Getter
@Setter
@ToString
@EqualsAndHashCode(of = { "id" })
@ApiModel(description = "登录日志表")
@GenericGenerator(name = "idGenerator", strategy = "com.crunii.micro.core.distributed.DistributedSnowFlakeId")
public class TsmLoginLog {

	@Id
	@GeneratedValue(generator = "idGenerator")
	@Column(name = "id")
	@ApiModelProperty(value = "主键")
	private Long id;

	@Column(name = "mobile")
	@ApiModelProperty(value = "手机号")
	private String mobile;

	@Column(name = "ip")
	@ApiModelProperty(value = "ip地址")
	private String ip;

	@Column(name = "cn_ip")
	@ApiModelProperty(value = "是否中国IP：1是 0否")
	private Integer cnIp;

	@Column(name = "ip_location")
	@ApiModelProperty(value = "ip在现实生活中的地址")
	private String ipLocation;

	@Column(name = "os")
	@ApiModelProperty(value = "操作系统")
	private String os;

	@Column(name = "login_time")
	@ApiModelProperty(value = "登录时间")
	private Date loginTime;

	@Column(name = "login_status")
	@ApiModelProperty(value = "登录状态")
	private Integer loginStatus;

	@Column(name = "login_type")
	@ApiModelProperty(value = "登录方式：密码登录、短信验证码登录")
	private String loginType;

	@Column(name = "client_type")
	@ApiModelProperty(value = "客户端类型：WEB、PHONE、SSO")
	private String clientType;

	@Column(name = "user_agent")
	@ApiModelProperty(value = "客户端ua")
	private String userAgent;

}
