Skip to content

Commit

Permalink
fix #2860 migrate jpns to jpush
Browse files Browse the repository at this point in the history
  • Loading branch information
wikylyu committed Nov 18, 2024
1 parent 8471a0e commit 3c88d1b
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion config/openim-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ fcm:
# Prioritize using file paths. If the file path is empty, use URL
filePath: # File path is concatenated with the parameters passed in through - c(`mage` default pass in `config/`) and filePath.
authURL: # Must start with https or http.
jpns:
jpush:
appKey:
masterSecret:
pushURL:
Expand Down
10 changes: 5 additions & 5 deletions deployments/templates/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -240,11 +240,11 @@ push:
channelName: ${GETUI_CHANNEL_NAME}
fcm:
serviceAccount: "${FCM_SERVICE_ACCOUNT}"
jpns:
appKey: ${JPNS_APP_KEY}
masterSecret: ${JPNS_MASTER_SECRET}
pushUrl: ${JPNS_PUSH_URL}
pushIntent: ${JPNS_PUSH_INTENT}
jpush:
appKey: ${JPUSH_APP_KEY}
masterSecret: ${JPUSH_MASTER_SECRET}
pushUrl: ${JPUSH_PUSH_URL}
pushIntent: ${JPUSH_PUSH_INTENT}

# App manager configuration
#
Expand Down
8 changes: 4 additions & 4 deletions docs/contrib/environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -474,10 +474,10 @@ This section involves setting up additional configuration variables for Websocke
| GETUI_CHANNEL_ID | [User Defined] | GeTui Channel ID |
| GETUI_CHANNEL_NAME | [User Defined] | GeTui Channel Name |
| FCM_SERVICE_ACCOUNT | "x.json" | FCM Service Account |
| JPNS_APP_KEY | [User Defined] | JPNS Application Key |
| JPNS_MASTER_SECRET | [User Defined] | JPNS Master Secret |
| JPNS_PUSH_URL | [User Defined] | JPNS Push Notification URL |
| JPNS_PUSH_INTENT | [User Defined] | JPNS Push Intent |
| JPUSH_APP_KEY | [User Defined] | JPUSH Application Key |
| JPUSH_MASTER_SECRET | [User Defined] | JPUSH Master Secret |
| JPUSH_PUSH_URL | [User Defined] | JPUSH Push Notification URL |
| JPUSH_PUSH_INTENT | [User Defined] | JPUSH Push Intent |
| IM_ADMIN_USERID | "imAdmin" | IM Administrator ID |
| IM_ADMIN_NAME | "imAdmin" | IM Administrator Nickname |
| MULTILOGIN_POLICY | "1" | Multi-login Policy |
Expand Down
2 changes: 1 addition & 1 deletion internal/push/offlinepush/jpush/body/notification.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (n *Notification) SetExtras(extras map[string]string) {
}

func (n *Notification) SetAndroidIntent(pushConf *config.Push) {
n.Android.Intent.URL = pushConf.JPNS.PushIntent
n.Android.Intent.URL = pushConf.JPush.PushIntent
}

func (n *Notification) IOSEnableMutableContent() {
Expand Down
4 changes: 2 additions & 2 deletions internal/push/offlinepush/jpush/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ func (j *JPush) Push(ctx context.Context, userIDs []string, title, content strin
func (j *JPush) request(ctx context.Context, po body.PushObj, resp *map[string]any, timeout int) error {
err := j.httpClient.PostReturn(
ctx,
j.pushConf.JPNS.PushURL,
j.pushConf.JPush.PushURL,
map[string]string{
"Authorization": j.getAuthorization(j.pushConf.JPNS.AppKey, j.pushConf.JPNS.MasterSecret),
"Authorization": j.getAuthorization(j.pushConf.JPush.AppKey, j.pushConf.JPush.MasterSecret),
},
po,
resp,
Expand Down
4 changes: 2 additions & 2 deletions pkg/common/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,12 +213,12 @@ type Push struct {
FilePath string `mapstructure:"filePath"`
AuthURL string `mapstructure:"authURL"`
} `mapstructure:"fcm"`
JPNS struct {
JPush struct {
AppKey string `mapstructure:"appKey"`
MasterSecret string `mapstructure:"masterSecret"`
PushURL string `mapstructure:"pushURL"`
PushIntent string `mapstructure:"pushIntent"`
} `mapstructure:"jpns"`
} `mapstructure:"jpush"`
IOSPush struct {
PushSound string `mapstructure:"pushSound"`
BadgeCount bool `mapstructure:"badgeCount"`
Expand Down

0 comments on commit 3c88d1b

Please sign in to comment.