You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Open-IM-Server/pkg/common/db/controller/push.go

29 lines
854 B

2 years ago
package controller
import (
"context"
2 years ago
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache"
"github.com/OpenIMSDK/Open-IM-Server/pkg/proto/sdkws"
2 years ago
)
2 years ago
type PushDatabase interface {
2 years ago
DelFcmToken(ctx context.Context, userID string, platformID int) error
2 years ago
HandleSignalInvite(ctx context.Context, msg *sdkws.MsgData, pushToUserID string) (isSend bool, err error)
2 years ago
}
2 years ago
type pushDataBase struct {
2 years ago
cache cache.Model
2 years ago
}
2 years ago
func NewPushDatabase(cache cache.Model) PushDatabase {
2 years ago
return &pushDataBase{cache: cache}
}
func (p *pushDataBase) DelFcmToken(ctx context.Context, userID string, platformID int) error {
2 years ago
return p.cache.DelFcmToken(ctx, userID, platformID)
}
2 years ago
func (p *pushDataBase) HandleSignalInvite(ctx context.Context, msg *sdkws.MsgData, pushToUserID string) (isSend bool, err error) {
return p.cache.HandleSignalInvite(ctx, msg, pushToUserID)
}