yzx 4 dagen geleden
bovenliggende
commit
9c3af4a609

+ 8 - 0
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java

@@ -103,7 +103,15 @@ public class SysUser extends BaseEntity
 
     /** 岗位组 */
     private Long[] postIds;
+    /** 分机号 */
+    private Long extNum;
+    public Long getExtNum() {
+        return extNum;
+    }
 
+    public void setExtNum(Long extNum) {
+        this.extNum = extNum;
+    }
     public SysUser()
     {
 

+ 33 - 0
ruoyi-common/src/main/java/com/ruoyi/common/utils/DateUtils.java

@@ -192,4 +192,37 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
     public static String format(Date date, String dateFormat) {
         return DateFormatUtils.format(date, dateFormat);
     }
+
+    /**
+     * 格式化时间长度(秒转为可读格式,自动省略为 0 的单位)
+     * @param timeLenSeconds 时间长度(秒)
+     * @return 格式化后的时间字符串,如:1 天 2 小时 3 分 4 秒、36 秒、1 小时 5 分等
+     */
+    public static String formatTimeLength(long timeLenSeconds) {
+        if (timeLenSeconds <= 0) {
+            return "0 秒";
+        }
+
+        long days = timeLenSeconds / (24 * 3600);
+        long hours = (timeLenSeconds % (24 * 3600)) / 3600;
+        long minutes = (timeLenSeconds % 3600) / 60;
+        long seconds = timeLenSeconds % 60;
+
+        StringBuilder result = new StringBuilder();
+
+        if (days > 0) {
+            result.append(days).append("天");
+        }
+        if (hours > 0) {
+            result.append(hours).append("小时");
+        }
+        if (minutes > 0) {
+            result.append(minutes).append("分");
+        }
+        if (seconds > 0 || result.length() == 0) {
+            result.append(seconds).append("秒");
+        }
+
+        return result.toString();
+    }
 }

+ 4 - 0
ruoyi-framework/src/main/java/com/ruoyi/framework/config/ShiroConfig.java

@@ -310,6 +310,10 @@ public class ShiroConfig
         filterChainDefinitionMap.put("/aicall/api/test/localChat", "anon");
         filterChainDefinitionMap.put("/api/ai/chat/stream", "anon");
 
+        //开放公共api所有接口
+        filterChainDefinitionMap.put("/aicall/api/**", "anon");
+
+
         // 匿名访问不鉴权注解列表
         List<String> permitAllUrl = SpringUtils.getBean(PermitAllUrlProperties.class).getUrls();
         if (StringUtils.isNotEmpty(permitAllUrl))