Record Class OutboundMessage
java.lang.Object
java.lang.Record
io.leandev.appfuse.notification.OutboundMessage
- Record Components:
type- 通知型別鍵(供通道與稽核辨識)recipientUserId- 收件人使用者識別(IN_APP 投遞 / 稽核;可為 null)recipientAddress- 該通道的收件位址(已解析)ccRecipientAddresses- EMAIL 通道的 CC 位址(其他通道為空)subject- 已渲染主旨body- 已渲染內文(EMAIL 為 HTML;SMS/LINE 為純文字)deepLink- 附帶的深連結 URL(可為 null)tenantId- 所屬租戶(遞送時供通道解析租戶資源,如租戶郵件設定)deliveryId- 框架產生的 opaque 技術遞送識別;同一 Outbox 列重試時保持不變,供支援 idempotency 的 channel/provider 防止不確定結果後重送;舊呼叫端可為 null
public record OutboundMessage(String type, String recipientUserId, String recipientAddress, List<String> ccRecipientAddresses, String subject, String body, String deepLink, String tenantId, String deliveryId)
extends Record
交付給通道遞送的單則訊息
由 NotificationService / dispatcher 把「已解析的收件位址 + 渲染內容 + 脈絡」組成,傳給
NotificationChannel.send(OutboundMessage)。位址已是該通道適用的形式(EMAIL→email、SMS→phone、LINE→lineUserId、
IN_APP→userId),通道直接使用、不需再認得 Recipient。
- Since:
- 4.0.0
-
Constructor Summary
ConstructorsConstructorDescriptionOutboundMessage(String type, String recipientUserId, String recipientAddress, String subject, String body, String deepLink, String tenantId) 相容舊版 constructor(未指定 CC 與技術遞送識別時使用預設值)。OutboundMessage(String type, String recipientUserId, String recipientAddress, List<String> ccRecipientAddresses, String subject, String body, String deepLink, String tenantId) 相容舊版 constructor(未指定 CC 時視為空清單)。OutboundMessage(String type, String recipientUserId, String recipientAddress, List<String> ccRecipientAddresses, String subject, String body, String deepLink, String tenantId, String deliveryId) Creates an instance of aOutboundMessagerecord class. -
Method Summary
Modifier and TypeMethodDescriptionbody()Returns the value of thebodyrecord component.Returns the value of theccRecipientAddressesrecord component.deepLink()Returns the value of thedeepLinkrecord component.Returns the value of thedeliveryIdrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of therecipientAddressrecord component.Returns the value of therecipientUserIdrecord component.subject()Returns the value of thesubjectrecord component.tenantId()Returns the value of thetenantIdrecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Constructor Details
-
OutboundMessage
public OutboundMessage(String type, String recipientUserId, String recipientAddress, List<String> ccRecipientAddresses, String subject, String body, String deepLink, String tenantId, String deliveryId) Creates an instance of aOutboundMessagerecord class.- Parameters:
type- the value for thetyperecord componentrecipientUserId- the value for therecipientUserIdrecord componentrecipientAddress- the value for therecipientAddressrecord componentccRecipientAddresses- the value for theccRecipientAddressesrecord componentsubject- the value for thesubjectrecord componentbody- the value for thebodyrecord componentdeepLink- the value for thedeepLinkrecord componenttenantId- the value for thetenantIdrecord componentdeliveryId- the value for thedeliveryIdrecord component
-
OutboundMessage
-
OutboundMessage
-
-
Method Details
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
type
-
recipientUserId
Returns the value of therecipientUserIdrecord component.- Returns:
- the value of the
recipientUserIdrecord component
-
recipientAddress
Returns the value of therecipientAddressrecord component.- Returns:
- the value of the
recipientAddressrecord component
-
ccRecipientAddresses
Returns the value of theccRecipientAddressesrecord component.- Returns:
- the value of the
ccRecipientAddressesrecord component
-
subject
-
body
-
deepLink
-
tenantId
-
deliveryId
Returns the value of thedeliveryIdrecord component.- Returns:
- the value of the
deliveryIdrecord component
-