ws add logout remove push token

This commit is contained in:
Gordon
2022-10-27 17:15:06 +08:00
parent 59b625b7c0
commit eba25f1bb8
7 changed files with 319 additions and 241 deletions
+13 -1
View File
@@ -3,6 +3,7 @@ package logic
import (
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/constant"
"Open_IM/pkg/common/db"
"Open_IM/pkg/common/log"
promePkg "Open_IM/pkg/common/prometheus"
"Open_IM/pkg/grpc-etcdv3/getcdv3"
@@ -10,7 +11,6 @@ import (
"Open_IM/pkg/utils"
"context"
"net"
"strconv"
"strings"
@@ -91,3 +91,15 @@ func (r *RPCServer) PushMsg(_ context.Context, pbData *pbPush.PushMsgReq) (*pbPu
}, nil
}
func (r *RPCServer) DelUserPushToken(c context.Context, req *pbPush.DelUserPushTokenReq) (*pbPush.DelUserPushTokenResp, error) {
var resp pbPush.DelUserPushTokenResp
err := db.DB.DelFcmToken(req.UserID, int(req.PlatformID))
if err != nil {
errMsg := req.OperationID + " " + "SetFcmToken failed " + err.Error()
log.NewError(req.OperationID, errMsg)
resp.ErrCode = 500
resp.ErrMsg = errMsg
}
return &resp, nil
}