mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-06 04:15:46 +08:00
34 lines
792 B
Go
34 lines
792 B
Go
package rpcclient
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/discoveryregistry"
|
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/proto/push"
|
|
)
|
|
|
|
type Push struct {
|
|
}
|
|
|
|
func NewPushPush(client discoveryregistry.SvcDiscoveryRegistry) *PushClient {
|
|
return &PushClient{
|
|
MetaClient: MetaClient{
|
|
client: client,
|
|
rpcRegisterName: config.Config.RpcRegisterName.OpenImPushName,
|
|
},
|
|
}
|
|
}
|
|
|
|
func (p *PushClient) DelUserPushToken(ctx context.Context, req *push.DelUserPushTokenReq) (*push.DelUserPushTokenResp, error) {
|
|
cc, err := p.getConn(ctx)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
resp, err := push.NewPushMsgServiceClient(cc).DelUserPushToken(ctx, req)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return resp, nil
|
|
}
|