package com.ywt.outpatient;

import com.ywt.outpatient.configs.RibbonConfiguration;
import org.apache.dubbo.config.spring.context.annotation.EnableDubbo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.netflix.ribbon.RibbonClient;
import org.springframework.cloud.netflix.ribbon.RibbonClients;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

@SpringBootApplication
@EnableDubbo
@RibbonClients(
        value = {
                @RibbonClient(name = "stocks-nacos",configuration = RibbonConfiguration.class)
        }
)
public class OutpatientFrontServiceApplication {

    public static void main(String[] args) {
        SpringApplication.run(OutpatientFrontServiceApplication.class, args);
    }


    @Bean
    @LoadBalanced
    public RestTemplate getRestTemplate(RestTemplateBuilder builder){
        return builder.build();
    }
}
