package cn.freemud.interceptor;

import com.freemud.card.sdk.comm.ConstantProfiles;
import com.freemud.card.sdk.comm.IUrlConfig;
import com.freemud.card.sdk.comm.UrlConfig;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;

/**
 * All rights Reserved, Designed By www.freemud.cn
 *
 * @version V1.0
 * @Title: ${FILE_NAME}
 * @Package com.freemud.mail.core
 * @Description: ${TODO}(用一句话描述该文件做什么)
 * @author: aiqi.gong
 * @date: 2019/1/4 15:49
 * @Copyright: 2018 www.freemud.cn Inc. All rights reserved.
 * 注意：本内容仅限于上海非码科技内部传阅，禁止外泄以及用于其他的商业目
 */
@Configuration
public class ConfigInitBean {
    @Profile("pro")
    @Bean
    IUrlConfig proiUrlConfig() {
        return new UrlConfig(ConstantProfiles.PRO);
    }

    @Profile("test")
    @Bean
    IUrlConfig devOrTestIUrlConfig() {
        return new UrlConfig(ConstantProfiles.TEST);
    }

    @Profile("qa")
    @Bean
    IUrlConfig qaIUrlConfig() {
        return new UrlConfig(ConstantProfiles.QA);
    }

    @Profile("default")
    @Bean
    IUrlConfig defaultIUrlConfig() {
        return new UrlConfig(ConstantProfiles.TEST);
    }

    @Profile("dev")
    @Bean
    IUrlConfig devIUrlConfig() {
        return new UrlConfig(ConstantProfiles.DEV);
    }

    @Profile("pre-release")
    @Bean
    IUrlConfig preIUrlConfig() {
        return new UrlConfig(ConstantProfiles.PRO);
    }
}
