nickchange
2023-10-31 986989a2b7a49353598fda317e3bdaed59f09abc
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
71
72
package com.dsh.course.controller;
 
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.dsh.course.entity.CoursePackageScheduling;
import com.dsh.course.model.QueryCoursePackageSchedulingList;
import com.dsh.course.service.ICoursePackageSchedulingService;
import com.dsh.course.util.PageFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
import java.util.Map;
 
/**
 * @author zhibing.pu
 * @Date 2023/8/11 10:58
 */
@RestController
@RequestMapping("")
public class CoursePackageSchedulingController {
 
    @Autowired
    private ICoursePackageSchedulingService coursePackageSchedulingService;
 
 
    /**
     * 获取课包排课列表
     * @param queryCoursePackageSchedulingList
     * @return
     */
    @ResponseBody
    @PostMapping("/coursePackageScheduling/queryCoursePackageSchedulingList")
    public Page<Map<String, Object>> queryCoursePackageSchedulingList(@RequestBody QueryCoursePackageSchedulingList queryCoursePackageSchedulingList){
        Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(queryCoursePackageSchedulingList.getLimit(), queryCoursePackageSchedulingList.getOffset(),
                queryCoursePackageSchedulingList.getSort(), queryCoursePackageSchedulingList.getOrder());
        Page<Map<String, Object>> mapPage = page.setRecords(coursePackageSchedulingService.queryCoursePackageSchedulingList(page, queryCoursePackageSchedulingList));
        return mapPage;
    }
 
 
    /**
     * 根据id获取数据
     * @param id
     * @return
     */
    @ResponseBody
    @PostMapping("/coursePackageScheduling/queryCoursePackageSchedulingById")
    public CoursePackageScheduling queryCoursePackageSchedulingById(@RequestBody Long id){
        return coursePackageSchedulingService.getById(id);
    }
 
 
    /**
     * 编辑数据
     * @param coursePackageScheduling
     */
    @ResponseBody
    @PostMapping("/coursePackageScheduling/editCoursePackageScheduling")
    public void editCoursePackageScheduling(@RequestBody CoursePackageScheduling coursePackageScheduling){
        coursePackageScheduling.setCoursePackageId(null);
        coursePackageSchedulingService.updateById(coursePackageScheduling);
    }
 
    /**
     * 新增数据
     * @param coursePackageScheduling
     */
    @ResponseBody
    @PostMapping("/coursePackageScheduling/saveCoursePackageScheduling")
    public void addCoursePackageScheduling(@RequestBody CoursePackageScheduling coursePackageScheduling){
        coursePackageSchedulingService.save(coursePackageScheduling);
    }
}