// Path: springCloudHystrixRibbon/src/main/java/me/helllp/demo/springCloudHystrixRibbon/service/HystrixRibbonService.java
// @Service
// public class HystrixRibbonService {
// 	private static final String SERVICE_NAME = "EUREKACLIENT";
// 	
// 	@Autowired
// 	RestTemplate restTemplate;
// 	
// 	@Autowired
// 	private LoadBalancerClient loadBalancerClient;
// 
// 	@HystrixCommand(fallbackMethod = "helloServiceFallBack")
//     public String helloService(String name) {
// 		ServiceInstance serviceInstance = this.loadBalancerClient.choose(SERVICE_NAME);
// 		System.out.println("服务主机：" + serviceInstance.getHost());
// 		System.out.println("服务端口：" + serviceInstance.getPort());
// 		
//     	//	通过服务名来访问
//         return restTemplate.getForObject("http://" + SERVICE_NAME + "/hello?name="+name,String.class);
//     }
// 
// 	@SuppressWarnings("unused")
// 	private String helloServiceFallBack(String name) {
// 		return "这个是失败的信息！";
// 	}
// }


import me.helllp.demo.springCloudHystrixRibbon.service.HystrixRibbonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

package me.helllp.demo.springCloudHystrixRibbon.web;



@RestController
public class HelloController {
	@Autowired

// Path: springCloudHystrixRibbon/src/main/java/me/helllp/demo/springCloudHystrixRibbon/service/HystrixRibbonService.java
// @Service
// public class HystrixRibbonService {
// 	private static final String SERVICE_NAME = "EUREKACLIENT";
// 	
// 	@Autowired
// 	RestTemplate restTemplate;
// 	
// 	@Autowired
// 	private LoadBalancerClient loadBalancerClient;
// 
// 	@HystrixCommand(fallbackMethod = "helloServiceFallBack")
//     public String helloService(String name) {
// 		ServiceInstance serviceInstance = this.loadBalancerClient.choose(SERVICE_NAME);
// 		System.out.println("服务主机：" + serviceInstance.getHost());
// 		System.out.println("服务端口：" + serviceInstance.getPort());
// 		
//     	//	通过服务名来访问
//         return restTemplate.getForObject("http://" + SERVICE_NAME + "/hello?name="+name,String.class);
//     }
// 
// 	@SuppressWarnings("unused")
// 	private String helloServiceFallBack(String name) {
// 		return "这个是失败的信息！";
// 	}
// }


// Path: springCloudHystrixRibbon/src/main/java/me/helllp/demo/springCloudHystrixRibbon/web/HelloController.java
import me.helllp.demo.springCloudHystrixRibbon.service.HystrixRibbonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

package me.helllp.demo.springCloudHystrixRibbon.web;



@RestController
public class HelloController {
	@Autowired

	HystrixRibbonService helloService;
