| 
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -7,6 +7,8 @@ import org.springframework.web.bind.annotation.RequestMapping; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import org.springframework.web.bind.annotation.RestController; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import javax.servlet.http.HttpServletRequest; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import java.net.InetAddress; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import java.net.UnknownHostException; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					@RestController | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					@RequestMapping("lb") | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -16,16 +18,13 @@ public class LbController { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    private TestCallFeignClient testCallFeignClient; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @GetMapping("test") | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    public String test(HttpServletRequest request) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        String localAddr = request.getServerName(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    public String test() { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        String localAddr = null; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        try { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            localAddr = InetAddress.getLocalHost().getHostAddress(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } catch (UnknownHostException e) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            e.printStackTrace(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        return localAddr; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @GetMapping("test-cal") | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    public String testCall() { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        String result = testCallFeignClient.test(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        System.out.println("调用结果:" + result); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        return result; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					} | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
					 | 
				
				 | 
				
					
  |