Interface NotificationDeepLinkProvider


public interface NotificationDeepLinkProvider

深連結提供者 SPI(選用;每收件人產生深連結)

解決「簽章連結是 per-recipient(以收件人 email 為 subject 簽發)、無法用單一 NotificationRequest.deepLink 表達多收件人」的問題:當通知會發給多位由 RecipientResolver 解析出的收件人、且每人需各自的深連結(如免登入落地的事件連結)時,由本 SPI 為每位收件人產生。

把簽章連結(io.leandev.appfuse.security.link)留在應用層、不滲進通知核心:應用層以 SignedLinkService 為每位收件人簽連結。為選用——未提供且 NotificationRequest.deepLink 亦為 null 時,通知就沒有深連結。當 NotificationRequest.deepLink 已顯式提供(靜態、共用)時,本 SPI 不被呼叫。

Since:
4.0.0
  • Method Details

    • deepLinkFor

      String deepLinkFor(String type, Recipient recipient, Map<String,Object> model)
      為某收件人產生深連結 URL
      Parameters:
      type - 通知型別鍵
      recipient - 收件人
      model - 範本 / 業務資料袋
      Returns:
      深連結 URL(無則回 null)