ard-work/src/main/java/com/ruoyi/storage/minio/service/impl/StorageMinioEventServiceImpl.java
@@ -106,12 +106,14 @@ @Async @Override public void parseStorageMinioEvent(String message) { try { JsonsRootBean jsonsRootBean = JSONObject.parseObject(message, JsonsRootBean.class); if (jsonsRootBean != null) { Records records = jsonsRootBean.getRecords().get(0); StorageMinioEvent storageMinioEvent = new StorageMinioEvent(); storageMinioEvent.setEventTime(records.getEventTime()); storageMinioEvent.setEventType(records.getEventName()); String eventType = records.getEventName().substring(0, records.getEventName().indexOf(":", records.getEventName().indexOf(":") + 1));//不包含本身位置 storageMinioEvent.setEventType(eventType); storageMinioEvent.setBucketName(records.getS3().getBucket().getName()); String encode = null; try { @@ -127,10 +129,14 @@ storageMinioEvent.setUserName(records.getRequestParameters().getPrincipalid()); int i = insertStorageMinioEvent(storageMinioEvent); if(i>0) { if (i > 0) { log.debug("minio操作日志入库成功!【"+storageMinioEvent.getEventType()+"】"); } } } catch (Exception ex) { log.error("minio事件格式化异常:"+ex.getMessage()); } } } ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysUserOnlineController.java
@@ -1,9 +1,7 @@ package com.ruoyi.web.controller.monitor; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.DeleteMapping; @@ -75,6 +73,9 @@ } Collections.reverse(userOnlineList); userOnlineList.removeAll(Collections.singleton(null)); //在线用户按登录时间逆序排序 Comparator<SysUserOnline> comparator = Comparator.comparingLong(sysUserOnline -> sysUserOnline.getLoginTime()); // 使用Collections.sort方法进行排序 Collections.sort(personList, comparator); Collections.sort(userOnlineList, comparator.reversed()); return getDataTable(userOnlineList); }