|
@@ -3,7 +3,6 @@ package com.zipcodewilmington.bakery.Controllers;
|
3
|
3
|
import com.zipcodewilmington.bakery.Models.Baker;
|
4
|
4
|
import com.zipcodewilmington.bakery.Repositories.BakerRepository;
|
5
|
5
|
import org.springframework.beans.factory.annotation.Autowired;
|
6
|
|
-import org.springframework.beans.factory.annotation.Qualifier;
|
7
|
6
|
import org.springframework.http.HttpStatus;
|
8
|
7
|
import org.springframework.http.ResponseEntity;
|
9
|
8
|
import org.springframework.web.bind.annotation.*;
|
|
@@ -11,10 +10,12 @@ import org.springframework.web.bind.annotation.*;
|
11
|
10
|
@RestController
|
12
|
11
|
public class BakerController {
|
13
|
12
|
|
14
|
|
- @Autowired
|
15
|
|
-// @Qualifier("beanBaker")
|
16
|
13
|
private BakerRepository bakerRepository;
|
17
|
14
|
|
|
15
|
+ BakerController(@Autowired BakerRepository bakerRepository){
|
|
16
|
+ this.bakerRepository = bakerRepository;
|
|
17
|
+ }
|
|
18
|
+
|
18
|
19
|
@GetMapping("/baker")
|
19
|
20
|
public ResponseEntity<Iterable<Baker>> index() {
|
20
|
21
|
return new ResponseEntity<>(this.bakerRepository.findAll(), HttpStatus.OK);
|