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<CoursePackagePaymentConfig> queryCoursePackagePaymentConfigList(@RequestBody Integer coursePackageId) {
|
return coursePackagePaymentConfigService.list(new QueryWrapper<CoursePackagePaymentConfig>().eq("coursePackageId", coursePackageId));
|
}
|
|
|
/**
|
* 删除数据
|
*
|
* @param coursePackageId
|
*/
|
@ResponseBody
|
@PostMapping("/coursePackagePaymentConfig/delCoursePackagePaymentConfig")
|
public void delCoursePackagePaymentConfig(@RequestBody Integer coursePackageId) {
|
coursePackagePaymentConfigService.remove(new QueryWrapper<CoursePackagePaymentConfig>().eq("coursePackageId", coursePackageId));
|
}
|
}
|