package com.prolog.rdc.tms.service.impl;

import com.prolog.rdc.tms.constant.RabbitMQConstant;
import org.springframework.amqp.core.Queue;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 
 *
 * 消息队列注册
 *
 * @className :RabbitMQSetting
 * @author :xiaoyf
 * @creationTime :2020/08/06
 * @description :
 * 
 * @version :1.0.0
 *
 */
@Configuration
public class RabbitMQSetting{

	/**
	 * 商品品类导入日志 消息队列注册
	 */
	@Bean
	@ConditionalOnMissingBean(name = {RabbitMQConstant.ITEM_CATEGORY_IMPORT_LOG})
	public Queue itemCategoryQueue(){
		return new Queue(RabbitMQConstant.ITEM_CATEGORY_IMPORT_LOG);
	}

	/**
	 * 商品导入日志 消息队列注册
	 */
	@Bean
	@ConditionalOnMissingBean(name = {RabbitMQConstant.ITEM_IMPORT_LOG})
	public Queue itemQueue(){
		return new Queue(RabbitMQConstant.ITEM_IMPORT_LOG);
	}

	/**
	 * 供应商导入日志 消息队列注册
	 */
	@Bean
	@ConditionalOnMissingBean(name = {RabbitMQConstant.PROVIDER_IMPORT_LOG})
	public Queue providerQueue(){
		return new Queue(RabbitMQConstant.PROVIDER_IMPORT_LOG);
	}

	/**
	 * 供应商发货方导入日志 消息队列注册
	 */
	@Bean
	@ConditionalOnMissingBean(name = {RabbitMQConstant.PROVIDER_SHIPPER_IMPORT_LOG})
	public Queue providerShipperQueue(){
		return new Queue(RabbitMQConstant.PROVIDER_SHIPPER_IMPORT_LOG);
	}

	/**
	 * 客户导入日志 消息队列注册
	 */
	@Bean
	@ConditionalOnMissingBean(name = {RabbitMQConstant.CUSTOMER_IMPORT_LOG})
	public Queue customerQueue(){
		return new Queue(RabbitMQConstant.CUSTOMER_IMPORT_LOG);
	}

	/**
	 * 客户收货方导入日志 消息队列注册
	 */
	@Bean
	@ConditionalOnMissingBean(name = {RabbitMQConstant.CUSTOMER_RECEIVER_IMPORT_LOG})
	public Queue customerReceiverQueue(){
		return new Queue(RabbitMQConstant.CUSTOMER_RECEIVER_IMPORT_LOG);
	}

	/**
	 * 仓库导入日志 消息队列注册
	 */
	@Bean
	@ConditionalOnMissingBean(name = {RabbitMQConstant.BRANCH_IMPORT_LOG})
	public Queue branchQueue(){
		return new Queue(RabbitMQConstant.BRANCH_IMPORT_LOG);
	}

	/**
	 * 仓库车位导入日志 消息队列注册
	 */
	@Bean
	@ConditionalOnMissingBean(name = {RabbitMQConstant.BRANCH_CARPORT_IMPORT_LOG})
	public Queue branchCarportQueue(){
		return new Queue(RabbitMQConstant.BRANCH_CARPORT_IMPORT_LOG);
	}

	/**
	 * 承运商导入日志 消息队列注册
	 */
	@Bean
	@ConditionalOnMissingBean(name = {RabbitMQConstant.CARRIER_IMPORT_LOG})
	public Queue carrierQueue(){
		return new Queue(RabbitMQConstant.CARRIER_IMPORT_LOG);
	}

	/**
	 * 线路导入日志 消息队列注册
	 */
	@Bean
	@ConditionalOnMissingBean(name = {RabbitMQConstant.LINE_IMPORT_LOG})
	public Queue lineQueue(){
		return new Queue(RabbitMQConstant.LINE_IMPORT_LOG);
	}

	/**
	 * 线路承运方导入日志 消息队列注册
	 */
	@Bean
	@ConditionalOnMissingBean(name = {RabbitMQConstant.LINE_CARRIER_IMPORT_LOG})
	public Queue lineCarrierQueue(){
		return new Queue(RabbitMQConstant.LINE_CARRIER_IMPORT_LOG);
	}

	/**
	 * 线路收货方导入日志 消息队列注册
	 */
	@Bean
	@ConditionalOnMissingBean(name = {RabbitMQConstant.LINE_CONSIGNEE_IMPORT_LOG})
	public Queue lineConsigneeQueue(){
		return new Queue(RabbitMQConstant.LINE_CONSIGNEE_IMPORT_LOG);
	}

	/**
	 * 司机导入日志 消息队列注册
	 */
	@Bean
	@ConditionalOnMissingBean(name = {RabbitMQConstant.DRIVER_IMPORT_LOG})
	public Queue driverQueue(){
		return new Queue(RabbitMQConstant.DRIVER_IMPORT_LOG);
	}

	/**
	 * 送货员导入日志 消息队列注册
	 */
	@Bean
	@ConditionalOnMissingBean(name = {RabbitMQConstant.DELIVERYMAN_IMPORT_LOG})
	public Queue deliverymanQueue(){
		return new Queue(RabbitMQConstant.DELIVERYMAN_IMPORT_LOG);
	}

	/**
	 * 车型导入日志 消息队列注册
	 */
	@Bean
	@ConditionalOnMissingBean(name = {RabbitMQConstant.VEHICLE_TYPE_IMPORT_LOG})
	public Queue vehicleTypeQueue(){
		return new Queue(RabbitMQConstant.VEHICLE_TYPE_IMPORT_LOG);
	}

	/**
	 * 车辆导入日志 消息队列注册
	 */
	@Bean
	@ConditionalOnMissingBean(name = {RabbitMQConstant.VEHICLE_IMPORT_LOG})
	public Queue vehicleQueue(){
		return new Queue(RabbitMQConstant.VEHICLE_IMPORT_LOG);
	}

}
