gongchunyi
6 天以前 ad65726388fc99ff95db91b4a8a716362cccedd7
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
81
82
83
84
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.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
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 {
    private NotificationManagementService notificationManagementService ;
    private OnlineMeetingMapper onlineMeetingMapper;
    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
     */
    @Log(title = "增添通知管理", businessType = BusinessType.INSERT)
    @PostMapping("/add")
    public AjaxResult add(@RequestBody NotificationManagement notificationManagement){
        return AjaxResult.success(notificationManagementService.save(notificationManagement));
    }
    /**
     * 更新
     * @return
     */
    @Log(title = "更新通知管理", businessType = BusinessType.UPDATE)
    @PostMapping("/update")
    public AjaxResult update(@RequestBody NotificationManagement notificationManagement){
        return AjaxResult.success(notificationManagementService.updateById(notificationManagement));
    }
    /**
     * 删除
     * @return
     */
    @Log(title = "删除通知管理", businessType = BusinessType.DELETE)
    @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
     */
    @Log(title = "新增线上会议", businessType = BusinessType.INSERT)
    @PostMapping("/addOnlineMeeting")
    public AjaxResult addOnlineMeeting(@RequestBody OnlineMeeting onlineMeeting){
        return AjaxResult.success(onlineMeetingMapper.insert(onlineMeeting));
    }
    /**
     *新增文件共享
     *
     */
    @Log(title = "新增文件共享", businessType = BusinessType.INSERT)
    @PostMapping("/addFileSharing")
    public AjaxResult addFileSharing(@RequestBody FileSharing fileSharing){
        return AjaxResult.success(fileSharingMapper.insert(fileSharing));
    }
}