forked from aws-samples/eb-java-scorekeep
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRulesController.java
More file actions
27 lines (24 loc) · 939 Bytes
/
Copy pathRulesController.java
File metadata and controls
27 lines (24 loc) · 939 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package scorekeep;
import java.util.concurrent.atomic.AtomicLong;
import java.util.*;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.CrossOrigin;
@RestController
@RequestMapping(value="/api/rules")
public class RulesController {
private final RulesFactory rulesFactory = new RulesFactory();
/* GET /rules */
@RequestMapping(method=RequestMethod.GET)
public Collection<Rules> rules() {
return rulesFactory.getAllRules();
}
/* GET /rules/RULES */
@RequestMapping(value="/{rulesId}",method=RequestMethod.GET)
public Rules rules(@PathVariable String rulesId) {
return rulesFactory.getRules(rulesId);
}
}