package com.xiang.app; import com.google.common.collect.Maps; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Value; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; import java.util.Map; @Slf4j @RestController public class HealthController { @Value("${spring.profiles.active}") private String env; @GetMapping("/actuator/health") public Map checkHealth() { Map map = Maps.newHashMap(); map.put("env", env); map.put("status", "UP"); log.info("cornucopia application health check success! listening in env:{}, now:{}", env, System.currentTimeMillis()); return map; } }