package tech.easyflow.chatlog.service.impl;

import org.springframework.stereotype.Service;
import tech.easyflow.chatlog.domain.dto.ChatHistoryPage;
import tech.easyflow.chatlog.domain.query.ChatPageQuery;
import tech.easyflow.chatlog.repository.analyticaldb.ChatAnalyticalDBRepository;
import tech.easyflow.chatlog.service.ChatHistoryQueryService;

import java.math.BigInteger;

@Service
public class ChatHistoryQueryServiceImpl implements ChatHistoryQueryService {

    private final ChatAnalyticalDBRepository chatAnalyticalDBRepository;

    public ChatHistoryQueryServiceImpl(ChatAnalyticalDBRepository chatAnalyticalDBRepository) {
        this.chatAnalyticalDBRepository = chatAnalyticalDBRepository;
    }

    @Override
    public ChatHistoryPage queryHistoryMessages(BigInteger sessionId, ChatPageQuery query) {
        return chatAnalyticalDBRepository.queryHistory(sessionId, query);
    }
}
