记录ios不能看得视频;免费课程按分类查询
This commit is contained in:
@@ -5,6 +5,7 @@ import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
|||||||
import com.peanut.common.utils.R;
|
import com.peanut.common.utils.R;
|
||||||
import com.peanut.common.utils.ShiroUtils;
|
import com.peanut.common.utils.ShiroUtils;
|
||||||
import com.peanut.modules.common.entity.*;
|
import com.peanut.modules.common.entity.*;
|
||||||
|
import com.peanut.modules.common.service.CourseErrorLogService;
|
||||||
import com.peanut.modules.common.to.ParamTo;
|
import com.peanut.modules.common.to.ParamTo;
|
||||||
import com.peanut.modules.medical.service.CourseMedicalService;
|
import com.peanut.modules.medical.service.CourseMedicalService;
|
||||||
import com.peanut.modules.medical.service.CourseService;
|
import com.peanut.modules.medical.service.CourseService;
|
||||||
@@ -26,6 +27,8 @@ public class CourseController {
|
|||||||
private CourseService courseService;
|
private CourseService courseService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private CourseMedicalService courseMedicalService;
|
private CourseMedicalService courseMedicalService;
|
||||||
|
@Autowired
|
||||||
|
private CourseErrorLogService courseErrorLogService;
|
||||||
|
|
||||||
//添加正在学习(收藏)
|
//添加正在学习(收藏)
|
||||||
@RequestMapping("/addUserCourseStudying")
|
@RequestMapping("/addUserCourseStudying")
|
||||||
@@ -84,20 +87,35 @@ public class CourseController {
|
|||||||
return R.ok().put("data",courseList);
|
return R.ok().put("data",courseList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//记录ios不能看得视频
|
||||||
|
@RequestMapping("/addErrorCourse")
|
||||||
|
public R addErrorCourse(@RequestBody CourseErrorLog courseErrorLog){
|
||||||
|
courseErrorLogService.save(courseErrorLog);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
//免费课程
|
//免费课程
|
||||||
@RequestMapping("/getFreeCourse")
|
@RequestMapping("/getFreeCourse")
|
||||||
public R getFreeCourse(){
|
public R getFreeCourse(@RequestBody Map<String,Object> params){
|
||||||
MPJLambdaWrapper<CourseEntity> wrapper = new MPJLambdaWrapper<>();
|
MPJLambdaWrapper<CourseEntity> wrapper = new MPJLambdaWrapper<>();
|
||||||
wrapper.distinct();
|
wrapper.distinct();
|
||||||
wrapper.disableSubLogicDel().leftJoin(CourseToMedicine.class,CourseToMedicine::getCourseId,CourseEntity::getId);
|
if ("medicine".equals(params.get("type"))) {
|
||||||
wrapper.disableSubLogicDel().leftJoin(CourseToSociologyEntity.class,CourseToSociologyEntity::getCourseId,CourseEntity::getId);
|
wrapper.leftJoin(CourseToMedicine.class,CourseToMedicine::getCourseId,CourseEntity::getId);
|
||||||
wrapper.disableSubLogicDel().leftJoin(CourseToPsyche.class,CourseToPsyche::getCourseId,CourseEntity::getId);
|
}else if ("sociology".equals(params.get("type"))) {
|
||||||
|
wrapper.leftJoin(CourseToSociologyEntity.class,CourseToSociologyEntity::getCourseId,CourseEntity::getId);
|
||||||
|
}else if ("psyche".equals(params.get("type"))) {
|
||||||
|
wrapper.leftJoin(CourseToPsyche.class,CourseToPsyche::getCourseId,CourseEntity::getId);
|
||||||
|
}else {
|
||||||
|
wrapper.disableSubLogicDel().leftJoin(CourseToMedicine.class,CourseToMedicine::getCourseId,CourseEntity::getId);
|
||||||
|
wrapper.disableSubLogicDel().leftJoin(CourseToSociologyEntity.class,CourseToSociologyEntity::getCourseId,CourseEntity::getId);
|
||||||
|
wrapper.disableSubLogicDel().leftJoin(CourseToPsyche.class,CourseToPsyche::getCourseId,CourseEntity::getId);
|
||||||
|
wrapper.and(t->t.eq(CourseToMedicine::getDelFlag,0).or()
|
||||||
|
.eq(CourseToSociologyEntity::getDelFlag,0).or()
|
||||||
|
.eq(CourseToPsyche::getDelFlag,0));
|
||||||
|
}
|
||||||
wrapper.leftJoin(CourseCatalogueEntity.class,CourseCatalogueEntity::getCourseId,CourseEntity::getId);
|
wrapper.leftJoin(CourseCatalogueEntity.class,CourseCatalogueEntity::getCourseId,CourseEntity::getId);
|
||||||
wrapper.eq(CourseCatalogueEntity::getType,0);
|
wrapper.eq(CourseCatalogueEntity::getType,0);
|
||||||
wrapper.selectAll(CourseEntity.class);
|
wrapper.selectAll(CourseEntity.class);
|
||||||
wrapper.and(t->t.eq(CourseToMedicine::getDelFlag,0).or()
|
|
||||||
.eq(CourseToSociologyEntity::getDelFlag,0).or()
|
|
||||||
.eq(CourseToPsyche::getDelFlag,0));
|
|
||||||
wrapper.orderByAsc(CourseEntity::getSort);
|
wrapper.orderByAsc(CourseEntity::getSort);
|
||||||
List<CourseEntity> courseList = courseService.list(wrapper);
|
List<CourseEntity> courseList = courseService.list(wrapper);
|
||||||
return R.ok().put("courseList",courseList);
|
return R.ok().put("courseList",courseList);
|
||||||
|
|||||||
Reference in New Issue
Block a user