refactor: remove config from notification struct. (#617)

* refactor: remove config from notification struct.

* chore: update

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi Wu
2021-08-01 19:48:57 +08:00
committed by GitHub
parent 132e1791cd
commit 8d03ac5f1e
10 changed files with 73 additions and 78 deletions

View File

@@ -56,7 +56,6 @@ func (s *Server) Check(ctx context.Context, in *proto.HealthCheckRequest) (*prot
func (s *Server) Send(ctx context.Context, in *proto.NotificationRequest) (*proto.NotificationReply, error) {
badge := int(in.Badge)
notification := notify.PushNotification{
Cfg: s.cfg,
Platform: int(in.Platform),
Tokens: in.Tokens,
Message: in.Message,
@@ -102,7 +101,7 @@ func (s *Server) Send(ctx context.Context, in *proto.NotificationRequest) (*prot
}
}
go notify.SendNotification(&notification)
go notify.SendNotification(&notification, s.cfg)
return &proto.NotificationReply{
Success: true,