コード例 #1
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);
 }
コード例 #2
0
 @RequestMapping(value = "/tests/{testId}/delete", method = RequestMethod.GET)
 public Boolean deleteTestById(@PathVariable Long testId) {
   testService.deleteTestById(testId);
   return true;
 }
コード例 #3
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);
 }