@RequestMapping( value = {"/courses/{courseId}/modules"}, method = RequestMethod.GET) public List<ModuleJsonDto> getModules(@PathVariable Long courseId) { return dtoService.convert( moduleService.getAllByCourseId(courseId), ModuleJsonDto.class, Module.class); }
@RequestMapping( value = {"/modules/{moduleId}/resources/addexisting/{resourceId}"}, method = RequestMethod.POST) public void addExistingResourceToModule( @PathVariable Long moduleId, @PathVariable Long resourceId, HttpServletResponse response) throws IOException, RestAjaxInternalServerException { try { moduleService.addExistingResource(moduleId, resourceService.getById(resourceId)); } catch (Exception e) { throw new RestAjaxInternalServerException(e.getMessage(), e); } }
@RequestMapping( value = {"/modules/{moduleId}", "/courses/{courseId}/modules/{moduleId}"}, method = RequestMethod.GET) public ModuleJsonDto getModule(@PathVariable Long moduleId) { return dtoService.convert(moduleService.getById(moduleId), ModuleJsonDto.class, Module.class); }