package com.skr.mdm.api.company.service;

import com.skr.mdm.result.ResponseResult;

import java.util.List;
import java.util.Map;

/**
 * @author nfq
 * @date 2020/9/8 11:45
 */
public interface FunctionScopeService {

    /**
     * 创建功能范围
     * @param functionScope 功能范围名称
     * @return
     */
    ResponseResult addFunctionScope(String functionScope);

    /**
     * 功能范围列表
     * @return
     */
    ResponseResult listFunctionScope(Integer pageNum, Integer pageSize);

    /**
     * 菜单树
     * @param parentId 父id
     * @param functionScopeId 功能范围id
     * @return
     */
    List<Map<String, Object>> menuTree(Integer parentId, Integer functionScopeId);

    /**
     * 配置功能范围
     * @param functionScopeId
     * @param menuIdList
     * @return
     */
    ResponseResult configFunctionScope(Integer functionScopeId, List<Integer> menuIdList);

    /**
     * 获取所有功能范围
     * @return
     */
    ResponseResult allFunctionScope();

    /**
     * 删除功能范围
     * @param functionScopeId
     * @return
     */
    ResponseResult deleteFunctionScope(Integer functionScopeId);

    /**
     * 角色去除取消的功能范围权限
     *
     * @param functionScopeId
     * @param menuIdList
     */
    void subtractRolePermission(Integer functionScopeId, List<Integer> menuIdList);

    /**
     * 编辑功能范围名称
     *
     * @param functionScopeId
     * @param functionScopeName
     * @return
     */
    ResponseResult updateFunctionScope(Integer functionScopeId, String functionScopeName);
}
