RestConfig.java 425 字节
Newer Older
Q
qinyingjie 已提交
1 2
package com.kwan.springcloud.config;

Q
qinyingjie 已提交
3
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
Q
qinyingjie 已提交
4 5 6 7 8 9 10
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

@Configuration
public class RestConfig {

Q
qinyingjie 已提交
11
    @LoadBalanced
Q
qinyingjie 已提交
12 13 14 15 16
    @Bean
    public RestTemplate restTemplate() {
        return new RestTemplate();
    }
}