@@ -0,0 +1,1624 @@
+package com.danchu.momuck.controller;%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.PathVariable;%0Aimport org.springframework.web.bind.annotation.RequestBody;%0Aimport org.springframework.web.bind.annotation.RequestMapping;%0Aimport org.springframework.web.bind.annotation.RequestMethod;%0Aimport org.springframework.web.bind.annotation.ResponseBody;%0A%0Aimport com.danchu.momuck.service.RestaurantService;%0Aimport com.danchu.momuck.view.ResultView;%0Aimport com.danchu.momuck.vo.Account;%0Aimport com.danchu.momuck.vo.Restaurant;%0A%0A@Controller%0A@RequestMapping(value = %22/restaurants%22)%0Apublic class RestaurantController %7B%0A%0A%09@Autowired%0A%09RestaurantService restaurantService;%0A%0A%09@ResponseBody%0A%09@RequestMapping(method = RequestMethod.POST, consumes = %22application/json%22)%0A%09public ResultView register(HttpServletRequest req, HttpServletResponse res, @RequestBody Restaurant restaurant) %7B%0A%0A%09%09Restaurant result = restaurantService.createRestaurant(restaurant);%0A%09%09if (result == null) %7B%0A%09%09%09return new ResultView(%22500%22, %22Duplicated email or name%22, null);%0A%09%09%7D%0A%09%09return new ResultView(%22200%22, %22Register success%22, restaurant);%0A%09%7D%0A%09%0A%09@ResponseBody%0A%09@RequestMapping(method = RequestMethod.DELETE, consumes = %22application/json%22)%0A%09public ResultView delete(HttpServletRequest req, HttpServletResponse res, @PathVariable String restaurantName) %7B%0A%09%09restaurantService.deleteRestaurant(restaurantName);%0A%09%09return new ResultView(%22200%22, %22SUCCESS%22, null);%0A%09%7D%0A%7D%0A

Add RestaurantController