mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-08-28 06:05:44 +08:00
push
This commit is contained in:
parent
36e37052e0
commit
0b4b408552
@ -152,18 +152,9 @@ func (g *Getui) Push(userIDList []string, title, detailContent, operationID stri
|
|||||||
ChannelName: config.Config.Push.Getui.ChannelName,
|
ChannelName: config.Config.Push.Getui.ChannelName,
|
||||||
}
|
}
|
||||||
if len(userIDList) > 1 {
|
if len(userIDList) > 1 {
|
||||||
taskID, err := db.DB.GetGetuiTaskID()
|
taskID, err := g.GetTaskID(operationID, token, pushReq)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.NewError(operationID, utils.GetSelfFuncName(), "GetGetuiTaskID failed", err.Error())
|
return "", utils.Wrap(err, "GetTaskIDAndSave2Redis failed")
|
||||||
} else {
|
|
||||||
log.NewDebug(operationID, utils.GetSelfFuncName(), "taskID", taskID)
|
|
||||||
}
|
|
||||||
if taskID == "" || err != nil {
|
|
||||||
taskID, err = g.GetTaskIDAndSave2Redis(operationID, token, pushReq)
|
|
||||||
if err != nil {
|
|
||||||
log.NewError(operationID, utils.GetSelfFuncName(), "GetTaskIDAndSave2Redis failed", err.Error())
|
|
||||||
return "", utils.Wrap(err, "")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
var IsAsync = true
|
var IsAsync = true
|
||||||
pushReq.IsAsync = &IsAsync
|
pushReq.IsAsync = &IsAsync
|
||||||
@ -176,7 +167,7 @@ func (g *Getui) Push(userIDList []string, title, detailContent, operationID stri
|
|||||||
err = g.request(BatchPushURL, pushReq, token, &pushResp, operationID)
|
err = g.request(BatchPushURL, pushReq, token, &pushResp, operationID)
|
||||||
} else {
|
} else {
|
||||||
reqID := utils.OperationIDGenerator()
|
reqID := utils.OperationIDGenerator()
|
||||||
pushReq := PushReq{
|
pushReq = PushReq{
|
||||||
RequestID: &reqID,
|
RequestID: &reqID,
|
||||||
Audience: struct {
|
Audience: struct {
|
||||||
Alias []string `json:"alias"`
|
Alias []string `json:"alias"`
|
||||||
|
Loading…
x
Reference in New Issue
Block a user