Ejemplo n.º 1
0
 @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);
 }
Ejemplo n.º 2
0
 @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);
   }
 }
Ejemplo n.º 3
0
 @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);
 }