package com.ho.user.service;


import com.ho.common.tools.entity.PageVO;
import com.ho.common.tools.entity.SysPermission;
import com.ho.common.tools.entity.SimpleUser;
import com.ho.common.tools.entity.UserDetailRespVO;
import com.ho.user.api.vo.req.QueryPermissionReqVo;
import com.ho.user.entity.PermissionRespNode;
import com.ho.user.vo.req.PermissionAddReqVO;
import com.ho.user.vo.req.PermissionPageReqVO;
import com.ho.user.vo.req.PermissionUpdateReqVO;

import java.util.List;
import java.util.Set;

/**
 * @ClassName: PermissionService
 * @Author: fancl
 * @CreateDate: 2019/9/19 11:39
 * @UpdateUser: fancl
 * @UpdateDate: 2019/9/19 11:39
 */
public interface PermissionService {

    List<SysPermission> getPermission(String userId);

    List<SysPermission> getPermissionByRoleIds(List<Integer> roleIds,String lang);

    List<SysPermission> getPermissionByTop();

    SysPermission addPermission(PermissionAddReqVO vo);

    SysPermission detailInfo(Integer permissionId);

    //查询 系统管理 这条记录
    SysPermission findSysManageMenu();

    //查询 菜单管理 这个记录
    SysPermission findTheMenu();

    void updatePermission(PermissionUpdateReqVO vo);

    Integer updateByPrimaryKeySelective(SysPermission vo);

    void deleted(Integer permissionId);

    PageVO<SysPermission> pageInfo(PermissionPageReqVO vo);

    List<SysPermission> selectAll(QueryPermissionReqVo query, String enableStatus, String enableType);

    Set<String> getPermissionsByUserId(String userId);

    List<PermissionRespNode> permissionTreeList(String userId);

    List<PermissionRespNode> selectAllByTree(QueryPermissionReqVo query, String enableStatus, String enableType);

    SysPermission selectByPerms(String perms);

    //通过jwt和缓存获取当前用户
    SimpleUser getCurrentSimpleUser();

    SysPermission selectByPrimaryKey(Integer pid);

    //查询所有系统管理的菜单,包括子菜单 ,做递归查询
    List<SysPermission> getSysMangeMenus(List<SysPermission> list, List<Integer> queryIds);


    List<PermissionRespNode> getStationPer(Integer stationId, UserDetailRespVO user,String lang);

    List<PermissionRespNode> getAll(QueryPermissionReqVo query);
}
