ソースを参照

initial commit

Yesoda Sanka 5 年 前
コミット
71e874fa9a

バイナリ
.DS_Store ファイルの表示


バイナリ
src/main/.DS_Store ファイルの表示


+ 10
- 0
src/main/java/com/zipcodewilmington/bakery/Controllers/BakerController.java ファイルの表示

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

+ 6
- 0
src/main/java/com/zipcodewilmington/bakery/Controllers/MuffinController.java ファイルの表示

2
 
2
 
3
 import com.zipcodewilmington.bakery.Models.Muffin;
3
 import com.zipcodewilmington.bakery.Models.Muffin;
4
 import com.zipcodewilmington.bakery.Repositories.MuffinRepository;
4
 import com.zipcodewilmington.bakery.Repositories.MuffinRepository;
5
+import org.springframework.beans.factory.annotation.Autowired;
5
 import org.springframework.http.HttpStatus;
6
 import org.springframework.http.HttpStatus;
6
 import org.springframework.http.ResponseEntity;
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
 public class MuffinController {
13
 public class MuffinController {
9
 
14
 
15
+    @Autowired
10
     private MuffinRepository muffinRepository;
16
     private MuffinRepository muffinRepository;
11
 
17
 
12
     public ResponseEntity<Iterable<Muffin>> index() {
18
     public ResponseEntity<Iterable<Muffin>> index() {

+ 3
- 0
src/main/java/com/zipcodewilmington/bakery/Repositories/BakerRepository.java ファイルの表示

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

+ 3
- 0
src/main/java/com/zipcodewilmington/bakery/Repositories/MuffinRepository.java ファイルの表示

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

+ 1
- 0
src/main/resources/application.properties ファイルの表示

1
+server.port:8082