package com.dsh.course.controller; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.dsh.course.entity.CoursePackagePaymentConfig; import com.dsh.course.service.ICoursePackagePaymentConfigService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import java.util.List; /** * @author zhibing.pu * @Date 2023/8/7 11:46 */ @RestController @RequestMapping("") public class CoursePackagePaymentConfigController { @Autowired private ICoursePackagePaymentConfigService coursePackagePaymentConfigService; /** * 根据主键id获取价格配置 * * @return */ @ResponseBody @PostMapping("/coursePackagePaymentConfig/getById") public CoursePackagePaymentConfig getById(@RequestBody Integer id) { return coursePackagePaymentConfigService.getById(id); } /** * 添加数据 * * @param coursePackagePaymentConfig */ @ResponseBody @PostMapping("/coursePackagePaymentConfig/addCoursePackagePaymentConfig") public int addCoursePackagePaymentConfig(@RequestBody CoursePackagePaymentConfig coursePackagePaymentConfig) { coursePackagePaymentConfigService.save(coursePackagePaymentConfig); return coursePackagePaymentConfig.getId(); } /** * 根据课包id获取价格配置 * * @param coursePackageId * @return */ @ResponseBody @PostMapping("/coursePackagePaymentConfig/queryCoursePackagePaymentConfigList") public List queryCoursePackagePaymentConfigList(@RequestBody Integer coursePackageId) { return coursePackagePaymentConfigService.list(new QueryWrapper().eq("coursePackageId", coursePackageId)); } /** * 根据课时规格id获取价格配置 * * @param * @return */ @ResponseBody @PostMapping("/coursePackagePaymentConfig/queryCoursePackagePaymentConfigList1") public List queryCoursePackagePaymentConfigList1(@RequestBody Integer coursePackagePaymentConfigId) { return coursePackagePaymentConfigService. list(new QueryWrapper() .eq("id", coursePackagePaymentConfigId)); } /** * 删除数据 * * @param coursePackageId */ @ResponseBody @PostMapping("/coursePackagePaymentConfig/delCoursePackagePaymentConfig") public void delCoursePackagePaymentConfig(@RequestBody Integer coursePackageId) { coursePackagePaymentConfigService.remove(new QueryWrapper().eq("coursePackageId", coursePackageId)); } }