package com.sikey.wa04.business.domain.usecase;


import com.sikey.wa04.business.domain.adapter.MessageIdIncrementingAdapter;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class MessageFactory {
    private final MessageIdIncrementingAdapter<Long> messageIdIncrementingAdapter;

    @Autowired
    public MessageFactory(MessageIdIncrementingAdapter<Long> redisMessageIdIncrementingAdapterImpl) {
        this.messageIdIncrementingAdapter = redisMessageIdIncrementingAdapterImpl;
    }

    public Long idBuilder() {
        return messageIdIncrementingAdapter.incr();
    }
}
