package tech.easyflow.system.service;

import com.mybatisflex.core.service.IService;
import tech.easyflow.system.entity.SysApiKey;

import java.math.BigInteger;

/**
 *  服务层。
 *
 * @author Administrator
 * @since 2025-04-18
 */
public interface SysApiKeyService extends IService<SysApiKey> {

    void checkApikeyPermission(String apiKey, String requestURI);

    SysApiKey getSysApiKey(String apiKey);

    /**
     * 校验资源级作用域权限。
     *
     * @param apiKeyId apiKey 记录 ID
     * @param requestURI 请求 URI
     * @param resourceType 资源类型
     * @param resourceTargetId 资源目标 ID
     * @param actionScope 动作范围
     */
    void checkResourceScope(BigInteger apiKeyId, String requestURI, String resourceType, BigInteger resourceTargetId, String actionScope);

}
