File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
backend/src/main/java/com/youdemy/controller Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 1
1
package com .youdemy .controller ;
2
2
3
+ import java .util .ArrayList ;
3
4
import java .util .Optional ;
4
5
5
6
import org .springframework .beans .factory .annotation .Autowired ;
11
12
import com .youdemy .model .OrderP ;
12
13
import com .youdemy .service .OrderPService ;
13
14
15
+ import antlr .collections .List ;
16
+
14
17
@ RestController
15
18
@ RequestMapping ("/api/orders" )
16
19
public class OrderPRestController {
@@ -30,6 +33,15 @@ public ResponseEntity<OrderP> getOrder(@PathVariable long id) {
30
33
}
31
34
}
32
35
36
+
37
+ @ GetMapping ("/" )
38
+ public ArrayList <OrderP > getOrders () {
39
+
40
+ ArrayList <OrderP > orders = (ArrayList <OrderP >) orderService .findAll ();
41
+
42
+ return orders ;
43
+ }
44
+
33
45
@ PostMapping ("/" )
34
46
@ ResponseStatus (HttpStatus .CREATED )
35
47
public OrderP createBook (@ RequestBody OrderP order ) {
You can’t perform that action at this time.
0 commit comments