<commit_before>package com.github.aha.sat.elk.city;

import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE;

import javax.websocket.server.PathParam;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.elasticsearch.core.SearchHits;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import lombok.NonNull;
import lombok.RequiredArgsConstructor;

/**
 * Usage:
 * get city detail							- GET http://localhost:8080/api/cities/HwB5aHgBiVYee_AkNeA6 
 * static search cities (with pagination)	- GET http://localhost:8080/api/cities/country/czech republic?sort=name,desc
 * dynamic search cities (with pagination)	- GET http://localhost:8080/api/cities/?name=be&country=Czech&subcountry=bohemia&size=5&sort=name
 */
@RestController
@RequestMapping(value = CityController.ROOT_CONTEXT, produces = APPLICATION_JSON_VALUE)
@RequiredArgsConstructor
public class CityController {

	public static final String ROOT_CONTEXT = "/api/cities";

	@NonNull
	final CityService service;

	@GetMapping("/{id}")
	public City getOne(@PathVariable String id) {
		return service.getOne(id).orElse(null);
	}

	@GetMapping("/country/{country}")
	public Page<City> searchByCountry(@PathVariable("country") String country, Pageable pageable) {
		return service.searchByCountry(country, pageable);
	}

	@GetMapping
	public SearchHits<City> search(@PathParam("name") String name, @PathParam("country") String country,
			@PathParam("subcountry") String subcountry, Pageable pageable) {
		return service.search(name, country, subcountry, pageable);
	}

	@PostMapping("/upload")
	public ResponseEntity uploadFile(String filename) {
		service.uploadFile(filename);
		return ResponseEntity.noContent().build();
	}

}<commit_msg>- IDE hint (no generic in the response type)<commit_after>package com.github.aha.sat.elk.city;

import static org.springframework.http.HttpStatus.NO_CONTENT;
import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE;

import javax.websocket.server.PathParam;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.elasticsearch.core.SearchHits;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController;

import lombok.NonNull;
import lombok.RequiredArgsConstructor;

/**
 * Usage:
 * get city detail							- GET http://localhost:8080/api/cities/HwB5aHgBiVYee_AkNeA6 
 * static search cities (with pagination)	- GET http://localhost:8080/api/cities/country/czech republic?sort=name,desc
 * dynamic search cities (with pagination)	- GET http://localhost:8080/api/cities/?name=be&country=Czech&subcountry=bohemia&size=5&sort=name
 */
@RestController
@RequestMapping(value = CityController.ROOT_CONTEXT, produces = APPLICATION_JSON_VALUE)
@RequiredArgsConstructor
public class CityController {

	public static final String ROOT_CONTEXT = "/api/cities";

	@NonNull
	final CityService service;

	@GetMapping("/{id}")
	public City getOne(@PathVariable String id) {
		return service.getOne(id).orElse(null);
	}

	@GetMapping("/country/{country}")
	public Page<City> searchByCountry(@PathVariable("country") String country, Pageable pageable) {
		return service.searchByCountry(country, pageable);
	}

	@GetMapping
	public SearchHits<City> search(@PathParam("name") String name, @PathParam("country") String country,
			@PathParam("subcountry") String subcountry, Pageable pageable) {
		return service.search(name, country, subcountry, pageable);
	}

	@PostMapping("/upload")
	@ResponseStatus(code = NO_CONTENT)
	public void uploadFile(String filename) {
		service.uploadFile(filename);
	}

}
{'fraction_non_alphanumeric': 0.1149613673612737, 'fraction_numerical': 0.007024116132053383, 'mean_word_length': 6.455497382198953, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '6542098', 'n_tokens_mistral': 1313, 'n_tokens_neox': 1251, 'n_words': 241}