package com.ai.da.common.RabbitMQ;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Slf4j
@Component
public class MQPublisher {

    private final String url = "http://localhost:15672/api/queues/%2f/generate-queue";

    @Resource
    private AmqpTemplate amqpTemplate;

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

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

}
