Bladeren bron

fixed pom file

mpierse 5 jaren geleden
bovenliggende
commit
c15e2c0ca0

+ 10
- 4
pom.xml Bestand weergeven

1
-
2
- <?xml version="1.0" encoding="UTF-8"?>
1
+<?xml version="1.0" encoding="UTF-8"?>
3
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4
 	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3
 	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5
 	<modelVersion>4.0.0</modelVersion>
4
 	<modelVersion>4.0.0</modelVersion>
15
 	<parent>
14
 	<parent>
16
 		<groupId>org.springframework.boot</groupId>
15
 		<groupId>org.springframework.boot</groupId>
17
 		<artifactId>spring-boot-starter-parent</artifactId>
16
 		<artifactId>spring-boot-starter-parent</artifactId>
18
-		<version>2.0.4.RELEASE</version>
17
+		<version>1.5.11.RELEASE</version>
19
 		<relativePath/> <!-- lookup parent from repository -->
18
 		<relativePath/> <!-- lookup parent from repository -->
20
 	</parent>
19
 	</parent>
21
 
20
 
59
             <groupId>com.h2database</groupId>
58
             <groupId>com.h2database</groupId>
60
             <artifactId>h2</artifactId>
59
             <artifactId>h2</artifactId>
61
         </dependency>
60
         </dependency>
62
-    </dependencies>
61
+
62
+        <dependency>
63
+            <groupId>org.hsqldb</groupId>
64
+            <artifactId>hsqldb</artifactId>
65
+            <scope>runtime</scope>
66
+        </dependency>
67
+
68
+	</dependencies>
63
 
69
 
64
 	<build>
70
 	<build>
65
 		<plugins>
71
 		<plugins>

+ 4
- 6
src/main/java/com/zipcodewilmington/bakery/Controllers/BakerController.java Bestand weergeven

5
 import org.springframework.beans.factory.annotation.Autowired;
5
 import org.springframework.beans.factory.annotation.Autowired;
6
 import org.springframework.http.HttpStatus;
6
 import org.springframework.http.HttpStatus;
7
 import org.springframework.http.ResponseEntity;
7
 import org.springframework.http.ResponseEntity;
8
-import org.springframework.web.bind.annotation.GetMapping;
9
-import org.springframework.web.bind.annotation.RequestMapping;
10
-import org.springframework.web.bind.annotation.RestController;
8
+import org.springframework.web.bind.annotation.*;
11
 
9
 
12
 @RestController
10
 @RestController
13
 @RequestMapping
11
 @RequestMapping
26
         return new ResponseEntity<>(this.bakerRepository.findOne(id), HttpStatus.OK);
24
         return new ResponseEntity<>(this.bakerRepository.findOne(id), HttpStatus.OK);
27
     }
25
     }
28
 
26
 
29
-    @GetMapping(value = "/baker")
27
+    @PostMapping(value = "/baker")
30
     public ResponseEntity<Baker> create(Baker baker) {
28
     public ResponseEntity<Baker> create(Baker baker) {
31
         return new ResponseEntity<>(this.bakerRepository.save(baker), HttpStatus.CREATED);
29
         return new ResponseEntity<>(this.bakerRepository.save(baker), HttpStatus.CREATED);
32
     }
30
     }
33
 
31
 
34
-    @GetMapping(value = "/baker/{id}")
32
+    @PutMapping(value = "/baker/{id}")
35
     public ResponseEntity<Baker> update(Long id, Baker baker) {
33
     public ResponseEntity<Baker> update(Long id, Baker baker) {
36
         Baker foundBaker = bakerRepository.findOne(id);
34
         Baker foundBaker = bakerRepository.findOne(id);
37
 
35
 
41
         return new ResponseEntity<>(this.bakerRepository.save(foundBaker), HttpStatus.OK);
39
         return new ResponseEntity<>(this.bakerRepository.save(foundBaker), HttpStatus.OK);
42
     }
40
     }
43
 
41
 
44
-    @GetMapping(value = "/baker/{id}")
42
+    @DeleteMapping(value = "/baker/{id}")
45
     public ResponseEntity<Boolean> destroy(Long id) {
43
     public ResponseEntity<Boolean> destroy(Long id) {
46
         this.bakerRepository.delete(id);
44
         this.bakerRepository.delete(id);
47
         return new ResponseEntity<>(true, HttpStatus.OK);
45
         return new ResponseEntity<>(true, HttpStatus.OK);

+ 4
- 7
src/main/java/com/zipcodewilmington/bakery/Controllers/MuffinController.java Bestand weergeven

5
 import org.springframework.beans.factory.annotation.Autowired;
5
 import org.springframework.beans.factory.annotation.Autowired;
6
 import org.springframework.http.HttpStatus;
6
 import org.springframework.http.HttpStatus;
7
 import org.springframework.http.ResponseEntity;
7
 import org.springframework.http.ResponseEntity;
8
-import org.springframework.web.bind.annotation.GetMapping;
9
-import org.springframework.web.bind.annotation.RequestMapping;
10
-import org.springframework.web.bind.annotation.RequestMethod;
11
-import org.springframework.web.bind.annotation.RestController;
8
+import org.springframework.web.bind.annotation.*;
12
 
9
 
13
 @RestController
10
 @RestController
14
 @RequestMapping
11
 @RequestMapping
26
     public ResponseEntity<Muffin> show(Long id) {
23
     public ResponseEntity<Muffin> show(Long id) {
27
         return new ResponseEntity<>(this.muffinRepository.findOne(id), HttpStatus.OK);
24
         return new ResponseEntity<>(this.muffinRepository.findOne(id), HttpStatus.OK);
28
     }
25
     }
29
-    @GetMapping(value = "/muffin")
26
+    @PostMapping(value = "/muffin")
30
     public ResponseEntity<Muffin> create(Muffin muffin) {
27
     public ResponseEntity<Muffin> create(Muffin muffin) {
31
         return new ResponseEntity<>(this.muffinRepository.save(muffin), HttpStatus.CREATED);
28
         return new ResponseEntity<>(this.muffinRepository.save(muffin), HttpStatus.CREATED);
32
     }
29
     }
33
 
30
 
34
-    @GetMapping(value ="/muffin/{id}")
31
+    @PutMapping(value ="/muffin/{id}")
35
     public ResponseEntity<Muffin> update(Long id, Muffin muffin) {
32
     public ResponseEntity<Muffin> update(Long id, Muffin muffin) {
36
         Muffin foundMuffin = muffinRepository.findOne(id);
33
         Muffin foundMuffin = muffinRepository.findOne(id);
37
         foundMuffin.setFlavor(muffin.getFlavor());
34
         foundMuffin.setFlavor(muffin.getFlavor());
39
         return new ResponseEntity<>(this.muffinRepository.save(foundMuffin), HttpStatus.OK);
36
         return new ResponseEntity<>(this.muffinRepository.save(foundMuffin), HttpStatus.OK);
40
     }
37
     }
41
 
38
 
42
-    @GetMapping(value = "/muffin/{id}")
39
+    @DeleteMapping(value = "/muffin/{id}")
43
     public ResponseEntity<Boolean> destroy(Long id) {
40
     public ResponseEntity<Boolean> destroy(Long id) {
44
         this.muffinRepository.delete(id);
41
         this.muffinRepository.delete(id);
45
         return new ResponseEntity<>(true, HttpStatus.OK);
42
         return new ResponseEntity<>(true, HttpStatus.OK);