package kr.co.zioinfo.web.repository;

import kr.co.zioinfo.web.model.News;
import org.springframework.data.domain.*;
import org.springframework.data.jpa.repository.JpaRepository;
import java.util.List;

public interface NewsRepository extends JpaRepository<News, Long> {
    Page<News> findByVisibleTrue(Pageable p);
    Page<News> findByCategoryAndVisibleTrue(String category, Pageable p);
    long countByVisibleTrue();
    List<News> findTop5ByOrderByCreatedAtDesc();
}
