Class BannerNotificationTemplateResolver
java.lang.Object
io.leandev.appfuse.notification.BannerNotificationTemplateResolver
- All Implemented Interfaces:
NotificationTemplateResolver
public class BannerNotificationTemplateResolver
extends Object
implements NotificationTemplateResolver
在範本渲染後於內文前置橫幅的 NotificationTemplateResolver decorator
包裝既有 resolver 鏈,呼叫 delegate 渲染後,以 NotificationBanner 取該通道橫幅、前置於
RenderedTemplate.body;主旨不變。橫幅為 null / 空白時原樣回傳(no-op)。
業務通知若單一漏斗化經通知子系統(見 ADR-010),此處即「標記所有業務通知」的單點。
與 framework Mailer 的「主旨前綴 + 自訂標頭」chokepoint 互補(橫幅給人看、主旨 / 標頭在
Mailer 層全攔含繞過通知的路徑)。
接線:包在 resolver 鏈最外層,如
new BannerNotificationTemplateResolver(existingChain, notificationBanner)。
- Since:
- 4.0.0
-
Constructor Summary
ConstructorsConstructorDescriptionBannerNotificationTemplateResolver(NotificationTemplateResolver delegate, NotificationBanner banner) -
Method Summary
Modifier and TypeMethodDescription渲染某通知於某通道、某語系的內容
-
Constructor Details
-
BannerNotificationTemplateResolver
public BannerNotificationTemplateResolver(NotificationTemplateResolver delegate, NotificationBanner banner)
-
-
Method Details
-
render
public RenderedTemplate render(String type, ChannelType channel, Locale locale, Map<String, Object> model) Description copied from interface:NotificationTemplateResolver渲染某通知於某通道、某語系的內容- Specified by:
renderin interfaceNotificationTemplateResolver- Parameters:
type- 通知型別鍵channel- 遞送通道locale- 目標語系(null 表示系統預設)model- 範本資料袋(含保留鍵deepLink,若有)- Returns:
- 渲染後的主旨與內文
-