From b48323a4c946c89775d1aadc5d6f796acaadf52a Mon Sep 17 00:00:00 2001 From: mbarre Date: Sun, 18 Feb 2018 17:43:06 +1100 Subject: [PATCH] authorize cross origin --- pom.xml | 2 +- .../mbarre/ticketrestoncrest/service/AccountService.java | 4 ++++ .../mbarre/ticketrestoncrest/service/PartnerService.java | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index bc77b8b..eafb0f4 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ io.github.mbarre ticketresto-nc-rest - 1.1.2 + 1.1.3 jar ticketresto-nc-rest diff --git a/src/main/java/io/github/mbarre/ticketrestoncrest/service/AccountService.java b/src/main/java/io/github/mbarre/ticketrestoncrest/service/AccountService.java index 2054140..baed6c2 100644 --- a/src/main/java/io/github/mbarre/ticketrestoncrest/service/AccountService.java +++ b/src/main/java/io/github/mbarre/ticketrestoncrest/service/AccountService.java @@ -10,6 +10,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Service; +import org.springframework.web.bind.annotation.CrossOrigin; import java.text.DateFormat; import java.text.SimpleDateFormat; @@ -24,6 +25,7 @@ public class AccountService { private final Logger log = LoggerFactory.getLogger(AccountService.class); private TicketsRestaurantsServiceWrapper wrap; + @CrossOrigin(origins = "http://localhost:8080") public Account getAccountDetails(String identifier, String password) { Account account = null; @@ -52,6 +54,7 @@ public Account getAccountDetails(String identifier, String password) { } } + @CrossOrigin(origins = "http://localhost:8080") public Balance getBalance(String identifier, String password) { try { @@ -75,6 +78,7 @@ public Balance getBalance(String identifier, String password) { } + @CrossOrigin(origins = "http://localhost:8080") public List getTransactions(String identifier, String password, Date from) { try { diff --git a/src/main/java/io/github/mbarre/ticketrestoncrest/service/PartnerService.java b/src/main/java/io/github/mbarre/ticketrestoncrest/service/PartnerService.java index 2defe04..05274c9 100644 --- a/src/main/java/io/github/mbarre/ticketrestoncrest/service/PartnerService.java +++ b/src/main/java/io/github/mbarre/ticketrestoncrest/service/PartnerService.java @@ -7,6 +7,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Service; +import org.springframework.web.bind.annotation.CrossOrigin; import java.util.ArrayList; import java.util.List; @@ -17,6 +18,7 @@ public class PartnerService { private final Logger log = LoggerFactory.getLogger(AccountService.class); private TicketsRestaurantsServiceWrapper wrap; + @CrossOrigin(origins = "http://localhost:8080") public List getAllPartners() throws Exception { List allPartners = new ArrayList<>();