package tech.easyflow.chatlog.service.impl;

import org.springframework.stereotype.Service;
import tech.easyflow.chatlog.domain.command.ChatRoundSelectCommand;
import tech.easyflow.chatlog.domain.command.ChatRoundUpsertCommand;
import tech.easyflow.chatlog.domain.dto.ChatRoundRecord;
import tech.easyflow.chatlog.service.ChatPersistDispatcher;
import tech.easyflow.chatlog.service.ChatRoundCommandService;

/**
 * 聊天轮次写服务实现。
 */
@Service
public class ChatRoundCommandServiceImpl implements ChatRoundCommandService {

    private final ChatPersistDispatcher chatPersistDispatcher;

    public ChatRoundCommandServiceImpl(ChatPersistDispatcher chatPersistDispatcher) {
        this.chatPersistDispatcher = chatPersistDispatcher;
    }

    @Override
    public ChatRoundRecord createOrTouchRound(ChatRoundUpsertCommand command) {
        return chatPersistDispatcher.createOrTouchRound(command);
    }

    @Override
    public void selectVariant(ChatRoundSelectCommand command) {
        chatPersistDispatcher.selectRoundVariant(command);
    }
}
