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

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 ISysPermissionRepository {

    Mono<SysPermission> findById(Long id);

    Mono<SysPermission> findByIdIncludingDeleted(Long id);

    Mono<SysPermission> save(SysPermission sysPermission);

    Mono<Void> deleteById(Long id);

    Flux<SysPermission> findAll();

    Flux<SysPermission> findAll(Sort sort);

    Mono<SysPermission> findByPermissionCode(String permissionCode);

    Mono<Long> count();

    Mono<Boolean> existsByPermissionCode(String permissionCode);

    Mono<SysPermission> updatePermission(SysPermission permission);

    Flux<SysPermission> findByRoleId(Long roleId);

    Flux<SysPermission> findByRoleIds(java.util.List<Long> roleIds);
}