package com.peanut.modules.sociology.controller; import com.peanut.common.utils.R; import com.peanut.modules.common.entity.CourseEntity; import com.peanut.modules.common.entity.CourseSociologyEntity; import com.peanut.modules.common.to.ParamTo; import com.peanut.modules.sociology.service.CourseService; import com.peanut.modules.sociology.service.CourseSociologyService; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import java.util.List; @Slf4j @RestController("sociologyHome") @RequestMapping("sociology/home") public class HomeController { @Autowired private CourseService courseService; @Autowired private CourseSociologyService courseSociologyService; //首页-我的课程 @RequestMapping("/getMyCourse") public R getMyCourse(String userId){ List courseList = courseService.getMyCourse(userId); return R.ok().put("myCourse",courseList); } @RequestMapping("/getSociologyLabels") public R getSociologyLabels(@RequestBody ParamTo param){ List sociologyLabels = courseSociologyService.getSociologyLabels(param.getId()); return R.ok().put("labels",sociologyLabels); } }