package com.ruoyi.imclient.task;

import com.ruoyi.common.im.constant.IMRedisKey;
import com.ruoyi.common.im.enums.IMListenerType;
import com.ruoyi.common.im.model.IMSendResult;
import com.ruoyi.common.im.mq.RedisMQListener;
import com.ruoyi.imclient.listener.MessageListenerMulticaster;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

import java.util.List;


@Component
@RequiredArgsConstructor
@RedisMQListener(queue = IMRedisKey.IM_RESULT_PRIVATE_QUEUE, batchSize = 100)
public class PrivateMessageResultResultTask extends AbstractMessageResultTask<IMSendResult> {

    private final MessageListenerMulticaster listenerMulticaster;

    @Override
    public void onMessage(List<IMSendResult> results) {
        listenerMulticaster.multicast(IMListenerType.PRIVATE_MESSAGE, results);
    }

}
