package com.njzscloud.supervisory.config;

import com.njzscloud.common.http.HttpClientDecorator;
import com.njzscloud.supervisory.voicebox.service.VoiceboxApi;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@EnableConfigurationProperties({CloudVoiceboxProperties.class})
@ConditionalOnBean(HttpClientDecorator.class)
public class CloudVoiceboxAutoConfiguration {

    @Bean
    public VoiceboxApi voiceboxApi(HttpClientDecorator httpClientDecorator) {
        return httpClientDecorator.decorate(VoiceboxApi.class);
    }

}
