package com.sunxung.factoring.service.sys;

import com.sunxung.factoring.entity.sys.User;
import com.sunxung.factoring.service.sys.dto.LoginResultDto;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public interface AuthorityService {

    /**
     * 判断是否登录
     * 
     * @param sid
     * @param url
     * @return
     */
    boolean isLogin(Long sid, String url);

    /**
     * 判断是否有权限
     * 
     * @param ename
     * @return
     */
    boolean hasPermission(String ename);

    /**
     * 退出
     * 
     * @param httpRequest
     * @param response
     * @return
     */
    boolean sginOut(HttpServletRequest httpRequest, HttpServletResponse response);

    /**
     * 注销
     * 
     * @param id
     * @return
     */
    boolean doSginOut(Long id, HttpServletRequest request);

    /**
     * 登录
     * 
     * @param loginName
     * @param password
     * @return
     */
    LoginResultDto login(String loginName, String password);


    void loginOut(String token);


    User getUserByToken(String token);
}
