From 2aed1fde4785806ad670af47dae24d0158a95a1c Mon Sep 17 00:00:00 2001 From: icey-yu <1186114839@qq.com> Date: Wed, 12 Jun 2024 14:16:56 +0800 Subject: [PATCH] refactor:change FCM config name --- config/openim-push.yml | 2 +- internal/push/offlinepush/fcm/push.go | 4 ++-- pkg/common/config/config.go | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/config/openim-push.yml b/config/openim-push.yml index 63cba053d8..cf9de6ba4f 100644 --- a/config/openim-push.yml +++ b/config/openim-push.yml @@ -24,7 +24,7 @@ geTui: channelName: '' fcm: # Prioritize using file paths. If the file path is empty, use URL - serviceAccount: "" # File path is concatenated with the parameters passed in through - c and serviceAccount. + filePath: "" # File path is concatenated with the parameters passed in through - c(`mage` default pass in `config/`) and serviceAccount. authURL: "" # file URL. Protocol must be specified. jpns: appKey: '' diff --git a/internal/push/offlinepush/fcm/push.go b/internal/push/offlinepush/fcm/push.go index 515f0ab9ae..b1ccc88888 100644 --- a/internal/push/offlinepush/fcm/push.go +++ b/internal/push/offlinepush/fcm/push.go @@ -44,9 +44,9 @@ type Fcm struct { func NewClient(pushConf *config.Push, cache cache.ThirdCache, fcmConfigPath string) (*Fcm, error) { var opt option.ClientOption switch { - case len(pushConf.FCM.ServiceAccount) != 0: + case len(pushConf.FCM.FilePath) != 0: // with file path - credentialsFilePath := filepath.Join(fcmConfigPath, pushConf.FCM.ServiceAccount) + credentialsFilePath := filepath.Join(fcmConfigPath, pushConf.FCM.FilePath) opt = option.WithCredentialsFile(credentialsFilePath) case len(pushConf.FCM.AuthUrl) != 0: // with authentication URL diff --git a/pkg/common/config/config.go b/pkg/common/config/config.go index cc5c3a9c50..5cd6a1abd3 100644 --- a/pkg/common/config/config.go +++ b/pkg/common/config/config.go @@ -202,8 +202,8 @@ type Push struct { ChannelName string `mapstructure:"channelName"` } `mapstructure:"geTui"` FCM struct { - ServiceAccount string `mapstructure:"serviceAccount"` - AuthUrl string `mapstructure:"authURL"` + FilePath string `mapstructure:"filePath"` + AuthUrl string `mapstructure:"authURL"` } `mapstructure:"fcm"` JPNS struct { AppKey string `mapstructure:"appKey"`