package cn.novalon.gym.manage.notify.core.repository;

import cn.novalon.gym.manage.common.dto.PageRequest;
import cn.novalon.gym.manage.common.dto.PageResponse;
import cn.novalon.gym.manage.notify.core.domain.SysUserMessage;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

public interface ISysUserMessageRepository {

    Flux<SysUserMessage> findByUserIdOrderByCreateTimeDesc(Long userId);

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

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

    Mono<PageResponse<SysUserMessage>> findByUserIdPage(Long userId, PageRequest pageRequest);

    Mono<PageResponse<SysUserMessage>> findByUserIdAndIsReadPage(Long userId, String isRead, PageRequest pageRequest);

    Mono<Long> markAllAsReadByUserId(Long userId);

    Mono<SysUserMessage> save(SysUserMessage message);

    Mono<SysUserMessage> findById(Long id);

    Mono<Void> deleteById(Long id);
}
