package cn.ey.biz.module.system.service.abac;

import cn.ey.biz.common.pojo.PageResult;
import cn.ey.biz.module.system.api.auth.dto.AuthCodeBlockPermissionDTO;
import cn.ey.biz.module.system.controller.admin.abac.vo.AbacPageVo;
import cn.ey.biz.module.system.controller.admin.abac.vo.AbacVo;
import cn.ey.biz.module.system.dal.dataobject.user.AdminUserDO;

import javax.annotation.PostConstruct;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;

public interface AbacService {

    String HUMAN = "0";

    String BUSINESS = "1";

    @PostConstruct
    void initLocalCache();

    void resetMaxUpdateTime();

    void createABAC(AbacVo abacVO);

    void deleteAbac(AbacVo abacVO);

    List<AbacVo> getAbacByAppAndScene(String app, String scene);

    PageResult<AbacVo> getAbacByPage(AbacPageVo abacPageVo);

    void checkAbac(AdminUserDO user, Set<Long> roleIds, Set<Long> menuIds, Map<String, Object> dynamicAttr, String app);

    AuthCodeBlockPermissionDTO checkAbac(String codeBlock, Map<String, Object> dynamicAttr, String app, String scene);

    List<AuthCodeBlockPermissionDTO> checkAbacList(Collection<String> codeBlock, Map<String, Object> dynamicAttr, String app, String scene);
}
