yaowanxin
18 小时以前 d9eaac8263074653c111cf671cd41297ed720fa9
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
73
74
75
76
77
78
79
80
package com.ruoyi.approve.controller;
 
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.approve.mapper.FileSharingMapper;
import com.ruoyi.approve.mapper.OnlineMeetingMapper;
import com.ruoyi.approve.pojo.FileSharing;
import com.ruoyi.approve.pojo.NotificationManagement;
import com.ruoyi.approve.pojo.OnlineMeeting;
import com.ruoyi.approve.service.NotificationManagementService;
import com.ruoyi.framework.web.domain.AjaxResult;
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
import java.util.List;
 
@RestController
@RequestMapping("/notificationManagement")
@AllArgsConstructor
public class NotificationManagementController {
    @Autowired
    private NotificationManagementService notificationManagementService ;
    @Autowired
    private OnlineMeetingMapper onlineMeetingMapper;
    @Autowired
    private FileSharingMapper fileSharingMapper;
    /**、
     * 获取列表
     * @return
     */
    @GetMapping("/getList")
    public AjaxResult getList(@RequestParam(defaultValue = "1") long current,
                              @RequestParam(defaultValue = "50") long size, NotificationManagement notificationManagement) {
        Page page = new Page(current, size);
        return AjaxResult.success(notificationManagementService.listpage(page,notificationManagement));
    }
    /**、
     * 增添
     * @return
     */
    @PostMapping("/add")
    public AjaxResult add(@RequestBody NotificationManagement notificationManagement){
        return AjaxResult.success(notificationManagementService.save(notificationManagement));
    }
    /**
     * 更新
     * @return
     */
    @PostMapping("/update")
    public AjaxResult update(@RequestBody NotificationManagement notificationManagement){
        return AjaxResult.success(notificationManagementService.updateById(notificationManagement));
    }
    /**
     * 删除
     * @return
     */
    @DeleteMapping("/delete")
    public AjaxResult delete(@RequestBody List<Long> ids){
        if(CollectionUtils.isEmpty(ids)) return AjaxResult.error("请传入要删除的ID");
        return AjaxResult.success(notificationManagementService.removeByIds(ids));
    }
    /**
     *新增会议
     * @param onlineMeeting
     * @return
     */
    @PostMapping("/addOnlineMeeting")
    public AjaxResult addOnlineMeeting(@RequestBody OnlineMeeting onlineMeeting){
        return AjaxResult.success(onlineMeetingMapper.insert(onlineMeeting));
    }
    /**
     *新增文件共享
     *
     */
    @PostMapping("/addFileSharing")
    public AjaxResult addFileSharing(@RequestBody FileSharing fileSharing){
        return AjaxResult.success(fileSharingMapper.insert(fileSharing));
    }
}