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

import cn.novalon.manage.sys.core.domain.SysLoginLog;
import cn.novalon.manage.common.dto.PageRequest;
import cn.novalon.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 ISysLoginLogRepository {

    Flux<SysLoginLog> findAllByOrderByLoginTimeDesc();

    Flux<SysLoginLog> findByUsernameOrderByLoginTimeDesc(String username);

    Flux<SysLoginLog> findByLoginTimeBetweenOrderByLoginTimeDesc(LocalDateTime startTime, LocalDateTime endTime);

    Mono<SysLoginLog> save(SysLoginLog loginLog);

    Mono<SysLoginLog> findById(Long id);

    Mono<Long> count();

    Mono<Long> countToday();

    Mono<PageResponse<SysLoginLog>> findLoginLogsByPage(PageRequest pageRequest);
}