@Test public void updateViewSpace()throws Exception { request.setRequestURI("/vs/1/update"); request.addParameter("spaceId", "1"); request.addParameter("spaceName", "测试景区2"); request.addParameter("description", "测试景区2~~"); request.setMethod("PUT"); ModelAndView mav = handlerAdapter.handle(request, response, controller); assertNotNull(mav); assertEquals(mav.getViewName(), "redirect:/vs/index"); }
@RequestMapping(value="/vs/{id}/update",method=RequestMethod.PUT) public String updateViewSpace(@PathVariable Integer id,HttpServletRequest request, ViewSpace vs) { vs.setUser(getSessionUser(request)); vs.setSpaceId(id); viewSpaceService.updateViewSpace(vs); String targetUrl = "/vs/index"; return "redirect:"+targetUrl; }
ViewManageController extends BaseController { @RequestMapping(value="/vs/{id}/update",method=RequestMethod.PUT) public String updateViewSpace(@PathVariable Integer id,HttpServletRequest request, ViewSpace vs) { vs.setUser(getSessionUser(request)); vs.setSpaceId(id); viewSpaceService.updateViewSpace(vs); String targetUrl = "/vs/index"; return "redirect:"+targetUrl; } }
ViewManageController extends BaseController { @RequestMapping(value="/vs/{id}/update",method=RequestMethod.PUT) public String updateViewSpace(@PathVariable Integer id,HttpServletRequest request, ViewSpace vs) { vs.setUser(getSessionUser(request)); vs.setSpaceId(id); viewSpaceService.updateViewSpace(vs); String targetUrl = "/vs/index"; return "redirect:"+targetUrl; }  }
ViewManageController extends BaseController { @RequestMapping(value="/vs/{id}/update",method=RequestMethod.PUT) public String updateViewSpace(@PathVariable Integer id,HttpServletRequest request, ViewSpace vs) { vs.setUser(getSessionUser(request)); vs.setSpaceId(id); viewSpaceService.updateViewSpace(vs); String targetUrl = "/vs/index"; return "redirect:"+targetUrl; }  @RequestMapping(value = "/index", method = RequestMethod.GET) String listViewSpaces(HttpServletRequest request); @RequestMapping(value = "/vs/index", method = RequestMethod.GET) String listUserViewSpaces(HttpServletRequest request); @RequestMapping(value = "/search",method=RequestMethod.PUT) String queryViewSpaces(HttpServletRequest request); @RequestMapping(value = "/vs/{id}", method = RequestMethod.GET) String showViewSpace(@PathVariable Integer id,HttpServletRequest request); @RequestMapping(value = "/vs/add", method = RequestMethod.GET) String addViewSpacePage(); @RequestMapping(value = "/vs/save", method=RequestMethod.PUT) String addViewSpace(HttpServletRequest request,ViewSpace viewSpace); @RequestMapping(value="/vs/{id}/edit") String updateViewSpacePage(@PathVariable Integer id,HttpServletRequest request); @RequestMapping(value="/vs/{id}/update",method=RequestMethod.PUT) String updateViewSpace(@PathVariable Integer id,HttpServletRequest request, ViewSpace vs); @RequestMapping(value="/vs/{id}/delete",method=RequestMethod.DELETE) String deleteViewSpace(@PathVariable Integer id); @RequestMapping(value="/vs/comment/{id}/{commentType}",method=RequestMethod.GET) String commentViewSpace(@PathVariable Integer id,@PathVariable Integer commentType,HttpServletRequest request); @RequestMapping(value = "/vp/{id}/add", method = RequestMethod.GET) String addViewPointPage(@PathVariable Integer id,HttpServletRequest request); @RequestMapping(value = "/vp/save", method = RequestMethod.POST) String addViewPoint(MultipartHttpServletRequest request, @RequestParam("spaceId") int spaceId,
			@RequestParam("pointName") String pointName,
			@RequestParam("ticketPrice") float ticketPrice,
			@RequestParam("description") String description); @RequestMapping(value="/vp/{id}/delete",method=RequestMethod.DELETE) String deleteViewPoint(@PathVariable Integer id); @RequestMapping(value="/vp/{id}/edit",method=RequestMethod.GET) String updateViewPointPage(@PathVariable Integer id,HttpServletRequest request); @RequestMapping(value = "/vp/{id}/update", method = RequestMethod.POST) String updateViewPoint(@PathVariable Integer id,MultipartHttpServletRequest request,
		    @RequestParam("spaceId") int spaceId,
			@RequestParam("pointName") String pointName,
			@RequestParam("ticketPrice") float ticketPrice,
			@RequestParam("description") String description); }
ViewManageController extends BaseController { @RequestMapping(value="/vs/{id}/update",method=RequestMethod.PUT) public String updateViewSpace(@PathVariable Integer id,HttpServletRequest request, ViewSpace vs) { vs.setUser(getSessionUser(request)); vs.setSpaceId(id); viewSpaceService.updateViewSpace(vs); String targetUrl = "/vs/index"; return "redirect:"+targetUrl; }  @RequestMapping(value = "/index", method = RequestMethod.GET) String listViewSpaces(HttpServletRequest request); @RequestMapping(value = "/vs/index", method = RequestMethod.GET) String listUserViewSpaces(HttpServletRequest request); @RequestMapping(value = "/search",method=RequestMethod.PUT) String queryViewSpaces(HttpServletRequest request); @RequestMapping(value = "/vs/{id}", method = RequestMethod.GET) String showViewSpace(@PathVariable Integer id,HttpServletRequest request); @RequestMapping(value = "/vs/add", method = RequestMethod.GET) String addViewSpacePage(); @RequestMapping(value = "/vs/save", method=RequestMethod.PUT) String addViewSpace(HttpServletRequest request,ViewSpace viewSpace); @RequestMapping(value="/vs/{id}/edit") String updateViewSpacePage(@PathVariable Integer id,HttpServletRequest request); @RequestMapping(value="/vs/{id}/update",method=RequestMethod.PUT) String updateViewSpace(@PathVariable Integer id,HttpServletRequest request, ViewSpace vs); @RequestMapping(value="/vs/{id}/delete",method=RequestMethod.DELETE) String deleteViewSpace(@PathVariable Integer id); @RequestMapping(value="/vs/comment/{id}/{commentType}",method=RequestMethod.GET) String commentViewSpace(@PathVariable Integer id,@PathVariable Integer commentType,HttpServletRequest request); @RequestMapping(value = "/vp/{id}/add", method = RequestMethod.GET) String addViewPointPage(@PathVariable Integer id,HttpServletRequest request); @RequestMapping(value = "/vp/save", method = RequestMethod.POST) String addViewPoint(MultipartHttpServletRequest request, @RequestParam("spaceId") int spaceId,
			@RequestParam("pointName") String pointName,
			@RequestParam("ticketPrice") float ticketPrice,
			@RequestParam("description") String description); @RequestMapping(value="/vp/{id}/delete",method=RequestMethod.DELETE) String deleteViewPoint(@PathVariable Integer id); @RequestMapping(value="/vp/{id}/edit",method=RequestMethod.GET) String updateViewPointPage(@PathVariable Integer id,HttpServletRequest request); @RequestMapping(value = "/vp/{id}/update", method = RequestMethod.POST) String updateViewPoint(@PathVariable Integer id,MultipartHttpServletRequest request,
		    @RequestParam("spaceId") int spaceId,
			@RequestParam("pointName") String pointName,
			@RequestParam("ticketPrice") float ticketPrice,
			@RequestParam("description") String description);  }