package com.yuanchu.mom.controller; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.yuanchu.mom.mapper.InformationNotificationMapper; import com.yuanchu.mom.pojo.InformationNotification; import com.yuanchu.mom.pojo.InformationNotificationDto; import com.yuanchu.mom.service.InformationNotificationService; import com.yuanchu.mom.vo.Result; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.ibatis.annotations.Param; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import org.springframework.stereotype.Controller; import java.util.List; /** *
* 消息通知 前端控制器 *
* * @author 江苏鵷雏网络科技有限公司 * @since 2024-04-23 02:14:30 */ @Api(tags = "消息通知") @RestController @RequestMapping("/informationNotification") public class InformationNotificationController { @Autowired private InformationNotificationService informationNotificationService; @ApiOperation(value = "滚动分页查询") @GetMapping("page") public Result> getPage(Long size, Long current, String messageType) { return Result.success(informationNotificationService.getPage(new Page<>(current, size), messageType)); } @ApiOperation(value = "更新消息状态(拒绝、接收)") @PutMapping("updateMessageStatus") public Result> updateMessageStatus(@RequestBody InformationNotification informationNotification) { informationNotificationService.updateById(informationNotification); return Result.success(); } @ApiOperation(value = "标记所有信息为已读/删除所有已读消息") @PutMapping("informationReadOrDelete/{isMarkAllInformationRead}") public Result> markAllInformationReadOrDeleteAllReadMessages(@PathVariable("isMarkAllInformationRead") Boolean isMarkAllInformationRead) { informationNotificationService.markAllInformationReadOrDeleteAllReadMessages(isMarkAllInformationRead); return Result.success(); } @ApiOperation(value = "根据Id删除数据") @DeleteMapping("deleteDataBasedOnId") public Result> deleteDataBasedOnId(Integer id) { informationNotificationService.removeById(id); return Result.success(); } @ApiOperation(value = "查询是否存在未读数据") @GetMapping("checkForUnreadData") public Result> checkForUnreadData() { return Result.success(informationNotificationService.checkForUnreadData()); } }