package ru.k0r0tk0ff.SpringBootJournalApplication.Service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import ru.k0r0tk0ff.SpringBootJournalApplication.Models.Journal;
import ru.k0r0tk0ff.SpringBootJournalApplication.Repository.JournalRepository;

import java.util.List;

/**
 * Created by user on 9/27/2017.
 */

@Controller
public class JournalController {

    @Autowired
    JournalRepository repo;

    /**
     * For parsing "index.*" in /src/main/java/resources
     */
    /*    @RequestMapping("/")
    public String index(Model model){
        model.addAttribute("journal", repo.findAll());
        return "index";
    }*/

    @RequestMapping("/")
    public @ResponseBody List<Journal> getJournal() {
        return repo.findAll();
    }
}


@@ -584,16 +584,162 @@
 ller %7B%0A%0A
+    /*%0A    * @Autowired %D0%BE%D0%B7%D0%BD%D0%B0%D1%87%D0%B0%D0%B5%D1%82, %D1%87%D1%82%D0%BE BEAN %D1%82%D0%B8%D0%BF%D0%B0 %22JournalRepository%22 %D0%B1%D1%83%D0%B4%D0%B5%D1%82 %D1%81%D0%BE%D0%B7%D0%B4%D0%B0%D0%BD %D0%B0%D0%B2%D1%82%D0%BE%D0%BC%D0%B0%D1%82%D0%B8%D1%87%D0%B5%D1%81%D0%BA%D0%B8, %0A    * %D0%BF%D1%80%D0%B8 %D0%BD%D0%B5%D0%BE%D0%B1%D1%85%D0%BE%D0%B4%D0%B8%D0%BC%D0%BE%D1%81%D1%82%D0%B8 %D0%B5%D0%B3%D0%BE %D0%B8%D1%81%D0%BF%D0%BE%D0%BB%D1%8C%D0%B7%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D1%8F%0A    */%0A
     @Aut
@@ -745,16 +745,16 @@
 towired%0A
-
     Jour
@@ -780,17 +780,16 @@
 %0A%0A    /*
-*
 %0A     * 
@@ -1003,16 +1003,168 @@
    %7D*/%0A%0A
+    /*%0A    * @ResponseBody %D0%BE%D0%B7%D0%BD%D0%B0%D1%87%D0%B0%D0%B5%D1%82, %D1%87%D1%82%D0%BE %D0%BC%D0%B5%D1%82%D0%BE%D0%B4 %D0%B2%D0%BE%D0%B7%D0%B2%D1%80%D0%B0%D1%89%D0%B0%D0%B5%D1%82 %D1%81%D0%BE%D0%B4%D0%B5%D1%80%D0%B6%D0%B8%D0%BC%D0%BE%D0%B5 %D0%BE%D1%82%D0%B2%D0%B5%D1%82 %D0%BD%D0%B0 REST %D0%B7%D0%B0%D0%BF%D1%80%D0%BE%D1%81%0A    * %D0%A2%D1%80%D0%B0%D0%BD%D1%81%D1%84%D0%BE%D1%80%D0%BC%D0%B0%D1%86%D0%B8%D1%8F %D0%B2 JSON %D0%BF%D1%80%D0%BE%D0%B8%D0%B7%D0%B2%D0%BE%D0%B4%D0%B8%D1%82%D1%8C%D1%81%D1%8F %D0%B0%D0%B2%D1%82%D0%BE%D0%BC%D0%B0%D1%82%D0%B8%D1%87%D0%B5%D1%81%D0%BA%D0%B8%0A    */%0A
     @Req

Update JournalController.java