17
17
import org .springframework .http .HttpStatus ;
18
18
import org .springframework .http .ResponseEntity ;
19
19
import org .springframework .stereotype .Component ;
20
+ import org .springframework .web .bind .annotation .CrossOrigin ;
20
21
import org .springframework .web .bind .annotation .PathVariable ;
21
22
import org .springframework .web .bind .annotation .RequestBody ;
22
23
29
30
import io .swagger .annotations .ApiOperation ;
30
31
31
32
@ Component
33
+ @ CrossOrigin
32
34
@ Api (value = "subscription" , description = "The Subscription API for the store and retrieve the subscriptions from the database" )
33
35
public class SubscriptionControllerImpl implements SubscriptionController {
34
36
@@ -38,6 +40,7 @@ public class SubscriptionControllerImpl implements SubscriptionController {
38
40
private static final Logger LOG = LoggerFactory .getLogger (SubscriptionControllerImpl .class );
39
41
40
42
@ Override
43
+ @ CrossOrigin
41
44
@ ApiOperation (value = "Creates the subscription" )
42
45
public ResponseEntity <SubscriptionResponse > createSubscription (@ RequestBody Subscription subscription ) {
43
46
SubscriptionResponse subscriptionResponse = new SubscriptionResponse ();
@@ -55,6 +58,7 @@ public ResponseEntity<SubscriptionResponse> createSubscription(@RequestBody Subs
55
58
}
56
59
57
60
@ Override
61
+ @ CrossOrigin
58
62
@ ApiOperation (value = "Returns the subscription rules for given subscription name" )
59
63
public ResponseEntity <Subscription > getSubscriptionById (@ PathVariable String subscriptionName ) {
60
64
Subscription subscription = null ;
@@ -71,6 +75,7 @@ public ResponseEntity<Subscription> getSubscriptionById(@PathVariable String sub
71
75
}
72
76
73
77
@ Override
78
+ @ CrossOrigin
74
79
@ ApiOperation (value = "Update the existing subscription by the subscription name" )
75
80
public ResponseEntity <SubscriptionResponse > updateSubscriptionById (@ PathVariable String subscriptionName , @ RequestBody Subscription subscription ) {
76
81
LOG .info ("Subscription :" + subscriptionName + " update started" );
@@ -90,6 +95,7 @@ public ResponseEntity<SubscriptionResponse> updateSubscriptionById(@PathVariable
90
95
}
91
96
92
97
@ Override
98
+ @ CrossOrigin
93
99
@ ApiOperation (value = "Removes the subscription from the database" )
94
100
public ResponseEntity <SubscriptionResponse > deleteSubscriptionById (@ PathVariable String subscriptionName ) {
95
101
SubscriptionResponse subscriptionResponse = new SubscriptionResponse ();
@@ -107,6 +113,7 @@ public ResponseEntity<SubscriptionResponse> deleteSubscriptionById(@PathVariable
107
113
}
108
114
109
115
@ Override
116
+ @ CrossOrigin
110
117
@ ApiOperation (value = "Retrieve all the subscriptions" )
111
118
public ResponseEntity <List <Subscription >> getSubscriptions () {
112
119
LOG .info ("Subscription : get all records started" );
0 commit comments