package cn.reghao.bnt.web.admin.model.po;

import cn.reghao.bnt.web.util.BaseEntity;
import lombok.*;

import jakarta.persistence.Entity;
import jakarta.persistence.Table;

/**
 * @author reghao
 * @date 2024-10-12 11:32:15
 */
@NoArgsConstructor
@AllArgsConstructor
@Setter
@Getter
@Data
@Entity
@Table(name = "sys_login_attempt")
public class LoginAttempt extends BaseEntity {
    private String loginId;
    private Integer userId;
    private Integer loginType;
    private Integer plat;
    private Long loginAt;
    private String loginIp;
    private String userAgent;
    private Boolean rememberMe;
    private Boolean success;

    public LoginAttempt(String loginId, int userId, int plat, String loginIp,
                        int loginType, String userAgent, boolean rememberMe) {
        this.loginId = loginId;
        this.userId = userId;
        this.loginType = loginType;
        this.plat = plat;
        this.loginAt = System.currentTimeMillis();
        this.loginIp = loginIp;
        this.userAgent = userAgent;
        this.rememberMe = rememberMe;
        this.success = true;
    }
}
