File tree Expand file tree Collapse file tree 3 files changed +8
-1
lines changed
src/main/java/com/example/postgresql/student Expand file tree Collapse file tree 3 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ public void setAge(Integer age) {
70
70
71
71
@ Override
72
72
public String toString () {
73
- return "Student{" +
73
+ return "Student {" +
74
74
"id=" + id +
75
75
", name='" + name + '\'' +
76
76
", email='" + email + '\'' +
@@ -79,3 +79,4 @@ public String toString() {
79
79
'}' ;
80
80
}
81
81
}
82
+
Original file line number Diff line number Diff line change 1
1
package com .example .postgresql .student ;
2
2
3
+ import org .springframework .beans .factory .annotation .Autowired ;
3
4
import org .springframework .web .bind .annotation .GetMapping ;
4
5
import org .springframework .web .bind .annotation .RequestMapping ;
5
6
import org .springframework .web .bind .annotation .RestController ;
@@ -13,6 +14,7 @@ public class StudentController {
13
14
14
15
private final StudentService studentService ;
15
16
17
+ @ Autowired
16
18
public StudentController (StudentService studentService ) {
17
19
this .studentService = studentService ;
18
20
}
Original file line number Diff line number Diff line change 1
1
package com .example .postgresql .student ;
2
2
3
+ import org .springframework .stereotype .Component ;
4
+ import org .springframework .stereotype .Service ;
5
+
3
6
import java .time .LocalDate ;
4
7
import java .time .Month ;
5
8
import java .util .List ;
6
9
10
+ @ Service
7
11
public class StudentService {
8
12
9
13
You can’t perform that action at this time.
0 commit comments