package kr.co.accura.wbx.spring.auth;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

@Repository
public interface LoginHistoryRepository extends JpaRepository<WbxLoginHistory, Long> {

    Page<WbxLoginHistory> findByUserIdOrderByCreatedAtDesc(Long userId, Pageable pageable);

    Page<WbxLoginHistory> findAllByOrderByCreatedAtDesc(Pageable pageable);

    long countByAction(String action);
}
