package com.hfkj.service;


import com.github.pagehelper.PageInfo;
import com.hfkj.entity.SecRole;
import com.hfkj.entity.SecUser;

import java.util.List;

/**
 *@ClassName SecRoleService
 *@Description 角色管理
 *@Author 杜江
 *@Date 2020/7/23 11:23
 *@Version 1.0
 */
public interface SecRoleService {

   /**
    *
    * @Title: getRoleByUserId
    * @Description: 根据用户id查询用户角色
    * @author: 杜江
    * @Date: 2020/7/23 14:27
    * @param: [userId]
    * @return: com.shinwoten.train.entity.SecRole
    * @throws
    */
    SecRole getRoleByUserId(Long userId) throws Exception;


    /**
     *
     * @Title: findPage
     * @Description: TODO(角色分页)
     * @author: 杜江
     * @param: [roleType, roleName, pageNum, pageSize]
     * @return: com.github.pagehelper.PageInfo<com.shinwoten.haj.entity.SecRole>
     * @throws
     */
    PageInfo<SecRole> findPage(Long companyId, Integer templetType, Integer roleType, String roleName, Integer pageNum, Integer pageSize);
    /**
     *
     * @Title: findByName
     * @Description: TODO(通过角色名查询)
     * @author: 杜江
     * @param: [roleName]
     * @return: com.shinwoten.haj.entity.SecRole
     * @throws
     */
    SecRole findByName(Long companyId, String roleName);
    /**
     *
     * @Title: findById
     * @Description: TODO(通过id查询)
     * @author: 杜江
     * @param: [sId]
     * @return: com.shinwoten.haj.entity.SecRole
     * @throws
     */
    SecRole findById(Long sId);


    /**
     *
     * @Title: getAllRole
     * @Description: TODO(查询符合条件的角色集合)
     * @author: 杜江
     * @param: [companyId, roleType, primaryRole, templetType]
     * @return: java.util.List<com.shinwoten.haj.entity.SecRole>
     * @throws
     */
    List<SecRole> getAllRole(Long companyId, List<Integer> roleTypes, Integer primaryRole, Integer templetType);

    /**
     *
     * @Title: findMainRole
     * @Description: TODO(根据公司id查询公司主角色)
     * @author: 杜江
     * @param: [company]
     * @return: com.shinwoten.haj.entity.SecRole
     * @throws
     */
    SecRole findMainRole(Long companyId);



 /**
  *
  * @Title: addRole
  * @Description: 添加角色
  * @author: 杜江
  * @Date: 2020/7/7 12:05
  * @param: [role]
  * @return: void
  * @throws
  */
 void addRole(SecRole role);

 /**
  *
  * @Title: modifyRole
  * @Description: 修改角色
  * @author: 杜江
  * @Date: 2020/7/7 14:05
  * @param: [role]
  * @return: void
  * @throws
  */
 void modifyRole(SecRole role);

 /**
  *
  * @Title: getUsersByRoleId
  * @Description: 查询该角色的用户
  * @author: 杜江
  * @Date: 2020/7/7 14:07
  * @param: [roleId]
  * @return: java.util.List<com.shinwoten.plat.entity.SecUser>
  * @throws
  */
 List<SecUser> getUsersByRoleId(Long roleId);
}
