Files
nuttyreading-java/src/main/java/com/peanut/modules/master/controller/CourseSociologyController.java
wangjinlei d4f30ed903 1
2024-03-26 17:23:15 +08:00

49 lines
1.8 KiB
Java

package com.peanut.modules.master.controller;
import com.peanut.common.utils.R;
import com.peanut.modules.common.entity.CourseSociologyEntity;
import com.peanut.modules.common.to.ParamTo;
import com.peanut.modules.master.service.CourseSociologyService;
import com.peanut.modules.master.service.CourseToSociologyService;
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("masterCourseSociology")
@RequestMapping("master/courseSociology")
public class CourseSociologyController {
@Autowired
private CourseSociologyService courseSociologyService;
@Autowired
private CourseToSociologyService courseToSociologyService;
@RequestMapping("/getCourseSociologyList")
public R getCourseSociologyList(){
List<CourseSociologyEntity> courseSociologyList = courseSociologyService.getCourseSociologyList();
return R.ok().put("sociologys",courseSociologyList);
}
@RequestMapping("/addCourseSociology")
public R addCourseSociology(@RequestBody CourseSociologyEntity courseSociologyEntity){
courseSociologyService.save(courseSociologyEntity);
return R.ok();
}
@RequestMapping("/delCourseSociology")
public R delCourseSociology(@RequestBody ParamTo param){
return courseSociologyService.delCourseSociology(param.getId());
}
@RequestMapping("/editCourseSociology")
public R editCourseSociology(@RequestBody CourseSociologyEntity courseSociologyEntity){
courseSociologyService.editCourseSociology(courseSociologyEntity);
return R.ok();
}
}