package cn.reghao.bnt.web.admin.db.repository;

import cn.reghao.bnt.web.admin.model.po.UserMessage;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;

/**
 * @author reghao
 * @date 2024-02-05 09:29:02
 */
public interface UserMessageRepository extends JpaRepository<UserMessage, Integer> {
    void deleteByUserId(int userId);

    int countByUserIdAndUnreadIsTrue(int userId);
    Page<UserMessage> findByUserIdAndUnreadIsTrue(int userId, Pageable pageable);
}
