package cn.novalon.gym.manage.db.dao;

import cn.novalon.gym.manage.db.entity.SysUserMessageEntity;
import org.springframework.data.r2dbc.repository.R2dbcRepository;
import org.springframework.stereotype.Repository;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

@Repository
public interface SysUserMessageDao extends R2dbcRepository<SysUserMessageEntity, Long> {

    Flux<SysUserMessageEntity> findByUserIdAndIsReadOrderByCreateTimeDesc(Long userId, String isRead);

    Flux<SysUserMessageEntity> findByUserIdOrderByCreateTimeDesc(Long userId);

    Mono<Long> countByUserIdAndIsRead(Long userId, String isRead);
}
