コード例 #1
0
 @RequestMapping(
     value = {"/courses/{courseId}/groups"},
     method = RequestMethod.GET)
 public List<GroupNameJsonDto> getAllGroupsByCourseId(@PathVariable Long courseId) {
   return dtoService.convert(
       groupService.getAllByCourseId(courseId), GroupNameJsonDto.class, Group.class);
 }
コード例 #2
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);
 }
コード例 #3
0
 @RequestMapping(
     value = {"/modules/{moduleId}/resources", "/courses/{courseId}/modules/{moduleId}/resources"},
     method = RequestMethod.GET)
 public List<ResourceJsonDto> getResources(@PathVariable Long moduleId) {
   return dtoService.convert(
       resourceService.getAllByModuleId(moduleId), ResourceJsonDto.class, Resource.class);
 }
コード例 #4
0
 @RequestMapping(
     value = {"/modules/{moduleId}/tests", "/courses/{courseId}/modules/{moduleId}/tests"},
     method = RequestMethod.GET)
 public List<TestJsonDto> getTests(@PathVariable Long moduleId) {
   return dtoService.convert(
       testService.getAllByModuleId(moduleId), TestJsonDto.class, Test.class);
 }
コード例 #5
0
 @RequestMapping(
     value = {"/areas"},
     method = RequestMethod.GET)
 public List<AreaJsonDto> getAreas(HttpServletResponse response) {
   List<AreaJsonDto> dtos =
       dtoService.convert(areaService.getAll(), AreaJsonDto.class, Area.class);
   response.addIntHeader("X-Total-Count", dtos.size());
   return dtos;
 }
コード例 #6
0
 // resources REST
 @RequestMapping(
     value = {"/resources/notAssociatedWith/modules/{moduleId}"},
     method = RequestMethod.GET)
 public List<ResourceJsonDto> getAllResourcesNotAssociatedWithModule(@PathVariable Long moduleId) {
   return dtoService.convert(
       resourceService.getAllNotAssociatedWithModule(moduleId),
       ResourceJsonDto.class,
       Resource.class);
 }
コード例 #7
0
 @RequestMapping(
     value = {
       "/resources/{resourceId}",
       "/courses/{courseId}/modules/{moduleId}/resources/{resourceId}"
     },
     method = RequestMethod.GET)
 public ResourceJsonDto getResource(@PathVariable Long resourceId) {
   return dtoService.convert(
       resourceService.getById(resourceId), ResourceJsonDto.class, Resource.class);
 }
コード例 #8
0
 @RequestMapping(
     value = {"/courses/{courseId}"},
     method = RequestMethod.GET)
 public CourseJsonDto getCourse(@PathVariable Long courseId) {
   return dtoService.convert(courseService.getById(courseId), CourseJsonDto.class, Course.class);
 }
コード例 #9
0
 @RequestMapping(
     value = {"/courses"},
     method = RequestMethod.GET)
 public List<CourseJsonDto> getCourses() {
   return dtoService.convert(courseService.getAll(), CourseJsonDto.class, Course.class);
 }
コード例 #10
0
 @RequestMapping(
     value = {"/areas/{areaId}"},
     method = RequestMethod.GET)
 public AreaJsonDto getArea(@PathVariable Long areaId) {
   return dtoService.convert(areaService.getById(areaId), AreaJsonDto.class, Area.class);
 }
コード例 #11
0
 // Group REST
 @RequestMapping(
     value = {"/groups"},
     method = RequestMethod.GET)
 public List<GroupNameJsonDto> getAllGroups() {
   return dtoService.convert(groupService.getAll(), GroupNameJsonDto.class, Group.class);
 }
コード例 #12
0
 @RequestMapping(
     value = {"/tests/{testId}", "/courses/{courseId}/modules/{moduleId}/tests/{testId}"},
     method = RequestMethod.GET)
 public TestJsonDto getTest(@PathVariable Long testId) {
   return dtoService.convert(testService.getById(testId), TestJsonDto.class, Test.class);
 }
コード例 #13
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);
 }