package com.muyu.data.processing.controller;

import com.muyu.common.rabbit.config.RabbitmqConfig;
import com.muyu.data.processing.service.DataProcessingService;

import javax.annotation.Resource;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.web.bind.annotation.*;
import lombok.extern.slf4j.Slf4j;

/**
 * 数据处理控制层
 *
 * @Author: 胡杨
 * @Name: DataProcessing
 * @Description: 数据处理控制层
 * @CreatedDate: 2024/9/28 下午3:53
 * @FilePath: com.muyu.data.processing.controller
 */

@Slf4j
@RestController
@RequestMapping("/DataProcessing")
public class DataProcessingController {
    @Resource
    private DataProcessingService service;
    @Resource
    private RabbitTemplate rabbitTemplate;

    @GetMapping("/goOnline")
    public void goOnline(@RequestParam("vin") String vin) {
        rabbitTemplate.convertAndSend(RabbitmqConfig.EXCHANGE_TOPICS_INFORM, "inform.email", vin);
        log.info("发送消息成功:{}",vin);
    }
}
