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

import cn.novalon.gym.manage.sys.audit.domain.AuditLogArchive;
import org.springframework.data.r2dbc.repository.R2dbcRepository;
import org.springframework.stereotype.Repository;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

import java.time.LocalDateTime;

/**
 * 审计日志归档仓储接口
 * 
 * @author 张翔
 * @date 2026-04-01
 */
@Repository
public interface IAuditLogArchiveRepository extends R2dbcRepository<AuditLogArchive, Long> {

    Flux<AuditLogArchive> findByEntityType(String entityType);

    Flux<AuditLogArchive> findByEntityId(Long entityId);

    Flux<AuditLogArchive> findByOperator(String operator);

    Flux<AuditLogArchive> findByOperationTimeBetween(LocalDateTime startTime, LocalDateTime endTime);

    Flux<AuditLogArchive> findByArchivedAtBetween(LocalDateTime startTime, LocalDateTime endTime);

    Mono<Long> countByEntityType(String entityType);

    Mono<Long> countByOperator(String operator);
}
