Demetrius Murray 5 年 前
コミット
584d211fbf

+ 32
- 36
pom.xml ファイルの表示

@@ -1,65 +1,61 @@
1 1
 <?xml version="1.0" encoding="UTF-8"?>
2
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3
-	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
2
+<project xmlns="http://maven.apache.org/POM/4.0.0"
3
+		 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">
4 5
 	<modelVersion>4.0.0</modelVersion>
5 6
 
6
-	<groupId>com.zipcodewilmington</groupId>
7
-	<artifactId>bakery</artifactId>
8
-	<version>0.0.1-SNAPSHOT</version>
9
-	<packaging>jar</packaging>
10
-
11
-	<name>bakery</name>
12
-	<description>Demo project for Spring Boot</description>
13
-
7
+	<groupId>io.zipcoder</groupId>
8
+	<artifactId>spring-demo</artifactId>
9
+	<version>1.0-SNAPSHOT</version>
10
+	<build>
11
+		<plugins>
12
+			<plugin>
13
+				<groupId>org.apache.maven.plugins</groupId>
14
+				<artifactId>maven-compiler-plugin</artifactId>
15
+				<configuration>
16
+					<source>8</source>
17
+					<target>8</target>
18
+				</configuration>
19
+			</plugin>
20
+		</plugins>
21
+	</build>
14 22
 	<parent>
15 23
 		<groupId>org.springframework.boot</groupId>
16 24
 		<artifactId>spring-boot-starter-parent</artifactId>
17
-		<version>2.0.4.RELEASE</version>
25
+		<version>1.5.3.RELEASE</version>
18 26
 		<relativePath/> <!-- lookup parent from repository -->
19 27
 	</parent>
20
-
21 28
 	<properties>
22 29
 		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
23
-		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
24
-		<java.version>1.8</java.version>
30
+		<start-class>com.zipcodewilmington.bakery.BakeryApplication</start-class>
31
+		<java.version>1.7</java.version>
25 32
 	</properties>
26
-
27 33
 	<dependencies>
28 34
 		<dependency>
29 35
 			<groupId>org.springframework.boot</groupId>
30
-			<artifactId>spring-boot-starter</artifactId>
31
-		</dependency>
32
-
33
-		<dependency>
34
-			<groupId>org.springframework.boot</groupId>
35
-			<artifactId>spring-boot-starter-data-rest</artifactId>
36
+			<artifactId>spring-boot-starter-web</artifactId>
36 37
 		</dependency>
37
-
38 38
 		<dependency>
39 39
 			<groupId>org.springframework.boot</groupId>
40
-			<artifactId>spring-boot-starter-web</artifactId>
40
+			<artifactId>spring-boot-starter-data-jpa</artifactId>
41 41
 		</dependency>
42
-
43 42
 		<dependency>
44 43
 			<groupId>org.springframework.boot</groupId>
45 44
 			<artifactId>spring-boot-starter-test</artifactId>
46 45
 			<scope>test</scope>
47 46
 		</dependency>
48 47
 		<dependency>
49
-			<groupId>org.springframework.data</groupId>
50
-			<artifactId>spring-data-commons</artifactId>
51
-			<version>1.13.10.RELEASE</version>
48
+			<groupId>org.hsqldb</groupId>
49
+			<artifactId>hsqldb</artifactId>
50
+			<scope>runtime</scope>
52 51
 		</dependency>
53
-	</dependencies>
54 52
 
55
-	<build>
56
-		<plugins>
57
-			<plugin>
58
-				<groupId>org.springframework.boot</groupId>
59
-				<artifactId>spring-boot-maven-plugin</artifactId>
60
-			</plugin>
61
-		</plugins>
62
-	</build>
53
+		<dependency>
54
+			<groupId>javax.inject</groupId>
55
+			<artifactId>javax.inject</artifactId>
56
+			<version>1</version>
57
+		</dependency>
58
+	</dependencies>
63 59
 
64 60
 
65 61
 </project>

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

