config path

This commit is contained in:
wangchuxiao
2023-02-24 11:01:33 +08:00
parent dd7a7d9cda
commit bb94a7947c
24 changed files with 245 additions and 801 deletions
+2 -2
View File
@@ -19,10 +19,10 @@ var Terminal = []int{constant.IOSPlatformID, constant.AndroidPlatformID, constan
type Fcm struct {
fcmMsgCli *messaging.Client
cache cache.MsgCache
cache cache.Cache
}
func NewClient(cache cache.MsgCache) *Fcm {
func NewClient(cache cache.Cache) *Fcm {
opt := option.WithCredentialsFile(filepath.Join(config.Root, "config", config.Config.Push.Fcm.ServiceAccount))
fcmApp, err := firebase.NewApp(context.Background(), nil, opt)
if err != nil {
+1 -1
View File
@@ -9,7 +9,7 @@ import (
)
func Test_Push(t *testing.T) {
var redis cache.MsgCache
var redis cache.Cache
offlinePusher := NewClient(redis)
err := offlinePusher.Push(context.Background(), []string{"userID1"}, "test", "test", &push.Opts{})
assert.Nil(t, err)
+2 -2
View File
@@ -38,12 +38,12 @@ const (
)
type Client struct {
cache cache.MsgCache
cache cache.Cache
tokenExpireTime int64
taskIDTTL int64
}
func NewClient(cache cache.MsgCache) *Client {
func NewClient(cache cache.Cache) *Client {
return &Client{cache: cache, tokenExpireTime: tokenExpireTime, taskIDTTL: taskIDTTL}
}
+1 -1
View File
@@ -25,7 +25,7 @@ type RPCServer struct {
pusher Pusher
}
func (r *RPCServer) Init(rpcPort int, cache cache.MsgCache) {
func (r *RPCServer) Init(rpcPort int, cache cache.Cache) {
r.rpcPort = rpcPort
r.rpcRegisterName = config.Config.RpcRegisterName.OpenImPushName
}
+2 -2
View File
@@ -25,7 +25,7 @@ import (
)
type Pusher struct {
cache cache.MsgCache
cache cache.Cache
client discoveryregistry.SvcDiscoveryRegistry
offlinePusher OfflinePusher
groupLocalCache localcache.GroupLocalCache
@@ -33,7 +33,7 @@ type Pusher struct {
successCount int
}
func NewPusher(cache cache.MsgCache, client discoveryregistry.SvcDiscoveryRegistry, offlinePusher OfflinePusher) *Pusher {
func NewPusher(cache cache.Cache, client discoveryregistry.SvcDiscoveryRegistry, offlinePusher OfflinePusher) *Pusher {
return &Pusher{
cache: cache,
client: client,