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

import cn.novalon.gym.manage.sys.core.domain.SysExceptionLog;
import cn.novalon.gym.manage.common.dto.PageRequest;
import cn.novalon.gym.manage.common.dto.PageResponse;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

import java.time.LocalDateTime;

/**
 * 异常日志仓储接口
 * 
 * @author 张翔
 * @date 2026-03-13
 */
public interface ISysExceptionLogRepository {

    Flux<SysExceptionLog> findAllByOrderByCreateTimeDesc();

    Flux<SysExceptionLog> findByUsernameOrderByCreateTimeDesc(String username);

    Flux<SysExceptionLog> findByCreateTimeBetweenOrderByCreateTimeDesc(LocalDateTime startTime, LocalDateTime endTime);

    Mono<SysExceptionLog> save(SysExceptionLog exceptionLog);

    Mono<SysExceptionLog> findById(Long id);

    Mono<Long> count();

    Mono<PageResponse<SysExceptionLog>> findExceptionLogsByPage(PageRequest pageRequest);
}