package cn.novalon.manage.sys.core.service;

import cn.novalon.manage.sys.core.domain.SysPermission;
import org.springframework.data.domain.Sort;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

/**
 * 权限服务接口
 * 
 * @author 张翔
 * @date 2026-03-25
 */
public interface ISysPermissionService {
    Mono<SysPermission> findById(Long id);
    Flux<SysPermission> findAll();
    Flux<SysPermission> findAll(Sort sort);
    Mono<SysPermission> findByPermissionCode(String permissionCode);
    Mono<Long> count();
    Mono<SysPermission> createPermission(SysPermission permission);
    Mono<SysPermission> updatePermission(SysPermission permission);
    Mono<Void> deletePermission(Long id);
    Mono<Boolean> existsByPermissionCode(String permissionCode);
    Flux<SysPermission> findByRoleId(Long roleId);
    Flux<SysPermission> findByRoleIds(java.util.List<Long> roleIds);
    Mono<Void> assignPermissionsToRole(Long roleId, java.util.List<Long> permissionIds);
    Flux<SysPermission> getPermissionsByRoleId(Long roleId);
}