|
@@ -6,6 +6,7 @@ import cn.rankin.common.utils.api.page.Page;
|
|
import cn.rankin.data.api.product.dto.LessonDTO;
|
|
import cn.rankin.data.api.product.dto.LessonDTO;
|
|
import cn.rankin.common.utils.dto.search.SearchDTO;
|
|
import cn.rankin.common.utils.dto.search.SearchDTO;
|
|
import cn.rankin.common.utils.util.BeanUtil;
|
|
import cn.rankin.common.utils.util.BeanUtil;
|
|
|
|
+import cn.rankin.data.api.product.entity.Lesson;
|
|
import cn.rankin.data.api.product.vo.LessonVo;
|
|
import cn.rankin.data.api.product.vo.LessonVo;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
@@ -20,22 +21,22 @@ public class LessonController {
|
|
private LessonService lessonService;
|
|
private LessonService lessonService;
|
|
|
|
|
|
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
|
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
|
- public APIResult<Page<LessonVo>> getLessonList(SearchDTO searchDTO) {
|
|
|
|
|
|
+ public APIResult<Page<Lesson>> getLessonList(SearchDTO searchDTO) {
|
|
return lessonService.search(BeanUtil.convertToMap(searchDTO));
|
|
return lessonService.search(BeanUtil.convertToMap(searchDTO));
|
|
}
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
|
|
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
|
|
- public APIResult<LessonVo> getLesson(@PathVariable("id") String id) {
|
|
|
|
|
|
+ public APIResult<Lesson> getLesson(@PathVariable("id") String id) {
|
|
return lessonService.getLesson(id);
|
|
return lessonService.getLesson(id);
|
|
}
|
|
}
|
|
|
|
|
|
@RequestMapping(method = RequestMethod.POST)
|
|
@RequestMapping(method = RequestMethod.POST)
|
|
- public APIResult<LessonVo> create(@Valid @RequestBody LessonDTO lessonDTO) {
|
|
|
|
|
|
+ public APIResult<Lesson> create(@Valid @RequestBody LessonDTO lessonDTO) {
|
|
return lessonService.create(lessonDTO);
|
|
return lessonService.create(lessonDTO);
|
|
}
|
|
}
|
|
|
|
|
|
@RequestMapping(method = RequestMethod.PUT)
|
|
@RequestMapping(method = RequestMethod.PUT)
|
|
- public APIResult<LessonVo> update(@Valid @RequestBody LessonDTO lessonDTO) {
|
|
|
|
|
|
+ public APIResult<Lesson> update(@Valid @RequestBody LessonDTO lessonDTO) {
|
|
return lessonService.update(lessonDTO);
|
|
return lessonService.update(lessonDTO);
|
|
}
|
|
}
|
|
|
|
|