Java 类org.springframework.boot.actuate.endpoint.mvc.ActuatorMediaTypes 实例源码

项目:extended-actuator-health-endpoints    文件:ExtendedHealthMvcEndpoint.java   
@RequestMapping(method = RequestMethod.GET, produces = {
        ActuatorMediaTypes.APPLICATION_ACTUATOR_V1_JSON_VALUE,
        MediaType.APPLICATION_JSON_VALUE})
@ResponseBody
public Object invoke(HttpServletRequest request) {
    if (!getDelegate().isEnabled()) {
        // Shouldn't happen because the request mapping should not be registered
        return getDisabledResponse();
    }
    Health health = getDelegate().invoke();
    HttpStatus status = this.statusMapping.get(health.getStatus().getCode());
    if (status != null) {
        return new ResponseEntity<>(health, status);
    }
    return health;
}
项目:druid-spring-boot    文件:DruidDataSourceMvcEndpoint.java   
@GetMapping(value = "/{name:.*}", produces = {ActuatorMediaTypes.APPLICATION_ACTUATOR_V1_JSON_VALUE,
        MediaType.APPLICATION_JSON_VALUE})
@ResponseBody
@HypermediaDisabled
public String handle(@PathVariable String name) {
    String temp = name;
    if (name.contains(".")) {
        temp = name.substring(0, name.indexOf("."));
    }
    name = "/" + temp + ".json";
    return statService.service(name);
}