通知ドメイン/ディスパッチ/APIコンバータにFCMオプションを追加#17
Merged
Merged
Conversation
ImageURL/AnalyticsLabel/APNs(Badge/Sound/ContentAvailable)/Android(ChannelID/Priority/TTLSeconds)/WebpushLinkをドメインとGORMモデルに追加し、FCM送信で扱える追加設定を保持できるようにした。 あわせて本文フィールドをMessageからBodyへ改称し、FCM SDKのNotification.Body命名と揃えた。APIスキーマは後続対応のため変更せず、ハンドラのコンバータ側でBodyとMessageのマッピングを維持している。 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
ドメインに追加したFCMオプション群(ImageURL/AnalyticsLabel/APNs/Android/Webpush)を、MulticastMessageのNotification.ImageURL・FCMOptions・APNSConfig・AndroidConfig・WebpushConfigへそれぞれ設定するようにした。 各プラットフォーム設定は該当フィールドが全てnilのときは付与せず、部分指定でもそのまま送信できるようbuildAndroidConfig/buildAPNSConfig/buildWebpushConfigで組み立てを局所化している。 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…/notification-fcm-options
Notification のドメインモデルとAPI型に追加されていた ImageURL / AnalyticsLabel / APNs・Android の配信オプション / WebpushLink などのフィールドが、Converter で取りこぼされていた。 toAPINotification と toDomainNotification の双方で これらのフィールドを相互に変換するようにし、 APNsBadge と AndroidTTLSeconds については ドメイン側の int とAPI側の int32 の差異を明示的に変換する。
There was a problem hiding this comment.
Pull request overview
通知(Notification)ドメインに FCM の追加オプション(画像、AnalyticsLabel、APNs/Android/Webpush 設定)を保持できるようにし、ディスパッチ時に FCM の MulticastMessage へ反映するための変更です。
Changes:
- 通知ドメイン/DBモデルに FCM 追加オプション用の optional フィールドを追加し、本文フィールドを
Message→Bodyに改称 - ディスパッチ処理でプラットフォーム別設定(Android/APNs/Webpush/FCMOptions)を組み立てて
MulticastMessageに付与 - API <-> domain 変換で新規オプション群をマッピング(badge/ttl は型変換を追加)
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| internal/service/notification_dispatch.go | 追加オプションを MulticastMessage に反映し、Android/APNs/Webpush 設定の組み立てを関数分離 |
| internal/handler/converter.go | Notification の新規オプション群を API/domain 間で相互変換(badge/ttl は int32 変換) |
| internal/domain/notification.go | Notification ドメインに追加オプションフィールドを追加し本文を Body に統一 |
| internal/database/notification.go | Notification DBモデルに追加オプションカラムを追加し本文カラムを Body に改称 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
androidTtlSeconds と apnsBadge の型が int32 から int に変更されたため、生成コードを再生成した。 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…/notification-fcm-options
APIとドメイン双方で APNsBadge / AndroidTTLSeconds が *int に統一されたため、 不要な int/int32 変換と nil 分岐を削除し、構造体リテラル内で直接代入する形に整理した。 振る舞いは変わらず、ビルド不整合の解消とコードの簡素化のみを行う。
Member
Author
|
コンフリクト修正します... |
Member
Author
修正した |
masaya-osuga
approved these changes
Apr 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
通知(Notification)ドメインに Firebase Cloud Messaging で設定可能な追加オプションを持たせ、ディスパッチ時の
MulticastMessageと API コンバータの双方でそれらを扱えるようにした。ベースブランチは
update-openapi-schemaで、OpenAPI スキーマ側への追加フィールド定義はそちらで対応済み。変更点
モデル層
domain.Notification/database.Notificationに以下のフィールドを追加した(いずれも optional)。ImageURL— 通知画像AnalyticsLabel— Firebase Analytics ラベルAPNsBadge/APNsSound/APNsContentAvailable— iOS 向けAndroidChannelID/AndroidPriority/AndroidTTLSeconds— Android 向けWebpushLink— Web Push クリック時リンクtext/integer/booleanの NULL 許容カラムとして定義した。MessageからBodyに改称し、FCM SDK のNotification.Bodyに揃えた。ディスパッチ層
service.sendToTokensで追加フィールドをMulticastMessageに反映するようにした。Notification.ImageURL/FCMOptions.AnalyticsLabelAPNSConfig.Payload.Aps(Badge/Sound/ContentAvailable)AndroidConfig(Notification.ChannelID/Priority/TTL)WebpushConfig.FCMOptions.LinkbuildAndroidConfig/buildAPNSConfig/buildWebpushConfigに切り出して局所化した。ハンドラ層
handler/converter.goのtoAPINotification/toDomainNotificationを拡張し、追加した FCM オプションをドメイン ⇔ API 型で相互変換するようにした。APNsBadge/AndroidTTLSecondsはドメイン側のintと API 側のint32の差異を明示的に変換する。補足
Title/Body/URLなど)のみで送信する既存挙動は変わらない。動作確認