|
|
@ -1,10 +1,14 @@ |
|
|
|
package com.epmet.healthcheck; |
|
|
|
|
|
|
|
import com.epmet.commons.tools.utils.IpUtils; |
|
|
|
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; |
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
|
|
|
|
@RestController |
|
|
|
@RequestMapping("healthcheck") |
|
|
|
public class HealthCheckController { |
|
|
@ -14,8 +18,9 @@ public class HealthCheckController { |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@PostMapping("http") |
|
|
|
public Result httpHealthCheck() { |
|
|
|
return new Result(); |
|
|
|
public Result httpHealthCheck(HttpServletRequest request) { |
|
|
|
String serverIp = IpUtils.getIpAddr(request); |
|
|
|
return new Result().ok(serverIp); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|