//package com.mortals.xhx.system;
//
//import com.alibaba.fastjson.JSON;
//import com.mortals.framework.model.AccessLogPdu;
//import com.mortals.framework.model.BizLogPdu;
//import com.mortals.framework.model.ErrorLogPdu;
//import com.mortals.framework.model.OperateLogPdu;
//import com.mortals.framework.service.IMessageProduceService;
//import com.mortals.xhx.common.keys.QueueKey;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.amqp.rabbit.core.RabbitTemplate;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.context.annotation.Primary;
//import org.springframework.stereotype.Component;
//
////@Component
//@Primary
//@Slf4j
//public class MessageProducer implements IMessageProduceService {
//
//    @Autowired
//    private RabbitTemplate rabbitTemplate;
//
//    public void syncAccessSend(AccessLogPdu accessLogPdu) {
//        //new Message(JSON.toJSONString(accessLogPdu).getBytes(StandardCharsets.UTF_8))
//        //rabbitTemplate.send(QueueKey.EXCHANGE, QueueKey.ACCESS_LOG_QUEUE,new Message(JSON.toJSONString(accessLogPdu).getBytes(StandardCharsets.UTF_8)));
//
//        rabbitTemplate.convertAndSend(QueueKey.EXCHANGE, QueueKey.ACCESS_LOG_QUEUE, JSON.toJSONString(accessLogPdu));
//        //rabbitTemplate.convertAndSend(QueueKey.EXCHANGE, QueueKey.ACCESS_LOG_QUEUE, accessLogPdu);
//    }
//
//    @Override
//    public void syncBizSend(BizLogPdu bizLogPdu) {
//        rabbitTemplate.convertAndSend(QueueKey.EXCHANGE, QueueKey.BIZ_LOG_QUEUE, JSON.toJSONString(bizLogPdu));
//    }
//
//    @Override
//    public void syncErrorSend(ErrorLogPdu errorLogPdu) {
//        rabbitTemplate.convertAndSend(QueueKey.EXCHANGE, QueueKey.ERROR_LOG_QUEUE, JSON.toJSONString(errorLogPdu));
//    }
//
//    @Override
//    public void syncOperSend(OperateLogPdu operLogPdu) {
//        rabbitTemplate.convertAndSend(QueueKey.EXCHANGE, QueueKey.OPERATION_LOG_QUEUE, JSON.toJSONString(operLogPdu));
//    }
//
//}
