@Secured(value = {"ROLE_ADMIN"}) @RequestMapping(value = "/a/course/{code}", method = RequestMethod.GET) public ModelAndView manageCourse(ModelAndView model, @PathVariable String code) { model.addObject("courseId", courseService.getCourseByCourseCode(code).getId()); model.addObject("courseCode", code); model.setViewName(CM_DIR + "editCourse"); return model; }
@RequestMapping(value = "/a/course/", method = RequestMethod.POST) public @ResponseBody CreateCourseResponse createCourse( @RequestBody Course course, HttpServletResponse response) { courseService.addCourse(course); CreateCourseResponse result = new CreateCourseResponse(); result.setStatus("OK"); result.setCourse(course); return result; }