mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-05-01 07:03:15 +08:00
singal offline push
This commit is contained in:
parent
6996c008d0
commit
409a8311b1
@ -1,7 +1,7 @@
|
|||||||
package getui
|
package getui
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"Open_IM/internal/push/logic"
|
"Open_IM/internal/push"
|
||||||
"Open_IM/pkg/common/config"
|
"Open_IM/pkg/common/config"
|
||||||
"Open_IM/pkg/common/db"
|
"Open_IM/pkg/common/db"
|
||||||
"Open_IM/pkg/common/log"
|
"Open_IM/pkg/common/log"
|
||||||
@ -99,7 +99,7 @@ func newGetuiClient() *Getui {
|
|||||||
return &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()
|
token, err := db.DB.GetGetuiToken()
|
||||||
log.NewDebug(operationID, utils.GetSelfFuncName(), "token:", token)
|
log.NewDebug(operationID, utils.GetSelfFuncName(), "token:", token)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
package push
|
package push
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"Open_IM/internal/push"
|
||||||
"Open_IM/internal/push/jpush/common"
|
"Open_IM/internal/push/jpush/common"
|
||||||
"Open_IM/internal/push/jpush/requestBody"
|
"Open_IM/internal/push/jpush/requestBody"
|
||||||
"Open_IM/internal/push/logic"
|
|
||||||
"Open_IM/pkg/common/config"
|
"Open_IM/pkg/common/config"
|
||||||
"bytes"
|
"bytes"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
@ -33,7 +33,7 @@ func (j *JPush) SetAlias(cid, alias string) (resp string, err error) {
|
|||||||
return resp, nil
|
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
|
var pf requestBody.Platform
|
||||||
pf.SetAll()
|
pf.SetAll()
|
||||||
var au requestBody.Audience
|
var au requestBody.Audience
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
package logic
|
package logic
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"Open_IM/internal/push"
|
||||||
"Open_IM/pkg/common/config"
|
"Open_IM/pkg/common/config"
|
||||||
"Open_IM/pkg/common/constant"
|
"Open_IM/pkg/common/constant"
|
||||||
"Open_IM/pkg/common/log"
|
"Open_IM/pkg/common/log"
|
||||||
@ -36,14 +37,6 @@ type AtContent struct {
|
|||||||
|
|
||||||
var grpcCons []*grpc.ClientConn
|
var grpcCons []*grpc.ClientConn
|
||||||
|
|
||||||
type PushOpts struct {
|
|
||||||
Signal Signal
|
|
||||||
}
|
|
||||||
|
|
||||||
type Signal struct {
|
|
||||||
ClientMsgID string
|
|
||||||
}
|
|
||||||
|
|
||||||
func MsgToUser(pushMsg *pbPush.PushMsgReq) {
|
func MsgToUser(pushMsg *pbPush.PushMsgReq) {
|
||||||
var wsResult []*pbRelay.SingleMsgToUser
|
var wsResult []*pbRelay.SingleMsgToUser
|
||||||
isOfflinePush := utils.GetSwitchFromOptions(pushMsg.MsgData.Options, constant.IsOfflinePush)
|
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 {
|
if pushMsg.MsgData.ContentType < constant.SignalingNotificationEnd && pushMsg.MsgData.ContentType > constant.SignalingNotification {
|
||||||
req := &pbRtc.SignalMessageAssembleReq{}
|
req := &pbRtc.SignalMessageAssembleReq{}
|
||||||
if err := proto.Unmarshal(pushMsg.MsgData.Content, req); err != nil {
|
if err := proto.Unmarshal(pushMsg.MsgData.Content, req); err != nil {
|
||||||
|
@ -1,7 +1,13 @@
|
|||||||
package push
|
package push
|
||||||
|
|
||||||
import "Open_IM/internal/push/logic"
|
|
||||||
|
|
||||||
type OfflinePusher interface {
|
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…
x
Reference in New Issue
Block a user