forked from luyan/epmet-cloud-lingshan
				
			
			You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							30 lines
						
					
					
						
							875 B
						
					
					
				
			
		
		
		
			
			
			
				
					
				
				
					
				
			
		
		
	
	
							30 lines
						
					
					
						
							875 B
						
					
					
				
								package com.epmet.lbtest.controller;
							 | 
						|
								
							 | 
						|
								import com.epmet.lbtest.feign.TestCallFeignClient;
							 | 
						|
								import org.springframework.beans.factory.annotation.Autowired;
							 | 
						|
								import org.springframework.web.bind.annotation.GetMapping;
							 | 
						|
								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")
							 | 
						|
								public class LbController {
							 | 
						|
								
							 | 
						|
								    @Autowired
							 | 
						|
								    private TestCallFeignClient testCallFeignClient;
							 | 
						|
								
							 | 
						|
								    @GetMapping("test")
							 | 
						|
								    public String test() {
							 | 
						|
								        String localAddr = null;
							 | 
						|
								        try {
							 | 
						|
								            localAddr = InetAddress.getLocalHost().getHostAddress();
							 | 
						|
								        } catch (UnknownHostException e) {
							 | 
						|
								            e.printStackTrace();
							 | 
						|
								        }
							 | 
						|
								        return localAddr;
							 | 
						|
								    }
							 | 
						|
								}
							 | 
						|
								
							 |