首页标签树
This commit is contained in:
@@ -9,6 +9,7 @@ import com.peanut.modules.common.entity.*;
|
||||
import com.peanut.modules.common.service.CoursePsycheService;
|
||||
import com.peanut.modules.common.service.UserCourseStudyingService;
|
||||
import com.peanut.modules.common.service.UserVipService;
|
||||
import com.peanut.modules.common.to.ParamTo;
|
||||
import com.peanut.modules.master.service.CourseCatalogueService;
|
||||
import com.peanut.modules.master.service.CourseService;
|
||||
import com.peanut.modules.master.service.UserCourseBuyService;
|
||||
@@ -31,6 +32,8 @@ public class PsycheHomeController {
|
||||
@Autowired
|
||||
private CourseService courseService;
|
||||
@Autowired
|
||||
private CourseCatalogueService courseCatalogueService;
|
||||
@Autowired
|
||||
private ShopProductService shopProductService;
|
||||
|
||||
//获取标签列表
|
||||
@@ -42,6 +45,13 @@ public class PsycheHomeController {
|
||||
return R.ok().put("labels",psycheLabels);
|
||||
}
|
||||
|
||||
//获取课程分类标签单节点的子分类标签树
|
||||
@RequestMapping("/getChildCoursePsycheTree")
|
||||
public R getChildCoursePsycheTree(@RequestBody ParamTo param){
|
||||
List<CoursePsyche> labelsTree = coursePsycheService.getChildCoursePsycheTree(param);
|
||||
return R.ok().put("labels",labelsTree);
|
||||
}
|
||||
|
||||
//获取标签下的课程列表
|
||||
@RequestMapping("/getPsycheCourseList")
|
||||
public R getPsycheCourseList(@RequestBody Map<String,Object> params){
|
||||
@@ -52,6 +62,11 @@ public class PsycheHomeController {
|
||||
wrapper.orderByAsc(CourseToPsyche::getSort);
|
||||
Page<CourseEntity> courseEntityPage = courseService.page(new Page<>(
|
||||
Long.parseLong(params.get("page").toString()), Long.parseLong(params.get("limit").toString())),wrapper);
|
||||
for (CourseEntity c:courseEntityPage.getRecords()){
|
||||
c.setCourseCatalogueEntityList(courseCatalogueService.list(new LambdaQueryWrapper<CourseCatalogueEntity>()
|
||||
.eq(CourseCatalogueEntity::getCourseId,c.getId())
|
||||
.orderByAsc(CourseCatalogueEntity::getSort)));
|
||||
}
|
||||
return R.ok().put("courses",courseEntityPage);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user