refactor:change FCM config name

pull/2341/head
icey-yu 1 year ago
parent 9ae653c32d
commit 2aed1fde47

@ -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: ''

@ -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

@ -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"`

Loading…
Cancel
Save