package cn.estsh.i3plus.core.apiservice.mq;

import cn.estsh.i3plus.platform.common.util.CommonConstWords;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.core.*;
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Description : wms队列
 * @Reference :
 * @Author : alwaysfrin
 * @CreateDate : 2018-09-26 16:57
 * @Modify:
 **/
@Configuration
public class I3CoreQueueConfig {
    private static final Logger LOGGER = LoggerFactory.getLogger(I3CoreQueueConfig.class);

    public static final String IMPP_MESSAGE_QUEUE = "IMPP_MESSAGE_QUEUE";

    @Bean
    public Queue getImppMessageQueue() {
        LOGGER.info("【开启平台消息队列】");
        return new Queue(IMPP_MESSAGE_QUEUE);
    }

    /*********** 队列demo ***********/

    public static final String DEMO_STR_QUEUE = "demo_str_queue";
    @Bean
    public Queue getStrQueue() {
        //LOGGER.info("【DEMO_STR_QUEUE队列】");
        return new Queue(DEMO_STR_QUEUE);
    }

    public static final String DEMO_OBJ_QUEUE = "demo_obj_queue";
    @Bean
    public Queue getObjQueue() throws Exception {
        //LOGGER.info("【DEMO_OBJ_QUEUE队列】");
        return new Queue(DEMO_OBJ_QUEUE);
    }

    public static final String DEMO_HANDLE_QUEUE = "demo_handle_queue";
    @Bean
    public Queue getHandleQueue() throws Exception {
        //LOGGER.info("【DEMO_HANDLE_QUEUE队列】");
        return new Queue(DEMO_HANDLE_QUEUE);
    }

    public static final String DEMO_ACK_QUEUE = "ack_queue";
    @Bean
    public Queue getAckQueue() throws Exception {
        //LOGGER.info("【DEMO_ACK_QUEUE队列】");
        return new Queue(DEMO_ACK_QUEUE);
    }

    public static final String DEMO_RETURN_QUEUE = "return_queue";
    @Bean
    public Queue getReturnQueue() throws Exception {
        //LOGGER.info("【DEMO_RETURN_QUEUE队列】");
        return new Queue(DEMO_RETURN_QUEUE);
    }

    //测试wms微服队列
    public static final String DEMO_CLOUD_WMS = "DEMO_CLOUD_WMS";
    @Bean
    public Queue getDemoCloudWmsQueue() throws Exception {
        //LOGGER.info("【DEMO_CLOUD_WMS】");
        return new Queue(DEMO_CLOUD_WMS);
    }
}
