package com.knockingstar.controller;

import com.knockingstar.model.Post;
import com.knockingstar.service.PostService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @author mer Ufuk Efendio?lu
 */
@Controller
public class PostController {

    @Autowired
    private PostService postService;

    @RequestMapping("/post")
    public
    @ResponseBody
    Post post(@RequestParam(value = "id", required = true)
              String id) {
        return postService.getPost(Integer.parseInt(id));
    }

    @RequestMapping("/allposts")
    public
    @ResponseBody
    List<Post> posts() {
        return postService.getAllPosts();
    }
}

@@ -463,16 +463,17 @@
 @author 
+%C3%96
 mer Ufuk
@@ -484,9 +484,9 @@
 ndio
-?
+%C4%9F
 lu%0D%0A

Update PostController.java