fix: 通知公告和字典重构问题修复

This commit is contained in:
ray
2024-10-08 00:40:01 +08:00
parent 3fadc0bb96
commit 2f01e054a4
13 changed files with 58 additions and 25 deletions

View File

@@ -120,7 +120,7 @@ public class NoticeController {
}
@Operation(summary = "获取我的通知公告分页列表")
@GetMapping("/my/page")
@GetMapping("/my-page")
public PageResult<UserNoticePageVO> getMyNoticePage(
NoticePageQuery queryParams
) {

View File

@@ -48,11 +48,6 @@ public class NoticeBO {
*/
private String level;
/**
* 通知等级标签
*/
private String levelLabel;
/**
* 目标类型(1: 全体 2: 指定)
*/

View File

@@ -3,6 +3,7 @@ package com.youlai.boot.system.model.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
import java.util.Set;
/**
@@ -23,5 +24,8 @@ public class NoticeDTO {
@Schema(description = "通知标题")
private String title;
@Schema(description = "通知时间")
private LocalDateTime publishTime;
}

View File

@@ -22,6 +22,9 @@ public class DictDataForm {
@Schema(description = "字典ID")
private Long id;
@Schema(description = "字典编码")
private String dictCode;
@Schema(description = "字典值")
private String value;

View File

@@ -41,9 +41,6 @@ public class NoticePageVO implements Serializable {
@Schema(description = "通知等级")
private String level;
@Schema(description = "通知等级")
private String levelLabel;
@Schema(description = "发布时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
private LocalDateTime publishTime;

View File

@@ -22,18 +22,15 @@ public class UserNoticePageVO {
@Schema(description = "通知标题")
private String title;
@Schema(description = "通知类型")
private Integer type;
@Schema(description = "通知等级")
private String level;
@Schema(description = "通知类型")
private String typeLabel;
@Schema(description = "发布人姓名")
private String publisherName;
@Schema(description = "通知级别")
private String levelLabel;
@Schema(description = "发布时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
private LocalDateTime publishTime;

View File

@@ -222,11 +222,11 @@ public class NoticeServiceImpl extends ServiceImpl<NoticeMapper, Notice> impleme
// 找出在线用户的通知接收者
Set<String> onlineReceivers = new HashSet<>(CollectionUtil.intersection(receivers, allOnlineUsers));
NoticeDTO noticeDTO = new NoticeDTO();
noticeDTO.setId(id);
noticeDTO.setTitle(notice.getTitle());
noticeDTO.setType(notice.getType());
noticeDTO.setPublishTime(notice.getPublishTime());
onlineReceivers.forEach(receiver -> messagingTemplate.convertAndSendToUser(receiver, "/queue/message", noticeDTO));
}