package cn.superdesk.uniorder.dubbo.provider.redis;

import cn.superdesk.uniorder.common.mq.redis.dto.ExcelImportTaskMessage;
import cn.superdesk.uniorder.common.mq.redis.producer.MessageProducerService;
import cn.superdesk.uniorder.dubbo.facade.redis.DubboRedisQueueService;
import com.alibaba.dubbo.config.annotation.Service;
import lombok.extern.slf4j.Slf4j;

import javax.annotation.Resource;

@Slf4j
@Service(version = "1.0.0", retries = -1, timeout = 3000)
public class DubboRedisQueueServiceImpl implements DubboRedisQueueService {

	@Resource
	private MessageProducerService messageProducerService;

	public Long sendMessage(String message) {
		log.info("DubboRedisQueueServiceImpl sendMessage {}", message);
		return messageProducerService.sendMessage(message);
	}

	public Long pushMessage2CHANNEL_ACCOUNTING_UNIFIED_CUSTOMER(String message) {
		log.info("DubboRedisQueueServiceImpl pushMessage2CHANNEL_ACCOUNTING_UNIFIED_CUSTOMER {}", message);
		return messageProducerService.pushMessage2CHANNEL_ACCOUNTING_UNIFIED_CUSTOMER(message);
	}

	public Long pushMessage2CHANNEL_ACCOUNTING_UNIFIED_SUPPLIER(String message) {
		log.info("DubboRedisQueueServiceImpl pushMessage2CHANNEL_ACCOUNTING_UNIFIED_SUPPLIER {}", message);
		return messageProducerService.pushMessage2CHANNEL_ACCOUNTING_UNIFIED_SUPPLIER(message);
	}


	public Long pushMessage2CHANNEL_QUEUE_F(ExcelImportTaskMessage message) {
		log.info("DubboRedisQueueServiceImpl pushMessage2CHANNEL_QUEUE_F {}", message);
		return messageProducerService.pushMessage2CHANNEL_QUEUE_F(message);
	}
}
