Package org.motechproject.mots.web
Class ModuleController
- java.lang.Object
-
- org.motechproject.mots.web.BaseController
-
- org.motechproject.mots.web.ModuleController
-
@Controller public class ModuleController extends BaseController
This class is responsible for CURD operations.
-
-
Constructor Summary
Constructors Constructor Description ModuleController()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ModuleDtocopyModule(java.util.UUID id)CopyModuleas a new draft.CourseDtocreateCourse()CreateCourse.ModuleDtocreateModule(@Valid ModuleDto moduleDto, org.springframework.validation.BindingResult bindingResult)CreateModule.java.util.List<CourseDto>getCourses()Get list ofCourses.java.util.List<ModuleSimpleDto>getSimpleModules()Get list of Module Simple DTOs.CourseDtoreleaseCourse(java.util.UUID id)ReleaseCourse.CourseDtoupdateCourse(java.util.UUID id, @Valid CourseDto courseDto, org.springframework.validation.BindingResult bindingResult)UpdateCourse.ModuleDtoupdateModule(java.util.UUID id, @Valid ModuleDto moduleDto, org.springframework.validation.BindingResult bindingResult)UpdateModule.-
Methods inherited from class org.motechproject.mots.web.BaseController
checkBindingResult, getErrors
-
-
-
-
Method Detail
-
getSimpleModules
@RequestMapping(value="/modules/simple", method=GET) @ResponseStatus(OK) @ResponseBody public java.util.List<ModuleSimpleDto> getSimpleModules()Get list of Module Simple DTOs.- Returns:
- list of all Modules
-
createModule
@RequestMapping(value="/modules", method=POST) @ResponseStatus(CREATED) @ResponseBody public ModuleDto createModule(@RequestBody @Valid @Valid ModuleDto moduleDto, org.springframework.validation.BindingResult bindingResult)CreateModule.- Parameters:
moduleDto- DTO of Module to createbindingResult- spring object used for validation- Returns:
- created Module
-
updateModule
@RequestMapping(value="/modules/{id}", method=PUT) @ResponseStatus(OK) @ResponseBody public ModuleDto updateModule(@PathVariable("id") java.util.UUID id, @RequestBody @Valid @Valid ModuleDto moduleDto, org.springframework.validation.BindingResult bindingResult)UpdateModule.- Parameters:
id- id of Module to updatemoduleDto- DTO of Module to updatebindingResult- spring object used for validation- Returns:
- updated Module
-
copyModule
@RequestMapping(value="/modules/{id}/edit", method=PUT) @ResponseStatus(OK) @ResponseBody public ModuleDto copyModule(@PathVariable("id") java.util.UUID id)CopyModuleas a new draft.- Parameters:
id- id of Module to update- Returns:
- copy of Module to be edited
-
getCourses
@RequestMapping(value="/courses", method=GET) @ResponseStatus(OK) @ResponseBody public java.util.List<CourseDto> getCourses()Get list ofCourses.- Returns:
- list of all Courses
-
createCourse
@RequestMapping(value="/courses", method=POST) @ResponseStatus(CREATED) @ResponseBody public CourseDto createCourse()CreateCourse.- Returns:
- created Course
-
updateCourse
@RequestMapping(value="/courses/{id}", method=PUT) @ResponseStatus(OK) @ResponseBody public CourseDto updateCourse(@PathVariable("id") java.util.UUID id, @RequestBody @Valid @Valid CourseDto courseDto, org.springframework.validation.BindingResult bindingResult)UpdateCourse.- Parameters:
id- id of Course to updatecourseDto- DTO of Course to updatebindingResult- spring object used for validation- Returns:
- updated Course
-
-