package com.ai.da.common.RabbitMQ;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Slf4j
@Component
public class MQPublisher {

    @Autowired
    private RabbitMQProperties rabbitMQProperties;

    @Autowired
    private AmqpTemplate amqpTemplate;

    public void sendGenerateMessage(String mm) {
        log.info("send message: " + mm);
        amqpTemplate.convertAndSend(rabbitMQProperties.getQueues().getGenerate(), mm);
    }

    public void sendSRMessage(String mm) {
        log.info("send message: " + mm);
        amqpTemplate.convertAndSend(rabbitMQProperties.getQueues().getSr(), mm);
    }
}
