package com.xhkjedu.sexam.listener;

import com.alibaba.fastjson.JSON;
import com.xhkjedu.model.slog.THandleLog;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/*
 * @Description: 操作日志
 * @Author: WN
 * @Date: 2023/11/15 16:20:25
 **/
@Component
public class HandleLogSender {
    @Autowired
    private AmqpTemplate rabbitTemplate;
    //生产者mq
    @Value("${rabbitmq.handleLogQueue}")
    private String handleLogQueue;

    //操作日志
    public void handleLogSend(THandleLog handleLog) {
        rabbitTemplate.convertAndSend(handleLogQueue, JSON.toJSONString(handleLog));
    }

}
