Пример #1
0
 private XAppUserLoginInfoDTO setMemCache(String sessionId) throws BcgogoException {
   XAppUserLoginInfoDTO appUserLoginInfoDTO =
       appUserService.getAppUserLoginInfoDTOBySessionId(sessionId);
   if (appUserLoginInfoDTO == null) return null;
   MemCacheAdapter.set(
       MEM_CACHE_DATE, MemcachePrefix.xApiSession.getValue() + sessionId, appUserLoginInfoDTO);
   return appUserLoginInfoDTO;
 }
Пример #2
0
 public String getAppUserNo(HttpServletRequest request, HttpServletResponse response)
     throws BcgogoException, IOException, ServletException {
   String sessionId = CookieUtil.getSessionId(request);
   if (StringUtil.isEmpty(sessionId)) {
     throw new BcgogoException("session id is null!");
   }
   XAppUserLoginInfoDTO appUserLoginInfoDTO =
       (XAppUserLoginInfoDTO)
           MemCacheAdapter.get(MemcachePrefix.xApiSession.getValue() + sessionId);
   if (appUserLoginInfoDTO == null) {
     appUserLoginInfoDTO = setMemCache(sessionId);
   }
   if (appUserLoginInfoDTO == null) return null;
   //    doSessionTimeoutUpdate(response, sessionId, appUserLoginInfoDTO.getSessionCreateTime());
   if (appUserLoginInfoDTO == null) {
     throw new BcgogoException("appUserLoginInfoDTO is null!");
   }
   return appUserLoginInfoDTO.getAppUserNo();
 }