<commit_before>package fr.eisti.web;

import fr.eisti.repository.StationRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by ivan on 21/12/16.
 */
@RestController
public class StationController {

    @Autowired
    private StationRepository stationRepository;

    @RequestMapping("/stations/all")
    public Iterable List() {
        return stationRepository.findAll();
    }

    @RequestMapping("/stations/county/{county}")
    public Iterable ListByCounty(@PathVariable("county") int county) {
        return stationRepository.findByCounty(county);
    }

    @RequestMapping("/stations/district/{district}")
    public Iterable ListByDistrict(@PathVariable("district") int district) {
        return stationRepository.findByDistrict(district);
    }
}<commit_msg>Client can now retrieve information about a station<commit_after>package fr.eisti.web;

import fr.eisti.domain.Station;
import fr.eisti.domain.StationRealTime;
import fr.eisti.repository.StationRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import java.util.HashMap;

/**
 * Created by ivan on 21/12/16.
 */
@RestController
public class StationController {

    @Autowired
    private StationRepository stationRepository;

    @RequestMapping("/stations/all")
    public Iterable List() {
        return stationRepository.findAll();
    }

    @RequestMapping("/stations/county/{county}")
    public Iterable ListByCounty(@PathVariable("county") int county) {
        return stationRepository.findByCounty(county);
    }

    @RequestMapping("/stations/district/{district}")
    public Iterable ListByDistrict(@PathVariable("district") int district) {
        return stationRepository.findByDistrict(district);
    }

    @RequestMapping("/stations/station/{station_number}")
    public StationRealTime getInformation(@PathVariable("station_number") int stationNumber) {
        RestTemplate restTemplate = new RestTemplate();
        return restTemplate.getForObject("https://api.jcdecaux.com/vls/v1/stations/" + stationNumber + "?contract=Paris&apiKey=<KEY>", StationRealTime.class);
    }
}
{'fraction_non_alphanumeric': 0.11068702290076336, 'fraction_numerical': 0.004961832061068702, 'mean_word_length': 4.876681614349776, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 1, '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': '7242989', 'n_tokens_mistral': 719, 'n_tokens_neox': 696, 'n_words': 126}