| | |
| | | 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; |
| | |
| | | } |
| | | 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); |
| | | } |
| | | |