package com.yaoyuan.jiscuss.repository;

import com.yaoyuan.jiscuss.entity.AuditLog;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface AuditLogRepository extends JpaRepository<AuditLog, Integer> {
    List<AuditLog> findAllByOrderByCreateTimeDesc();

    Page<AuditLog> findAllByOrderByCreateTimeDesc(Pageable pageable);

    List<AuditLog> findByTargetTypeAndTargetIdOrderByCreateTimeDesc(String targetType, Integer targetId);

    List<AuditLog> findByAdminIdOrderByCreateTimeDesc(Integer adminId);
}
