package com.kospo.talk.service;

import com.kospo.talk.model.TalkMessage;
import com.kospo.talk.payload.*;
import jakarta.transaction.Transactional;
import org.springframework.data.domain.Pageable;

import java.time.LocalDateTime;
import java.util.List;

public interface TalkMessageService {
    List<TalkMessage> findAll(String talkId);

    TalkMessage save(TalkMessage talkMessage);

    void externalSave(ExternalMessageDto externalMessageDto);

    void saveAll(List<TalkMessage> talkMessages);

    boolean read(String talkId, String sabun);

    @Transactional
    boolean allRead(String talkId);

    @Transactional
    List<TalkDto> getMessageAll(String sabun);

    @Transactional
    List<TalkDto> getMessageAllMore(String sabun, String insDate);

    @Transactional
    TalkReceiveDto getMessage(String talkId);

    @Transactional
    TalkReceiveDto getMessageLine(String talkId, Integer start, Integer end, String insDate);

    @Transactional
    List<MessageDto> getMessage(String talkId, String insDate);

    @Transactional
    TalkReceiveDto getMessageWeek(String talkId, String week);

    @Transactional
    TalkReceiveDto getSearchMessage(String talkId, String search);

    @Transactional
    List<MessageDto> getAllSearchContent(String search, String sabun);

    void saveContent(TalkMessage talkMessage);

    @Transactional
    List<MessageDto> getMessage(String talkId, Pageable pageable);

    ITalkMessageDto getLastContent(String talkId);

    int unreadCountBySabun(String talkId, String sabun);
}
