refactor: 通知公告重构
This commit is contained in:
@@ -1,9 +1,7 @@
|
||||
package com.youlai.boot.system.model.bo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
@@ -11,36 +9,57 @@ import java.time.LocalDateTime;
|
||||
*
|
||||
* @author Theo
|
||||
* @since 2024-09-01 10:31
|
||||
* @version 1.0.0
|
||||
*/
|
||||
@Data
|
||||
public class NoticeBO {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 通知ID
|
||||
*/
|
||||
private Long id;
|
||||
@Schema(description = "通知标题")
|
||||
|
||||
/**
|
||||
* 通知标题
|
||||
*/
|
||||
private String title;
|
||||
|
||||
@Schema(description = "通知类型")
|
||||
private Integer noticeType;
|
||||
/**
|
||||
* 通知类型
|
||||
*/
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "发布人")
|
||||
private String releaseBy;
|
||||
/**
|
||||
* 通知内容
|
||||
*/
|
||||
private String content;
|
||||
|
||||
@Schema(description = "优先级(0-低 1-中 2-高)")
|
||||
private Integer priority;
|
||||
/**
|
||||
* 发布人姓名
|
||||
*/
|
||||
private String publisherName;
|
||||
|
||||
@Schema(description = "目标类型(0-全体 1-指定)")
|
||||
private Integer tarType;
|
||||
/**
|
||||
* 通知等级(L: 低, M: 中, H: 高)
|
||||
*/
|
||||
private Integer level;
|
||||
|
||||
@Schema(description = "发布状态(0-未发布 1已发布 2已撤回)")
|
||||
private Integer releaseStatus;
|
||||
/**
|
||||
* 目标类型(1: 全体 2: 指定)
|
||||
*/
|
||||
private Integer targetType;
|
||||
|
||||
@Schema(description = "发布时间")
|
||||
private LocalDateTime releaseTime;
|
||||
/**
|
||||
* 发布状态(0: 未发布, 1: 已发布, -1: 已撤回)
|
||||
*/
|
||||
private Integer publishStatus;
|
||||
|
||||
@Schema(description = "撤回时间")
|
||||
private LocalDateTime recallTime;
|
||||
/**
|
||||
* 发布时间
|
||||
*/
|
||||
private LocalDateTime publishTime;
|
||||
|
||||
/**
|
||||
* 撤回时间
|
||||
*/
|
||||
private LocalDateTime revokeTime;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.youlai.boot.system.model.bo;
|
||||
|
||||
import com.youlai.boot.common.enums.MenuTypeEnum;
|
||||
import com.youlai.boot.system.enums.MenuTypeEnum;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.youlai.boot.system.model.dto;
|
||||
|
||||
import com.youlai.boot.common.enums.NoticeTypeEnum;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
@@ -23,9 +22,4 @@ public class ChatMessage {
|
||||
*/
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 消息类型
|
||||
*/
|
||||
private NoticeTypeEnum noticeType;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
package com.youlai.boot.system.model.dto;
|
||||
|
||||
import com.youlai.boot.common.enums.NoticeWayEnum;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 消息载体
|
||||
@@ -23,8 +22,8 @@ public class MessageDTO {
|
||||
private String sender;
|
||||
|
||||
@Schema(description = "接收者")
|
||||
private List<String> receiver;
|
||||
private Set<String> receivers;
|
||||
|
||||
|
||||
|
||||
@Schema(description = "通知方式")
|
||||
private NoticeWayEnum noticeWay;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.youlai.boot.system.model.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 通知传送对象
|
||||
*
|
||||
* @author Theo
|
||||
* @since 2024-9-2 14:32:58
|
||||
*/
|
||||
@Data
|
||||
public class NoticeDTO {
|
||||
|
||||
@Schema(description = "通知ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "通知类型")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "通知标题")
|
||||
private String title;
|
||||
|
||||
|
||||
}
|
||||
@@ -2,7 +2,7 @@ package com.youlai.boot.system.model.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
|
||||
import com.youlai.boot.common.enums.MenuTypeEnum;
|
||||
import com.youlai.boot.system.enums.MenuTypeEnum;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
|
||||
@@ -2,11 +2,11 @@ package com.youlai.boot.system.model.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.youlai.boot.common.base.BaseEntity;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.time.LocalDateTime;
|
||||
/**
|
||||
* 通知公告实体对象
|
||||
@@ -19,6 +19,7 @@ import java.time.LocalDateTime;
|
||||
@TableName("sys_notice")
|
||||
public class Notice extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
@@ -32,41 +33,48 @@ public class Notice extends BaseEntity {
|
||||
/**
|
||||
* 通知类型
|
||||
*/
|
||||
private Integer noticeType;
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 发布人
|
||||
*/
|
||||
private Long releaseBy;
|
||||
private Long publisherBy;
|
||||
|
||||
/**
|
||||
* 优先级(0-低 1-中 2-高)
|
||||
* 通知等级(L: 低, M: 中, H: 高)
|
||||
*/
|
||||
private Integer priority;
|
||||
private String level;
|
||||
|
||||
/**
|
||||
* 目标类型(0-全体 1-指定)
|
||||
* 目标类型(1: 全体, 2: 指定)
|
||||
*/
|
||||
private Integer tarType;
|
||||
private Integer targetType;
|
||||
|
||||
/**
|
||||
* 目标ID
|
||||
* 目标用户ID集合
|
||||
*/
|
||||
private String tarIds;
|
||||
private String targetUserIds;
|
||||
|
||||
/**
|
||||
* 发布状态(0-未发布 1已发布 2已撤回)
|
||||
* 发布状态(0: 未发布, 1: 已发布, -1: 已撤回)
|
||||
*/
|
||||
private Integer releaseStatus;
|
||||
private Integer publishStatus;
|
||||
|
||||
/**
|
||||
* 发布时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime releaseTime;
|
||||
private LocalDateTime publishTime;
|
||||
|
||||
/**
|
||||
* 撤回时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime recallTime;
|
||||
private LocalDateTime revokeTime;
|
||||
|
||||
/**
|
||||
* 创建人ID
|
||||
*/
|
||||
private Long createBy;
|
||||
|
||||
/**
|
||||
* 更新人ID
|
||||
*/
|
||||
|
||||
@@ -2,25 +2,24 @@ package com.youlai.boot.system.model.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.youlai.boot.common.base.BaseEntity;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 用户公告状态实体对象
|
||||
* 用户通知公告实体对象
|
||||
*
|
||||
* @author youlaitech
|
||||
* @since 2024-08-28 16:56
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@TableName("sys_notice_status")
|
||||
public class NoticeStatus implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@TableName("sys_user_notice")
|
||||
public class UserNotice extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
@@ -39,9 +38,15 @@ public class NoticeStatus implements Serializable {
|
||||
/**
|
||||
* 读取状态,0未读,1已读
|
||||
*/
|
||||
private Integer readStatus;
|
||||
private Integer isRead;
|
||||
/**
|
||||
* 用户阅读时间
|
||||
*/
|
||||
private LocalDateTime readTime;
|
||||
|
||||
/**
|
||||
* 逻辑删除标识(0-未删除 1-已删除)
|
||||
*/
|
||||
@TableLogic(value = "0", delval = "1")
|
||||
private Integer isDeleted;
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.youlai.boot.system.model.form;
|
||||
|
||||
import com.youlai.boot.common.enums.MenuTypeEnum;
|
||||
import com.youlai.boot.system.enums.MenuTypeEnum;
|
||||
import com.youlai.boot.common.model.KeyValue;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -39,17 +39,16 @@ public class NoticeForm implements Serializable {
|
||||
private String content;
|
||||
|
||||
@Schema(description = "通知类型")
|
||||
private Integer noticeType;
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "优先级(0-低 1-中 2-高)")
|
||||
@Range(min = 0, max = 2, message = "优先级取值范围[0,2]")
|
||||
private Integer priority;
|
||||
@Schema(description = "优先级(L-低 M-中 H-高)")
|
||||
private String level;
|
||||
|
||||
@Schema(description = "目标类型(0-全体 1-指定)")
|
||||
@Range(min = 0, max = 1, message = "目标类型取值范围[0,1]")
|
||||
private Integer tarType;
|
||||
@Schema(description = "目标类型(1-全体 2-指定)")
|
||||
@Range(min = 1, max = 2, message = "目标类型取值范围[1,2]")
|
||||
private Integer targetType;
|
||||
|
||||
@Schema(description = "接收人ID集合")
|
||||
private List<String> tarIds;
|
||||
private List<String> targetUserIds;
|
||||
|
||||
}
|
||||
|
||||
@@ -16,9 +16,7 @@ import java.util.List;
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description ="通知公告查询对象")
|
||||
public class NoticeQuery extends BasePageQuery {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
public class NoticePageQuery extends BasePageQuery {
|
||||
|
||||
@Schema(description = "通知标题")
|
||||
private String title;
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.youlai.boot.system.model.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.youlai.boot.common.enums.MenuTypeEnum;
|
||||
import com.youlai.boot.system.enums.MenuTypeEnum;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
@@ -25,18 +25,18 @@ public class NoticeDetailVO {
|
||||
private String content;
|
||||
|
||||
@Schema(description = "通知类型")
|
||||
private String noticeType;
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "发布人")
|
||||
private String releaseBy;
|
||||
private String publisherName;
|
||||
|
||||
@Schema(description = "优先级(0-低 1-中 2-高)")
|
||||
private Integer priority;
|
||||
@Schema(description = "优先级(L-低 M-中 H-高)")
|
||||
private String level;
|
||||
|
||||
@Schema(description = "发布状态(0-未发布 1已发布 2已撤回) 冗余字段,方便判断是否已经发布")
|
||||
private Integer releaseStatus;
|
||||
private Integer publishStatus;
|
||||
|
||||
@Schema(description = "发布时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime releaseTime;
|
||||
private LocalDateTime publishTime;
|
||||
}
|
||||
|
||||
@@ -7,14 +7,14 @@ import lombok.Data;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 用户公告状态VO
|
||||
* 用户公告VO
|
||||
*
|
||||
* @author Theo
|
||||
* @since 2024-08-28 16:56
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "用户公告状态VO")
|
||||
public class NoticeStatusVO {
|
||||
@Schema(description = "用户公告VO")
|
||||
public class UserNoticePageVO {
|
||||
|
||||
@Schema(description = "通知ID")
|
||||
private Long id;
|
||||
@@ -23,19 +23,19 @@ public class NoticeStatusVO {
|
||||
private String title;
|
||||
|
||||
@Schema(description = "通知类型")
|
||||
private String noticeType;
|
||||
private String typeLabel;
|
||||
|
||||
@Schema(description = "发布人")
|
||||
private String releaseBy;
|
||||
@Schema(description = "发布人姓名")
|
||||
private String publisherName;
|
||||
|
||||
@Schema(description = "优先级(0-低 1-中 2-高)")
|
||||
private Integer priority;
|
||||
@Schema(description = "通知级别")
|
||||
private String levelLabel;
|
||||
|
||||
@Schema(description = "发布时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime releaseTime;
|
||||
private LocalDateTime publishTime;
|
||||
|
||||
@Schema(description = "是否已读")
|
||||
private Integer readStatus;
|
||||
private String isReadLabel;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user