package com.vetti.hotake.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.vetti.common.annotation.Excel;
import com.vetti.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.Date;

/**
 * 用户安全设置对象 hotake_security_settings
 *
 * @author vetti
 * @date 2026-02-02
 */
@Data
@Accessors(chain = true)
@ApiModel("用户安全设置")
public class HotakeSecuritySettings extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 主键ID */
    @ApiModelProperty("主键ID")
    private Long id;

    /** 用户ID */
    @ApiModelProperty("用户ID")
    @Excel(name = "用户ID")
    private Long userId;

    /** 是否启用两步验证 0-否 1-是 */
    @ApiModelProperty("是否启用两步验证 0-否 1-是")
    @Excel(name = "是否启用两步验证", readConverterExp = "0=否,1=是")
    private Integer twoFactorEnabled;

    /** 两步验证密钥 */
    @ApiModelProperty("两步验证密钥")
    private String twoFactorSecret;

    /** 两步验证类型 TOTP/SMS/EMAIL */
    @ApiModelProperty("两步验证类型")
    @Excel(name = "两步验证类型")
    private String twoFactorType;

    /** 备份验证码(JSON格式) */
    @ApiModelProperty("备份验证码")
    private String backupCodes;

    /** 密码最后修改时间 */
    @ApiModelProperty("密码最后修改时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "密码最后修改时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date passwordChangedAt;

    /** 密码重置令牌 */
    @ApiModelProperty("密码重置令牌")
    private String passwordResetToken;

    /** 密码重置令牌过期时间 */
    @ApiModelProperty("密码重置令牌过期时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date passwordResetExpires;

    /** 失败登录尝试次数 */
    @ApiModelProperty("失败登录尝试次数")
    @Excel(name = "失败登录尝试次数")
    private Integer failedLoginAttempts;

    /** 账户锁定截止时间 */
    @ApiModelProperty("账户锁定截止时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "账户锁定截止时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date accountLockedUntil;
}
