Skip to content

Commit 467709f

Browse files
authored
Merge pull request #1 from SOFTNETWORK-APP/feature/spi
Feature/spi
2 parents bd445c5 + f9cf06a commit 467709f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+821
-606
lines changed

.github/workflows/release.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
6+
name: Release
7+
# Run workflow on commits to the `main` branch
8+
on:
9+
workflow_dispatch:
10+
push:
11+
branches:
12+
- 'main'
13+
# - '*' # matches every branch that doesn't contain a '/'
14+
# - '*/*' # matches every branch containing a single '/'
15+
# - '**' # matches every branch
16+
# - '!main' # excludes main
17+
18+
permissions:
19+
contents: read
20+
21+
jobs:
22+
release:
23+
runs-on: self-hosted
24+
# runs-on: ubuntu-latest
25+
env:
26+
# define Java options for both official sbt and sbt-extras
27+
JAVA_OPTS: -Xms2048M -Xmx2048M -Xss6M -XX:ReservedCodeCacheSize=256M -Dfile.encoding=UTF-8
28+
JVM_OPTS: -Xms2048M -Xmx2048M -Xss6M -XX:ReservedCodeCacheSize=256M -Dfile.encoding=UTF-8
29+
steps:
30+
- name: Checkout
31+
uses: actions/checkout@v3
32+
- name: Set up JDK 8
33+
uses: actions/setup-java@v3
34+
with:
35+
java-version: '8'
36+
distribution: 'temurin'
37+
cache: 'sbt'
38+
- name: Run tests & publish
39+
run: sbt test publish

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,10 @@
1+
<!---
2+
This file is auto-generate by a github hook please modify r.md if you don't want to loose your work
3+
-->
4+
![Build Status](https://github.com/SOFTNETWORK-APP/generic-notification-api/workflows/Build/badge.svg)
5+
[![Scala Steward badge](https://img.shields.io/badge/Scala_Steward-helping-blue.svg?style=flat&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAQCAMAAAARSr4IAAAAVFBMVEUAAACHjojlOy5NWlrKzcYRKjGFjIbp293YycuLa3pYY2LSqql4f3pCUFTgSjNodYRmcXUsPD/NTTbjRS+2jomhgnzNc223cGvZS0HaSD0XLjbaSjElhIr+AAAAAXRSTlMAQObYZgAAAHlJREFUCNdNyosOwyAIhWHAQS1Vt7a77/3fcxxdmv0xwmckutAR1nkm4ggbyEcg/wWmlGLDAA3oL50xi6fk5ffZ3E2E3QfZDCcCN2YtbEWZt+Drc6u6rlqv7Uk0LdKqqr5rk2UCRXOk0vmQKGfc94nOJyQjouF9H/wCc9gECEYfONoAAAAASUVORK5CYII=)](https://scala-steward.org)
6+
[![codecov](https://codecov.io/gh/SOFTNETWORK-APP/generic-notification-api/branch/feature%2Fspi/graph/badge.svg)](https://codecov.io/gh/SOFTNETWORK-APP/generic-notification-api/)
7+
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/122252a6bdfb41c3af16d31f8cefaecc)](https://www.codacy.com/gh/SOFTNETWORK-APP/generic-notification-api/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=SOFTNETWORK-APP/generic-notification-api&amp;utm_campaign=Badge_Grade)
8+
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
9+
110
# generic-notification-api

api/src/main/scala/app/softnetwork/notification/api/NotificationApi.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ import akka.actor.typed.ActorSystem
44
import app.softnetwork.notification.handlers.NotificationHandler
55
import app.softnetwork.notification.launch.NotificationApplication
66
import app.softnetwork.notification.model.Notification
7-
import app.softnetwork.notification.peristence.query.{
7+
import app.softnetwork.notification.persistence.query.{
88
NotificationCommandProcessorStream,
99
Scheduler2NotificationProcessorStream
1010
}
11-
import app.softnetwork.notification.peristence.typed.{
11+
import app.softnetwork.notification.persistence.typed.{
1212
AllNotificationsBehavior,
1313
NotificationBehavior
1414
}

build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ ThisBuild / organization := "app.softnetwork"
3131

3232
name := "notification"
3333

34-
ThisBuild / version := "0.3-SNAPSHOT"
34+
ThisBuild / version := "0.1-SNAPSHOT"
3535

3636
ThisBuild / scalaVersion := "2.12.15"
3737

common/src/main/protobuf/model/notifications.proto

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,4 +132,14 @@ message Push{
132132
required string id = 21 [default = ""];
133133
required int32 badge = 22 [default = 0];
134134
optional string sound = 23;
135+
optional string app = 24;
135136
}
137+
138+
message PushPayload{
139+
option (scalapb.message).extends = "ProtobufDomainObject";
140+
required string app = 1;
141+
required string title = 2;
142+
required string body = 3;
143+
required int32 badge = 4 [default = 0];
144+
optional string sound = 5;
145+
}

common/src/main/resources/reference.conf

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,6 @@ notification {
4040
dry-run = ${?NOTIFICATION_PUSH_APNS_DRY_RUN}
4141
}
4242

43-
gcm {
44-
apiKey = ""
45-
apiKey = ${?NOTIFICATION_PUSH_GCM_API_KEY}
46-
}
47-
4843
fcm {
4944
databaseUrl = ""
5045
databaseUrl = ${?NOTIFICATION_PUSH_FCM_DATABASE_URL}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
package app.softnetwork.notification.config
2+
3+
case class EventStreams(externalToNotificationTag: String)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
package app.softnetwork.notification.config
2+
3+
case class NotificationConfig(eventStreams: EventStreams, akkaNodeRole: String)
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package app.softnetwork.notification.config
2+
3+
import com.typesafe.config.{Config, ConfigFactory}
4+
import com.typesafe.scalalogging.StrictLogging
5+
import configs.Configs
6+
7+
import scala.language.implicitConversions
8+
9+
trait NotificationSettings extends StrictLogging {
10+
11+
lazy val config: Config = ConfigFactory.load()
12+
13+
lazy val NotificationConfig: NotificationConfig =
14+
Configs[NotificationConfig].get(config, "notification").toEither match {
15+
case Left(configError) =>
16+
logger.error(s"Something went wrong with the provided arguments $configError")
17+
throw configError.configException
18+
case Right(r) => r
19+
}
20+
21+
}
22+
23+
object NotificationSettings extends NotificationSettings

common/src/main/scala/app/softnetwork/notification/config/Settings.scala

Lines changed: 0 additions & 63 deletions
This file was deleted.

0 commit comments

Comments
 (0)