package com.vci.starter.web.util;
|
|
|
import com.vci.starter.web.pagemodel.SessionInfo;
|
|
/**
|
* 线程中存储的变量信息
|
* @author weidy
|
*/
|
public class WebThreadLocalUtil {
|
|
/**
|
* 线程里的当前用户session信息
|
*/
|
private static ThreadLocal<SessionInfo> currentUserSessionInfoInThread = new ThreadLocal<SessionInfo>();
|
|
/**
|
* 查询列表的时候是否查询总数
|
*/
|
private static ThreadLocal<String> needQueryTotalInThread = new ThreadLocal<String>();
|
|
|
/**
|
* 获取当前用户的session对象
|
* @return session对象
|
*/
|
public static ThreadLocal<SessionInfo> getCurrentUserSessionInfoInThread() {
|
return currentUserSessionInfoInThread;
|
}
|
|
|
public static void setCurrentUserSessionInfoInThread(ThreadLocal<SessionInfo> currentUserSessionInfoInThread) {
|
WebThreadLocalUtil.currentUserSessionInfoInThread = currentUserSessionInfoInThread;
|
}
|
|
public static ThreadLocal<String> getNeedQueryTotalInThread() {
|
return needQueryTotalInThread;
|
}
|
|
public static void setNeedQueryTotalInThread(ThreadLocal<String> needQueryTotalInThread) {
|
WebThreadLocalUtil.needQueryTotalInThread = needQueryTotalInThread;
|
}
|
|
}
|