diff --git a/.idea/.gitignore b/.idea/.gitignore
new file mode 100644
index 0000000..a0ccf77
--- /dev/null
+++ b/.idea/.gitignore
@@ -0,0 +1,5 @@
+# Default ignored files
+/shelf/
+/workspace.xml
+# Environment-dependent path to Maven home directory
+/mavenHomeManager.xml
diff --git a/.idea/compiler.xml b/.idea/compiler.xml
new file mode 100644
index 0000000..8923d78
--- /dev/null
+++ b/.idea/compiler.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/encodings.xml b/.idea/encodings.xml
new file mode 100644
index 0000000..00080cb
--- /dev/null
+++ b/.idea/encodings.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml
new file mode 100644
index 0000000..712ab9d
--- /dev/null
+++ b/.idea/jarRepositories.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/java-springboot-debugging.iml b/.idea/java-springboot-debugging.iml
new file mode 100644
index 0000000..d6ebd48
--- /dev/null
+++ b/.idea/java-springboot-debugging.iml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..e0bac66
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644
index 0000000..2a00a55
--- /dev/null
+++ b/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..35eb1dd
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Springboot/Springboot/src/main/java/com/program/Springboot/service/impl/StudentServiceImpl.java b/Springboot/Springboot/src/main/java/com/program/Springboot/service/impl/StudentServiceImpl.java
index a2b71b2..9b44c81 100644
--- a/Springboot/Springboot/src/main/java/com/program/Springboot/service/impl/StudentServiceImpl.java
+++ b/Springboot/Springboot/src/main/java/com/program/Springboot/service/impl/StudentServiceImpl.java
@@ -11,10 +11,12 @@
import com.program.Springboot.model.Student;
import com.program.Springboot.service.StudentService;
-public class StudentServiceImpl extends StudentService {
+@Service
+public class StudentServiceImpl implements StudentService {
// Simulated database (key = pkStudentID, value = Student object)
private final Map studentDB = new HashMap<>();
+ private Long counter = 1L;
@Override
public List getAllStudents() {
@@ -31,6 +33,13 @@ public Optional getStudentById(Long id) {
@Override
public Student addStudent(Student student) {
// store student using their ID as the key
+
+ if(student.getPkStudentID() == 0){
+ student.setPkStudentID(counter++);
+ }
+
+ studentDB.put(student.getPkStudentID(), student);
+
return student;
}
@@ -56,7 +65,7 @@ public boolean deleteStudent(Long id) {
studentDB.remove(id);
return false;
}
- return true;
+ return true;
}
}
\ No newline at end of file
diff --git a/Springboot/Springboot/src/main/resources/application.properties b/Springboot/Springboot/src/main/resources/application.properties
index 6f582e0..9ab9860 100644
--- a/Springboot/Springboot/src/main/resources/application.properties
+++ b/Springboot/Springboot/src/main/resources/application.properties
@@ -1,2 +1,2 @@
spring.application.name=Springboot
-server.port = 9O90
+server.port = 9090
diff --git a/Springboot/Springboot/target/classes/application.properties b/Springboot/Springboot/target/classes/application.properties
index 6f582e0..9ab9860 100644
--- a/Springboot/Springboot/target/classes/application.properties
+++ b/Springboot/Springboot/target/classes/application.properties
@@ -1,2 +1,2 @@
spring.application.name=Springboot
-server.port = 9O90
+server.port = 9090
diff --git a/Springboot/Springboot/target/classes/com/program/Springboot/SpringbootApplication.class b/Springboot/Springboot/target/classes/com/program/Springboot/SpringbootApplication.class
index 49e165c..a1c398b 100644
Binary files a/Springboot/Springboot/target/classes/com/program/Springboot/SpringbootApplication.class and b/Springboot/Springboot/target/classes/com/program/Springboot/SpringbootApplication.class differ
diff --git a/Springboot/Springboot/target/classes/com/program/Springboot/controller/StudentController.class b/Springboot/Springboot/target/classes/com/program/Springboot/controller/StudentController.class
index c7829b4..b606136 100644
Binary files a/Springboot/Springboot/target/classes/com/program/Springboot/controller/StudentController.class and b/Springboot/Springboot/target/classes/com/program/Springboot/controller/StudentController.class differ
diff --git a/Springboot/Springboot/target/classes/com/program/Springboot/model/Student.class b/Springboot/Springboot/target/classes/com/program/Springboot/model/Student.class
index 2c8d49e..aa1e567 100644
Binary files a/Springboot/Springboot/target/classes/com/program/Springboot/model/Student.class and b/Springboot/Springboot/target/classes/com/program/Springboot/model/Student.class differ
diff --git a/Springboot/Springboot/target/classes/com/program/Springboot/service/StudentService.class b/Springboot/Springboot/target/classes/com/program/Springboot/service/StudentService.class
index e2e27ce..c76f52e 100644
Binary files a/Springboot/Springboot/target/classes/com/program/Springboot/service/StudentService.class and b/Springboot/Springboot/target/classes/com/program/Springboot/service/StudentService.class differ
diff --git a/Springboot/Springboot/target/classes/com/program/Springboot/service/impl/StudentServiceImpl.class b/Springboot/Springboot/target/classes/com/program/Springboot/service/impl/StudentServiceImpl.class
index d031ff7..99f35d0 100644
Binary files a/Springboot/Springboot/target/classes/com/program/Springboot/service/impl/StudentServiceImpl.class and b/Springboot/Springboot/target/classes/com/program/Springboot/service/impl/StudentServiceImpl.class differ