mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-12-11 23:47:32 +08:00
24 lines
547 B
Go
24 lines
547 B
Go
package dummy
|
|
|
|
import (
|
|
"context"
|
|
"github.com/openimsdk/open-im-server/v3/internal/push/offlinepush/options"
|
|
"github.com/openimsdk/tools/log"
|
|
"sync/atomic"
|
|
)
|
|
|
|
func NewClient() *Dummy {
|
|
return &Dummy{}
|
|
}
|
|
|
|
type Dummy struct {
|
|
v atomic.Bool
|
|
}
|
|
|
|
func (d *Dummy) Push(ctx context.Context, userIDs []string, title, content string, opts *options.Opts) error {
|
|
if d.v.CompareAndSwap(false, true) {
|
|
log.ZWarn(ctx, "dummy push", nil, "ps", "the offline push is not configured. to configure it, please go to config/openim-push.yml")
|
|
}
|
|
return nil
|
|
}
|