singal offline push

pull/232/head
wangchuxiao 2 years ago
parent 6996c008d0
commit 409a8311b1

@ -1,7 +1,7 @@
package getui
import (
"Open_IM/internal/push/logic"
"Open_IM/internal/push"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/db"
"Open_IM/pkg/common/log"
@ -99,7 +99,7 @@ func newGetuiClient() *Getui {
return &Getui{}
}
func (g *Getui) Push(userIDList []string, alert, detailContent, operationID string, opts logic.PushOpts) (resp string, err error) {
func (g *Getui) Push(userIDList []string, alert, detailContent, operationID string, opts push.PushOpts) (resp string, err error) {
token, err := db.DB.GetGetuiToken()
log.NewDebug(operationID, utils.GetSelfFuncName(), "token", token)
if err != nil {

@ -1,9 +1,9 @@
package push
import (
"Open_IM/internal/push"
"Open_IM/internal/push/jpush/common"
"Open_IM/internal/push/jpush/requestBody"
"Open_IM/internal/push/logic"
"Open_IM/pkg/common/config"
"bytes"
"encoding/json"
@ -33,7 +33,7 @@ func (j *JPush) SetAlias(cid, alias string) (resp string, err error) {
return resp, nil
}
func (j *JPush) Push(accounts []string, alert, detailContent, operationID string, opts logic.PushOpts) (string, error) {
func (j *JPush) Push(accounts []string, alert, detailContent, operationID string, opts push.PushOpts) (string, error) {
var pf requestBody.Platform
pf.SetAll()
var au requestBody.Audience

@ -7,6 +7,7 @@
package logic
import (
"Open_IM/internal/push"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/constant"
"Open_IM/pkg/common/log"
@ -36,14 +37,6 @@ type AtContent struct {
var grpcCons []*grpc.ClientConn
type PushOpts struct {
Signal Signal
}
type Signal struct {
ClientMsgID string
}
func MsgToUser(pushMsg *pbPush.PushMsgReq) {
var wsResult []*pbRelay.SingleMsgToUser
isOfflinePush := utils.GetSwitchFromOptions(pushMsg.MsgData.Options, constant.IsOfflinePush)
@ -146,7 +139,7 @@ func MsgToUser(pushMsg *pbPush.PushMsgReq) {
}
}
func GetOfflinePushOpts(pushMsg *pbPush.PushMsgReq) (opts PushOpts, err error) {
func GetOfflinePushOpts(pushMsg *pbPush.PushMsgReq) (opts push.PushOpts, err error) {
if pushMsg.MsgData.ContentType < constant.SignalingNotificationEnd && pushMsg.MsgData.ContentType > constant.SignalingNotification {
req := &pbRtc.SignalMessageAssembleReq{}
if err := proto.Unmarshal(pushMsg.MsgData.Content, req); err != nil {

@ -1,7 +1,13 @@
package push
import "Open_IM/internal/push/logic"
type OfflinePusher interface {
Push(userIDList []string, alert, detailContent, operationID string, opts logic.PushOpts) (resp string, err error)
Push(userIDList []string, alert, detailContent, operationID string, opts PushOpts) (resp string, err error)
}
type PushOpts struct {
Signal Signal
}
type Signal struct {
ClientMsgID string
}

Loading…
Cancel
Save