@@ -0,0 +1,1676 @@
+package com.danchu.momuck.controller;%0A%0A%0Aimport javax.servlet.http.HttpServletRequest;%0Aimport javax.servlet.http.HttpServletResponse;%0A%0Aimport org.springframework.beans.factory.annotation.Autowired;%0Aimport org.springframework.stereotype.Controller;%0Aimport org.springframework.web.bind.annotation.RequestMapping;%0Aimport org.springframework.web.bind.annotation.RequestMethod;%0Aimport org.springframework.web.bind.annotation.RequestParam;%0Aimport org.springframework.web.bind.annotation.ResponseBody;%0A%0Aimport com.danchu.momuck.dao.FoodListDao;%0Aimport com.fasterxml.jackson.core.JsonProcessingException;%0Aimport com.fasterxml.jackson.databind.ObjectMapper;%0A%0A@Controller%0A@RequestMapping(value = %22/foods%22)%0Apublic class ListController %7B%0A%09%0A%09@Autowired%0A%09FoodListDao foodListDao;%0A%09%0A%09private ObjectMapper mapper = new ObjectMapper();%0A%09private String jsonString;%0A%09%0A%09%0A%09@ResponseBody%0A%09@RequestMapping(method=RequestMethod.GET, produces = %22text/json; charset=UTF-8%22)%0A%09public String getAllFoodList(HttpServletRequest req, HttpServletResponse res) throws JsonProcessingException%0A%09%7B%0A%09%09try %7B%0A%09%09%09jsonString = mapper.writeValueAsString(foodListDao.selectAllFood());%0A%09%09%7D catch (JsonProcessingException e) %7B%0A%09%09%09throw e;%0A%09%09%7D%0A%09%09return jsonString;%0A%09%7D%0A%09%0A%09@ResponseBody%0A%09@RequestMapping(params=%22category%22, method = RequestMethod.GET, produces = %22text/json; charset=UTF-8%22)%0A%09public String getCategoryFoodList(HttpServletRequest req, HttpServletResponse res, @RequestParam(%22category%22) String category) throws JsonProcessingException%0A%09%7B%0A%09%09try %7B%0A%09%09%09jsonString = mapper.writeValueAsString(foodListDao.selectCategoryFood(category));%0A%09%09%7D catch (JsonProcessingException e) %7B%0A%09%09%09throw e;%0A%09%09%7D%0A%09%09return jsonString;%0A%09%7D%0A%7D%0A

Add ListController