UserServiceApplication.java 790 字节
Newer Older
M
ManongJu 已提交
1
package com.mircoservice.skeleton.user.service;
M
ManongJu 已提交
2 3 4

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
M
ManongJu 已提交
5
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
M
ManongJu 已提交
6 7 8 9 10 11 12
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

@SpringBootApplication
@EnableDiscoveryClient
M
ManongJu 已提交
13
@EnableCircuitBreaker
M
ManongJu 已提交
14
public class UserServiceApplication {
M
ManongJu 已提交
15 16

	public static void main(String[] args) {
M
ManongJu 已提交
17
		SpringApplication.run(UserServiceApplication.class, args);
M
ManongJu 已提交
18 19 20 21 22 23 24
	}
	@Bean
	@LoadBalanced
	RestTemplate restTemplate(){
		return new RestTemplate();
	}
}