@@ -1,37 +0,0 @@
1
-package com.zipcodewilmington.bakery.Controllers;
2
-
3
-import com.zipcodewilmington.bakery.Models.Baker;
4
-import com.zipcodewilmington.bakery.Repositories.BakerRepository;
5
-import org.springframework.http.HttpStatus;
6
-import org.springframework.http.ResponseEntity;
7
-
8
-public class BakerController {
9
-
10
-    private BakerRepository bakerRepository;
11
-
12
-    public ResponseEntity<Iterable<Baker>> index() {
13
-        return new ResponseEntity<>(this.bakerRepository.findAll(), HttpStatus.OK);
14
-    }
15
-
16
-    public ResponseEntity<Baker> show(Long id) {
17
-        return new ResponseEntity<>(this.bakerRepository.findOne(id), HttpStatus.OK);
18
-    }
19
-
20
-    public ResponseEntity<Baker> create(Baker baker) {
21
-        return new ResponseEntity<>(this.bakerRepository.save(baker), HttpStatus.CREATED);
22
-    }
23
-
24
-    public ResponseEntity<Baker> update(Long id, Baker baker) {
25
-        Baker foundBaker = bakerRepository.findOne(id);
26
-
27
-        foundBaker.setName(baker.getName());
28
-        foundBaker.setSpecialty(baker.getSpecialty());
29
-
30
-        return new ResponseEntity<>(this.bakerRepository.save(foundBaker), HttpStatus.OK);
31
-    }
32
-
33
-    public ResponseEntity<Boolean> destroy(Long id) {
34
-        this.bakerRepository.delete(id);
35
-        return new ResponseEntity<>(true, HttpStatus.OK);
36
-    }
37
-}

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

@@ -1,36 +0,0 @@
1
-package com.zipcodewilmington.bakery.Controllers;
2
-
3
-import com.zipcodewilmington.bakery.Models.Muffin;
4
-import com.zipcodewilmington.bakery.Repositories.MuffinRepository;
5
-import org.springframework.http.HttpStatus;
6
-import org.springframework.http.ResponseEntity;
7
-
8
-public class MuffinController {
9
-
10
-    private MuffinRepository muffinRepository;
11
-
12
-    public ResponseEntity<Iterable<Muffin>> index() {
13
-        return new ResponseEntity<>(this.muffinRepository.findAll(), HttpStatus.OK);
14
-    }
15
-
16
-    public ResponseEntity<Muffin> show(Long id) {
17
-        return new ResponseEntity<>(this.muffinRepository.findOne(id), HttpStatus.OK);
18
-    }
19
-
20
-    public ResponseEntity<Muffin> create(Muffin muffin) {
21
-        return new ResponseEntity<>(this.muffinRepository.save(muffin), HttpStatus.CREATED);
22
-    }
23
-
24
-    public ResponseEntity<Muffin> update(Long id, Muffin muffin) {
25
-        Muffin foundMuffin = muffinRepository.findOne(id);
26
-        foundMuffin.setFlavor(muffin.getFlavor());
27
-
28
-        return new ResponseEntity<>(this.muffinRepository.save(foundMuffin), HttpStatus.OK);
29
-    }
30
-
31
-    public ResponseEntity<Boolean> destroy(Long id) {
32
-        this.muffinRepository.delete(id);
33
-        return new ResponseEntity<>(true, HttpStatus.OK);
34
-    }
35
-
36
-}

+ 0
- 49
src/main/java/com/zipcodewilmington/bakery/Models/Baker.java ファイルの表示

@@ -1,49 +0,0 @@
1
-package com.zipcodewilmington.bakery.Models;
2
-
3
-public class Baker {
4
-    private Long id;
5
-
6
-    private String name;
7
-
8
-    private String employeeId;
9
-
10
-    private String specialty;
11
-
12
-    public Baker(String name, String employeeId, String specialty) {
13
-        this.name = name;
14
-        this.employeeId = employeeId;
15
-        this.specialty = specialty;
16
-    }
17
-
18
-    public Long getId() {
19
-        return id;
20
-    }
21
-
22
-    public void setId(Long id) {
23
-        this.id = id;
24
-    }
25
-
26
-    public String getName() {
27
-        return name;
28
-    }
29
-
30
-    public void setName(String name) {
31
-        this.name = name;
32
-    }
33
-
34
-    public String getEmployeeId() {
35
-        return employeeId;
36
-    }
37
-
38
-    public void setEmployeeId(String employeeId) {
39
-        this.employeeId = employeeId;
40
-    }
41
-
42
-    public String getSpecialty() {
43
-        return specialty;
44
-    }
45
-
46
-    public void setSpecialty(String specialty) {
47
-        this.specialty = specialty;
48
-    }
49
-}

+ 0
- 28
src/main/java/com/zipcodewilmington/bakery/Models/Muffin.java ファイルの表示

@@ -1,28 +0,0 @@
1
-package com.zipcodewilmington.bakery.Models;
2
-
3
-public class Muffin {
4
-
5
-    private Long id;
6
-
7
-    private String flavor;
8
-
9
-    public Muffin(String flavor) {
10
-        this.flavor = flavor;
11
-    }
12
-
13
-    public Long getId() {
14
-        return id;
15
-    }
16
-
17
-    public void setId(Long id) {
18
-        this.id = id;
19
-    }
20
-
21
-    public String getFlavor() {
22
-        return flavor;
23
-    }
24
-
25
-    public void setFlavor(String flavor) {
26
-        this.flavor = flavor;
27
-    }
28
-}

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

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

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

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