Compare commits
No commits in common. "3456145830ba89bf98a2e6ca1ab0bce493f0a45f" and "0194019077f298fd3a3433158bf36be612aaba6c" have entirely different histories.
3456145830
...
0194019077
@ -5607,28 +5607,4 @@ public class SdmController extends LocaleController<AkunVO> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "cek-health", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
|
|
||||||
public ResponseEntity<Map<String, Object>> cekHealth(HttpServletRequest request) {
|
|
||||||
|
|
||||||
long startTime = System.currentTimeMillis();
|
|
||||||
|
|
||||||
Map<String, Object> body = new HashMap<>();
|
|
||||||
String now = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
|
||||||
|
|
||||||
body.put("message", "ready");
|
|
||||||
body.put("time", now);
|
|
||||||
|
|
||||||
long latency = System.currentTimeMillis() - startTime;
|
|
||||||
|
|
||||||
Map<String, Object> response = new LinkedHashMap<>();
|
|
||||||
response.put("url", request.getRequestURL().toString());
|
|
||||||
response.put("status_code", HttpStatus.OK.value());
|
|
||||||
response.put("is_ok", true);
|
|
||||||
response.put("latency_ms", latency);
|
|
||||||
response.put("body", body);
|
|
||||||
response.put("checked_at", now);
|
|
||||||
|
|
||||||
return ResponseEntity.ok(response);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user