<commit_before>package parking.controller;

import java.lang.management.ManagementFactory;

import org.apache.commons.lang3.time.DurationFormatUtils;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * 
 * @author gustavojotz
 *
 */
@RestController
@RequestMapping(produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public class HealthController {

	@RequestMapping(value = "/health", method = RequestMethod.GET)
	public String health() {
		return "Running";
	}

	@RequestMapping(value = "/uptime", method = RequestMethod.GET)
	public String uptime() {
		return DurationFormatUtils.formatDurationWords(ManagementFactory.getRuntimeMXBean().getUptime(), false, false);
	}
}<commit_msg>Metodo para retornar se o usuario está autenticado.<commit_after>package parking.controller;

import java.lang.management.ManagementFactory;

import org.apache.commons.lang3.time.DurationFormatUtils;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.security.core.Authentication;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * 
 * @author gustavojotz
 *
 */
@RestController
@RequestMapping(produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public class HealthController {

	@RequestMapping(value = "/health", method = RequestMethod.GET)
	public String health() {
		return "Running";
	}

	@RequestMapping(value = "/uptime", method = RequestMethod.GET)
	public String uptime() {
		return DurationFormatUtils.formatDurationWords(ManagementFactory.getRuntimeMXBean().getUptime(), false, false);
	}
	
	@RequestMapping(value = "/logged-in", method = RequestMethod.GET)
	public ResponseEntity<Boolean> loggedIn(Authentication authentication) {
		return new ResponseEntity<>(authentication.isAuthenticated(), HttpStatus.OK);
	}
	
}
{'fraction_non_alphanumeric': 0.10915002322340919, 'fraction_numerical': 0.0018578727357176034, 'mean_word_length': 6.6113074204946995, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '932287', 'n_tokens_mistral': 617, 'n_tokens_neox': 593, 'n_words': 109}