From ab6dd7555377d0d5fe3a78149c0cdb98e2f15275 Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期三, 11 三月 2026 13:38:51 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/system/entity/User.java |   92 +++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 86 insertions(+), 6 deletions(-)

diff --git a/src/main/java/com/zy/system/entity/User.java b/src/main/java/com/zy/system/entity/User.java
index c5086aa..78f470d 100644
--- a/src/main/java/com/zy/system/entity/User.java
+++ b/src/main/java/com/zy/system/entity/User.java
@@ -1,13 +1,14 @@
 package com.zy.system.entity;
 
-import com.baomidou.mybatisplus.annotations.TableField;
-import com.baomidou.mybatisplus.annotations.TableId;
-import com.baomidou.mybatisplus.annotations.TableName;
-import com.baomidou.mybatisplus.enums.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
 import com.core.common.Cools;
 import com.core.common.SpringUtils;
 import com.zy.system.service.HostService;
 import com.zy.system.service.RoleService;
+import org.springframework.format.annotation.DateTimeFormat;
 
 import java.io.Serializable;
 import java.text.SimpleDateFormat;
@@ -48,6 +49,31 @@
     private String password;
 
     /**
+     * 鏄惁鍏佽浣跨敤 MFA
+     */
+    @TableField("mfa_allow")
+    private Integer mfaAllow;
+
+    /**
+     * 鏄惁宸插惎鐢� MFA
+     */
+    @TableField("mfa_enabled")
+    private Integer mfaEnabled;
+
+    /**
+     * MFA 瀵嗛挜
+     */
+    @TableField(value = "mfa_secret", select = false)
+    private String mfaSecret;
+
+    /**
+     * MFA 缁戝畾鏃堕棿
+     */
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @TableField("mfa_bound_time")
+    private Date mfaBoundTime;
+
+    /**
      * 瑙掕壊
      */
     @TableField("role_id")
@@ -56,6 +82,7 @@
     /**
      * 娉ㄥ唽鏃堕棿
      */
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
     @TableField("create_time")
     private Date createTime;
 
@@ -82,7 +109,7 @@
 
     public String getHostName() {
         HostService service = SpringUtils.getBean(HostService.class);
-        Host host = service.selectById(this.hostId);
+        Host host = service.getById(this.hostId);
         if (!Cools.isEmpty(host)){
             return host.getName();
         }
@@ -113,13 +140,66 @@
         this.password = password;
     }
 
+    public Integer getMfaAllow() {
+        return mfaAllow;
+    }
+
+    public String getMfaAllow$() {
+        if (null == this.mfaAllow) {
+            return null;
+        }
+        return Integer.valueOf(1).equals(this.mfaAllow) ? "鏄�" : "鍚�";
+    }
+
+    public void setMfaAllow(Integer mfaAllow) {
+        this.mfaAllow = mfaAllow;
+    }
+
+    public Integer getMfaEnabled() {
+        return mfaEnabled;
+    }
+
+    public String getMfaEnabled$() {
+        if (null == this.mfaEnabled) {
+            return null;
+        }
+        return Integer.valueOf(1).equals(this.mfaEnabled) ? "鏄�" : "鍚�";
+    }
+
+    public void setMfaEnabled(Integer mfaEnabled) {
+        this.mfaEnabled = mfaEnabled;
+    }
+
+    public String getMfaSecret() {
+        return mfaSecret;
+    }
+
+    public void setMfaSecret(String mfaSecret) {
+        this.mfaSecret = mfaSecret;
+    }
+
+    public Date getMfaBoundTime() {
+        return mfaBoundTime;
+    }
+
+    public String getMfaBoundTime$() {
+        if (Cools.isEmpty(this.mfaBoundTime)) {
+            return "";
+        }
+        return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.mfaBoundTime);
+    }
+
+    public void setMfaBoundTime(Date mfaBoundTime) {
+        this.mfaBoundTime = mfaBoundTime;
+    }
+
     public Long getRoleId() {
         return roleId;
     }
 
     public String getRoleName(){
         RoleService service = SpringUtils.getBean(RoleService.class);
-        Role role = service.selectById(this.roleId);
+        Role role = service.getById(this.roleId);
         if (!Cools.isEmpty(role)){
             return role.getName();
         }

--
Gitblit v1.9.1