1 package com.example.rest;
\r
3 import java.util.List;
\r
5 import org.springframework.beans.factory.annotation.Autowired;
\r
6 import org.springframework.http.MediaType;
\r
7 import org.springframework.web.bind.annotation.RequestMapping;
\r
8 import org.springframework.web.bind.annotation.RequestMethod;
\r
9 import org.springframework.web.bind.annotation.RequestParam;
\r
10 import org.springframework.web.bind.annotation.ResponseBody;
\r
11 import org.springframework.web.bind.annotation.RestController;
\r
13 import com.example.domain.TodoHeaderInfo;
\r
14 import com.example.domain.TodoListInfo;
\r
15 import com.example.service.TodoService;
\r
19 @RequestMapping("/api")
\r
20 public class TodoRestController {
\r
23 TodoService todoHeaderService;
\r
25 @RequestMapping(value = "/findHeaders", method = RequestMethod.GET)
\r
27 public List<TodoHeaderInfo> findHeaders() {
\r
28 return todoHeaderService.findTodoHeaders();
\r
31 @RequestMapping(value = "/findLists", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE , produces = MediaType.APPLICATION_JSON_VALUE)
\r
33 public List<TodoListInfo> findLists(@RequestParam(name = "headerId") String headerId) {
\r
34 return todoHeaderService.findTodoLists(headerId);
\r
37 @RequestMapping(value = "/getLists", method = RequestMethod.GET)
\r
39 public List<TodoListInfo> getLists(@RequestParam(name = "headerId") String headerId) {
\r
40 return todoHeaderService.findTodoLists(headerId);
\r