2 changed files with 20 additions and 2 deletions
			
			
		@ -0,0 +1,20 @@ | 
				
			|||
package com.epmet.modules.test; | 
				
			|||
 | 
				
			|||
import com.epmet.commons.tools.utils.Result; | 
				
			|||
import org.springframework.web.bind.annotation.PostMapping; | 
				
			|||
import org.springframework.web.bind.annotation.RequestMapping; | 
				
			|||
import org.springframework.web.bind.annotation.RestController; | 
				
			|||
 | 
				
			|||
import javax.servlet.http.HttpServletRequest; | 
				
			|||
 | 
				
			|||
@RestController | 
				
			|||
@RequestMapping("test") | 
				
			|||
public class TestController { | 
				
			|||
 | 
				
			|||
    @PostMapping("get-req-domain") | 
				
			|||
    public Result testDomain(HttpServletRequest request) { | 
				
			|||
        String domain = String.format("%s://%s", request.getScheme(), request.getServerName()); | 
				
			|||
        return new Result().ok(domain); | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
} | 
				
			|||
					Loading…
					
					
				
		Reference in new issue