<commit_before>package lendmanager.mongo.rest;

import java.util.List;

import lendmanager.mongo.Item;
import lendmanager.mongo.ItemRepository;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/rest/items")
public class RestItemController {

	@Autowired
	private ItemRepository itemRepository;
	
	@RequestMapping(value = "/all", method = RequestMethod.GET, produces = "application/json")
	public List<Item> getAllItems() {
		return itemRepository.findAll();
	}
	
}<commit_msg>added rest service adding sample data for test purpose<commit_after>package lendmanager.mongo.rest;

import java.util.Calendar;
import java.util.List;

import lendmanager.mongo.Item;
import lendmanager.mongo.ItemRepository;
import lendmanager.mongo.Person;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.google.common.collect.Lists;


@RestController
@RequestMapping("/rest/items")
public class RestItemController {

	@Autowired
	private ItemRepository itemRepository;
	
	@RequestMapping(value = "/all", method = RequestMethod.GET, produces = "application/json")
	public List<Item> getAllItems() {
		return itemRepository.findAll();
	}
	
	@RequestMapping(value = "/addSampleData", method = RequestMethod.GET)
	public String createTestItems() {
		List<Item> entites = Lists.newArrayList();
		Item item = new Item("kilof");
		item.setLendDate(Calendar.getInstance().getTime());
		item.setPerson(new Person("to nie", "ja"));
		entites.add(item);
		entites.add(new Item("dlugopis"));
		entites.add(new Item("komputer"));
		itemRepository.save(entites);
		return "Items saved";
	}
}
{'fraction_non_alphanumeric': 0.11852589641434264, 'fraction_numerical': 0.0, 'mean_word_length': 6.278985507246377, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, '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': '7487379', 'n_tokens_mistral': 600, 'n_tokens_neox': 576, 'n_words': 114}