puzhibing
2023-11-25 53e7558400dcacecdce70e39ebfe1727740f9296
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
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));
    }
}