diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/manager/factory/AsyncFactory.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/manager/factory/AsyncFactory.java index 4542e84f..d924af51 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/manager/factory/AsyncFactory.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/manager/factory/AsyncFactory.java @@ -14,8 +14,8 @@ import com.ruoyi.system.domain.SysLogininfor; import com.ruoyi.system.domain.SysOperLog; import com.ruoyi.system.domain.SysUserOnline; import com.ruoyi.system.service.ISysOperLogService; +import com.ruoyi.system.service.ISysUserOnlineService; import com.ruoyi.system.service.impl.SysLogininforServiceImpl; -import com.ruoyi.system.service.impl.SysUserOnlineServiceImpl; import eu.bitwalker.useragentutils.UserAgent; /** @@ -53,7 +53,7 @@ public class AsyncFactory online.setBrowser(session.getBrowser()); online.setOs(session.getOs()); online.setStatus(session.getStatus()); - SpringUtils.getBean(SysUserOnlineServiceImpl.class).saveOnline(online); + SpringUtils.getBean(ISysUserOnlineService.class).saveOnline(online); } }; diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/shiro/session/OnlineSessionDAO.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/shiro/session/OnlineSessionDAO.java index d7d3039e..4f20fbb5 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/shiro/session/OnlineSessionDAO.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/shiro/session/OnlineSessionDAO.java @@ -10,7 +10,7 @@ import com.ruoyi.common.enums.OnlineStatus; import com.ruoyi.framework.manager.AsyncManager; import com.ruoyi.framework.manager.factory.AsyncFactory; import com.ruoyi.system.domain.SysUserOnline; -import com.ruoyi.system.service.impl.SysUserOnlineServiceImpl; +import com.ruoyi.system.service.ISysUserOnlineService; /** * 针对自定义的ShiroSession的db操作 @@ -31,7 +31,7 @@ public class OnlineSessionDAO extends EnterpriseCacheSessionDAO private static final String LAST_SYNC_DB_TIMESTAMP = OnlineSessionDAO.class.getName() + "LAST_SYNC_DB_TIMESTAMP"; @Autowired - private SysUserOnlineServiceImpl onlineService; + private ISysUserOnlineService onlineService; public OnlineSessionDAO() { diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/shiro/web/session/OnlineWebSessionManager.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/shiro/web/session/OnlineWebSessionManager.java index c79d6ac5..1c8edc6f 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/shiro/web/session/OnlineWebSessionManager.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/shiro/web/session/OnlineWebSessionManager.java @@ -17,7 +17,7 @@ import com.ruoyi.common.constant.ShiroConstants; import com.ruoyi.framework.shiro.session.OnlineSession; import com.ruoyi.framework.util.SpringUtils; import com.ruoyi.system.domain.SysUserOnline; -import com.ruoyi.system.service.impl.SysUserOnlineServiceImpl; +import com.ruoyi.system.service.ISysUserOnlineService; /** * 主要是在此如果会话的属性修改了 就标识下其修改了 然后方便 OnlineSessionDao同步 @@ -90,7 +90,7 @@ public class OnlineWebSessionManager extends DefaultWebSessionManager int timeout = (int) this.getGlobalSessionTimeout(); Date expiredDate = DateUtils.addMilliseconds(new Date(), 0 - timeout); - SysUserOnlineServiceImpl userOnlineService = SpringUtils.getBean(SysUserOnlineServiceImpl.class); + ISysUserOnlineService userOnlineService = SpringUtils.getBean(ISysUserOnlineService.class); List userOnlineList = userOnlineService.selectOnlineByExpired(expiredDate); // 批量过期删除 List needOfflineIdList = new ArrayList(); diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserOnlineServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserOnlineServiceImpl.java index 02b3f208..2fad5720 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserOnlineServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserOnlineServiceImpl.java @@ -3,7 +3,7 @@ package com.ruoyi.system.service.impl; import java.util.Date; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; +import org.springframework.stereotype.Service; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.system.domain.SysUserOnline; @@ -15,7 +15,7 @@ import com.ruoyi.system.service.ISysUserOnlineService; * * @author ruoyi */ -@Component +@Service public class SysUserOnlineServiceImpl implements ISysUserOnlineService { @Autowired