Yesoda Sanka преди 5 години
родител
ревизия
71e874fa9a

BIN
.DS_Store Целия файл


BIN
src/main/.DS_Store Целия файл


+ 10
- 0
src/main/java/com/zipcodewilmington/bakery/Controllers/BakerController.java Целия файл

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

+ 6
- 0
src/main/java/com/zipcodewilmington/bakery/Controllers/MuffinController.java Целия файл

@@ -2,11 +2,17 @@ package com.zipcodewilmington.bakery.Controllers;
2 2
 
3 3
 import com.zipcodewilmington.bakery.Models.Muffin;
4 4
 import com.zipcodewilmington.bakery.Repositories.MuffinRepository;
5
+import org.springframework.beans.factory.annotation.Autowired;
5 6
 import org.springframework.http.HttpStatus;
6 7
 import org.springframework.http.ResponseEntity;
8
+import org.springframework.stereotype.Controller;
9
+import org.springframework.web.bind.annotation.GetMapping;
10
+import org.springframework.web.bind.annotation.RestController;
7 11
 
12
+@RestController
8 13
 public class MuffinController {
9 14
 
15
+    @Autowired
10 16
     private MuffinRepository muffinRepository;
11 17
 
12 18
     public ResponseEntity<Iterable<Muffin>> index() {

+ 3
- 0
src/main/java/com/zipcodewilmington/bakery/Repositories/BakerRepository.java Целия файл

@@ -2,6 +2,9 @@ package com.zipcodewilmington.bakery.Repositories;
2 2
 
3 3
 import com.zipcodewilmington.bakery.Models.Baker;
4 4
 import org.springframework.data.repository.CrudRepository;
5
+import org.springframework.stereotype.Repository;
5 6
 
7
+@Repository
6 8
 public interface BakerRepository extends CrudRepository<Baker, Long> {
9
+
7 10
 }

+ 3
- 0
src/main/java/com/zipcodewilmington/bakery/Repositories/MuffinRepository.java Целия файл

@@ -2,6 +2,9 @@ package com.zipcodewilmington.bakery.Repositories;
2 2
 
3 3
 import com.zipcodewilmington.bakery.Models.Muffin;
4 4
 import org.springframework.data.repository.CrudRepository;
5
+import org.springframework.stereotype.Repository;
5 6
 
7
+@Repository
6 8
 public interface MuffinRepository extends CrudRepository<Muffin, Long> {
9
+
7 10
 }

+ 1
- 0
src/main/resources/application.properties Целия файл

@@ -0,0 +1 @@
1
+server.port:8082