diff --git a/financer-server/pom.xml b/financer-server/pom.xml
index 48a03b1..82315ca 100644
--- a/financer-server/pom.xml
+++ b/financer-server/pom.xml
@@ -17,7 +17,7 @@
jar
- postgres,dev
+ hsqldb,dev
mk
diff --git a/financer-web-client/pom.xml b/financer-web-client/pom.xml
index 1601ea7..b7b8138 100644
--- a/financer-web-client/pom.xml
+++ b/financer-web-client/pom.xml
@@ -21,7 +21,7 @@
dev
diff --git a/financer-web-client/src/main/java/de/financer/config/FinancerConfig.java b/financer-web-client/src/main/java/de/financer/config/FinancerConfig.java
index 7c1bba8..6eec601 100644
--- a/financer-web-client/src/main/java/de/financer/config/FinancerConfig.java
+++ b/financer-web-client/src/main/java/de/financer/config/FinancerConfig.java
@@ -3,12 +3,14 @@ package de.financer.config;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import java.util.Currency;
@Configuration
@ConfigurationProperties(prefix = "financer")
+@ComponentScan("de.pushservice.client")
public class FinancerConfig {
private static final Logger LOGGER = LoggerFactory.getLogger(FinancerConfig.class);
diff --git a/financer-web-client/src/main/java/de/financer/controller/AccountController.java b/financer-web-client/src/main/java/de/financer/controller/AccountController.java
index 627b067..fcbad97 100644
--- a/financer-web-client/src/main/java/de/financer/controller/AccountController.java
+++ b/financer-web-client/src/main/java/de/financer/controller/AccountController.java
@@ -11,6 +11,9 @@ import de.financer.template.*;
import de.financer.template.exception.FinancerRestException;
import de.financer.util.ControllerUtils;
import de.financer.util.TransactionUtils;
+import de.pushservice.client.dto.PayloadDto;
+import de.pushservice.client.model.Urgency;
+import de.pushservice.client.service.SubscriptionService;
import org.apache.commons.collections4.IterableUtils;
import org.apache.commons.lang3.BooleanUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -189,4 +192,30 @@ public class AccountController {
return "redirect:/accountOverview";
}
+
+ // ---------------------------------------------
+
+ @Autowired
+ private SubscriptionService subscriptionService;
+ private int counter = 0;
+
+ @GetMapping("/sentTestNotification")
+ public String sentTestNotification() {
+ if (this.subscriptionService.isInitialized()) {
+ PayloadDto p = new PayloadDto("Hello from Financer!");
+
+ p.setTimestamp(System.currentTimeMillis());
+ p.setMessage("Test notification " + counter++);
+ p.setVibration(new int[] {100, 200, 300, 400, 500});
+
+ try {
+ this.subscriptionService.notify(p, "FINANCER-TEST", Urgency.NORMAL);
+ }
+ catch(Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ return "redirect:/accountOverview";
+ }
}
diff --git a/financer-web-client/src/main/resources/config/application-mk.properties b/financer-web-client/src/main/resources/config/application-mk.properties
index 1961672..dd36e21 100644
--- a/financer-web-client/src/main/resources/config/application-mk.properties
+++ b/financer-web-client/src/main/resources/config/application-mk.properties
@@ -1 +1,2 @@
-financer.serverUrl=http://localhost:8080/financer-server-mk/
\ No newline at end of file
+financer.serverUrl=http://localhost:8080/financer-server-mk/
+push-service-client.serverUrl=http://localhost:8080/push-service-server-mk/
\ No newline at end of file
diff --git a/financer-web-client/src/main/resources/config/application.properties b/financer-web-client/src/main/resources/config/application.properties
index 03a2920..21eba0e 100644
--- a/financer-web-client/src/main/resources/config/application.properties
+++ b/financer-web-client/src/main/resources/config/application.properties
@@ -32,4 +32,7 @@ spring.messages.basename=i18n/message
# The currency code to use for displaying money values. Note that the currency is only used for
# displaying.
# Possible values are ISO-4271 currency codes.
-financer.currencyCode=EUR
\ No newline at end of file
+financer.currencyCode=EUR
+
+push-service-client.serverUrl=http://localhost:8077/push-service-server/
+logging.level.de.pushservice=DEBUG
\ No newline at end of file
diff --git a/financer-web-client/src/main/resources/static/javascript/init.js b/financer-web-client/src/main/resources/static/javascript/init.js
new file mode 100644
index 0000000..4abd3d0
--- /dev/null
+++ b/financer-web-client/src/main/resources/static/javascript/init.js
@@ -0,0 +1 @@
+window.onload = registerServiceWorker();
\ No newline at end of file
diff --git a/financer-web-client/src/main/resources/templates/account/accountOverview.html b/financer-web-client/src/main/resources/templates/account/accountOverview.html
index 83a39eb..5a14b03 100644
--- a/financer-web-client/src/main/resources/templates/account/accountOverview.html
+++ b/financer-web-client/src/main/resources/templates/account/accountOverview.html
@@ -4,8 +4,10 @@
-
+
+
+
diff --git a/financer-web-client/src/main/resources/templates/includes/footer.html b/financer-web-client/src/main/resources/templates/includes/footer.html
index f7d062b..ff66c12 100644
--- a/financer-web-client/src/main/resources/templates/includes/footer.html
+++ b/financer-web-client/src/main/resources/templates/includes/footer.html
@@ -2,6 +2,6 @@
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 7b37496..c58c36c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -26,7 +26,7 @@
- 000030
+ 000031
@@ -87,6 +87,11 @@
financer-common
${project.version}
+
+ de.77zzcx7.push-service
+ push-service-client-lib
+ 2
+