Java Code Examples for com.ruoyi.system.domain.SysUserOnline#setExpireTime()

The following examples show how to use com.ruoyi.system.domain.SysUserOnline#setExpireTime() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: supplierShop   File: AsyncFactory.java    License: MIT License 6 votes vote down vote up
/**
 * 同步session到数据库
 * 
 * @param session 在线用户会话
 * @return 任务task
 */
public static TimerTask syncSessionToDb(final OnlineSession session)
{
    return new TimerTask()
    {
        @Override
        public void run()
        {
            SysUserOnline online = new SysUserOnline();
            online.setSessionId(String.valueOf(session.getId()));
            online.setDeptName(session.getDeptName());
            online.setLoginName(session.getLoginName());
            online.setStartTimestamp(session.getStartTimestamp());
            online.setLastAccessTime(session.getLastAccessTime());
            online.setExpireTime(session.getTimeout());
            online.setIpaddr(session.getHost());
            online.setLoginLocation(AddressUtils.getRealAddressByIP(session.getHost()));
            online.setBrowser(session.getBrowser());
            online.setOs(session.getOs());
            online.setStatus(session.getStatus());
            SpringUtils.getBean(ISysUserOnlineService.class).saveOnline(online);

        }
    };
}
 
Example 2
Source Project: ruoyiplus   File: AsyncFactory.java    License: MIT License 6 votes vote down vote up
/**
 * 同步session到数据库
 * 
 * @param session 在线用户会话
 * @return 任务task
 */
public static TimerTask syncSessionToDb(final OnlineSession session)
{
    return new TimerTask()
    {
        @Override
        public void run()
        {
            SysUserOnline online = new SysUserOnline();
            online.setSessionId(String.valueOf(session.getId()));
            online.setDeptName(session.getDeptName());
            online.setLoginName(session.getLoginName());
            online.setStartTimestamp(session.getStartTimestamp());
            online.setLastAccessTime(session.getLastAccessTime());
            online.setExpireTime(session.getTimeout());
            online.setIpaddr(session.getHost());
            online.setLoginLocation(AddressUtils.getRealAddressByIP(session.getHost()));
            online.setBrowser(session.getBrowser());
            online.setOs(session.getOs());
            online.setStatus(session.getStatus());
            SpringUtils.getBean(ISysUserOnlineService.class).saveOnline(online);

        }
    };
}
 
Example 3
Source Project: RuoYi   File: AsyncFactory.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * 同步session到数据库
 *
 * @param session 在线用户会话
 * @return 任务task
 */
public static TimerTask syncSessionToDb(final OnlineSession session) {
    return new TimerTask() {
        @Override
        public void run() {
            SysUserOnline online = new SysUserOnline();
            online.setSessionId(String.valueOf(session.getId()));
            online.setDeptName(session.getDeptName());
            online.setLoginName(session.getLoginName());
            online.setStartTimestamp(session.getStartTimestamp());
            online.setLastAccessTime(session.getLastAccessTime());
            online.setExpireTime(session.getTimeout());
            online.setIpaddr(session.getHost());
            online.setLoginLocation(AddressUtils.getRealAddressByIp(session.getHost()));
            online.setBrowser(session.getBrowser());
            online.setOs(session.getOs());
            online.setStatus(session.getStatus());
            SpringUtils.getBean(ISysUserOnlineService.class).saveOnline(online);

        }
    };
}