package com.cab.service;

import javax.servlet.http.HttpServletRequest;

import com.cku.util.ServletUtils;
import com.sys.service.TokenService;

public class UserService {

	public static long verifyUserId(HttpServletRequest request) throws Exception
	{
		String p = ServletUtils.getParameter(request, "token");
		long userId = TokenService.instance().verifyTokenUser(p);
		return userId;
	}
	
	public static Long getUserId(HttpServletRequest request) throws Exception
	{
		String p = ServletUtils.getParameter(request, "token", null);
		if (p != null && !"".equals(p))
		{
			long userId = TokenService.instance().verifyTokenUser(p);
			return userId;
		}
		
		return null;
	}
}
