package com.sptg.common.core.enums;

import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang3.StringUtils;

/**
 *
 *
 * description: 指令
 */
@Getter
@Setter
public class InstructDH {

    /**
     * 临时交换机
     */
    private static final String TRANSIENT_EXCHANGE_DH = "TRANSIENT_EXCHANGE_DH";

    /**
     * 持久交换机
     */
    private static final String PERSISTENT_EXCHANGE_DH = "PERSISTENT_EXCHANGE_DH";

    /**
     * 指令
     */
    private String code;

    /**
     * 指令
     */
    private String batchCode;

    /**
     * 交换机
     */
    private String exchangeName;

    /**
     * 描述
     */
    private String describe;

    public String getDHExchange(String exchangeName) {
        if (StringUtils.isNotBlank(exchangeName)) {
            if (exchangeName.equals("TRANSIENT_EXCHANGE")) {
                return TRANSIENT_EXCHANGE_DH;
            } else if (exchangeName.equals("PERSISTENT_EXCHANGE")) {
                return PERSISTENT_EXCHANGE_DH;
            }
        }
        return exchangeName;
    }

}
