This commit is contained in:
wangjinlei
2024-03-27 14:29:49 +08:00
parent 8df893a543
commit 263ffaa7aa
5 changed files with 49 additions and 3 deletions

View File

@@ -1,9 +1,10 @@
package com.peanut.modules.master.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.peanut.common.utils.R;
import com.peanut.modules.common.dao.CourseDao;
import com.peanut.modules.common.entity.CourseEntity;
import com.peanut.modules.common.entity.CourseSociologyEntity;
import com.peanut.modules.common.entity.CourseToSociologyEntity;
import com.peanut.modules.common.to.ParamTo;
import com.peanut.modules.master.service.CourseService;
import com.peanut.modules.master.service.CourseSociologyService;
@@ -12,7 +13,6 @@ 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.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@@ -57,4 +57,21 @@ public class CourseSociologyController {
return R.ok().put("courseList",courseListForSociology);
}
@RequestMapping("/getCourseListCanSociology")
public R getCourseListCanSociology(@RequestBody ParamTo param){
Page courseListCanSociology = courseService.getCourseListCanSociology(param);
return R.ok().put("page",courseListCanSociology);
}
@RequestMapping("/bindCourseAndSociology")
public R bindCourseAndSociology(@RequestBody CourseToSociologyEntity courseToSociologyEntity){
return courseToSociologyService.bindCourseAndSociology(courseToSociologyEntity);
}
@RequestMapping("/unbindCourseAndSociology")
public R unbindCourseAndSociology(@RequestBody CourseToSociologyEntity courseToSociologyEntity){
courseToSociologyService.removeById(courseToSociologyEntity.getId());
return R.ok();
}
}