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.controller.BaseController; import com.ruoyi.framework.web.domain.R; 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 extends BaseController { private NotificationManagementService notificationManagementService ; private OnlineMeetingMapper onlineMeetingMapper; private FileSharingMapper fileSharingMapper; /**、 * 获取列表 * @return */ @GetMapping("/getList") public R getList(@RequestParam(defaultValue = "1") long current, @RequestParam(defaultValue = "50") long size, NotificationManagement notificationManagement) { Page page = new Page(current, size); return R.ok(notificationManagementService.listpage(page,notificationManagement)); } /**、 * 增添 * @return */ @PostMapping("/add") public R add(@RequestBody NotificationManagement notificationManagement){ return R.ok(notificationManagementService.save(notificationManagement)); } /** * 更新 * @return */ @PostMapping("/update") public R update(@RequestBody NotificationManagement notificationManagement){ return R.ok(notificationManagementService.updateById(notificationManagement)); } /** * 删除 * @return */ @DeleteMapping("/delete") public R delete(@RequestBody List ids){ if(CollectionUtils.isEmpty(ids)) return R.fail("请传入要删除的ID"); return R.ok(notificationManagementService.removeByIds(ids)); } /** *新增会议 * @param onlineMeeting * @return */ @PostMapping("/addOnlineMeeting") public R addOnlineMeeting(@RequestBody OnlineMeeting onlineMeeting){ return R.ok(onlineMeetingMapper.insert(onlineMeeting)); } /** *新增文件共享 * */ @PostMapping("/addFileSharing") public R addFileSharing(@RequestBody FileSharing fileSharing){ return R.ok(fileSharingMapper.insert(fileSharing)); } }