2023-02-22 19:51:14 +08:00
|
|
|
package controller
|
|
|
|
|
|
|
|
|
|
import (
|
2023-02-23 19:15:30 +08:00
|
|
|
"OpenIM/pkg/common/db/cache"
|
2023-02-22 19:51:14 +08:00
|
|
|
"context"
|
|
|
|
|
)
|
|
|
|
|
|
2023-03-01 15:32:26 +08:00
|
|
|
type PushDatabase interface {
|
2023-02-22 19:51:14 +08:00
|
|
|
DelFcmToken(ctx context.Context, userID string, platformID int) error
|
|
|
|
|
}
|
|
|
|
|
|
2023-03-01 15:32:26 +08:00
|
|
|
type pushDataBase struct {
|
2023-02-24 11:01:33 +08:00
|
|
|
cache cache.Cache
|
2023-02-22 19:51:14 +08:00
|
|
|
}
|
|
|
|
|
|
2023-03-01 15:32:26 +08:00
|
|
|
func NewPushDatabase(cache cache.Cache) PushDatabase {
|
|
|
|
|
return &pushDataBase{cache: cache}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (p *pushDataBase) DelFcmToken(ctx context.Context, userID string, platformID int) error {
|
2023-02-22 19:51:14 +08:00
|
|
|
return p.cache.DelFcmToken(ctx, userID, platformID)
|
|
|
|
|
}
|