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

import cn.novalon.gym.manage.sys.core.domain.SysRolePermission;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

/**
 * 角色权限关联仓储接口
 * 
 * @author 张翔
 * @date 2026-03-25
 */
public interface ISysRolePermissionRepository {

    Mono<SysRolePermission> save(SysRolePermission rolePermission);

    Mono<Void> deleteById(Long id);

    Mono<Void> deleteByRoleId(Long roleId);

    Mono<Void> deleteByPermissionId(Long permissionId);

    Flux<SysRolePermission> findByRoleId(Long roleId);

    Flux<SysRolePermission> findByPermissionId(Long permissionId);

    Flux<Long> findPermissionIdsByRoleId(Long roleId);

    Flux<Long> findRoleIdsByPermissionId(Long permissionId);

    Mono<Void> deleteByRoleIdAndPermissionIds(Long roleId, java.util.List<Long> permissionIds);

    Mono<Void> deleteByPermissionIdAndRoleIds(Long permissionId, java.util.List<Long> roleIds);
}