package com.kaidi.oa.domain; import jakarta.persistence.Column; import jakarta.persistence.Entity; import jakarta.persistence.GeneratedValue; import jakarta.persistence.GenerationType; import jakarta.persistence.Id; import jakarta.persistence.Table; import java.time.Instant; /** * A站内消息 / notification for the unified message center (统一消息中心). Generated by * the workflow engine on key events (new 待办 assigned, 退回, 办结, 知会/抄送) and * delivered to a recipient by display name. read flag drives the 顶栏铃铛 unread badge. */ @Entity @Table(name = "oa_message") public class Message { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; /** Recipient display name (matches SysUser.displayName / the workflow assignee). */ private String recipient; /** 稳定收件人 id(SysUser.id):读授权按此比对,根治改名重用冒充。recipient 仅作展示/路由。 */ private Long recipientId; /** 待办 / 退回 / 办结 / 知会 / 系统. */ private String type; private String title; @Column(columnDefinition = "TEXT") private String body; /** What this message points at, e.g. instance (a form instance). */ private String sourceType; private Long sourceId; private boolean read; private Instant createdAt; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getRecipient() { return recipient; } public void setRecipient(String recipient) { this.recipient = recipient; } public Long getRecipientId() { return recipientId; } public void setRecipientId(Long recipientId) { this.recipientId = recipientId; } public String getType() { return type; } public void setType(String type) { this.type = type; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getBody() { return body; } public void setBody(String body) { this.body = body; } public String getSourceType() { return sourceType; } public void setSourceType(String sourceType) { this.sourceType = sourceType; } public Long getSourceId() { return sourceId; } public void setSourceId(Long sourceId) { this.sourceId = sourceId; } public boolean isRead() { return read; } public void setRead(boolean read) { this.read = read; } public Instant getCreatedAt() { return createdAt; } public void setCreatedAt(Instant createdAt) { this.createdAt = createdAt; } }